Built and fact-checked by the DocNectar team — see our editorial standards
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.
- Enter mode.
- Enter text (or base64 ciphertext to decrypt).
- Enter public Key (PEM, for encrypting).
- Enter private Key (PEM, for decrypting).
- 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.