A script that converts ASCII-armored PGP keys (or any texts) to a series of QR codes.
This allows to transfer texts from a PC to other devices that can scan and decode QR codes. The script was originally made for transfering keys into Pass for iOS.
- libqrencode: Generate QR codes.
- imagemagick: Convert PNGs to GIF.
- (Optional) zbar: Read and test QR codes.
Execute ./asc-to-gif.sh input.txt output.gif
.
An example of exporting ASCII-armored PGP keys and generate QR codes.
gpg --export -a "Key ID" > public.asc
gpg --export-secret-keys -a "Key ID" > private.asc
./asc-to-gif.sh public.asc public.gif
./asc-to-gif.sh private.asc private.gif
You can use docker to perform the conversions:
docker build . -t asc-key-to-qr-code-gif
docker run --rm -v $(pwd):/data -e "SRC=/data/public.asc" -e "DST=/data/public.gif" asc-key-to-qr-code-gif
docker run --rm -v $(pwd):/data -e "SRC=/data/private.asc" -e "DST=/data/private.gif" asc-key-to-qr-code-gif