In 1976, Whitfield Diffie and Martin Hellman published their groundbreaking paper "New Directions in Cryptography", introducing the concept of Public Key Cryptography. For thousands of years prior, communication required sender and receiver to share a secret key in person before exchanging messages. Asymmetric cryptography solved this limitation using mathematical "one-way trapdoor functions"—problems that are easy to compute in one direction, but computationally impossible to reverse without a private trapdoor key.
Introduced in 1977 by Ron Rivest, Adi Shamir, and Leonard Adleman, the RSA algorithm derives its mathematical security from the extreme computational difficulty of factoring the product of two massive prime numbers:
p and q (e.g. 1024 bits each).n = p * q. The bit length of n is the key length (e.g. 2048 bits).φ(n) = (p - 1) * (q - 1).e such that 1 < e < φ(n) and gcd(e, φ(n)) = 1 (Standard industry default is e = 65537).d using Modular Multiplicative Inverse: d * e ≡ 1 (mod φ(n)).(e, n) • Private Key: (d, n).Ciphertext = (Plaintext)^e mod n • Decryption: Plaintext = (Ciphertext)^d mod n.While RSA remains widespread, modern cybersecurity is rapidly migrating to Elliptic Curve Cryptography (ECC). ECC operates over algebraic structures of elliptic curves defined by the Weierstrass equation: y^2 = x^3 + ax + b over a finite field. Security relies on the Elliptic Curve Discrete Logarithm Problem (ECDLP):
| Feature | RSA Algorithm | Elliptic Curve Cryptography (ECC) |
|---|---|---|
| Key Length for 128-bit Security | 3,072 bits (Bulky certificates) | 256 bits (Tiny, lightweight certificates) |
| Computation & Battery Impact | Heavy CPU cycles and memory usage. | Ultra-fast; consumes 90% less battery on mobile and IoT devices. |
| Top Standard Curves | RSA-2048, RSA-4096 | Curve25519 (X25519/Ed25519), NIST P-256 (secp256r1) |
How can two servers create a shared symmetric key across an open Wi-Fi network without eavesdroppers discovering it? The Diffie-Hellman Key Exchange allows two parties (Alice and Bob) to combine their private keys with each other's public keys, independently arriving at the exact same shared secret!
In legacy RSA handshakes, if an attacker recorded encrypted internet traffic for 5 years and eventually stole the server's static private key, they could decrypt all 5 years of historical traffic! Ephemeral Diffie-Hellman (ECDHE) generates a brand new, throwaway key pair for every single session. Even if the server's private certificate is compromised tomorrow, past recorded conversations remain completely unreadable!
Broaden your defensive and offensive security knowledge across our curriculum:
How RSA and ECC key pairs generate tamper-proof digital signatures.
Why asymmetric keys are used strictly for session negotiation, not bulk data.
ECDHE key exchange via Curve25519 for perfect forward secrecy.
Technical interview questions on RSA key generation, padding, and ECC security.