GithubHelp home page GithubHelp logo

otp_gen's Introduction

otp_gen

A one-time password generator.

Modern OTPs are generated from a fixed, constant setup key. otp_gen stores that setup key, encrypting it with a user-defined passcode and decrypting it where necessary.

  • The actual OTP is then generated based on the current timestamp (most implementations have 30-second interval timestamps) and the setup key.

Installation

Install the required dependencies with:

pip install -r requirements.txt

Usage

Adding a Setup Key

Generate a setup key with a PIN with:

python add_setupkey.py

This will prompt you for:

  1. A PIN code to be used to encrypt the setup key.
    • Warning: For security reasons, otp_gen does not store that PIN, so don't lose it.
    • You might also want to set up a separate authenticator (e.g. using Google Authenticator) to ensure you can still log in if the encrypted setupkey is corrupted.
  2. The label to be associated with the setup key (e.g. "Email")
  3. The actual setup key. This can be obtained either from:
    • Scanning the QR code with a regular QR code reader:
      • This will give a URI: otpauth://totp//...?secret=[SETUP KEY]&issuer=...
      • The setup key can be manually extracted from that URI.
    • Obtaining the setup key directly:
      1. If using Google, click "Can't scan it?" when setting up the authenticator app.
      2. The setup key will be the given security key in step 2. Google Auth Example

Example:
(Note: The actual PIN will not be visible)
add_setupkey Example

Requesting an OTP

python otp_gen.py

This will prompt you for the PIN, and will output all OTPs for the previous, current and next time interval associated with the PIN.

Example:
(Note: The actual PIN will not be visible)
otp_gen Example

otp_gen's People

Contributors

rye123 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.