Cryptology
From secret messages to post-quantum signatures
Who can read a message? Has it changed? Who signed it? Explore those questions through short games and experiments. Start with a cipher you can work by hand and finish by signing and verifying a software update.
Start with Lesson 1.1How to take the course
Start with the activity at the top of each lesson, then read the explanation and try the self-check. No prior cryptography is needed. The course assumes high-school math and introduces new concepts as you need them.
A shorter route to post-quantum cryptography
After Chapters 1–5, read Chapter 6, Lessons 7.3–7.5 and Lesson 9.3, then pick up at Chapter 10. When you reach Shor’s algorithm, use Lessons 7.1–7.2 and Lessons 8.1–8.2 for prime factorization and power cycles.
Lessons
Browse 107 lessons across 17 chapters. Select an upcoming lesson to read its preview.
Sign your first message
Chapters 1–5
Chapter 1 What can you prove about a message?
Chapter 2 Ciphers you can work by hand
-
2.1
Turn a cipher wheel with Julius Caesar
Upcoming lesson. Use a fixed shift to encrypt and decrypt a short message, including a letter that wraps around the end of the alphabet.
-
2.2
Rearrange the letters with a transposition cipher
Upcoming lesson. Encode and restore a short message by changing the order of its letters, and identify what a transposition preserves.
-
2.3
What do letter counts reveal about a substitution cipher?
Upcoming lesson. Use letter counts to propose a mapping in a fixed substitution puzzle and explain why the most frequent letter gives a clue.
-
2.4
Switch alphabets with the Vigenère cipher
Upcoming lesson. Use a repeating keyword to choose the shift for each letter and explain how a repeated plaintext letter can produce different ciphertext letters.
-
2.5
From paper wheels to Enigma’s moving rotors
Upcoming lesson. Trace how a keypress changes the state of a toy rotor and predict why consecutive presses of the same letter can produce different outputs.
Chapter 3 Where do secret bits come from?
-
3.1
How a message becomes bytes
Upcoming lesson. Trace a short message from text to UTF-8 bytes and back, and explain why its byte count can differ from its character count.
-
3.2
Flip bits twice with XOR
Upcoming lesson. Predict which bits a mask will flip and explain why applying the same mask twice restores the input.
-
3.3
Can you tell a real sequence of coin tosses from one a friend made up?
Upcoming lesson. Describe a clue that can distinguish some made-up sequences from independent fair tosses, and explain why the clue cannot prove where one short sequence came from.
-
3.4
Which outcome is harder to guess? Probability and entropy
Upcoming lesson. Compare a fair and a biased source and predict how often a player who always guesses the most probable outcome should succeed.
-
3.5
What makes a one-time pad secret?
Upcoming lesson. Use XOR to send and recover a short message and explain why a ciphertext alone leaves every same-length plaintext equally compatible with some pad.
-
3.6
What changes if two messages share the same pad?
Upcoming lesson. Use a two-message example to explain why reusing a pad reveals where two plaintexts agree or differ.
-
3.7
How does a computer collect enough entropy to seed a generator?
Upcoming lesson. Explain how unpredictable measurements can contribute to a seed and why collecting many samples from a predictable source adds little or no uncertainty.
-
3.8
How does a cryptographically secure pseudorandom number generator produce the bits for a key?
Upcoming lesson. Explain how a cryptographically secure generator uses a seed and internal state to supply key bytes, and predict what happens when a toy generator restarts from the same state.
Chapter 4 Hashes and fingerprints
-
4.1
Change one bit and compare two SHA-256 fingerprints
Upcoming lesson. Flip one bit in a message and explain why the same fixed-size digest format can show a large change in output.
-
4.2
Why is a hash hard to reverse? The preimage problem
Upcoming lesson. Explain what it means to find a preimage for a given digest and why recognizing a match is easier than finding a matching input for a strong hash.
-
4.3
Can two messages share a hash? Collisions and the birthday puzzle
Upcoming lesson. Identify a collision between distinct inputs and explain why looking for any matching pair offers more opportunities than looking for a match to one chosen output.
-
4.4
Which fingerprint should you trust when you download a file?
Upcoming lesson. Decide whether a matching digest is meaningful by identifying where the reference came from and who could have replaced it.
-
4.5
How do you check one leaf in a Merkle tree?
Upcoming lesson. Use a leaf, its sibling hashes, and their positions to recompute a trusted root and check inclusion.
-
4.6
Why do two people with the same password need different salts?
Upcoming lesson. Explain how distinct salts make records for the same password differ and stop one computed result from serving as the check for every record.
-
4.7
Why should a password hash take time and memory to compute?
Upcoming lesson. Explain how raising time and memory costs changes the work of checking many guesses and affects a normal sign-in.
Chapter 5 Sign a vote on paper
-
5.1
Generate two long random secrets, label them Yes and No, and publish their hashes
Upcoming lesson. Prepare one labeled pair of public fingerprints and identify which two values the signer keeps private.
-
5.2
Sign your vote by writing down the secret for your choice
Upcoming lesson. Given a labeled secret pair, sign a Yes or No vote by revealing only the secret for the chosen answer.
-
5.3
Hash the revealed secret. Does it match the fingerprint your friend published for that choice?
Upcoming lesson. Verify a vote by hashing the revealed secret and comparing the result with the saved fingerprint for the claimed choice.
-
5.4
What could someone sign after seeing both secrets? The one-time rule
Upcoming lesson. Explain why the two-secret key pair is for one vote and what changes when both secrets have been revealed.
-
5.5
How does a Lamport signature scale from one bit to a message digest?
Upcoming lesson. Explain how one secret pair per digest bit lets a signer reveal one secret per position and a verifier check each choice against the public fingerprints.
Trace a secure connection
Chapters 6–9
Chapter 6 Protecting messages with a shared key
-
6.1
What does AES do to one block of bytes?
Upcoming lesson. Trace one 16-byte block through AES encryption and decryption and distinguish the block size from the key size.
-
6.2
Why can you still see the penguin? Repeated blocks in ECB mode
Upcoming lesson. Predict which repeated image blocks will have equal ciphertext and explain why those equalities can preserve visible structure.
-
6.3
How does counter mode turn AES into a stream of bits?
Upcoming lesson. Trace how encrypting successive counter blocks produces a keystream and how XOR uses that stream to encrypt and recover a message.
-
6.4
How does ChaCha20 generate a stream from a key, nonce and counter?
Upcoming lesson. Identify the roles of the key, nonce, and block counter and predict when a ChaCha20 keystream block will repeat.
-
6.5
When can you use a counter as a nonce, and what happens if it repeats?
Upcoming lesson. Explain when a message counter can provide distinct nonces and spot a scheduling or restart scenario that repeats a nonce under the same key.
-
6.6
How can two key holders authenticate a message with HMAC?
Upcoming lesson. Explain how two parties with the same secret check a message tag and what a valid tag establishes about the message and the key holders.
-
6.7
Can a public header be protected too? Authenticated encryption with associated data (AEAD)
Upcoming lesson. Identify which parts of an AEAD message stay visible, which are encrypted, and which are checked for changes.
-
6.8
Change one letter in the header or the sealed message. Will the recipient accept it?
Upcoming lesson. Predict the receiver's result when either authenticated field changes and explain why plaintext is available only after successful verification.
Chapter 7 From prime numbers to RSA
-
7.1
Build whole numbers greater than one from primes
Upcoming lesson. Factor a whole number greater than one into primes.
-
7.2
Multiply two primes. How hard is it to find them again?
Upcoming lesson. Compare multiplying two supplied primes with finding them from their product.
-
7.3
What time is it in 100 hours? Modular arithmetic
Upcoming lesson. Compute a remainder and use a clock to predict where repeated addition lands.
-
7.4
Which steps visit every mark on a cipher wheel? Find the greatest common divisor with Euclid
Upcoming lesson. Predict how many positions a fixed step visits and find the greatest common divisor with Euclid's algorithm.
-
7.5
When can you undo multiplication on a clock? Modular inverses and division in a prime field
Upcoming lesson. Find a modular inverse and use it to undo multiplication on a clock.
-
7.6
Compute a large power by repeated squaring
Upcoming lesson. Compute a modular power by squaring and combining powers selected by the exponent.
-
7.7
How do repeating powers modulo two primes help you choose RSA exponents that undo each other?
Upcoming lesson. Choose exponents whose composition returns a residue modulo two distinct primes.
-
7.8
Follow one message through toy RSA with a public key and a private key
Upcoming lesson. Use a toy public key to encrypt a residue and the matching private key to recover it.
-
7.9
Why does encrypting the same message twice with raw RSA give the same result? The role of randomized padding
Upcoming lesson. Explain why raw RSA repeats output for the same input and how randomized encoding changes what is fed to RSA.
Chapter 8 Agreeing on a secret in public
-
8.1
How many different values do repeated powers visit? Meet a cyclic group
Upcoming lesson. List the residues visited by repeated powers and identify the order of the chosen base.
-
8.2
Which exponent got you here? The discrete logarithm puzzle
Upcoming lesson. Find an exponent on a short power cycle and explain what changes when the cycle is much larger.
-
8.3
Agree on a shared secret with Diffie–Hellman
Upcoming lesson. Trace two public exchanges and explain why both participants compute the same shared value.
-
8.4
Add points on an elliptic curve over a finite field
Upcoming lesson. Add two points on a small elliptic curve over a prime field and identify the role of the neutral point.
-
8.5
Take seven steps with the same point. How does scalar multiplication work on a curve?
Upcoming lesson. Compute seven times a point by repeated addition and recognize a shorter doubling route.
-
8.6
How does X25519 turn curve arithmetic into a shared secret?
Upcoming lesson. Trace an X25519 exchange and identify which values are public, private, or shared.
-
8.7
You have a shared secret. How do you know who shares it?
Upcoming lesson. Explain why matching key material and verified peer identity are separate checks.
Chapter 9 Signatures, identity and secure connections
-
9.1
Sign a message and verify it with Ed25519
Upcoming lesson. Sign a demo message and verify the signature against the expected public key.
-
9.2
Where does Ed25519 get its per-message signing nonce?
Upcoming lesson. Explain how plain Ed25519 derives a per-message signing value and distinguish it from an encryption nonce.
-
9.3
Whose public key is this? Certificates and chains of trust
Upcoming lesson. Follow a certificate chain to a trust anchor and check whether the leaf certificate names the expected peer.
-
9.4
How does a smart card answer a fresh challenge?
Upcoming lesson. Trace a fresh challenge to a card signature and explain why an old response will fail against a new challenge.
-
9.5
Why derive separate keys for sending and receiving? Meet HKDF
Upcoming lesson. Use purpose labels to distinguish derived sending and receiving keys from one shared secret.
-
9.6
Follow a TLS 1.3 handshake from key exchange to the encrypted server certificate and the first application message
Upcoming lesson. Trace key exchange, server authentication, and the first protected client request in a TLS 1.3 handshake.
-
9.7
What can end-to-end encryption hide, and who can still see the metadata?
Upcoming lesson. Identify what a relay, network observer, or endpoint can see in a specified messaging scenario.
Ship a post-quantum update
Chapters 10–17
Chapter 10 What changes with a quantum computer?
-
10.1
What is a qubit, and what can you learn by measuring it?
Upcoming lesson. Predict outcomes of a computational-basis measurement from a simple qubit state.
-
10.2
How can quantum interference change the odds of an answer?
Upcoming lesson. Explain how two contributions with different signs can reinforce or cancel before measurement.
-
10.3
Why does finding a period matter for factoring? Shor’s algorithm
Upcoming lesson. Explain how a useful modular period can turn one factoring example into two smaller calculations.
-
10.4
What would a large quantum computer mean for RSA and elliptic curves?
Upcoming lesson. Match RSA and elliptic-curve schemes to the underlying math problems affected by a sufficiently capable quantum computer.
-
10.5
How much faster is quantum search? Grover’s algorithm
Upcoming lesson. Compare classical and quantum query growth for an ideal unstructured search.
-
10.6
Why protect a message today if someone might decrypt it years from now?
Upcoming lesson. Use a timeline to decide which data needs confidentiality beyond the expected migration date.
Chapter 11 Drawing lattices
-
11.1
Put two arrows tip to tail to add vectors
Upcoming lesson. Add two vectors tip to tail and predict the resulting displacement.
-
11.2
Build a lattice by taking whole steps along two arrows
Upcoming lesson. Construct lattice points as integer combinations of two independent step vectors.
-
11.3
How can different bases draw the same lattice?
Upcoming lesson. Explain how two distinct pairs of basis vectors can reach the same lattice points.
-
11.4
Find the shortest nonzero vector in a small lattice
Upcoming lesson. Find a shortest nonzero displacement on a displayed lattice.
-
11.5
Which lattice point is closest to a dot between the lines?
Upcoming lesson. Find a lattice point closest to a target that lies off the lattice.
-
11.6
From a grid to a cube to a hundred dimensions. What happens to your search?
Upcoming lesson. Explain how adding independent coordinates increases the number of choices in a bounded search.
Chapter 12 When equations get noisy
-
12.1
Solve for a missing number on a clock with 13 positions
Upcoming lesson. Solve a one-variable linear equation modulo 13 and check the result.
-
12.2
Find two hidden numbers using two independent equations modulo 13
Upcoming lesson. Use elimination to recover two residues from two independent equations.
-
12.3
Can you still find the hidden numbers when the readings are a little off?
Upcoming lesson. Compare exact and noisy readings and identify which candidate secrets remain plausible under a small error model.
-
12.4
How does sampling small errors change the puzzle? Learning With Errors
Upcoming lesson. Explain how repeated modular readings with small sampled errors define a Learning With Errors puzzle.
-
12.5
What changes when you get more readings or add more unknowns?
Upcoming lesson. Compare how more readings and more unknowns affect a bounded toy candidate search.
-
12.6
Plot the clock readings (s, 3s) modulo 13 on a repeating grid. Which lattice point is closest to the noisy reading (4, 0)?
Upcoming lesson. Plot the periodic set of permitted readings and find a nearby point for a noisy reading.
Chapter 13 From clock arithmetic to module lattices
-
13.1
Arrange a list of clock numbers as the coefficients of a polynomial
Upcoming lesson. Translate between a list of modular coefficients and a polynomial in a fixed order.
-
13.2
Add and multiply two short polynomials by hand
Upcoming lesson. Add and multiply short polynomials and reduce their coefficients modulo 13.
-
13.3
What happens when a term wraps around with a minus sign? Arithmetic modulo xⁿ + 1
Upcoming lesson. Reduce a high-degree term using xⁿ = −1 and explain why it wraps with a sign change.
-
13.4
Use polynomials as the entries of a vector
Upcoming lesson. Read a vector whose entries are polynomials and compute a small sum of products.
-
13.5
Follow one noisy matrix–vector product through Module Learning With Errors
Upcoming lesson. Trace how a public polynomial matrix, a secret vector, and a small error vector produce a noisy result.
Chapter 14 Establishing a post-quantum shared key
-
14.1
What does a key encapsulation mechanism give each participant?
Upcoming lesson. Identify what the recipient publishes, what the sender transmits, and what both parties obtain in a KEM.
-
14.2
Follow the public key, ciphertext and shared secret through ML-KEM
Upcoming lesson. Trace an honest ML-KEM exchange and relate its public key and ciphertext to the noisy polynomial arithmetic inside the scheme.
-
14.3
How can two participants recover the same value in the presence of small errors?
Upcoming lesson. Use a toy modular number line to explain how nearby noisy values can decode to the same symbol.
-
14.4
How much rounding can an honestly generated ML-KEM ciphertext tolerate before the two keys disagree?
Upcoming lesson. Explain qualitatively how noise and compression rounding share a margin for successful decoding.
-
14.5
What key comes back when the ciphertext fails ML-KEM’s re-encryption check? Implicit rejection
Upcoming lesson. Describe what ML-KEM returns when a correctly sized ciphertext fails internal verification.
-
14.6
How does an application use the resulting key to protect a message?
Upcoming lesson. Trace a shared secret through key derivation and authenticated message protection.
Chapter 15 Two ways to sign in a post-quantum world
-
15.1
Follow a message from signing to verification with ML-DSA
Upcoming lesson. Trace signing and verification with ML-DSA and predict what happens when message bytes change.
-
15.2
Why does an ML-DSA signer sometimes discard a candidate and try again?
Upcoming lesson. Explain why the signer discards some candidates internally before returning a signature.
-
15.3
Revisit the paper signature. How can one Merkle root represent many signing keys?
Upcoming lesson. Use a root and authentication path to connect a selected one-time public key to a trusted set of keys.
-
15.4
Trace a hash-based signature through the trees in SLH-DSA
Upcoming lesson. Follow how several hash-based checks connect a message-dependent signature to the public root.
-
15.5
What fits on a smart card? Compare key sizes, signatures and verification time
Upcoming lesson. Compare public key size, signature size, and verification cost for a stated device budget.
Chapter 16 Putting post-quantum cryptography to work
-
16.1
Find the keys, algorithms and formats an application depends on
Upcoming lesson. Identify the keys, algorithms, serialized artifacts, and trust decisions in a small application.
-
16.2
Generate a key pair with a cryptographic library and the operating system’s random source
Upcoming lesson. Use a vetted cryptographic library's key-generation interface and distinguish private material from the public key.
-
16.3
Where does the private key live, and how do you rotate it?
Upcoming lesson. Choose where a private key should live and plan an orderly transfer of trust to a new key.
-
16.4
Check an implementation against published test vectors
Upcoming lesson. Use a published vector to verify a library result and distinguish a fixture test from a round trip.
-
16.5
What can timing reveal? Side channels and constant-time implementations
Upcoming lesson. Recognize why secret-dependent branches can create timing variation and why vetted constant-time primitives matter.
-
16.6
How do classical and post-quantum key exchange work together during migration?
Upcoming lesson. Explain what each component contributes to hybrid key establishment and where the protocol combines the results.
-
16.7
How can a publisher change signature algorithms while older devices are still in use?
Upcoming lesson. Choose a transition policy that lets old and new devices verify authorized releases without silently weakening the new policy.
Chapter 17 Ship a signed software update
-
17.1
How does a new device get a trusted copy of the publisher’s public key?
Upcoming lesson. Explain how a device establishes initial trust in the publisher verification key.
-
17.2
Build an update manifest that identifies the device model, version and file digest
Upcoming lesson. Build a manifest that binds one artifact to a device model and release version.
-
17.3
Sign the manifest with ML-DSA using a cryptographic library
Upcoming lesson. Sign the exact manifest bytes with ML-DSA using a library and identify what the publisher ships.
-
17.4
Verify the publisher’s signature, match the device model and check the file digest
Upcoming lesson. Check the publisher signature, device-model match, and file digest before permitting installation.
-
17.5
Should a device on version 3 accept a signed copy of version 2? Keep a trusted version record to prevent rollback
Upcoming lesson. Explain why a correctly signed older version may still be rejected and use a trusted version record to make the decision.
-
17.6
Try a changed file, a different signer, the wrong device model and an older signed release. Which check catches each one?
Upcoming lesson. Given several release bundles, decide whether to install each one and identify the first check that rejects each failed case.