Module for generating HOTP and TOTP codes
This repository contains a library called otpgen which could be used to obtain HOTP and TOTP codes, and an example script called totpgen.py, which is created to demonstrate what the library can be used to create.
To generate HOTP code from library:
>>> from otpgenlib.otpgen import hotp
>>> hotp("<HOTP_SECRET>", <COUNT>)To generate TOTP code from library:
>>> from otpgenlib.otpgen import totp
>>> totp("<TOTP_SECRET", <COUNT>)To generate TOTP code from totpgen.py script:
$ totpgen.py "<TOTP_SECRET>"
$ # OR
$ echo "<TOTP_SECRET>" | totpgen.py -RECOMMENDATION: Encrypt the file with the TOTP Secret using tools like GnuPG, and pass its contents to the scripts.
$ totpgen.py "$(gpg -qd /file/with/totp/secret)"
$ # OR
$ gpg -qd /file/with/totp/secret | totpgen.py -See CONTRIBUTING.md