Generate a PGP Key Pair That Does Not Expose You
A PGP key is only as strong as the way you make it and the way you store it. Most real world failures are not broken cryptography. They are a private key pasted into a web page, a passphrase saved in a browser, or one key reused everywhere until it quietly links every identity you own. The steps below cover generating an OpenPGP key pair and keeping it clean from the first minute.
- Generate on a machine you control. Use a fully updated system, and if you can, do the generation while offline. Threat: malware and keyloggers that capture the passphrase or the private key at the exact moment of creation, when both exist in the clear.
- Create a dedicated identity, not your real one. Use a fresh address or a user ID that carries no personal detail. Threat: keyservers are append only and effectively permanent, so whatever you bind to a key at creation is public forever and can link separate personas together.
- Choose modern algorithms and set an expiry. Ed25519 for signing and Curve25519 for encryption are the sensible defaults today. Fall back to RSA 4096 only when you must interoperate with old tooling. Threat: legacy defaults such as RSA 1024 or SHA1 signatures are weak and increasingly rejected outright. An expiry of twelve to twenty four months means a forgotten key does not stay valid forever in someone else's hands.
- Protect the private key with a strong passphrase kept in a real vault. Threat: a stolen laptop with an unprotected private key is a full identity compromise, and a passphrase sitting in a browser or a plain text note is the same outcome with extra steps.
- Split the key: certify only primary offline, subkeys on your daily machine. Keep signing, encryption and authentication subkeys on the device you actually use. Threat: if a daily subkey leaks you revoke that subkey and keep your identity, instead of rebuilding your reputation from zero.
- Generate the revocation certificate at creation time and store it offline. Threat: if the key is later lost or stolen you cannot revoke it without that file, and an unrevoked key keeps working for whoever holds it.
- Back up offline, never paste into browser tools, and test the flow. Keep two encrypted copies on removable media, and treat any web page that offers to generate, repair or convert a key as hostile, because it can copy the private material. Then encrypt a file to yourself, decrypt it, sign a message and verify it, and export only the public half. Threat: discovering a broken setup in the middle of a real conversation costs you the conversation.
Revisit the key before it expires, rotate the subkeys rather than the identity, and store the offline copy somewhere you would trust with your passport.