Skip to content
D DocNectar

Free RSA Encryption and Decryption

Encrypt or decrypt text with RSA public-key cryptography, using a public key to encrypt and a private key to decrypt.

100% Free No Signup Works on all devices

Built and fact-checked by the DocNectar team — see our editorial standards

Thanks for rating!

Key Features

Instant Calculation

Get accurate results in real time with our optimized algorithm.

Mobile Friendly

Fully responsive design. Works on all devices & screen sizes.

Privacy Focused

Your data stays on your device. We don't store any inputs.

100% Free

No hidden costs. This tool is completely free forever.

RSA is a public-key (asymmetric) cipher — unlike AES or Triple DES, it uses two different keys: a public key anyone can use to encrypt a message, and a private key only its owner should have, used to decrypt it.

This tool encrypts or decrypts text using RSA with PEM-formatted keys you provide — use the RSA Key Pair Generator Tool first if you don't already have a key pair.

How it works

To encrypt, paste a public key (PEM format) and the tool encrypts your text directly against it using PKCS#1 OAEP padding, a modern, secure padding scheme. To decrypt, paste the matching private key and the base64-encoded ciphertext, and the tool reverses the process. RSA can only encrypt fairly short messages directly — the maximum depends on the key size (for a 2048-bit key, up to 214 bytes) — the tool checks this and tells you if your text is too long.

  1. Enter mode.
  2. Enter text (or base64 ciphertext to decrypt).
  3. Enter public Key (PEM, for encrypting).
  4. Enter private Key (PEM, for decrypting).
  5. Click Calculate to see your results.

Examples

Encrypting with a 2048-bit key

A 2048-bit RSA key can encrypt up to 214 bytes of text directly; generate a key pair with the RSA Key Pair Generator Tool, then use the public key here to encrypt and the private key to decrypt.

Who should use it

  • Learning how public-key encryption differs from password-based symmetric encryption.
  • Encrypting a short secret (like a symmetric key) to share securely with someone who holds the matching private key.

Industry applications

  • HTTPS/TLS and secure web communication
  • Digital signatures and public-key infrastructure (PKI)

Advantages

  • Demonstrates real public-key cryptography, the foundation of HTTPS, SSH, and digital signatures.
  • Uses modern OAEP padding rather than older, less secure padding schemes.

Limitations

  • Can only encrypt short messages directly — not practical for encrypting large amounts of data on its own.
  • Much slower than symmetric ciphers like AES for the same amount of data.

Common mistakes to avoid

  • Trying to encrypt a long message directly with RSA — check the tool's size limit, or encrypt a short symmetric key with RSA instead of the message itself for longer content.
  • Mixing up which key goes where — the public key encrypts, the private key decrypts, never the other way around with this padding scheme.

Best practices

  • For encrypting anything longer than RSA's direct size limit, encrypt the actual message with AES and use RSA only to encrypt that AES key — this is exactly how real-world protocols like TLS combine the two.
  • Never share your private key — only the public key is meant to be distributed.

Tips

  • If you need to encrypt something larger than RSA's direct limit, encrypt it with the AES Encryption Tool instead, then use RSA only to protect the AES password if you need to share it securely.

Frequently asked questions

Yes, with no signup and no limit on how many conversions you run.
RSA is only designed to encrypt small amounts of data directly — with OAEP padding, a 2048-bit key tops out at 214 bytes. In real systems, RSA is normally used to encrypt a short symmetric (AES) key rather than the actual message, and that symmetric key then encrypts the real data — this tool demonstrates plain RSA encryption directly, so the same size limit applies here.
Use the RSA Key Pair Generator Tool to create a fresh key pair, then copy the public key here to encrypt and the private key to decrypt.
Your input is processed to generate your result and isn't retained afterward — see the Privacy Policy for full details. Even so, treat your private key as sensitive and avoid pasting it into tools you don't trust.
Make sure the ciphertext was copied in full and matches the exact public key used to encrypt it — RSA encryption and decryption must use keys from the same key pair.

Get new calculators and guides in your inbox

No spam — just new tools like RSA Encryption Tool and practical guides.

Favorites