SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 07/01/2016, 02:02 PM   #1
Igorek
Big Clucker
 
Igorek's Avatar
 
Join Date: Oct 2010
Posts: 110
Reputation: 74
Default TOTP Plugin

TOTP plugin v1.0.1

This plugin allows you to generate one-time passwords based on time (and computing on algorithm based TOTP RFC 6238 ) are also used by Ggle in the Ggle Authenticator.

With this plugin, you can protect your server accounts of subsidiary protection, providing the One-time Password on the user side using Ggle Authenticator and comparing it to the server using this plugin.

The secret key for the user, you can generate and set, for example, in the UCP your WebSite.

Natives

Code:
native Goo gleAuthenticatorCode(key[], tm); //anti-advertising removes the word Ggle. Remove the space
The parameters:
  • key[] - secret key
  • tm - UNIXTIME

Example

Code:
#include <a_samp>
#include <TOTP>

main()
{
	new code = Goo gleAuthenticatorCode("3ADXVY3HXVYX6XWZ", gettime()); //anti-advertising removes the word Ggle. Remove the space
	printf("CODE: %06d", code);
}
Downloads

GitHub repository:

https://github.com/GamesDV/TOTP

Pre-built binaries for Linux and Windows (releases page):

https://github.com/GamesDV/TOTP/releases

Last edited by Igorek; 04/12/2017 at 02:18 PM.
Igorek is offline   Reply With Quote
Old 07/01/2016, 02:05 PM   #2
Neutralneu
Big Clucker
 
Join Date: Oct 2012
Location: Russia
Posts: 70
Reputation: 41
Default Re: TOTP Plugin

Cool, thank you)
Neutralneu is offline   Reply With Quote
Old 07/01/2016, 02:52 PM   #3
Elegy
Banned
 
Join Date: Dec 2015
Location: Girl Friend House
Posts: 169
Reputation: 3
Default Re: TOTP Plugin

Nice,thank u very much,can I know,we can verify email,password,etc via email
Elegy is offline   Reply With Quote
Old 07/01/2016, 03:05 PM   #4
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,066
Reputation: 2660
Default Re: TOTP Plugin

Nice. Though consider renaming the function. As far as I know the protocol wasn't invented by ******, nor is it exclusively used by ******.
__________________
Vince is offline   Reply With Quote
Old 07/01/2016, 07:12 PM   #5
ikkentim
High-roller
 
ikkentim's Avatar
 
Join Date: Jan 2010
Location: Kampen, The Netherlands
Posts: 1,052
Reputation: 205
Default Re: TOTP Plugin

Quote:
Originally Posted by Vince View Post
Nice. Though consider renaming the function. As far as I know the protocol wasn't invented by ******, nor is it exclusively used by ******.
Second that.

It's just a standard, RFC 6239: https://tools.ietf.org/html/rfc6238
Only thing ****** has to do with it is that that have a slightly modified version of it available on github. ( https://github.com/******/******-authenticator )
__________________
Greetings,
Tim Potze

Projects
GAMEDEV | Part-time developer working on Parkitect. | Steampage
LSRES | A SA:MP server from the past, and hopefully, back in the future.
SampSharp | Plugin for writing SA:MP gamemodes in C#. | Topic Website Github
SanMap | San Andreas in G00GLE MAPS! | Topic Github Sample
ikkentim is offline   Reply With Quote
Old 07/01/2016, 09:11 PM   #6
Mauzen
High-roller
 
Mauzen's Avatar
 
Join Date: Jun 2007
Location: Western Germany
Posts: 4,878
Reputation: 1597
Default Re: TOTP Plugin

Nice idea, wonder why this hasnt been done before. Heres +1 mauzolike.
Mauzen is offline   Reply With Quote
Old 08/01/2016, 03:19 PM   #7
Igorek
Big Clucker
 
Igorek's Avatar
 
Join Date: Oct 2010
Posts: 110
Reputation: 74
Default Re: TOTP Plugin

Quote:
Originally Posted by Vince View Post
Nice. Though consider renaming the function. As far as I know the protocol wasn't invented by ******, nor is it exclusively used by ******.
I did not say that ****** invented it.
Function so named because plugin was written specifically for integration with ****** Authenticator.
Who wants to - can rename function and compile plugin

Or just use #define:
PHP Code:
#define TOTP ******AuthenticatorCode 
Igorek is offline   Reply With Quote
Old 23/08/2016, 04:51 AM   #8
MerryDeer
Banned
 
Join Date: Jun 2016
Posts: 723
Reputation: 8
Default Re: TOTP Plugin

What is secret code will by same for 2 users? they will get same code?
MerryDeer is offline   Reply With Quote
Old 23/08/2016, 11:45 AM   #9
JaydenJason
Gangsta
 
Join Date: Oct 2014
Location: Netherlands
Posts: 684
Reputation: 51
Default Re: TOTP Plugin

Nice one, will definitely mess around with this one when I'm home.



----


The codes do not seem to match for me

The codes also seem to be refreshing at different times for me

Could it be the timezone?
JaydenJason is offline   Reply With Quote
Old 23/08/2016, 01:16 PM   #10
Scranton
Little Clucker
 
Join Date: Aug 2016
Posts: 5
Reputation: 9
Default Re: TOTP Plugin

You need to be in the same timezone, or at least use the same time in the App and on your server. Also you should check for codes 30 seconds as the time on the device could be slightly out, or in the time taken to input the code it has expired.
Scranton is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Centos7 - Streamer plugin and crashdetect plugin Su37Erich Server Support 3 12/08/2016 12:18 AM
[MySQL] From StickenKid's plugin to BlueG's plugin jessejanssen Scripting Help 2 15/06/2014 01:20 AM
mysql plugin. loading plugin failed ikkentim Help Archive 2 10/02/2011 02:32 PM


All times are GMT. The time now is 03:01 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.