Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Paperkey - backup your GnuPG secret key on a piece of paper (jabberwocky.com)
50 points by jonasvp on May 21, 2013 | hide | past | favorite | 19 comments


Most printers keep a copy of what they print in memory. And some printers do so for a very long time (up to 2 years in my experience, it had an internal hard drive). So be sure to destroy your printer before getting rid of it if you print your GPG key with it.

Also, many new printers comes with internet connection (some even over 3G) and contact the vendor when ink is running low or maintenance is needed. The problem that they are not always well protected against attacks from the network.

At my university, we had a case of a printer which has been hacked and many giga of scanned and printed documents were downloaded. Fortunately the attacker couldn't find a way from the printer to other devices on the network (computers, hubs…), but some people had scanned their ID card for instance, which was a problem they really hadn't forseen…


In this case, it's enough to make sure that your key is encrypted with your (good) passphrase before you print it:

"if your key has a passphrase on it (i.e. is encrypted), the paper copy is similarly encrypted. If your key has no passphrase, neither does the paper copy."


Would you really want to leave it encrypted on paper though?

I would have the paper as a long term backup - including a backup in case I forget the password, or am incapacitated.


If this is your big concern, then write the password down on the paper (with a pencil or something, not as part of the print job). The paper is then no more secure than if you'd printed the paper in cleartext, but any copy kept by the printer would still be encrypted.


I see your point, but I prefer to see the passphrase that protect my GPG key as a bonus time to revoke it and generate a new one in case my key is compromised, rather than a protection sufficient to assume that the encrypted version of my key can safely be public.


Hm, random idea: print your key on paper and have a unique fold pattern that "decrypts" it. It'd be obvious how you folded it if you keep it around past a one-time thing, but you could print a dozen of them and keep them non-folded.


People often think that exporting a secret key from GPG means that the exported version is unencrypted. It's not. It's still encrypted with the same password that it was previously. Hence why you don't get prompted for a password when running:

  gpg --export-secret-key
And hence why the output of:

  gpg --export-secret-key | paperkey
Is already protected by a passphrase. The folding paper idea wouldn't make the printed data any more secure. I could give you my paperkey and you wouldn't be able to do anything with it.


It's still supposed to be the case that the private key is protected by being secret in addition to being encrypted. This removes one layer of security.

Not that I think it's really a big deal in most real-world cases, but distributing your encrypted private key is violating the contract, so you don't get the same security guarantees.


Yeah, I know it's encrypted. Just could be a fun project.


I realize this was a "random idea" but it makes no sense to me. What is the problem you are trying to solve?


How does this handle subkeys?


I think it would be more useful if it printed the key as QR code(s). This way you would not have to type in the key or rely on OCR.


Did you see:

  --output-type
    can be "base16" or "raw". "base16" is human-readable, and "raw" is useful
    if you want to pass the output to another program like a bar code or
    QR code generator (though note that scannable codes have some of the
    disadvantages discussed above).

It is as easy as:

  paperkey --secret-key secret-key.gpg --output-type raw | qrencode -o qr-paperkey.png

If you are curious David Shaw is one of the main GPG developers.


I have to admit, I just read the 'What paperkey does' section. This section suggests to "re-enter those bytes (whether by hand or via OCR)" and does not mention QR codes.

Next time I search the article for keywords before commenting...


How about everyone reads the entire article before commenting? I am a little surprised that anything else is even an option.


If you are going that route anyway, you can just use optar[1] and just print the whole encrypted file.

[1] http://ronja.twibright.com/optar/


Just generate a QR code from the output ("programs should do one thing and do it well")


Just add qrencode[1] to the mix:

> gpg --export-secret-key my-key | paperkey | qrencode

[1]: https://github.com/fukuchi/libqrencode


I went with Data Matrix to backup my (encrypted) PGP key pair to paper. When I compared QR and Data Matrix, Data Matrix "won" because of its ability to encode pretty massive amounts of data by chaining individual barcodes together. (QR tops out at around 3000 bytes; less if you increase the error correction level.)

That said, I'm not sure if I'd make the same decision today. QR code readers are plentiful, and Data Matrix readers are comparatively rare.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: