What is PGP and what does this tool do?
PGP, or OpenPGP, is the standard behind GnuPG. It lets two people who never shared a secret exchange private messages and check who wrote what. Each person has a key pair. You publish the public key. Others use it to encrypt a message only you can read, or to verify a signature you made with your private key.
This page does the common jobs in your browser, using the OpenPGP.js library. You can generate a key pair, encrypt a message for one or more recipients, decrypt it, sign a text (cleartext or detached), verify a signature, and read the details of a key. Keys and messages use the armored text format, the -----BEGIN PGP ...----- blocks that GnuPG writes, so they work with GnuPG and other OpenPGP tools. The standard is RFC 9580.
For new keys you can choose Curve25519 (recommended, GnuPG 2.1 and later), NIST P-256, P-384 or P-521, or RSA of 2048, 3072 or 4096 bits. There is also an OpenPGP v6 option, which follows the newest RFC and is read only by recent tools. Pick the default if you are not sure.
Everything runs locally and nothing is uploaded; the library is loaded when you first use the page. What the tool cannot do is tell you whether a public key really belongs to the person you think. A valid signature only says the text came from the owner of that key and was not changed. Check the fingerprint with the person by another channel, such as a call.
How to use it
- Pick a tab in What to do: Generate keys, Encrypt, Decrypt, Sign, Verify or Read a key.
- To make a key, fill in Name: and E-mail:, choose Key type:, set Expires in (days, 0 = never): and, if you want, Passphrase to lock the private key:. Press Generate key pair. The new keys are copied into the other tabs.
- To encrypt, type the Message: and paste the recipients' keys in Public key(s) of the recipients (one or more PGP PUBLIC KEY blocks):. You can add Also lock with a passphrase (optional): and Sign the message too. Press Encrypt.
- To decrypt, paste the Encrypted message: and your Private key (PGP PRIVATE KEY block): with its Passphrase of the private key:, or use Or the message passphrase:. Press Decrypt.
- To sign, pick the Signature kind: (cleartext or detached) and press Sign. To verify, paste the Signed message: or the text plus Signature (PGP SIGNATURE block):, add Public key of the signer: and press Verify.
- To inspect a key, paste it in A public or private key: and press Read key.
Examples
Send a private message
Ask the person for their public key block, paste it as the recipient, type the message and press Encrypt. Send them the -----BEGIN PGP MESSAGE----- block. Only their private key can open it. If you tick Sign the message too, they can also see that it came from you, when they have your public key.
A cleartext signature for a release
Sign a text such as release notes with the cleartext kind. The result keeps your text readable and adds a signature block under it. Readers verify it with your public key. A detached signature is better for files, because the signature lives in its own block.
Read a key and its fingerprint
The Read a key tab shows the key id, the fingerprint, the identities, the algorithm, the dates and whether the private key is locked. A v4 fingerprint has 40 hex characters. A v6 key has a longer one, of 64 characters. Share the fingerprint through a second channel so others can check your key.
Message locked only by a passphrase
Leave the recipients empty and fill in the message passphrase. Anyone with that passphrase can decrypt it, with no key pair involved. The passphrase should be long, because it is the only protection.
Common mistakes
- "Wrong passphrase for this key." Check the passphrase and keyboard layout.
- "This private key is locked: type its passphrase." Fill in the passphrase field.
- "Could not decrypt. This message was not made for this key (or this passphrase), or it was changed." You are not one of the recipients, or the text was altered in transit.
- "This is not a valid PGP text: ..." The block is damaged. Copy it again with its BEGIN and END lines.
- "Paste at least one public key." or "Paste the public key of a recipient, or type a passphrase to lock the message." Add a recipient.
- "Fill in a name or an e-mail for the key." and "The e-mail does not look right." Fix the identity fields.
- "The signature is not valid for this text and this key." The text changed, even by a space, or you used another key.
Frequently asked questions
Is it safe to generate a PGP key on a web page?
The key is made in your browser and never sent, but a page is a bigger trust than a tool installed on your own machine. For a key you will rely on for years, generate it with GnuPG, and always lock the private key with a passphrase.
What is a revocation certificate?
It is a block that declares a key dead. Keep it somewhere safe; if you lose the private key, publishing it tells others to stop using the key. The generate tab creates one for you.
Does encrypting hide who the message is for?
No. The recipient key ids are visible in the message. Only the content is hidden.
Where can I find related tools?
For signatures with plain RSA, ECDSA or Ed25519 keys, see sign and encrypt with a public key. To make an SSH key, use the SSH key generator.
Equivalent commands
# Generate a key
gpg --quick-generate-key "Alice Example <alice@example.test>" ed25519 default 2y
# Encrypt and sign for a recipient
gpg --encrypt --sign --armor -r bob@example.test message.txt
# Decrypt
gpg --decrypt message.txt.asc
# Detached signature, and verify it
gpg --detach-sign --armor file.txt
gpg --verify file.txt.asc file.txt