RSA-1024 • RSA-2048 • RSA-3072 • RSA-4096  |  Key generation  |  PKCS padding  |  Encrypt & Decrypt

RSA Encryption

Generate RSA key pairs, encrypt messages with the public key and decrypt with the private key. RSA is the most widely deployed asymmetric cipher — supporting 1024 to 4096-bit key sizes with PKCS#1 padding.

1
Generate RSA Key Pair
Choose a key length and generate a public / private key pair

2
Encrypt with Public Key
Encrypt a message using the RSA public key (PKCS#1 OAEP padding)
Public key auto-filled from Step 1. Enter your message and click Encrypt.

3
Decrypt with Private Key
Recover the original message using the RSA private key
Cipher text and private key auto-filled. Click Decrypt to recover your message.

What is RSA Cryptography?

RSA (Rivest–Shamir–Adleman) is the most widely deployed public-key cryptosystem, invented in 1977. Its security relies on the difficulty of integer factorization — given the product of two large primes, it is computationally infeasible to recover the primes classically.

RSA is used in TLS/HTTPS certificates, digital signatures, key exchange, email encryption (PGP/S-MIME) and API authentication.

How RSA works

StepOperationDescription
Key generationChoose primes p, q → n = p×qCompute public exponent e and private exponent d
Encryptionc = me mod nAnyone with the public key (n, e) can encrypt
Decryptionm = cd mod nOnly the private key holder (d) can decrypt

Key size security levels

Key sizeSecurity levelNIST statusQuantum safe?
1024-bit~80-bitProhibited since 2013No
2048-bit~112-bitAcceptable until 2030No
3072-bit~128-bitRecommendedNo
4096-bit~140-bitStrongNo

RSA and quantum computers

All RSA key sizes are vulnerable to Shor's algorithm running on a sufficiently powerful quantum computer. NIST recommends migrating to post-quantum alternatives — Kyber (ML-KEM) for key exchange and Dilithium (ML-DSA) for signatures — before 2030.

Try Kyber (ML-KEM)  •  Analyze your RSA key size  •  Check your domain's PQ readiness

References

  1. R. Rivest, A. Shamir, L. Adleman — "A Method for Obtaining Digital Signatures and Public-Key Cryptosystems" (1978)
  2. NIST SP 800-57 — Recommendation for Key Management
  3. RFC 8017 — PKCS#1 v2.2 RSA Cryptography Standard
  4. RSA on Wikipedia