Last active
July 6, 2021 05:13
-
-
Save fikr4n/5d965f785f79bd4f534e8fe850109db3 to your computer and use it in GitHub Desktop.
TOTP (like in Google Authenticator android app) using https://github.com/pyauth/pyotp, and (optional) gpg to secure the secret
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# How to use | |
# 1. Clone https://github.com/pyauth/pyotp.git | |
# 2. Put this file in the repo root dir | |
# 3. GPG-encrypt your TOTP key/seed (without newline), place it in secret.asc in the repo root dir | |
# 4. Run this file | |
cd `dirname $0`/src | |
watch gpg -dq ../secret.asc \| python3 -c \''import pyotp;print(pyotp.TOTP(input()).now(),end="")'\' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# How to use | |
# 1. Clone https://github.com/pyauth/pyotp.git | |
# 2. Put this file in the repo root dir | |
# 3. Replace __YOUR_KEY_HERE__ below with your TOTP key/seed | |
# 4. Run this file | |
cd `dirname $0`/src | |
watch python3 -c \''import pyotp;print(pyotp.TOTP("__YOUR_KEY_HERE__").now(),end="")'\' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment