PGP Public Key Encrypt and Decrypt (gpg Compatible, RSA and ECDH)

Encrypts a message to one or more OpenPGP public keys and decrypts messages made by gpg or other OpenPGP software when you paste the private key, all inside the page.

Use the tool

Why this tool exists

Sending an encrypted note to someone who published a PGP key normally needs gpg and a terminal. This page implements the needed parts of OpenPGP from the RFC: reading keys, picking the encryption subkey, wrapping a random AES-256 session key with RSA or ECDH, and a protected data packet with an integrity check. Messages decrypt with gpg, and messages from gpg decrypt here.

Keys and text never leave your browser, but a private key pasted into any web page is a risk you should weigh; use a throwaway key for sensitive work or the gpg command line. Supported: version 4 keys, RSA, ECDH on Curve25519, P-256, P-384 and P-521, secret keys protected by a passphrase, messages with integrity protection (SEIPD version 1) or the OCB packet gpg 2.4 writes, and compression. Not supported: version 6 keys and RFC 9580 messages, ElGamal, signing and verifying, Argon2 and BZip2. Signatures are ignored.

How to use it

  1. Choose Encrypt or Decrypt.
  2. To encrypt, paste your text and the recipient's public key block; several keys can be pasted one after another.
  3. To decrypt, paste the PGP MESSAGE, your private key block and its passphrase.
  4. Copy the armored result or the decrypted text.

Frequently asked questions

Is it compatible with gpg?

Yes for the supported algorithms. It was tested in both directions with gpg 2.4.4 on RSA 2048 and 3072, Curve25519, NIST P-256, P-384 and P-521 keys, with and without passphrases, including 100 KB messages and messages encrypted by gpg with OCB.

Does it sign the message?

No. The message is encrypted but not signed, so the recipient cannot tell who wrote it. Signatures in decrypted messages are not verified.

Why not paste my main private key here?

The page is open code but you cannot easily prove that your browser or extensions are not watching it. Prefer a dedicated key, and the gpg command line for important keys.

What about timing attacks?

The RSA and X25519 arithmetic uses JavaScript big integers, which are not constant time. That matters for a server, less for a one-off local decrypt.