PGP key generator

Runs in your browser

Create 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.

Nothing generated yet

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.

What’s inside a key

Primary keyEd25519Key ID AD9F2C1ABBE5DD9AIt signs, certifies.Expires: never
User IDAlice <alice@example.org>Bound to the key by a self-signature.
SubkeyCurve25519 (ECDH)Key ID A057BA954A17E594It encrypts.Expires: never
The 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
Choosing

Which key type?

TypeGood forWorks with
Curve25519Ed25519 signs, Curve25519 encryptsNew 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 4096When someone requires RSA, or older software has to read your key.Everything, including very old PGP versions
RSA 3072Same as RSA 4096, a bit faster. GnuPG’s old default.Everything
RSA 2048Only if a system can’t handle larger keys. Still secure today, but not for keys you keep for years.Everything
Next steps

After you generate your key

  1. 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.
  2. 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.
  3. 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.
  4. Set a reminder before it expires. Extend it in time with gpg --quick-set-expire FINGERPRINT 2y and share the updated public key. An expiry date protects you if you lose the key.
Command line

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 typeCommands
ECC Curve25519gpg --quick-gen-key 'Alice <alice@example.org>' ed25519 sign,cert 2y
gpg --quick-add-key FINGERPRINT cv25519 encr 2y
RSA 4096gpg --quick-gen-key 'Alice <alice@example.org>' rsa4096 sign,cert 2y
gpg --quick-add-key FINGERPRINT rsa4096 encr 2y
RSA 3072gpg --quick-gen-key 'Alice <alice@example.org>' rsa3072 sign,cert 2y
gpg --quick-add-key FINGERPRINT rsa3072 encr 2y
RSA 2048gpg --quick-gen-key 'Alice <alice@example.org>' rsa2048 sign,cert 2y
gpg --quick-add-key FINGERPRINT rsa2048 encr 2y
FAQ

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.

Searches the list of pages on this site. What you type stays in your browser.