Skip to content

Instantly share code, notes, and snippets.

@fordhurley
Last active January 14, 2019 17:28
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fordhurley/9080024 to your computer and use it in GitHub Desktop.
Save fordhurley/9080024 to your computer and use it in GitHub Desktop.

Backing up a GPG private key to a QR code

Use at your own risk! As with any backup method, test out your backup by restoring from it before you trust it.

  1. Install qrcode to generate the QR code:

     pip install qrcode
    
  2. Export the key, piping the output to qr, and save this to a png file:

     gpg --export-secret-key -a "User Name" | qr > secret-key-qr.png
    
  3. Print out the png, and stick it somewhere safe.

@brandoncurtis
Copy link

Note that a 4096-bit key won't fit in a QR code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment