🔐 PGP Key Generator – Create OpenPGP Key Pairs Online
Pretty Good Privacy (PGP) is the gold standard for end-to-end encrypted communication. Whether you are securing emails, signing Git commits, encrypting files, or setting up GPG-based workflows, every secure interaction begins with a key pair. This tool generates fully standard OpenPGP-compatible public/private key pairs in your browser using the trusted OpenPGP.js library — no software installation, no server contact, no data ever transmitted.
🛡️ How PGP Key Pairs Work
A PGP key pair consists of two mathematically linked keys:
🔓
Public Key
Share this freely. Others use it to encrypt messages that only you can read, or to verify signatures you produce. It starts with -----BEGIN PGP PUBLIC KEY BLOCK-----.
🔒
Private Key
Keep this secret — always. You use it to decrypt messages encrypted to you and to digitally sign data. It starts with -----BEGIN PGP PRIVATE KEY BLOCK-----.
⚙️ Choosing the Right Algorithm
The generator supports three algorithm families:
ECC – Curve25519 (Ed25519 + X25519) ⭐ Recommended
The modern standard used by ProtonMail, Keybase, and modern GPG defaults. Generates in milliseconds, produces compact keys (~400 bytes), and delivers security equivalent to RSA-3072. If in doubt, choose this option.
ECC – NIST Curves (P-256, P-384, P-521)
FIPS-certified curves used in corporate and government environments requiring NIST compliance. P-256 is roughly equivalent to RSA-3072 security. Choose these when FIPS 186-4 compliance is required.
RSA (2048 – 8192 bits)
The legacy standard with the widest compatibility. RSA 4096 is a safe choice for systems that do not support ECC. RSA 2048 is the minimum acceptable size. RSA 8192 can take 10–30 seconds to generate and offers negligible security gains over RSA 4096.
🔑 Passphrase Protection
A passphrase encrypts your private key using AES-256 with salted, iterated S2K (String-to-Key) derivation. This means even if someone steals your private key file, they cannot use it without the passphrase. Best practices:
- Use at least 12 characters combining uppercase, lowercase, numbers, and symbols.
- Consider using a passphrase (multiple words) rather than a single complex password.
- Store your passphrase in a reputable password manager.
- Never share your passphrase — unlike a key revocation certificate, a compromised passphrase cannot be undone without rotating the entire key pair.
📅 Key Expiry Date
Setting an expiry date is a security best practice. An expired key signals to recipients that they should seek a fresh key or new communication channel. It limits the blast radius if your key is lost or compromised and you forget to publish a revocation certificate. You can always extend the expiry date later using GnuPG without generating a new key.
📋 Using Your Generated Keys
After generating your keys, you can download the ASCII-armored .asc files and import them into your local GPG keyring:
# Import public key
gpg --import my_key_public.asc
# Import private key
gpg --import my_key_private.asc
# List imported keys
gpg --list-keysYour public key can be shared via email, uploaded to a public keyserver (keys.openpgp.org), or added to your GitHub profile for signed commit verification. The private key should remain on trusted, encrypted storage only.
🔍 Fingerprint and Key ID
The fingerprint is a 40-character hexadecimal SHA-1 hash of the public key packet. It uniquely identifies your key pair and can be safely shared to verify you are exchanging keys with the right person. The Key ID is the last 8 or 16 characters of the fingerprint — a shorter, less unique reference used in some GPG commands. Always verify a full fingerprint out-of-band (by phone, in person) when establishing a trust relationship.
🔒 Privacy and Security
All key generation happens entirely in your browser using OpenPGP.js and browser-native WebCrypto APIs. No keys, passphrases, names, or email addresses are transmitted to any server. The page contains no analytics trackers that could intercept key material. For maximum security — especially for high-value keys — consider generating keys on an air-gapped machine using GnuPG directly.