Interactive RSA encryption tool using small primes. See key generation, encryption, decryption calculations step-by-step. Break RSA by factoring n to understand why key size matters.
RSA (Rivest-Shamir-Adleman) is the first widely adopted public key cryptosystem, published in 1977. It enables secure communication, digital signatures, and key exchange without requiring parties to share a secret key in advance. RSA's security is based on the computational difficulty of factoring the product of two large prime numbers — a problem that remains intractable for classical computers at sufficient key sizes.
RSA is used in TLS/SSL certificates, PGP email encryption, code signing, secure boot, and countless other security protocols. While newer elliptic curve algorithms offer equivalent security with smaller keys, RSA remains foundational to understanding public key cryptography and is still the most widely deployed asymmetric algorithm.
RSA key generation, encryption, and decryption follow these mathematical steps:
| Operation | Formula | Used For |
|---|---|---|
| Encrypt | c = m^e mod n | Confidentiality — encrypting data with the recipient's public key |
| Decrypt | m = c^d mod n | Decrypting data with your private key |
| Sign | s = hash(m)^d mod n | Digital signatures — proving authorship with your private key |
| Verify | hash(m) = s^e mod n | Verifying a signature with the signer's public key |
| RSA Key Size | Equivalent Symmetric Strength | Status |
|---|---|---|
| 1024-bit | ~80-bit | Deprecated — factorable with sufficient resources |
| 2048-bit | ~112-bit | Minimum acceptable — adequate through ~2030 |
| 3072-bit | ~128-bit | Recommended for new deployments |
| 4096-bit | ~152-bit | Long-term security, but slower operations |