Created
August 17, 2018 02:50
-
-
Save agiantwhale/01ae34cb9b2bd4b6b75a00d1bc7acdcc to your computer and use it in GitHub Desktop.
GPG to QR code back up
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/env bash | |
if [ $# -eq 0 ]; then | |
echo "Need armored key" | |
exit 1 | |
fi | |
PREFIX=$(basename $1 .asc) | |
rm -rf $PREFIX.key* | |
rm -rf $PREFIX.encoded* | |
gpg --dearmor < $PREFIX.asc > $PREFIX.gpg | |
split -b 100 $PREFIX.gpg $PREFIX.key. | |
for f in $PREFIX.key.*; do echo "$f $(base64 $f)" > $f.b64; done | |
for f in $PREFIX.key.*.b64; do qrencode -l H -r $f -o $f.png; done | |
montage -label '%f' *.png -geometry '1x1<' -tile 3x4 $PREFIX.encoded.png |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment