Generate a PGP Key Pair
Create your own public and private key. They are made in this browser and never sent anywhere.
Both are written into the key, where anyone who has your public key can read them. The name does not have to be your real one, and the email can be left out.
ECC with Curve25519 is the recommended choice. The NIST curves are for organisations whose rules require them.
- Enter the name the key should carry, and an email if you want one on it.
- Choose a passphrase you will remember. It cannot be reset.
- Press Generate. Your public and private key appear here.
Never share your private key. If you lose it or forget its passphrase, nothing encrypted to this key can be read again.
How to generate a PGP key pair
A key pair is a public key, which others use to encrypt messages to you, and a private key, which you use to decrypt them.
- Enter a name, and an email if you want one. Both are written into the public key and visible to anyone who has it, so use a pseudonym and leave the email empty if you would rather not be identified.
- Choose a passphrase. It locks the private key, and you will need it every time you decrypt or sign. Use at least 8 characters. Longer is better.
- Choose a key type. ECC with Curve25519 is recommended: its keys are small and fast, and GnuPG and other current PGP programs read them. RSA is for older software, and 4096 bits is the size to pick for a key you will keep.
- Press Generate. Copy or download the private key before you leave or clear the page, because it cannot be shown again.
Questions about PGP keys
Is it safe to use an online PGP key generator?
Only if the keys are made on your device and never leave it. A generator that makes your private key on a server has held a copy of it.
Here the key pair is made in your browser by the open-source OpenPGP.js library, using the browser's cryptographic random number generator. Nothing is uploaded, and you can disconnect from the internet before you press Generate to be sure. You are still trusting this site to serve the code it publishes. Every release is signed so that this can be checked (see the About page).
For a key you will rely on for years, GnuPG on your own computer is the more cautious choice.
Should I choose ECC or RSA?
ECC with Curve25519, unless you have a reason not to. Its keys are short, quick to use and supported by current PGP software.
Choose RSA if the person or system you deal with asks for it or runs old software, and pick 4096 bits for a key you will keep. The NIST curves are for organisations whose rules require them.
Do PGP keys made here expire?
No. They have no expiry date, and the page does not make a revocation certificate.
If you want either, import the private key into GnuPG, which can add an expiry date (gpg --edit-key) and make a revocation certificate (gpg --gen-revoke).
What if I lose my private key or forget the passphrase?
Then messages encrypted to that key cannot be read by anyone. No copy of the key or the passphrase exists outside your own devices.
Download the private key as soon as it is made and keep it somewhere safe, such as a password manager or an encrypted drive, with a second copy elsewhere. Keep the passphrase where you will find it again, preferably not in the same place.
How do I share my public key?
Any way you like. Copy or download it, then send it by email, put it on your website or profile, or upload it to a key server such as keys.openpgp.org.
Give people the fingerprint too, through a different channel if you can, so they can check that the key they received is yours. Never send anyone the private key.
Can I use these keys in GnuPG or Kleopatra?
Yes. They are standard OpenPGP keys. Save the private key to a file and import it with gpg --import or Kleopatra's import option. You may be asked for the passphrase you chose here.
Curve25519 keys are written in the encoding GnuPG uses, and this project's tests import keys made here into GnuPG.