HashTools

RSA Encrypt / Decrypt

Generate a 2048-bit RSA key pair and encrypt/decrypt messages with RSA-OAEP (SHA-256). Everything stays in your browser.

Ciphertext will appear here…

What is RSA?

RSA (Rivest–Shamir–Adleman, 1977) is the original public-key cryptosystem. It relies on the practical difficulty of factoring the product of two large primes. Anyone who knows the public key (n, e) can encrypt; only the holder of the private exponent d can decrypt.

RSA-OAEP, not textbook RSA

Raw RSA is deterministic and malleable. OAEP (Optimal Asymmetric Encryption Padding) randomizes every encryption and turns RSA into a CCA-secure scheme. Always use OAEP for encryption, or PSS for signing — never the raw primitive.

When to use RSA

RSA is most often used to wrap a symmetric key (AES) rather than to encrypt long messages directly — RSA-OAEP-SHA256 with a 2048-bit modulus can only carry about 190 bytes of plaintext. For modern code, ECC (Curve25519, P-256) gives equivalent security at a fraction of the key and ciphertext size.