Skip to content

Instantly share code, notes, and snippets.

@obfusk
Last active Jul 27, 2021
Embed
What would you like to do?
#!/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
#!/usr/bin/python3
# apt install python3-pyotp
import pyotp, sys
totp = pyotp.TOTP(sys.stdin.readline().strip().replace(" ", ""))
print(totp.now())
#!/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