# Time-based One-time Password Generator (topgen)
This is a simple time-based one-time password generator. It is compatible with [Google Autheticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) 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](https://developers.google.com/protocol-buffers). 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](https://github.com/dim13) for his [Google Authenticator migration decoder](https://github.com/dim13/otpauth) and [Patrice Ferlet](https://github.com/metal3d) and [Tom Jaskowski](https://github.com/tadeck) for their answers under [this](https://stackoverflow.com/questions/8529265/google-authenticator-implementation-in-python) stackoverflow page.
## References
1. TOTP: Time-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc6238
1. HOTP: An HMAC-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc4226
Raw data
{
"_id": null,
"home_page": "https://github.com/byildiz/topgen",
"name": "topgen",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "totp, totp-generator, totp-cli, google-authenticator",
"author": "Burak Yildiz",
"author_email": "0byldz@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/5f/8c/7efdf9e768a23d61de93735c733528f4c83481fddf321dc38c6e1f4c53ac/topgen-0.1.1.tar.gz",
"platform": null,
"description": "# Time-based One-time Password Generator (topgen)\n\nThis is a simple time-based one-time password generator. It is compatible with [Google Autheticator](https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2) and keys can imported from `otpauth-migration://offline?data=...` urls generated by Google Autheticator.\n\n## Installation\n\ntopgen is tested with python 3.10 but it should work all python 3 versions. Requirement packages can be installed in two ways:\n\n```\npip install topgen\n```\n\n## Usage\n\nIt is needed to first add or import some keys.\n\nNew keys can be added with `--add` parameter:\n\n```\npython -m topgen --add\n```\n\nTo 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:\n\n```\npython -m topgen --url <URL>\n```\n\nOnce you add or import some keys, passwords can be generated with the following command:\n\n```\npython -m topgen\n```\n\ntop-g saves all keys in a binary file using Google's [protobuf](https://developers.google.com/protocol-buffers). The default file is `./payload.db`. It can be changed by providing `--db` parameter.\n\nTo print all of the keys with their information `--print` parameter can be used.\n\n```\npython -m topgen --list\n```\n\nNOTE: The database file is not encrypted. You are responsible to keep the database file secret and take your own risk.\n\n## Thanks\n\nI want to thank you to [Dimitri Sokolyuk](https://github.com/dim13) for his [Google Authenticator migration decoder](https://github.com/dim13/otpauth) and [Patrice Ferlet](https://github.com/metal3d) and [Tom Jaskowski](https://github.com/tadeck) for their answers under [this](https://stackoverflow.com/questions/8529265/google-authenticator-implementation-in-python) stackoverflow page.\n\n## References\n\n1. TOTP: Time-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc6238\n1. HOTP: An HMAC-Based One-Time Password Algorithm: https://www.rfc-editor.org/rfc/rfc4226\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Time-based one-time password generator",
"version": "0.1.1",
"project_urls": {
"Homepage": "https://github.com/byildiz/topgen"
},
"split_keywords": [
"totp",
" totp-generator",
" totp-cli",
" google-authenticator"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a8b6038f94019e42ea173785b0a555a01917e343db545a73e6b18dbec744d472",
"md5": "51e4654efa1801ad233e03396a9b2242",
"sha256": "5d48bb75e1c0e8de418b1bea435b8276ea6e0107bcd85352b3bbebdf27de4f37"
},
"downloads": -1,
"filename": "topgen-0.1.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "51e4654efa1801ad233e03396a9b2242",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 7563,
"upload_time": "2024-10-01T23:02:34",
"upload_time_iso_8601": "2024-10-01T23:02:34.408585Z",
"url": "https://files.pythonhosted.org/packages/a8/b6/038f94019e42ea173785b0a555a01917e343db545a73e6b18dbec744d472/topgen-0.1.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5f8c7efdf9e768a23d61de93735c733528f4c83481fddf321dc38c6e1f4c53ac",
"md5": "2ea13074e99677788fc1df82f83de64e",
"sha256": "d6289c18ad446b5f95075d3f969b307a9051015a3d97f5cb032593fea4b16f89"
},
"downloads": -1,
"filename": "topgen-0.1.1.tar.gz",
"has_sig": false,
"md5_digest": "2ea13074e99677788fc1df82f83de64e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 6573,
"upload_time": "2024-10-01T23:02:35",
"upload_time_iso_8601": "2024-10-01T23:02:35.582395Z",
"url": "https://files.pythonhosted.org/packages/5f/8c/7efdf9e768a23d61de93735c733528f4c83481fddf321dc38c6e1f4c53ac/topgen-0.1.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-01 23:02:35",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "byildiz",
"github_project": "topgen",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "topgen"
}