This is a CLI tool which allows you to securely generate Time-Based One-time Passcodes for any purpose you may need!
- Download the binary for your OS from the latest release.
- Run the binary and input your secret!
Important
Your secret must be at least 128 bits (in Base32 thats ~26 characters)
If you want to use multiple secrets, you must set them as environment variables.
You can do this by running the following command for your OS with your data for however many secrets you want..
Note
You must include the TOTP_ at the start of your env variable as otherwise it will be ignored
export TOTP_MY_SECRET=MY_SPECIAL_SECRET
set TOTP_MY_SECRET=MY_SPECIAL_SECRET
$env:TOTP_MY_SECRET="MY_SPECIAL_SECRET"
After you close the terminal session, your secrets will disappear and you will need to re-set them when you want to use them againn
Tip
Want your secrets to persist across terminal sessions?
Make a .env file in the same directory you downloaded TOTP-Generator and put all your secrets in there, like this!
TOTP_MY_SECRET=MY_SPECIAL_SECRET
Security Warning: The .env file stores TOTP secrets in plaintext (unencrypted). To protect your secrets:
- Restrict file permissions:
chmod 600 .env(macOS/Linux) or right-click → Properties → Security tab (Windows) - Never commit .env to version control (already in .gitignore)
- Clone the repo
- Run
cargo run
Contributions are always welcome!