Command line 2FA. 2-Factor verification similar to Google Authenticator and Authy.
- TOTP (Time-based One-Time Password) using oathtool
- Encrypt / Decrypt using OpenSSL
- Copies to clipboard using
pbcopy
(macOS);xclip
(Linux) - Supports both encrypted and plain-text token files
- oathtool (http://www.nongnu.org/oath-toolkit/)
- OpenSSL
- xclip (Linux)
brew install oath-toolkit gawk
$ sudo aptitude install -y oathtool libpam-oath
$ sudo aptitude install -y xclip
- otp - Read tokenfile and generate TOTP value
- otp-lockfile - Encrypt tokenfile, remove original file and save new encrypted tokenfile in tokenfiles/ folder
- otp-unlockfile - Decrypt tokenfile and save to plain-text file
- /tokenfiles/ - Empty folder
otp
$ ./otp amazon # reads tokenfiles/amazon[.enc]
Password:
29: 123456
59: 008256
10: 193842
Paste value from clipboard
- ⌘ Command + v
- Ctrl + v
otp-lockfile
$ echo "1234 1234 1234" > tokenfiles/amazon
$ ./otp-lockfile tokenfiles/amazon
Password:
Verify Password:
$ ls -l tokenfiles/