Key holder
- Do not store the private key on a live system
- Use a dedicated hardware token (e.g. Nitrokey or YubiKey)
- Must be exclusive (not used for any other key)
- Backup of the generated key and revocation certificate on at least one encrypted offline storage medium
- Must be exclusive (not used for regular user data backups etc.)
Generating a new key pair
-
Use a live medium (e.g. the installation medium) on a machine that is not connected to the network
-
When not using archiso, verify that the version of GnuPG available to you is recent enough by running
gpg --version
. It should be at least version 2.1.0 to avoid using the SHA-1 algorithm for signatures, which is no longer considered to be secure. If in doubt, add the following options to.gnupg/gpg.conf
to force using SHA-512 for digests and avoid all uses of deprecated algorithms such as MD5 or SHA-1:personal-digest-preferences SHA512 cert-digest-algo SHA512 default-preference-list SHA512 SHA384 SHA256 SHA224 AES256 AES192 AES CAST5 ZLIB BZIP2 ZIP Uncompressed
-
Use a future proof algorithm when generating the key pair
- RSA >= 4096 bit
- ECC Curve25519
-
Create a key with a valid encryption subkey (
E
), so that encrypted verification tokens can be received. -
Create a key with signing capabilities on the root key (
S
- this is the default), as otherwise the root key has to be (temporarily) modified to accommodate the key verification process:gpg --edit-key $KEYID # drops into an interactive prompt within gpg change-usage S # toggle signing capabilities on root key Q # finish adjustment save # if required, save key gpg --local-user $KEYID! --clear-sign $FILE_TO_SIGN # make note of the postfix ! on $KEYID # then follow above steps to remove signing capabilities
Validating a key pair
- Use
sq-keyring-linter
from thesequoia-keyring-linter
package to perform basic certificate checks (e.g. use of the unsafe SHA-1 checksum algorithm):sq-keyring-linter <(gpg --export "${FULL_PGP_FINGERPRINT}")
- Use
hokey lint
from thehopenpgp-tools
package to pretty print the whole key and perform checks for best practices. Observe the output for colored warnings or errors.gpg --no-armor --export "${FULL_PGP_FINGERPRINT}" | hokey lint
Revocation Certificate Holder
- Do not store the revocation certificate on a live system
- Backup of the revocation certificate on at least one encrypted offline storage medium
- Must be exclusive (not used for regular user data backups etc.)