PGP key generator
Runs in your browserCreate a PGP key pair with your name and email. You get the public key to share, the private key to keep and a revocation certificate. Nothing is sent anywhere.
Long and easy to remember beats short and complicated: four or five random words work well.
Enter your name and email
The key is made in your browser with its secure random generator. It never leaves this page unless you copy or download it.
Revocation certificate
If your private key is ever lost or stolen, publish this to tell everyone the key is no longer valid. Store it somewhere safe, apart from the key.
What’s inside a key
AD9F2C1ABBE5DD9AIt signs, certifies.Expires: neverA057BA954A17E594It encrypts.Expires: neverThe same with GnuPGin your terminal
gpg --quick-gen-key 'Alice Example <alice@example.org>' ed25519 sign,cert 2y gpg --quick-add-key FINGERPRINT cv25519 encr 2y gpg --armor --export alice@example.org > public.asc
Which key type?
| Type | Good for | Works with |
|---|---|---|
| Curve25519Ed25519 signs, Curve25519 encrypts | New keys. Small, fast and secure. GnuPG creates this by default since version 2.3. | GnuPG 2.2 and newer, Kleopatra, GPG Suite, Thunderbird, Proton Mail, OpenKeychain, Mailvelope |
| RSA 4096 | When someone requires RSA, or older software has to read your key. | Everything, including very old PGP versions |
| RSA 3072 | Same as RSA 4096, a bit faster. GnuPG’s old default. | Everything |
| RSA 2048 | Only if a system can’t handle larger keys. Still secure today, but not for keys you keep for years. | Everything |
After you generate your key
- Save both keys and the revocation certificate. Download them, or copy them into your password manager. Without the private key and its passphrase, nobody can read messages sent to you, not even you.
- Import the private key into your app. GnuPG:
gpg --import private.asc. Kleopatra: File → Import. Thunderbird: Account settings → End-to-end encryption → Add key → Import. GPG Suite on macOS: Import. OpenKeychain on Android: Import from file. - Share the public key. Send the public.asc file, put it on your website, or upload it to
keys.openpgp.org. Tell people the fingerprint through a second channel so they can check it. - Set a reminder before it expires. Extend it in time with
gpg --quick-set-expire FINGERPRINT 2yand share the updated public key. An expiry date protects you if you lose the key.
The same with GnuPG
To create the key on your own computer instead, GnuPG needs two commands: one for the primary key, one for the encryption subkey. The tests ran them exactly like this in GnuPG 2.4.4.
| Key type | Commands |
|---|---|
| ECC Curve25519 | gpg --quick-gen-key 'Alice <alice@example.org>' ed25519 sign,cert 2ygpg --quick-add-key FINGERPRINT cv25519 encr 2y |
| RSA 4096 | gpg --quick-gen-key 'Alice <alice@example.org>' rsa4096 sign,cert 2ygpg --quick-add-key FINGERPRINT rsa4096 encr 2y |
| RSA 3072 | gpg --quick-gen-key 'Alice <alice@example.org>' rsa3072 sign,cert 2ygpg --quick-add-key FINGERPRINT rsa3072 encr 2y |
| RSA 2048 | gpg --quick-gen-key 'Alice <alice@example.org>' rsa2048 sign,cert 2ygpg --quick-add-key FINGERPRINT rsa2048 encr 2y |
Questions about PGP keys
Is it safe to generate a PGP key in the browser?
The key is made with your browser’s cryptographic random generator (the same one HTTPS uses) and never leaves the page: there is no server, and the Content-Security-Policy blocks connections to other sites. For a key you will use for years, generating it with GnuPG on your own computer is the most cautious choice; the commands are above.
Should my key expire?
Yes. Two years is a good default. You can extend it any time with the private key, so an expiry date costs nothing. If you lose the key, it stops being used on its own.
RSA or Curve25519?
Curve25519, unless someone requires RSA. It is as secure as RSA 3072, much smaller and faster, and the default in GnuPG since 2.3.
What if I forget the passphrase?
Then the private key is lost for good: there is no reset. Publish the revocation certificate so people stop using the old key, and make a new one.
Do these keys work with GnuPG?
Yes. Each key type was imported into GnuPG 2.4.4, which then decrypted messages encrypted here and the other way round. The revocation certificate works there too.