Skip to main content

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

Metadata

Release files for topgen 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for topgen 0.1.1
File Size Uploaded
topgen-0.1.1.tar.gz 6.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for topgen 0.1.1
File Interpreter ABI Platform
topgen-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 14.1 kB

Release files / topgen-0.1.1.tar.gz

Download URL topgen-0.1.1.tar.gz
Size 6.6 kB
Tags Source
SHA-256 checksum
How to use checksums
d6289c18ad446b5f95075d3f969b307a9051015a3d97f5cb032593fea4b16f89
BLAKE2b-256 checksum
How to use checksums
5f8c7efdf9e768a23d61de93735c733528f4c83481fddf321dc38c6e1f4c53ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release files / topgen-0.1.1-py3-none-any.whl

Download URL topgen-0.1.1-py3-none-any.whl
Size 7.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5d48bb75e1c0e8de418b1bea435b8276ea6e0107bcd85352b3bbebdf27de4f37
BLAKE2b-256 checksum
How to use checksums
a8b6038f94019e42ea173785b0a555a01917e343db545a73e6b18dbec744d472
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.6

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page