Skip to content
Lesson 12 of 12

Step 1 of 7 · Reading · ~1 min

Read

Production

Putting It All Together

You've built every piece:

What you builtWhere you built it
Square-and-multiply, and why the loop leaksModular Exponentiation
Finding large primes with Miller-RabinPrime Generation
Bézout coefficients and the modular inverseExtended Euclidean & Modular Inverse
n, phi(n), e, and deriving dRSA Key Generation
The raw public and private operationsEncrypt & Decrypt
PKCS#1 v1.5 block type 02, and why it fellPadding (PKCS#1 v1.5 vs OAEP)
EME-OAEP and MGF1, byte for byteOAEP Padding
Signing as the private operation on a hashRSA Signatures
EMSA-PSS encode and verifyRSA-PSS Signatures
How each of these breaks in the fieldRSA Attacks
PEM, DER, PKCS#1, PKCS#8, OpenSSHKey Formats

Modern alternatives to RSA:

  • Ed25519 (signatures): 256-bit keys, much faster, smaller signatures (64 bytes vs 256+ for RSA-2048). Used by SSH (default since 2016), Signal, GitHub.
  • X25519 (key exchange): the ECDH equivalent. Used by TLS 1.3.
  • Kyber (post-quantum): NIST 2024 standardization. Drop-in replacement for RSA key exchange.
  • Dilithium (post-quantum signatures): NIST 2024 standard.

When does RSA still make sense?

  • Legacy compatibility (old TLS clients)
  • Protocols that hardcode RSA (some PKCS#11 tokens, smart cards)
  • Long-term archival (RSA-4096 is a known quantity)

For new applications, prefer Ed25519/X25519. RSA's footguns are real, and its algorithms predate modern crypto best practices by decades.

You now understand the most-deployed asymmetric algorithm in history.

Discussion

Ask a question, share an insight, or help someone who’s stuck.

Sign in to post a comment or reply.

Loading…