The Math of Cryptography
The Algorithms Protecting the Global Network
1. RSA: The Power of Primes
RSA (Rivest-Shamir-Adleman) is based on the difficulty of Integer Factorization. It is easy to multiply two large prime numbers $p$ and $q$ to get $N$. It is extremely hard for a computer to take $N$ and find $p$ and $q$ if they are hundreds of digits long.
However, RSA is vulnerable if implemented without Padding. Simple RSA (textbook RSA) is deterministic, meaning the same message always produces the same ciphertext. Modern implementations use OAEP (Optimal Asymmetric Encryption Padding) to add randomness and ensure that an attacker cannot learn information through frequency analysis.
RSA Public-Key Exchange
Alice (Client)
Step 0: Idle
Click Next Step to begin the RSA exchange process.
Bob (Server)
2. ECC: The Geometry of Curves
Elliptic Curve Cryptography (ECC) provides the same level of security as RSA but with much smaller key sizes. A 256-bit ECC key is equivalent in strength to a 3072-bit RSA key. This makes ECC ideal for mobile devices and low-power IoT sensors.
ECC is based on the Elliptic Curve Discrete Logarithm Problem. Points on a curve defined by an equation like $y^2 = x^3 + ax + b$ are part of a mathematical group.
3. Diffie-Hellman: The Handshake
Whitfield Diffie and Martin Hellman solved a problem as old as spycraft: How do two people agree on a secret key without meeting in person and without a middleman hearing them?
The Diffie-Hellman Key Exchange (DH) uses modular exponentiation to arrive at a Shared Secret.
Conclusion
The math of cryptography is the thin line between a private conversation and a public broadcast. As quantum computing looms, we are already preparing a new generation of math—Post-Quantum Cryptography (PQC)—based on lattice problems that even quantum computers cannot solve easily.
