Benjamin Italiaander / Topics / Math

The maths behind security, with worked examples and exercises.

Practise modular arithmetic step by step: remainders, negative numbers, inverses, the extended Euclidean algorithm, solving equations, Fermat's little theorem, and where you already use it (weekdays, IBAN, ISBN).
Play both sides of a Diffie–Hellman exchange, see why the group must have a large prime order, run a man-in-the-middle attack and a small-subgroup attack with real numbers, take a discrete log apart with Pohlig–Hellman, and see which groups real protocols use.
Sign and verify with Schnorr and ECDSA on a small curve, see why Schnorr is secure (identification and Fiat–Shamir), extract a private key from a reused nonce in both schemes, and see how Ed25519 makes that impossible.
Practise the one-way functions behind public-key cryptography: square-and-multiply by hand, discrete logarithms, generators, baby-step giant-step, and factoring (and why primes that are close together are a disaster).
Build RSA keys by hand, encrypt, decrypt and sign, see the full proof of why it works, speed it up with the Chinese remainder theorem, break textbook RSA in five different ways, and read a real OpenSSL key.
Math / Public Key Cryptography
Derive the point-addition formulas yourself, find every point on a curve by hand, compute with double-and-add, do ECDH on two small curves, and see how Curve25519, X25519, the Montgomery ladder and Edwards curves turn this into the key exchange in every SSH and HTTPS connection.
The maths behind the six-digit codes of an authenticator app: HMAC, a time counter and dynamic truncation, with a Python version you can check yourself.
Math / Public Key Cryptography
What prime numbers are, why there are infinitely many, how many there are, Euler's φ and Fermat's little theorem with proofs, how computers test whether a 300-digit number is prime, and the special primes used in real cryptography. With exercises.
A four-part explainer: the mathematics behind public-key cryptography with small worked examples, then how SSH, OpenPGP, TLS, WireGuard, FIDO2 and Signal use it.
Math / Public Key Cryptography
Clock arithmetic, RSA, Diffie–Hellman, elliptic curves and digital signatures, each worked out with small numbers you can check by hand.
A real SSH connection step by step: algorithm negotiation, the (post-quantum) key exchange, the host key signature, known_hosts, session keys and how your own key proves who you are.
Math / Public Key Cryptography
Encryption without a live connection: primary keys and subkeys, the random session key, ECDH with a throwaway key, signatures, fingerprints and the web of trust, with real gpg packet output.
Math / Public Key Cryptography
Four more ways to combine the same mathematics: certificates in HTTPS, signature-free authentication in WireGuard, phishing-proof logins with FIDO2 and passkeys, and keys that change with every message in Signal.
Math / Public Key Cryptography
Where the 77 digits of Curve25519 and the 925 digits of an RSA-3072 key come from, what 128-bit security means, why RSA needs twelve times more digits than an elliptic curve, why we don't simply use bigger numbers, and what quantum computers change.
🧭 Guide 1 note
How S/MIME signs and encrypts email, the mathematics inside it, where to get a certificate (free, paid, or through your university), how to make your own key with OpenSSL, and how to set it up in Thunderbird, Outlook, Zimbra and Evolution.

Other topics

All topics and genres →