cloak

Learn cryptography by doing the math.

Pick a journey, or browse the catalog. Each algorithm walks step by step from the basic math to a Python script you can run.

Start here

Curated journeys — pick one to see how the pieces connect.

How TLS 1.3 works essay

The modern handshake. ECDH for key exchange, an authenticated cipher for the record stream, Ed25519 (or a CA-signed RSA cert) for identity.

X25519 ChaCha20-Poly1305 Ed25519
Read the essay →

How HTTPS works (the classic story)

The older RSA-based TLS handshake, still useful to understand. Two strangers meet on the internet and build a secure channel — asymmetric meets symmetric.

RSA AES Hybrid Encryption
Start with RSA →

Why crypto looks weird

The attacks that motivated the design choices in the rest of the catalog. Padding oracles (CBC + RSA), ECB penguins, length extension, hash collisions, birthday math, PS3 nonce reuse — each one explains a design decision.

Padding Oracle Attack Bleichenbacher Attack Length Extension Attack Hash Collisions Birthday Attack Block Cipher Modes ECDSA
Start with Padding Oracle Attack →

Post-quantum primer

Shor's algorithm breaks RSA, ECDH, and ECDSA on a fault-tolerant quantum computer. NIST standardized three replacements in August 2024.

Kyber (ML-KEM) Dilithium (ML-DSA) SPHINCS+ (SLH-DSA) X25519
Start with Kyber (ML-KEM) →

Hashing for developers

SHA-256 fingerprints data; HMAC authenticates messages; HKDF derives keys; SHA-3 is the alternative when you want diversity. Plus password hashing (PBKDF2/bcrypt/Argon2).

SHA-256 SHA-3 (Keccak) HMAC HKDF Password Hashing bcrypt
Start with SHA-256 →

Where to start

If you've never touched cryptography, start here. Caesar through one-time pad — all the ciphers that broke, and one (the OTP) that's mathematically perfect but impractical.

Classical ciphers
Start with Classical ciphers →

Signatures, classical to modern

Sign with a private key, verify with a public one. From RSA's textbook math through RSA-PSS, ECDSA's nonce-reuse footguns, and the Schnorr/Ed25519 design family, to the post-quantum signatures from NIST 2024.

RSA RSA-PSS ECDSA Schnorr signatures Ed25519 Dilithium (ML-DSA) SPHINCS+ (SLH-DSA)
Start with RSA →

Key exchange, classical to modern

Diffie-Hellman invented the public-key handshake in 1976. Fifty years and one curve later, X25519 is what everyone uses.

Diffie-Hellman X25519 Kyber (ML-KEM)
Start with Diffie-Hellman →

Elliptic curves end to end

Start with what an elliptic curve actually IS — points, addition, scalar multiplication. Then watch the same operations power X25519 key exchange, Ed25519 signatures, and ECDSA's PS3 disaster.

Elliptic curves X25519 Ed25519 ECDSA Schnorr signatures
Start with Elliptic curves →

How card payments work

Your PIN travels through three banks. It's never decrypted along the way — only re-encrypted under fresh keys, inside tamper-evident HSMs.

HSM Triple DES AES
Start with HSM →

Block ciphers, old to new

How AES became the standard. The 30-year story from DES's deathbed through Blowfish and Twofish to ChaCha20 — plus the modes that make it work.

Triple DES Blowfish Twofish AES ChaCha20-Poly1305 Block Cipher Modes
Start with Triple DES →

How Linux stores your password essay

From `openssl passwd` to /etc/shadow's $y$, $gy$ and $argon2id$ prefixes. Why password storage got slow on purpose, then memory-hungry on purpose.

Password Hashing bcrypt yescrypt GOST-yescrypt Argon2id
Read the essay →

All algorithms

The full catalog, grouped by family.

Historical / pre-modern

Where cryptography started — substitution and shift ciphers, frequency analysis, the one-time pad. The on-ramp.

Hash & MAC

One-way functions that fingerprint data and authenticate messages — the building blocks under almost every protocol.

SHA-256

## SHA-256 The workhorse cryptographic hash: any input, fixed 256-bit fingerprint. One-way, deterministic, avalanche. The primitive under …

HMAC

## HMAC MACs prove a message came from someone with the shared key. HMAC is the standard MAC — used by TLS, JWT (HS256), AWS SigV4, and we…

Password Hashing

## Password Hashing Storing passwords: salt them, slow the hash way down. PBKDF2, bcrypt, and Argon2id are the three industry standards. A…

SHA-3 (Keccak)

## SHA-3 (Keccak) NIST's 2015 backup hash. Same security level as SHA-2 from a radically different construction — a sponge, not Merkle-Dam…

HKDF

## HKDF One shared secret in, many independent keys out. The KDF behind TLS 1.3, Signal, WireGuard. Extract + Expand, built on HMAC.

Length Extension Attack

## Length extension Merkle-Damgard hashes expose their internal state as the output. An attacker given `H(secret || msg)` can forge `H(sec…

Hash Collisions

## Hash collisions Two distinct inputs, same fingerprint. MD5 fell in 2004, SHA-1 in 2017. Real, downloadable proof. The pigeonhole princi…

Birthday Attack

## Birthday attack The generic sqrt(N) attack on N-output hash functions. An n-bit hash gives only n/2 bits of collision resistance — whic…

bcrypt

## bcrypt A password hash built on Blowfish's deliberately slow key schedule, iterated 2^cost times. The most-deployed password hash in 20…

yescrypt

The hash guarding most Linux logins since 2021 — scrypt's memory-hard idea tuned for /etc/shadow. Meet the $y$ prefix.

GOST-yescrypt

yescrypt wrapped in Russia's national-standard Streebog HMAC. Same engine, different paperwork — the $gy$ prefix.

Argon2id

The recommended variant of Argon2, the Password Hashing Competition winner. Memory-hard by design — the $argon2id$ everyone recommends.

Key management & HSMs

Patterns and devices for protecting the key material itself — vaults, not algorithms.