Skip to content
forked from jameslafa/totpex

TOTP: Time-Based One-Time Password written in Elixir

License

Notifications You must be signed in to change notification settings

michaelst/totpex

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Totpex

TOTP: Time-Based One-Time Password written in Elixir

I'm learning Elixir and gave myself a challenge to write a TOTP client with it.

At the moment it's more a proof of concept than a client, there is no interface. It's a work in process.

How to use it

Clone the directory :

git clone [email protected]:jameslafa/totpex.git
cd totpex

In debug mode:

iex -S mix

iex(1)> Totpex.generate_totp("mysecretkey_base32encoded")
"798396"

As a standalone application

# build binary (one time operation)
mix escript.build

# Execute application
./totpex
Please enter your secret key: 634hszwpdilkzqe2
Your One-Time Password is 382765

Requirements

  1. Elixir installed
  2. A computer running at the correct time. Most of the system are automatically so it shouldn't be a problem.
  3. A Base32 encoded secret key given by the service you enabled 2 factor authentication on.

How to get a secret key on Github to try this tool

  1. Go to your security settings
  2. Click on Set up two-factor authentication
  3. Choose Set up using an app. If you don't have Google Authenticator installed on your phone, get it from your App Store
  4. Scan the square code from your app, then it's safe and easy to use from your phone
  5. Click on enter this text code to get the Base32 encoded value. Save it somewhere safe
  6. Enter the value generated by your phone
  7. Click on Enable 2 factor authentication

You can now use your secret key obtained at step 5 and compare the generated value with the one given by your phone.

Thank you

I want to thank my friend Alexandre who helped me to understand the Java code of the official documentation.

I want also to thank the authors of the following articles or projects, it was a great help:

Contact

Contact me on twitter @jameslafa

About

TOTP: Time-Based One-Time Password written in Elixir

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Elixir 100.0%