Last active
July 27, 2021 14:57
-
-
Save obfusk/7de8959e136e3739151cf7537f3f54d6 to your computer and use it in GitHub Desktop.
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 | |
name="$1" | |
if [ -z "$name" ]; then | |
read -r -p 'name> ' | |
name="$REPLY" | |
fi | |
read -r -p 'key> ' | |
key="$REPLY" | |
printf '%s' "$key" | gpg -r YOUR_KEY_ID -e > /some/path/"$name".gpg |
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
#!/usr/bin/python3 | |
# apt install python3-pyotp | |
import pyotp, sys | |
totp = pyotp.TOTP(sys.stdin.readline().strip().replace(" ", "")) | |
print(totp.now()) |
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 | |
name="$1" | |
if [ -z "$name" ]; then | |
read -r -p 'name> ' | |
name="$REPLY" | |
fi | |
gpg -d /some/path/"$name".gpg | /some/path/totp.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment