β Back to all tools
RSA Encryption / Decryption
Asymmetric encryption with public/private key pairs. Generate keys and encrypt/decrypt data client-side.
βΉ
RSA is not suitable for large data β it is limited by key size. For large payloads, use AES to encrypt the data and RSA to encrypt the AES key (hybrid encryption).
Key Pair Generation
RSA
Generating β this may take a moment for 4096-bit keysβ¦
Key Pair
Public Key (PEM)
Private Key (PEM)
β
Keep your private key secret. Never share it or paste it into untrusted tools.
Encrypt / Decrypt
Output
Encrypted / decrypted result will appear hereβ¦
Frequently Asked Questions
What key size should I use?
2048-bit is the minimum recommended key size for RSA. Use 4096-bit for high-security scenarios where long-term data protection is required. Larger keys are more secure but slower to generate and use.
Is RSA safe for large files?
RSA is designed for small data β typically only used to encrypt a symmetric key. For bulk data encryption, use AES. A common hybrid approach is to encrypt your data with AES, then encrypt the AES key with RSA.
Are my keys saved anywhere?
No. Keys are generated entirely in your browser and are never stored or transmitted. You must save your private key manually β losing it means losing access to anything encrypted with the corresponding public key.
What is the difference between a public key and a private key?
The public key can be shared with anyone and is used to encrypt data. Only the matching private key can decrypt what was encrypted with the public key. This asymmetric design means you can receive encrypted messages from anyone without ever sharing a secret.
Why can't RSA encrypt large files?
RSA can only encrypt data smaller than its key size (e.g. ~245 bytes for a 2048-bit key with OAEP). For large data, use a hybrid approach: encrypt the data with AES, then use RSA to encrypt only the AES key. This is how TLS/HTTPS works.
What padding scheme should I use with RSA?
Use RSA-OAEP for all new applications β it is the modern secure standard. Avoid PKCS#1 v1.5 padding which is vulnerable to padding oracle attacks (Bleichenbacher attack). Most browsers support RSA-OAEP natively via the Web Crypto API.