# Heavily depends on: | |
# libqrencode (fukuchi.org/works/qrencode/) | |
# paperkey (jabberwocky.com/software/paperkey/) | |
# zbar (zbar.sourceforge.net) | |
# Producing the QR codes: | |
# Split over 4 codes to ensure the data per image is not too large. | |
gpg --export-secret-key KEYIDGOESHERE | paperkey --output-type raw | base64 > temp | |
split temp -n 4 IMG | |
for f in IMG*; do cat $f | qrencode -o $f.png; done | |
# Importing the QR codes: | |
# Note that, when making scans or photographs, you do not produce large images. | |
# If zbar does not recognise your QR code, try downscaling the image. | |
for f in IMG*.png; do zbarimg --raw $f | head -c -1 > $f.out ; done | |
cat *.out | base64 -d | paperkey --pubring ~/.gnupg/pubring.gpg | gpg --import | |
This comment has been minimized.
This comment has been minimized.
Thanks for this... it inspired me to create easy-gpp-to-paper. |
This comment has been minimized.
This comment has been minimized.
Another alternative is a self generating latex document. Run gpgbackup.tex \documentclass{article}
\usepackage{float}
\usepackage{graphicx}
\usepackage{pgffor}
\def\gpgkey{yourkeyname}
\newcommand\gpgtopng{
\immediate\write18{gpg --export-secret-key \gpgkey | paperkey --output-type raw | base64 > temp}
\immediate\write18{split temp -n 4 IMG}
\immediate\write18{for f in IMG*; do cat $f | qrencode -o /tmp/$f.png; done}
\immediate\write18{rm IMG* temp}
}
\gpgtopng
\begin{document}
\foreach \l in {a, ..., d} {
\begin{figure}[H]
\centering
\includegraphics[width=0.6\textwidth]{/tmp/IMGa\l.png}
\caption{QR \l}
\end{figure}
}
To recover run the following command
\begin{verbatim}
for f in IMG*.png; do zbarimg --raw $f | head -c -1 > $f.out ; done
cat *.out | base64 -d | paperkey --pubring ~/.gnupg/pubring.gpg | gpg --import
\end{verbatim}
\end{document} |
This comment has been minimized.
This comment has been minimized.
Here is a bash script that converts any file into a printable PDF with QR codes that you can use to restore the file back https://github.com/nurupo/paper-store. See PDF examples at https://github.com/nurupo/paper-store#examples. |
This comment has been minimized.
This comment has been minimized.
What's the reason for passing the output from Edit: Yes it is |
This comment has been minimized.
This comment has been minimized.
|
This comment has been minimized.
This comment has been minimized.
@stueja - This was extremely helpful. The only real suggestion I have is in the following section:
it would be preferable to append Thus, I would suggest amending the line in question to: Incidentally, given its usefulness, it seems to me that it's a little unfortunate for your script to be hardcoded to only work for pgp keys, as it is equally useful for storing other data such as SSH keys. If I get a chance, I'll try to cobble together some additional header lines that will allow the script to either use the pgp key as you've done or to accept any text from stdin (so that any key could be piped to it). |
This comment has been minimized.
Dear joostrijneveld,
thank you very much for providing this genius method of splitting and qr-ing the key.
I hacked around your export functionality and added rather dirty hacks to
to directly print it and put it into a safe location.
Maybe others might also want to use that.