-
-
Save elquimista/bc9b6e0bfb41e8da7edbfeec8c9b2045 to your computer and use it in GitHub Desktop.
Produce printable QR codes for persistent, tangible storage of GPG private keys and vice versa.
This file contains hidden or 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
# Depends on: | |
# paperkey (jabberwocky.com/software/paperkey/) | |
# libqrencode (fukuchi.org/works/qrencode/) | |
# Producing the QR codes: | |
# Split into 16 codes to ensure the data per image is not too large. | |
# Or split into 3 codes for smaller keys (e.g., ed25519) | |
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp | |
if [ "$(uname)" == "Darwin" ]; then | |
split -n 16 temp IMG | |
else | |
split temp -n 16 IMG | |
fi | |
for f in IMG*; do cat $f | qrencode -o $f.png; done |
This file contains hidden or 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
# Depends on: | |
# paperkey (jabberwocky.com/software/paperkey/) | |
# zbar (zbar.sourceforge.net) | |
# Importing the QR codes: | |
# Note that, when making scans or photographs, do not produce large images. | |
# If zbar fails to recognise your QR code, try downscaling the image. | |
if [ "$(uname)" == "Darwin" ]; then | |
for f in IMG*.png; do zbarimg --raw $f | head > $f.out ; done | |
else | |
for f in IMG*.png; do zbarimg --raw $f | head -c -1 > $f.out ; done | |
fi | |
gpg --export KEYIDGOESHERE > pubkey.gpg | |
cat *.out | base64 --decode | paperkey --pubring pubkey.gpg > key.gpg | |
gpg --import key.gpg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment