Skip to main content

Time-based one-time password generator

Project description

Time-based One-time Password Generator (topgen)

This is a simple time-based one-time password generator. It is compatible with Google Autheticator and keys can imported from otpauth-migration://offline?data=... urls generated by Google Autheticator.

Installation

topgen is tested with python 3.10 but it should work all python 3 versions. Requirement packages can be installed in two ways:

pip install topgen

Usage

It is needed to first add or import some keys.

New keys can be added with --add parameter:

python -m topgen --add

To import keys from Google Authenticator app --url parameter can be used. It is done by the URLs that Google Authenticator creates. The URLs can be easily be created by exporting keys from the settings menu of Google Authenticator. Google Autheticator creates QR codes which contain the URLs. The URLs start with otpauth-migration://offline?data=.... These URLs can then be imported using the following command:

python -m topgen --url <URL>

Once you add or import some keys, passwords can be generated with the following command:

python -m topgen

top-g saves all keys in a binary file using Google's protobuf. The default file is ./payload.db. It can be changed by providing --db parameter.

To print all of the keys with their information --print parameter can be used.

python -m topgen --list

NOTE: The database file is not encrypted. You are responsible to keep the database file secret and take your own risk.

Thanks

I want to thank you to Dimitri Sokolyuk for his Google Authenticator migration decoder and Patrice Ferlet and Tom Jaskowski for their answers under this stackoverflow page.

References

  1. TOTP: Time-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc6238
  2. HOTP: An HMAC-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc4226

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

topgen-0.1.1.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

topgen-0.1.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page