Question
What is the central insight behind the mathematics of asymmetric cryptography?
Answer
"Centuries-old mathematics in the most modern applications." — The math behind RSA, Diffie-Hellman, and ECC was developed hundreds of years ago by Fermat, Euler, Gauss, and others.
The key operations are surprisingly simple — they all boil down to modular arithmetic, which is essentially the integer remainder after division. As one description puts it: "In primary school you learned 20 ÷ 3 = 6 remainder 2. At university, we make it even simpler: we only care about the remainder. So $20 \bmod 3 \equiv 2$."
The six mathematical "protagonists" whose work underlies all of modern asymmetric crypto:
- Pierre de Fermat (1607–1665): Little Fermat's Theorem
- Leonhard Euler (1707–1783): Euler's Theorem, Euler's $\varphi$-function
- Carl Friedrich Gauss (1777–1855): Prime counting function $\pi(n)$
- Niels Henrik Abel (1802–1829): Abelian (commutative) groups
- Évariste Galois (1811–1832): Group theory, Galois fields
- George Boole (1815–1864): Boolean algebra, XOR operation
Go deeper:
Modular arithmetic (Wikipedia) — the single operation every asymmetric scheme reduces to.
Note saved — thanks!
Question
What does $c \equiv a \mod N$ mean, and what are equivalence classes mod $N$?
Answer
$c \equiv a \mod N$ means that when you divide $c$ by $N$, the remainder is $a$. The mod $N$ operation partitions all integers into $N$ equivalence classes.
* The integers split into 5 residue classes mod 5 — every integer lands in exactly one, giving the finite set $\mathbb{Z}_5 = \{0,1,2,3,4\}$. *
Definition: $c \equiv a \mod N$ iff $N$ divides $(c - a)$, i.e., $c = a + k \cdot N$ for some integer $k$.
Properties:
- The result is always in $\{0, 1, 2, ..., N-1\}$
- Equivalently: $c \mod N = (a + k \cdot N) \mod N$ for any integer $k$
Equivalence classes mod 5:
- $[0] = \{..., -10, -5, 0, 5, 10, 15, ...\}$
- $[1] = \{..., -9, -4, 1, 6, 11, 16, ...\}$
- $[2] = \{..., -8, -3, 2, 7, 12, 17, ...\}$
The set of equivalence classes mod $N$ is written as $\mathbb{Z}_N = \{0, 1, 2, ..., N-1\}$.
Handling negative numbers: Add multiples of $N$ until positive, then reduce. Example: $-55 \mod 9 = (-55 + 7 \times 9) \mod 9 = 8 \mod 9 = 8$
Go deeper:
Modular arithmetic (Wikipedia) — congruence, residue classes and ℤ_N in one place.
Note saved — thanks!