Tools / RSA Encrypt / Decrypt / Sign

RSA Encrypt / Decrypt / Sign.

Encrypt with RSA-OAEP, decrypt, sign and verify with PKCS#1 v1.5 or PSS using PEM keys, in your browser.

Runs in your browser

Public key, private key (PKCS#8 or PKCS#1) or a certificate. Encrypt and verify need the public half; decrypt and sign need the private key.

Ctrl/โŒ˜ + Enter to run ยท Ctrl/โŒ˜ + Shift + C to copy the result

Result
Result
Details

About RSA Encrypt / Decrypt / Sign

RSA Encrypt / Decrypt / Sign works with the RSA keys you already have in PEM form. Paste a public key, a private key in PKCS#8 (BEGIN PRIVATE KEY) or traditional PKCS#1 (BEGIN RSA PRIVATE KEY) format, or even a certificate, and choose an operation. Encryption uses RSA-OAEP with SHA-256 by default, the padding every modern library recommends; decrypt reverses it with the private key. Signing supports RSASSA-PKCS1-v1_5, which is what JWT RS256 and most code-signing tools use, and RSA-PSS, the safer probabilistic scheme behind PS256. Verify tells you whether a Base64 or hex signature matches the message and key. For example, a PKCS#1 v1.5 SHA-256 signature made here is byte-for-byte identical to openssl dgst -sha256 -sign key.pem, so you can check a signature produced by a build pipeline. The most common mistake is trying to encrypt a long message: with a 2048-bit key and SHA-256, OAEP can encrypt at most 190 bytes, which the details panel shows; larger data should be encrypted with AES and only the AES key wrapped with RSA. Others are mixing up the OAEP hash between sender and receiver, verifying with the wrong scheme, and expecting PKCS#1 v1.5 encryption, which WebCrypto deliberately does not offer. Encrypted private keys must be decrypted first. Everything runs locally with WebCrypto, and inputs are never saved in the page address.

How to Use

  1. Paste a PEM public key, private key or certificate.
  2. Choose the operation, scheme and hash, then enter the message (and the signature to verify).
  3. Copy the ciphertext or signature, or read the verification result.

Frequently Asked Questions

Why can't I encrypt a long text?

RSA-OAEP can only encrypt a few hundred bytes (190 bytes for a 2048-bit key with SHA-256). Real systems encrypt the data with AES and encrypt only the AES key with RSA.

Why does RSA-PSS give a different signature every time?

PSS adds a random salt to each signature. Every one of them verifies; only PKCS#1 v1.5 signatures are deterministic.

Can I generate a key pair here?

Not in this tool. Generate one with openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:3072, then paste the PEM.

Is my private key uploaded?

No. All operations use your browser's WebCrypto, the page makes no network requests, and the inputs are not stored in the URL or history.

Related Tools