A super simple application that takes in a TOTP secret key and returns the TOTP code.
This application is intended to be used in combination with other
utilities. A example is included in the file dmenu_select.sh which
will give you a dmenu prompt to select any of the files in
~/.config/totp/ that will contain TOTP keys. It will then put the TOTP
token of said file in the clipboard.
git clone --recurse-submodules https://github.com/elttil/totp
cd totp
make
DESTDIR=$HOME/.local/ make installtotp -t [UNIX time] -d [digit] -i [interval] -h(print this message) [file containing the secret]Either a file containing the TOTP secret key can be given as the first argument. If no argument is supplied then it will by default read from stdin.
totp ./secretecho JBSWY3DPEHPK3PXP | totpThis program has been tested by the test cases for SHA1 provided by rfc6238.
How the tests work can be seen in test.sh and the test cases can be
seen in test_cases.txt.