What RSA encryption is
RSA is an asymmetric cipher. It uses a pair of keys: a public key that anyone may have, and a private key that only you keep. Anything encrypted with the public key can be opened only with the private key. This solves a problem symmetric ciphers cannot: sending a secret to someone you have never shared a key with.
This tool generates an RSA key pair in your browser (2048, 3072 or 4096 bits), encrypts text with the public key, and decrypts it with the private key. It uses RSA-OAEP with SHA-256, the padding scheme recommended for encryption. Keys are shown as PEM by default and can also be exported as JWK (JSON Web Key).
How to use it
- Click to generate a key pair. This happens locally and can take a moment.
- Copy the public key to share, and keep the private key secret.
- To encrypt, paste the message and the recipient public key, then copy the ciphertext.
- To decrypt, paste the ciphertext and the matching private key.
Size limits
RSA can only encrypt a small amount of data directly. With a 2048-bit key and OAEP using SHA-256, the limit is about 190 bytes of plain text (larger keys allow more). Real systems use RSA to protect a random symmetric key and then encrypt the bulk of the data with AES. That pattern is called hybrid encryption, and it is how TLS and PGP work.
Common problems
Check these first when something does not work:
- Decryption fails: the private key does not match the public key used to encrypt, or the ciphertext was altered or copied with extra characters.
- Message too long: shorten the text or use AES for the data and RSA only for the key.
- Wrong key format: paste the full PEM text including the BEGIN and END lines, or a JWK.
Security notes
Generating keys in a web page is fine for learning and testing, but a key that has been shown on a screen or pasted into a browser should not protect anything valuable. For production, generate keys on a trusted machine or in a hardware module, keep private keys out of source control, and rotate them. RSA signatures and encryption are different operations; this tool only encrypts and decrypts.
Related tools
- AES Encryption & Decryption: Encrypt and decrypt with AES — ECB, CBC, CTR, and GCM modes. Multiple key formats, IV generator, and Base64/Hex output.
- PGP Encryption & Decryption: Secure client-side PGP key generation, encryption, and decryption.
- JWT Token Decoder: Decode JSON Web Tokens (JWT) locally in your browser. Inspect headers, payload, and signatures.
- Bulk SHA & MD5 Hash Generator: Generate MD5, SHA-1, SHA-256, and SHA-512 hashes in bulk from text or files.
