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
- TOTP: Time-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc6238
- 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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| topgen-0.1.1.tar.gz | 6.6 kB | Without provenance | Details for topgen-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| topgen-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for topgen-0.1.1-py3-none-any.whl |
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
|
Security for topgen 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.