How to use the PGP key generator
- Enter the name and email address the key is for, and choose a strong passphrase.
- Click Generate PGP Keys. RSA keys take a little longer.
- Download the public key, the private key and the revocation certificate. Share only the public key.
What you get
- Public key: give this to anyone who wants to send you encrypted messages or check your signature. It is safe to publish.
- Private key: decrypts messages sent to you and creates your signatures. It is locked with your passphrase. Never share it.
- Revocation certificate: a small file that tells the world the key should no longer be trusted. Keep it somewhere safe and separate, in case you lose the private key or forget the passphrase.
- Fingerprint: a 40-character ID for the key. People compare fingerprints to be sure they have the right key.
Curve25519 or RSA?
Curve25519 keys are modern, small and fast, and every current OpenPGP program supports them. Choose RSA only if you must work with very old software or a smart card that requires it.
Using the key with GnuPG
gpg --import private-key.asc # add the key to your keyring
gpg --list-secret-keys --keyid-format long
gpg --armor --export you@example.com # print your public key
To sign Git commits, tell Git which key to use:
git config --global user.signingkey YOUR_KEY_ID
git config --global commit.gpgsign true
Then paste the public key into the GPG keys page of your GitHub or GitLab settings so commits show as verified.
Choosing a passphrase
The passphrase is the only thing protecting the private key if the file is copied. Four or five random words work well. Check yours with the password strength checker or make one with the password generator. There is no way to recover a forgotten passphrase.
For server logins, use the SSH key generator instead.
Frequently asked questions
Is PGP the same as GPG?
PGP is the original program and OpenPGP is the standard based on it. GPG (GnuPG) is the free program most people use. Keys made here follow the OpenPGP standard and work with all of them.
Are my keys uploaded anywhere?
No. They are generated in your browser and exist only on this page until you download them.
What happens if I forget my passphrase?
The private key cannot be unlocked. Use the revocation certificate to retire the key, then create a new one.
Should my key expire?
An expiry date of one or two years is good practice. You can extend it later with your private key, and a lost key will stop being trusted on its own.