Tech News, Tech & Coding · Free Online Tools

IT Question Answer
Tools

RSA Encryption & Decryption

Generate secure RSA key pairs and encrypt or decrypt messages entirely in your browser.

Advertisement

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

Advertisement

Frequently asked questions

The public key encrypts and can be shared freely. The private key decrypts and must stay secret. Knowing the public key does not let anyone work out the private key.

It generates 2048, 3072 or 4096-bit RSA keys (2048 is the default) and encrypts with RSA-OAEP using SHA-256.

No. The keys are generated and used in your browser. Nothing is sent to a server.

RSA works on a block no larger than the key size minus padding. For 2048-bit keys that is about 190 bytes. Use AES for larger data and RSA for the AES key.

No. They are meant for learning and testing in the browser. They are not SSH keys or certificates.