Step 1 of 7 · Reading · ~1 min
Read
Production
Putting It All Together
You've built every piece:
| What you built | Where you built it |
|---|---|
| Square-and-multiply, and why the loop leaks | Modular Exponentiation |
| Finding large primes with Miller-Rabin | Prime Generation |
| Bézout coefficients and the modular inverse | Extended Euclidean & Modular Inverse |
| n, phi(n), e, and deriving d | RSA Key Generation |
| The raw public and private operations | Encrypt & Decrypt |
| PKCS#1 v1.5 block type 02, and why it fell | Padding (PKCS#1 v1.5 vs OAEP) |
| EME-OAEP and MGF1, byte for byte | OAEP Padding |
| Signing as the private operation on a hash | RSA Signatures |
| EMSA-PSS encode and verify | RSA-PSS Signatures |
| How each of these breaks in the field | RSA Attacks |
| PEM, DER, PKCS#1, PKCS#8, OpenSSH | Key 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…