- C 79.9%
- Shell 13.1%
- Roff 7%
| bin | Write the uri2totp manual | |
| po | Add en@quot translations | |
| src | Remove debug include | |
| .gitignore | Ignore totp-arm64 | |
| build | Add -a to the build script | |
| install | Update install script | |
| LICENSE | Bump the license | |
| README.md | Random fixes | |
| REFS | Add a references file | |
| totp.1 | Random fixes | |
totp
totp is a command-line utility to generate TOTP keys from the
command-line. This is very useful for integrating 2-factor
authentication support into your existing password-management setup.
Documentation
Both the totp and uri2totp utilities are documented via the
totp(1) and uri2totp(1) manual pages.
Build and Install
Building and installing totp is very simple:
$ ./build # Build the application
$ ./install # Install the built application
By default a generic binary is built, however those on x86-64 or ARM64 platforms that support SHA-1 extensions can build tailored profiles that make use of these CPU extensions:
$ ./build -p arm64
$ ./build -p x64
Usage
The totp utility reads TOTP secret keys from the standard input and
prints the corresponding codes to the standard output. You can use
multiple keys:
$ printf '%s\n' 7KFSJ562KJDK23KD 7YNEG7J3XBIVYR54 | totp
546316
942303
You can also provide the keys as arguments:
$ totp 7KFSJ562KJDK23KD 7YNEG7J3XBIVYR54
546316
942303
By default it is assumed that the TOTP codes have a length of 6 and
are valid for 30 seconds. You can change both of these parameters
using the -d and -p respectively, if required:
$ totp -d8 -p60 7KFSJ562KJDK23KD 7YNEG7J3XBIVYR54
71696020
18335070
uri2totp
Along with totp, this package also ships with the uri2totp script.
That script is a wrapper around totp and trurl to turn TOTP URIs
into codes:
$ uri2totp otpauth://totp/foo?secret=DEADBEEF&period=30&digits=5
69420