PAPERKEY(1)
π PAPERKEY β like, the manual page, bestie π
okay so you found yourself in the General Commands Manual section, staring at paperkey, and honestly? this one's a baddie. it's the tool that goes "hey bestie, what if your secret key lived on actual paper" and it's right. let's get into it π
β¨ NAME β¨
paperkey β extract secret information out of OpenPGP secret keys π
πΈ SYNOPSIS πΈ
paperkey [--secret-key=FILE] [--output=FILE] [--output-type=base16|raw]
[--output-width=WIDTH]
paperkey --pubring=FILE [--secrets=FILE] [--input-type=auto|base16|raw]
[--output=FILE] [--ignore-crc-error] [--comment=STRING] [--file-format]
paperkey --version
π¦ MOTIVATION π¦
okay so real talk. all data should be backed up. but secret keys?? bestie, secret keys need to be backed up even harder than everything else, because if you lose them they are literally impossible to recreate. every file that was encrypted to a lost key is forever (or at least for a really long time) undecipherable. gone. poof. π
so yeah, obviously keep backups of your secret key info on digital media β USB sticks, CDs, whatever β but it's also super reasonable to keep an if-all-else-fails copy on plain old paper, for the day your digital media becomes unreadable for whatever reason. and like, stored properly, paper keeps information for several decades or longer. paper is that girl fr fr π«Ά
here's the thing though. with GnuPG, PGP, or other OpenPGP implementations, the secret key usually holds a LOT more than just the secret numbers that actually matter. it also has all the public values of key pairs, user ids, expiration times, and more. and since the goal is to minimize the info that has to be entered manually or with the help of OCR, QR code, or similar software, paperkey extracts just the secret information out of OpenPGP secret keys. recovering a secret key assumes the public key is still available β for instance from public Internet keyservers. no cap π
π DESCRIPTION π
paperkey has two modes of operation:
the first mode creates "paperkeys" by extracting just the secret information from a secret key, formatting the data in a way suitable for printing, or in a raw mode for further processing. β¨
the other mode rebuilds secret keys from such a paperkey plus a copy of the public key, and it also verifies the checksums embedded in the paperkey. this mode is selected when the --pubring option is used, which is required in that case. if a passphrase was set on the original secret key, the same passphrase is set on the rebuilt key. π
input is read from standard-in except when the --secret-key or --secrets option is used; output is printed to standard-out, unless changed with the --output option.
π SECURITY CONSIDERATIONS π
bestie, read this one. seriously. π
please note that paperkey does not change the protection and encryption status of and security requirements for storing your secret key. if the secret key was protected by a passphrase, so is the paperkey. if the secret key was unprotected, the paperkey will not be protected either. it's giving "same energy, same consequences" π
β OPTIONS β
--help,-hβ display a short help message and exit successfully. cute and quick π--version,-Vβ print version information and copyright information and exit successfully. π--verbose,-vβ print status and progress information to standard-error while processing the input. repeat it for even more output. the way that more-v= more yapping π--output=FILE,-oβ redirect output to the file given instead of printing to standard-output. π--comment=STRINGβ include the specified comment in the base16 output. βοΈ--file-formatβ paperkey automatically includes the file format it uses as comments at the top of the base16 output. this command simply prints out the file format and exits successfully. π
π₯ OPTIONS FOR EXTRACTING SECRET INFORMATION π₯
--output-type=base16,--output-type=rawβ select the output type. the base16 style encodes the information in the style of a classic hex-dump, including line numbers and per-line CRC checksums, to facilitate localizing errors in the input file during the recovery phase. the raw, or binary, mode is just a raw dump of the secret information, intended for feeding to barcode generators or the like. π--output-width=WIDTHβ choose line width in the base16 output mode. the default is 78 characters. π--secret-key=FILEβ file to read the secret key from. if this option is not given,paperkeyreads from standard-input. ποΈ
π§ OPTIONS FOR RE-CREATING PRIVATE KEYS π§
--input-type=auto,--input-type=base16,--input-type=rawβ specify that the given input is either in base16 format, as produced bypaperkey, or in raw format. the default, auto, tries to automatically detect the format in use. π΅οΈββοΈ--pubring=FILEβ file to read public key information from. it is assumed that the user can get the public key from sources like public Internet keyservers. π--secrets=FILEβ file to read the extracted secrets, the paperkey, from. if this is not given then the information is read from standard-input. π--ignore-crc-errorβ do not reject corrupt input and continue despite any CRC errors. β οΈ (it's literally in the name, bestie β you're telling it to keep going even when the checksums say something's wrong)
π EXAMPLES π
take the secret key in key.gpg and generate a text file to-be-printed.txt that contains the secret data:
$ paperkey --secret-key my-secret-key.gpg --output to-be-printed.txt
take the secret key data in my-key-text-file.txt and combine it with my-public-key.gpg to reconstruct my-secret-key.gpg:
$ paperkey --pubring my-public-key.gpg --secrets my-key-text-file.txt
--output my-secret-key.gpg
if --output is not specified, the output goes to stdout. if --secret-key is not specified, the data is read from stdin so you can do things like:
$ gpg --export-secret-key my-key | paperkey | lpr
periodt. that last one is a whole pipeline and it ate π
π«Ά SEE ALSO π«Ά
gpg(1), http://www.jabberwocky.com/software/paperkey/
π AUTHORS π
paperkey is written by David Shaw <dshaw@jabberwocky.com>.
and that's the whole page, bestie!! this one is from June 2012 and it's part of the paperkey source, so go print your secrets on paper like the icon you are. mwah π πβ¨π¦
π¦ where this page comes from
- arch rolling: paperkey 1.6-6 Β· GPL-2.0-or-later
- debian bookworm: paperkey 1.6-1 Β· GPL-2.0-or-later
- debian trixie: paperkey 1.6-1 Β· GPL-2.0-or-later
- fedora 43: paperkey 1.6-17.fc43 Β· GPL-2.0-or-later
- fedora 44: paperkey 1.6-18.fc44 Β· GPL-2.0-or-later
- nixos 26.05: paperkey 1.6
- nixpkgs unstable: paperkey 1.6
- ubuntu jammy: paperkey 1.6-1 Β· GPL-2.0-or-later
- ubuntu noble: paperkey 1.6-1build1 Β· GPL-2.0-or-later
- ubuntu questing: paperkey 1.6-1build1
- ubuntu resolute: paperkey 1.6-1build2 Β· GPL-2.0-or-later
- ubuntu stonking: paperkey 1.6-1build2 Β· GPL-2.0-or-later
- copyright (C) 2007, 2012, 2013 Peter Palfrader <peter@palfrader.org>
- copyright 2007, 2008 David Shaw <dshaw@jabberwocky.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms