Loading search...

RSA Decrypt Online

Encrypted with RSA Encrypt? Use the matching private key.
Copy

Decrypt an RSA-encrypted message using your private key, entirely in the browser. Paste your PKCS#8 PEM private key and the ciphertext (base64 or hex), and recover the original plaintext. Uses RSA-OAEP — the modern, secure padding standard. Your private key never leaves your device.

How RSA Decryption Works

RSA decryption reverses the asymmetric encryption process. The sender encrypted a message using your public key. Only you, holding the corresponding private key, can decrypt it. The mathematical relationship between the key pair makes this possible, while making it computationally infeasible to decrypt without the private key.

Common Decryption Errors

  • Wrong key: The private key must correspond to the public key used for encryption
  • Hash mismatch: The hash algorithm must match what was used during encryption
  • Wrong format: Select base64 or hex to match the ciphertext format
  • Corrupted data: Even one missing character in the ciphertext causes decryption to fail

Private Key Security

  • Never paste your private key into untrusted websites — this tool is browser-only but always be cautious
  • Clear the browser tab after use on shared computers
  • Consider storing private keys in a hardware security module (HSM) for production systems

Frequently Asked Questions

Why does decryption fail with "decryption failed"?

Decryption fails when: (1) the private key does not match the public key used for encryption, (2) the ciphertext has been corrupted or truncated, (3) the hash algorithm does not match what was used during encryption, or (4) the ciphertext format (base64 vs hex) is wrong. Ensure all parameters match those used during encryption.

Does the hash algorithm need to match encryption?

Yes. The hash algorithm specified during RSA-OAEP decryption must match what was used during encryption. SHA-256 is the default. If you or the sender used a different hash (SHA-384, SHA-512), change the selector to match.

Is my private key safe?

Yes. Decryption happens entirely in your browser using the Web Crypto API. Your private key is loaded into browser memory for the duration of the operation and is never transmitted to any server. Close the browser tab after use if you are on a shared computer.

What format should the private key be in?

The private key should be in PKCS#8 PEM format, beginning with "-----BEGIN PRIVATE KEY-----". This is the format produced by the RSA Key Generator tool, and is the standard format used by OpenSSL (via the -pkcs8 flag), Node.js, Python cryptography library, and most modern tools.

Can I decrypt data encrypted by OpenSSL or other tools?

Yes, as long as the data was encrypted with RSA-OAEP using the same key and hash algorithm. For OpenSSL: openssl rsautl -decrypt -oaep -inkey private.pem uses OAEP with SHA-1 by default — in that case you would need to match with SHA-1 (not currently supported in this tool; use SHA-256 for new systems).