The implementation is described in this blog post: https://stegard.net/2023/11/implementing-a-time-based-one-time-password-totp-generator/
The following commands must be available in your PATH
:
- openssl
- base32
- xxd
$ echo "SOME_TOTP_BASE32_KEY" | ./totp
$ ./totp < .some_file_with_base32_key
$ gpg -d some_file_with_base32_key.gpg | ./totp
$ echo XCGVLAD4EMLOV72B | ./topt
532405
Check results using https://www.verifyr.com/en/otp/check#totp