Skip to content

Instantly share code, notes, and snippets.

@tjdett
Created November 2, 2016 03:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjdett/174735c26b00d3625dbdb7521ccc6b77 to your computer and use it in GitHub Desktop.
Save tjdett/174735c26b00d3625dbdb7521ccc6b77 to your computer and use it in GitHub Desktop.
Archiving secret keys to printed 2D data matrix

Produce with following steps:

paperkey --output-type raw < /tmp/mykey.gpg \
    > /tmp/mykey.paperkey
dmtxwrite -e 8 /tmp/mykey.paperkey > /tmp/mykey.paperkey.png

To reassemble, scan to JPG and then:

gpg2 --import /tmp/mykey.pub.asc
gpg2 --export > /tmp/pubring.gpg # To handle GPG 2.1 keyring format change
convert /tmp/mykey.jpg -colors 2 /tmp/mykey.paperkey.png
dmtxread /tmp/mykey.paperkey.png | \
    paperkey --pubring /tmp/pubring.gpg > mykey.gpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment