Mathematical Foundations of Cryptography
Visual explainers for the course. Each one runs in the browser: change the inputs, step through the algorithm or the attack, and see exactly where things go right or wrong.
Number theory
Extended Euclid and modular inverses
Watch the remainders shrink while each row keeps r = x·a + y·n. When the remainder hits 1, x is the inverse. Toy RSA gives d.
gcd · Bézout · a⁻¹ mod nOpen →Chinese Remainder Theorem
Two dials turn together, one mod m and one mod n, until both show the residues you asked for. Then the whole grid lights up.
x ≡ a (mod m) · x ≡ b (mod n)Open →Powers mod p: Fermat, Euler and orders
Follow a, a², a³, … around a circle until the cycle closes.
aᵖ⁻¹ ≡ 1 · ord(a) | p − 1Coming soonRSA from key generation to decryption
Pick two primes and follow every number through the scheme.
n = pq · ed ≡ 1 (mod φ)Coming soonElliptic curves
Lattices and post-quantum
Signatures
Applications
More topics
Groups and generators
Cayley tables of ℤₙ* and how a generator visits every element.
⟨g⟩ · LagrangeComing soonArithmetic in GF(2⁸)
Bytes as polynomials, multiplication with reduction, and the AES S-box.
x⁸ + x⁴ + x³ + x + 1Coming soonHash functions: avalanche and birthdays
Flip one input bit, watch half the output change; find a collision in a short hash.
2ⁿ/² · SHA-256Coming soon