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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file topgen-0.1.1.tar.gz.

File metadata

  • Download URL: topgen-0.1.1.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for topgen-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d6289c18ad446b5f95075d3f969b307a9051015a3d97f5cb032593fea4b16f89
MD5 2ea13074e99677788fc1df82f83de64e
BLAKE2b-256 5f8c7efdf9e768a23d61de93735c733528f4c83481fddf321dc38c6e1f4c53ac

See more details on using hashes here.

File details

Details for the file topgen-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: topgen-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for topgen-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5d48bb75e1c0e8de418b1bea435b8276ea6e0107bcd85352b3bbebdf27de4f37
MD5 51e4654efa1801ad233e03396a9b2242
BLAKE2b-256 a8b6038f94019e42ea173785b0a555a01917e343db545a73e6b18dbec744d472

See more details on using hashes here.

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