Chapter 14: What Can Go Wrong

Chapter 14 of Trappe & Washington: three case studies in which the cryptography was sound and the system failed anyway. Enigma's no-self-map guarantee and the 1941 intercept that exploited it; three ways of choosing RSA primes badly, from Netscape's timestamp seed to the 2012 surveys that found 26 965 moduli sharing a factor; and WEP in full — a 24-bit IV colliding after four thousand packets, a related-key structure, and a linear CRC used where a message authentication code was needed.

Subject: Cryptography · 60 slides · diagram-first lesson

Open the interactive version of this deck

What this lesson covers

The lesson, slide by slide

1. What Can Go Wrong

Title

Cryptography · Chapter 14

Three systems whose mathematics was correct and whose assembly was not

2. What you will be able to do

Objectives

Twelve chapters of primitives, and none of them has been broken by an attack on its mathematics. This chapter is the other half of the story, and the book puts it here deliberately — after the tools and before the protocols.

Figure (svg): The pattern across all three case studies: sound primitives, and a failure in the assembly around them.

The chapter's thesis, tabulated: cryptography fails at the joints.

3. Where have systems actually failed so far?

Warm-up

Thirteen chapters have covered dozens of attacks. Sort them by what was attacked.

Discussion prompt

How many of the breaks in this course so far were attacks on the underlying hard problem, and how many were something else?

Hint: Think about DES, WEP, the PlayStation 3, Venona and Debian.

Answer:

Attacks on the mathematics: very few. DES fell to exhaustive search, which the designers had been warned about; MD5 and SHA-1 fell to real cryptanalysis. That is close to the whole list.

Attacks on parameters: several. A 56-bit key, a 24-bit IV, a 128-bit digest, a 512-bit modulus. Each was a number chosen against yesterday's hardware or yesterday's algorithms.

Attacks on constructions: more. ECB leaking patterns, length extension, unhashed RSA signing, a MAC that was really a plain hash. The primitive was right and the wrapper was wrong.

Attacks on randomness: the largest single category. Venona's duplicated pads, WEP's IV, the PlayStation 3's constant nonce, Debian's OpenSSL, Netscape's timestamp seed.

This chapter is the fourth category made explicit, and the ordering is the point: the further you get from the mathematics, the more likely the failure.

4. An Enigma “Feature”

Section

Section 14.1 · pp. 282-283

5. The Enigma guarantee that gave the game away

Concept

The book is generous about Enigma: for its time it was an excellent system, and the German troops' belief in it was itself a security problem. If your ship is sinking, do you escape or stay to destroy a machine you have been told is unbreakable?

But the design had a consequence that looked like a virtue. The reflector wired the contacts in pairs, so the permutation applied at each step was an involution with no fixed points — a letter could never encrypt to itself. A would never come out as A.

To people unfamiliar with cryptography this looked excellent. There would always be 'complete encryption'; the plaintext would always be completely changed.

In practice it meant that certain guesses for the plaintext could immediately be discarded as impossible — at no computational cost whatever. Slide a suspected word along the ciphertext, and every alignment where any letter faces itself is ruled out.

Figure (svg): A ciphertext containing every letter except L, which under Enigma's no-self-map rule means the plaintext was all L.

One absent letter in a ciphertext, and a guarantee the designers were proud of, together give the key.

6. The message with no L in it

Worked example

One day in 1941, British cryptographers intercepted an Enigma message from the Italian navy.

Mavis Batey, at Bletchley Park, noticed the ciphertext contained no letter L at all

Why: In a message of any length, an absent letter is remarkable — in ordinary text every letter appears.

Knowing that no letter encrypts to itself, she reasoned that L was the one letter the plaintext could not have produced anywhere else

Why: If the plaintext were all L, then L is exactly the letter that could never appear in the ciphertext.

Her guess: a bored radio operator tapping the L key repeatedly while waiting for the next message

Why: A plausible human explanation, and a complete crib for the whole message.

With the full plaintext known, the day's Enigma key could be determined

Why: Known plaintext of that length against a machine whose wiring was understood is enough.

Verify: one of the messages read “Today's the day minus three.”

Why: It alerted the British to a surprise attack on their Mediterranean fleet. The resulting Battle of Cape Matapan established the dominance of the British fleet in the eastern Mediterranean — from one letter's absence and a design guarantee.

Figure (svg): A ciphertext containing every letter except L, which under Enigma's no-self-map rule means the plaintext was all L.

One absent letter in a ciphertext, and a guarantee the designers were proud of, together give the key.

7. Why is a guaranteed property dangerous?

Socratic

The no-self-map rule was a deliberate feature. Modern ciphers guarantee nothing about their output at all.

Discussion prompt

State the general principle, and give an example from a modern cipher.

Hint: Ask what an attacker does with any statement that is always true of the ciphertext.

Answer:

Any structure you guarantee about the output is a structure the adversary can test for. A property that always holds is a filter she applies for free — no computation, no cryptanalysis, just rejection of everything inconsistent with it.

A modern cipher aims to guarantee nothing. The design target is that the output be indistinguishable from random, which by definition means no property holds more often than chance. Chapter 4's game states this precisely.

The modern example is ECB mode. It guarantees that equal plaintext blocks give equal ciphertext blocks — presented as determinism, not as a security feature, but the effect is identical. Eve tests for equal blocks and reads the structure of the plaintext off the ciphertext.

And a subtler one: deterministic encryption of a database column, which guarantees that equal values encrypt equally and is therefore searchable — a feature deliberately built on a leak.

The rule to carry: when a design offers a guarantee about the ciphertext, ask what an attacker does with it. The answer is usually 'discards candidates', and discarding candidates is what cryptanalysis is.

8. Choosing Primes for RSA

Section

Section 14.2 · pp. 283-284

9. Choosing Primes for RSA: three ways to get it wrong

Concept

RSA's security rests on the inability to factor n = pq, so p and q must be chosen unpredictably. That needs a good pseudorandom generator, and a generator needs a random seed.

The book gives three failures, and they are increasingly systemic:

A predictable seed
Netscape, 1995: the seed for the generator that chose the RSA primes was formed from a timestamp. Goldberg and Wagner deduced the primes for a secure transaction in seconds on a desktop.
Related primes
A company was about to ship an implementation choosing one random starting point and taking p and q as the next two primes above it. Finding the next prime after √n immediately yields the larger prime.
A generator with too small a range
2012: two independent teams collected RSA moduli from the web and computed gcds between pairs, finding thousands with a shared factor.

None of these is an attack on RSA. All three are attacks on the process that produced the key.

Figure (svg): Netscape's RSA key generation seeded from a timestamp, collapsing an enormous key space to a few million possibilities.

The key space is bounded by the entropy of the seed, and no amount of downstream mathematics can enlarge it.

10. The Netscape Seed Flaw

Worked example

Goldberg and Wagner were graduate students at Berkeley reading the documentation for an early web browser.

When a secure transaction was needed, the browser generated an RSA key on the spot

Why: Which is reasonable — ephemeral keys are good practice.

The seed for the pseudorandom generator was formed from a time stamp

Why: This is the whole flaw. Everything downstream was correct.

A timestamp has very little entropy: the attacker knows roughly when the transaction occurred

Why: Within a second or two, so a few thousand candidate seeds; within a day, a few hundred thousand.

For each candidate seed, run the same generator and derive the same primes

Why: The generator is public — Kerckhoffs's principle — so the attacker reproduces it exactly.

Verify: the primes for a transaction, deduced in a few seconds on a desktop computer

Why: Netscape shipped a repair quickly. And the president of RSA Data Security noted pointedly that Netscape had declined help with the implementation the first time and asked for it the second. The mathematics was never in question.

Figure (svg): Netscape's RSA key generation seeded from a timestamp, collapsing an enormous key space to a few million possibilities.

The key space is bounded by the entropy of the seed, and no amount of downstream mathematics can enlarge it.

11. The Shared Factor Attack

Worked example

The 2012 result is the most worrying of the three, because nothing in a single key reveals it.

Two teams collected RSA moduli from the web — from X.509 certificates and similar sources

Why: The Lenstra team gathered 11.4 million of them.

They computed the gcd of each pair of moduli

Why: Naively this is 10¹⁴ gcds, but a batch algorithm computes all pairwise gcds against a product tree in near-linear time.

They found 26 965 moduli where a gcd gave a non-trivial factor

Why: Each such gcd breaks two keys at once — the shared prime factors both moduli.

Why it happened: a generator producing too few distinct primes, plus the birthday bound

Why: The book's illustration: a generator capable of only a million primes, used to make 2000 primes, is 2√N people in an N-birthday room. A repeat is likely.

Verify: and there is no way to check your own key without the data

Why: You cannot tell from n alone whether some other modulus shares a factor with it. You would have to compute the gcd against the millions of others — and if you found one, you would have broken someone else's system in the process. That asymmetry is what makes the flaw so awkward.

Figure (svg): Two RSA moduli sharing a prime factor, broken by a single gcd.

Nobody factored anything. Two public keys and one gcd, and both private keys fall out.

12. One gcd breaks two keys

Anomaly

Two organisations independently generate RSA moduli. Neither key is weak in isolation.

Predict first

What happens if their generators drew the same prime?

  • Nothing — the moduli are still different
  • gcd(n₁, n₂) reveals the shared prime in microseconds, breaking both keys
  • Only the second key is compromised
  • Both moduli must be factored first

Correct: gcd(n₁, n₂) reveals the shared prime in microseconds, breaking both keys

The asymmetry with factoring is stark: factoring one 2048-bit modulus is infeasible, and computing a gcd of two is instant. The attacker needs only that two keys were generated carelessly, and she does not need to know which two.

This is also why the attack scales: a batch gcd over millions of collected keys is cheap, so the attacker sweeps the whole internet rather than targeting anyone.

Why: The Euclidean algorithm computes gcd(n₁, n₂) in microseconds even for 2048-bit numbers — it is logarithmic, as Section 3.1 established. If the result is not 1, it is the shared prime p, and then q₁ = n₁/p and q₂ = n₂/p. Two private keys recovered by an algorithm from 300 BC, with no factoring at all.

Figure (svg): Two RSA moduli sharing a prime factor, broken by a single gcd.

Nobody factored anything. Two public keys and one gcd, and both private keys fall out.

13. Why does the birthday bound apply to prime generation?

Explain it to yourself

The book explains the shared factors with a birthday argument: a generator producing a million distinct primes, used to make 2000 of them.

Discussion prompt

Work the numbers, and say what the generator would have to produce for the problem to disappear.

Hint: N = 10⁶ and the number of 'people' is 2000.

Answer:

The numbers: N = 10⁶ possible primes, and 2000 = 2√N draws. The birthday bound says a repeat is likely once the draws reach √N = 1000, so 2000 draws makes a collision near-certain.

And a repeat across different moduli is what matters. Two primes equal within one modulus would be caught by any competent implementation; two primes equal across two different moduli is invisible to both parties.

What a good generator gives: there are roughly 10¹⁵¹ primes below 2¹⁰²⁴, so a generator drawing uniformly from them would need 10⁷⁵ draws before a repeat became likely. The problem simply does not arise.

So the failure is entirely about the generator's effective range, which is bounded by its seed entropy — Chapter 5's rule once more. A generator seeded with 20 bits produces at most a million distinct outputs however many primes exist.

And the setting where this bites is embedded devices, which generate keys at first boot before any entropy has accumulated. The Heninger study found exactly that: routers and firewalls, not general-purpose computers.

14. WEP

Section

Section 14.3 · pp. 284-288

15. WEP: the protocol

Concept

Wired Equivalent Privacy, the standard for wireless access from 1997 to 2004. The intent was to make wireless communication as secure as a wired connection. Every laptop on a router shares the same WEP key.

  1. The laptop sends a greeting
  2. The router generates a random 24-bit IV and sends it
  3. The laptop forms RC4Key = WEPKey ‖ IV and generates the RC4 keystream
  4. It computes the checksum ch = CRC32(message)
  5. It sends C = RC4 ⊕ (message, ch), together with the IV in the clear
  6. The router reforms the same key, decrypts, and accepts the message if the checksum matches

The book's summary is exact: except for the authentication step, this is essentially a one-time pad, with RC4 supplying the pseudorandom stream. Every component is from an earlier chapter.

Figure (svg): The WEP protocol: a 24-bit IV concatenated with the shared WEP key seeds RC4, whose keystream XORs the message and its CRC.

Every component is a primitive from an earlier chapter, used more or less as described. The assembly is the problem.

16. Failure one: the key was 40 bits

Concept

The usual WEP key length was 40 bits, giving 2⁴⁰ ≈ 10¹² possibilities — searchable.

Why so short? US export regulations at the time prohibited exporting stronger cryptography, so 40 bits was chosen to allow international use. Later versions moved to 104 bits.

But the book is emphatic: WEP is insecure at any key size, because of the full collection of design flaws in the protocol. The key length is the least of them, and lengthening it fixed nothing.

This is worth noting as a counter-example to the whole 'bigger key' instinct one last time. Here is a protocol where the obvious parameter was genuinely too small, it was genuinely fixed, and the system remained broken.

Figure (svg): WEP's key length increased from 40 to 104 bits, with the other flaws unchanged.

The one flaw everybody could see was fixed, and the system stayed broken.

17. Failure two: the 24-bit IV

Concept

The designers knew that reusing a one-time pad is insecure. That is exactly why they included the IV — it makes the RC4 key different per packet, so the keystream should differ too.

With 24 bits there are about 1.7 × 10⁷ IVs. The book notes that a heavily used router might get through almost all of them in a short time. But the real problem arrives much sooner.

The birthday bound. With N = 2²⁴ values, √N = 2¹² = 4096. So after about 10 000 communications, some IV has very likely been used twice — and because the IV travels unencrypted, Eve can see the repeat happen.

Two packets with the same IV have the same RC4 keystream, so their XOR is the XOR of the two messages: Section 4.3's two-time pad, in a shipping standard.

Figure (svg): The 24-bit IV space against the birthday bound: a repeat is likely after about four thousand packets.

Seventeen million values sounds ample until the square root is taken, and then it is four thousand.

18. What a repeated IV actually gives Eve

Worked example

The consequence goes further than reading two messages, and this is the step people miss.

Two ciphertexts with the same IV: C₁ ⊕ C₂ = M₁ ⊕ M₂

Why: The keystream cancels. Eve now has a classical language problem, exactly as in Section 4.3.

With plausible guesses about one message — headers, protocol structure — she recovers both

Why: Network traffic is highly structured, which makes this far easier than the book's ASCII example.

And she now has the RC4 keystream for that IV

Why: Because keystream = C₁ ⊕ M₁, and she knows both.

That is everything step 5 of the protocol needs to encrypt

Why: She can construct C = keystream ⊕ (message, ch) for any message she likes, and send it with that IV.

Verify: the WEP key is not required once the keystream for an IV is known

Why: So Eve gains the ability to send authenticated traffic through the router without ever learning the shared key. She has access to the network, not merely visibility of it — which is a much more serious outcome than reading two packets.

Figure (svg): The 24-bit IV space against the birthday bound: a repeat is likely after about four thousand packets.

Seventeen million values sounds ample until the square root is taken, and then it is four thousand.

19. Failure three: the CRC-32 Forgery

Concept

The third flaw needs no repeated IV at all. It uses the checksum.

CRC-32 is an error-detecting code, and it is linear: ch(M ⊕ M₁) = ch(M) ⊕ ch(M₁). That is exactly the property that makes it good at detecting burst errors, and it is fatal here.

Eve intercepts C = RC4 ⊕ (M, ch(M)) and guesses correctly that the message contains an IP address at a known offset — say Send to IP address 69.72.169.241. Here is my credit card number...

She builds M₁: all zeros except, at the address's position, the XOR of the real address with her own, 172.16.254.1. Then:

\[ C \oplus \bigl(M_1, \, ch(M_1)\bigr) = RC4 \oplus \bigl(M \oplus M_1, \; ch(M) \oplus ch(M_1)\bigr) = RC4 \oplus \bigl(M_2, \, ch(M_2)\bigr) \]

The router accepts it as authentic and forwards it to Eve's address. She never decrypted anything and never learned M — she redirected it, and then read it at the destination.

Figure (svg): The CRC-32 forgery: because the checksum is linear, XORing a chosen difference into the ciphertext produces a message the router accepts.

Linearity again — the same property that broke the LFSR, the Hill cipher and the XOR hash, in a fourth setting.

20. A forgery that never decrypts anything

Anomaly

Eve modifies an encrypted WEP packet so that it is delivered to her, without knowing the key or the plaintext.

Predict first

Which property of the design makes this possible?

  • RC4's biases
  • The IV being too short
  • CRC-32 being linear, combined with a stream cipher's bit-for-bit XOR
  • The 40-bit key

Correct: CRC-32 being linear, combined with a stream cipher's bit-for-bit XOR

The fix is a message authentication code, not a checksum. A CRC detects accidental corruption and was designed for exactly that; a MAC resists an adversary choosing the corruption. Chapter 12's HMAC is the tool, and WEP's designers used the wrong category of primitive.

The general error is worth naming: an error-detecting code and a message authentication code look alike — both append a value that the receiver checks — and they defend against completely different adversaries. Substituting one for the other is a recurring mistake.

Why: Two properties combine. A stream cipher lets Eve flip any plaintext bit by flipping the corresponding ciphertext bit — the controlled forgery Chapter 6 warned about. And CRC-32's linearity means she can compute the matching checksum change without knowing the message. Either alone would be survivable; together they let her make a targeted, verifying modification to a message she cannot read.

Figure (svg): The CRC-32 forgery: because the checksum is linear, XORing a chosen difference into the ciphertext produces a message the router accepts.

Linearity again — the same property that broke the LFSR, the Hill cipher and the XOR hash, in a fourth setting.

21. Audit the WEP design

Error analysis

The protocol, stated as its designers would have stated it.

Annotate

  • The claim is false by the birthday bound: 2¹² = 4096 packets makes a repeat likely, and the IV is sent in the clear so the repeat is visible. The intent was right and the field was sized without the calculation.
  • Related-key material: RC4 keys differing only in their first bytes leak information about the shared part, which is the Fluhrer-Mantin-Shamir attack. Section 5.3's key scheduling weakness, exposed directly.
  • A CRC detects accidental change; it does not resist an adversary. Its linearity lets Eve compute the checksum of a chosen difference and forge a verifying message.
  • Genuinely too small — and the least important flaw. Raising it to 104 bits fixed the brute-force attack and left everything else intact.

Four decisions. One was a compliance constraint, one was a miscalculation, and two were the wrong category of primitive. None was a mistake about RC4.

22. The whole chapter in one table

Picture it

Four failures, and the two columns that matter are what was sound and what was not.

Figure (svg): The pattern across all three case studies: sound primitives, and a failure in the assembly around them.

The chapter's thesis, tabulated: cryptography fails at the joints.

Read the left column and every entry is a respectable piece of engineering. Read the right and not one entry is about the mathematics.

23. What would have caught the shared factors?

Prediction

Thousands of deployed RSA keys shared a prime because their generators had too small an effective range.

Predict first

Which single change at design time would have prevented it?

  • A longer modulus
  • Blocking entropy — refusing to generate a key until the pool has enough randomness
  • A different primality test
  • Choosing p and q of different lengths

Correct: Blocking entropy — refusing to generate a key until the pool has enough randomness

The trade is a real one: a device that will not boot until it has entropy is a device that appears broken, and that pressure is exactly why non-blocking sources are chosen.

The modern answer is to seed from a hardware random source at manufacture, or from a CPU instruction such as RDRAND, so the pool is never empty. Chapter 5's layered design — slow real entropy stretched by a fast one-way function — is the shape that works.

Why: The failure was devices generating keys at first boot before any entropy had accumulated, so the generator's effective range collapsed. A blocking entropy source — refusing to produce output until enough real randomness is available — makes the failure a delay rather than a silent weakness. Everything else in the list is good practice against a different attack, and none of it enlarges the seed's entropy.

Figure (svg): Two RSA moduli sharing a prime factor, broken by a single gcd.

Nobody factored anything. Two public keys and one gcd, and both private keys fall out.

24. What the 2012 surveys actually showed

Two truths and a lie

Two of these overstate what was found.

Eliminate the wrong options

Which statement is accurate?

  • a. Thousands of moduli shared a prime with another modulus, and each such pair is broken by one gcd — with no factoring involved
  • b. RSA was shown to be weaker than believed
  • c. The affected keys could be identified by inspecting them individually

Survives elimination: a

Why: 26 965 out of 11.4 million moduli in the Lenstra collection had a non-trivial gcd with another. The mathematics of RSA is untouched; the generators were at fault. And option (c) matters practically — it is why the affected parties had to be told rather than being able to check, and why the surveys were published as a warning rather than as a tool.

25. Find the problems in this key generation code

Error analysis

From an embedded device's provisioning routine, written to run at first boot.

Annotate

  • Both are known to an attacker who sees the device on the network. The seed has essentially no entropy, which is Netscape's flaw with an extra XOR.
  • A linear congruential generator, which Section 5.1 says is provably predictable and forbidden for cryptographic use. Even with a good seed this would be wrong.
  • p and q are adjacent primes, so both are near √n. Fermat factorization finds them in a handful of steps, and this is the exact flaw a mathematician talked a company out of shipping.
  • The moment when the entropy pool is emptiest. This is where the 2012 surveys found their shared factors, and running key generation here is the single riskiest scheduling decision available.

Four lines, four documented attacks, and the RSA arithmetic on the last line is entirely correct.

26. Why did WEP's designers include an IV at all?

Socratic

The IV was not an oversight. It was there specifically because the designers understood keystream reuse.

Discussion prompt

What does that tell you about how this class of failure happens, and what would have caught it?

Hint: They knew the requirement and got the arithmetic wrong.

Answer:

They knew the rule. Reusing a one-time pad is insecure, so they added a per-packet value to make the keystream differ. The reasoning was correct.

They did not do the arithmetic. 2²⁴ ≈ 17 million looks like a lot of values, and the intuition 'it will take a long time to use them all' is the wrong question. The right question is when two of them coincide, and the answer is the square root.

So the failure is not ignorance of cryptography — it is a missing calculation. One square root, performed once at design time, would have shown 4096 and forced a wider field.

Which is why this category is worth a checklist rather than expertise. Anyone can compute 1.25√N for every field in a specification; nobody needs to be a cryptographer to do it.

And it generalises to the other failures here. Netscape's designers knew a seed was needed; they did not count how many seeds there were. The prime-generator failures knew randomness mattered; they did not count the generator's range.

The pattern is: the requirement was understood and the quantity was not checked.

27. Order these by how early each could have been caught

Ranking

All four were found after deployment. Rank by how cheaply each was findable beforehand.

Put in order

  1. WEP's 24-bit IV colliding after 4096 packets
  2. Netscape's timestamp seed
  3. The 2012 shared factors
  4. Enigma's no-self-map giving free crib filtering

Why: The IV needed one square root — a calculation on the specification, before any code existed. The seed needed a reading of the key generation path, which Goldberg and Wagner did from the public documentation. The shared factors needed the insight that a generator's range could be small enough for the birthday bound to apply across independent devices, which is subtler. And Enigma's feature required inventing the crib-dragging attack — genuine cryptanalysis, which is why it took a codebreaker rather than a reviewer. The ordering is really by how much creativity the discovery required, and the first two required almost none.

28. Why 40-bit keys existed at all

Real world

WEP's 40-bit key was not an engineering judgement. It was a legal constraint.

Discussion prompt

What were the export regulations, and what did they leave behind?

Hint: The rules changed; the deployed systems did not.

Answer:

US export regulations through the 1990s classified strong cryptography as a munition, capping exportable key lengths at 40 bits. Products shipped internationally used the weak version, and often the weak version was the only version.

So a generation of protocols carries a 40-bit mode: WEP, export-grade SSL ciphersuites, and the DES variants. Each was known to be inadequate at the time and shipped anyway.

The regulations relaxed around 2000. The protocols did not. Export ciphersuites remained in TLS implementations for compatibility, unused but negotiable — and that is where FREAK and Logjam came from in 2015, fifteen years later. An attacker downgraded a modern connection to an export-grade key and broke it.

The lesson about legacy is general: a weak option that is never used is not harmless, because negotiation can select it. TLS 1.3's response was to delete whole families of ciphersuites rather than deprecate them.

And the lesson about policy: a deliberate weakening for one purpose becomes a permanent structural weakness, because deployed protocols outlive the policies that shaped them by decades.

29. Match each WEP flaw to its earlier chapter

Analogy

Every WEP failure has appeared before in this course, in a different setting.

Match the pairs

  • y1. Repeated IV giving keystream reuse
  • y2. CRC-32 forged by exploiting linearity
  • y3. WEPKey ‖ IV leaking through RC4's key schedule
  • y4. One key shared by every station
  • z1. Section 4.3 — a reused one-time pad cancels the key
  • z2. Chapters 5, 6 and 11 — linearity is always solvable
  • z3. Section 5.3 — RC4's key scheduling has related-key weaknesses
  • z4. Chapter 1 — one key protecting everything loses everything at once

Why: Four flaws, four earlier chapters, and no new cryptography anywhere. That is what makes WEP such a good case study: a reader who had internalised Chapters 1, 4, 5 and 6 could have predicted every one of its failures from the protocol description alone, without knowing any of the published attacks.

30. How long does a WEP network survive?

Estimation

A busy access point handles perhaps 500 packets per second.

Predict first

How long before an IV repeat is likely?

  • About 8 seconds
  • About an hour
  • About a day
  • About a month

Correct: About 8 seconds

The related-key attack does even better in practice: rather than waiting for a collision, it collects packets with particular IV patterns and recovers the WEP key directly, needing tens of thousands of packets — minutes on a busy network, and injectable traffic can generate them on demand.

Which is the practical difference between a break and a vulnerability. Sweet32 needs 32 GB and hours; WEP needs seconds, and that is why replacement was urgent rather than scheduled.

Why: The birthday bound gives about 5100 packets, and at 500 per second that is roughly ten seconds. Even a lightly used home network reaches it in minutes. This is the number that made WEP not merely theoretically broken but practically trivial — tools that recover a WEP key in under a minute have existed since the mid-2000s.

Figure (svg): The 24-bit IV space against the birthday bound: a repeat is likely after about four thousand packets.

Seventeen million values sounds ample until the square root is taken, and then it is four thousand.

31. Which review question finds each failure?

Sorting

The six review questions from this chapter, applied to failures across the whole course.

Sort into buckets

Sort each failure by the question that would have found it.

What must never repeat, and how wide is it?
WEP's 24-bit IV
Does the integrity check involve a secret?
WEP's CRC-32 checksum
Where does the randomness come from?
Netscape's timestamp seed
Is this construction standard or invented?
Using SHA256(K‖m) as a MAC
What is the plan when this parameter ages?
DES's 56-bit key in 1998
What does the ciphertext guarantee?
ECB revealing an image
unique
One square root on the specification. The cheapest check in the list and the one that finds the most.
integ
A CRC has no key, so it withstands noise and not an adversary. The question is binary and takes seconds to answer.
rand
Trace the seed back to its source. This is the category with the most real damage and it is invisible in the cryptographic code.
constr
H(K‖m) is not a standard MAC construction, and asking why it was invented rather than taken from a standard would have surfaced length extension immediately.
age
56 bits was forecast inadequate in 1977 and recertified twice. The question is not whether the number is big enough now but whether there is a way to change it.
guar
ECB guarantees that equal blocks encrypt equally. Any guaranteed property is a filter, which is exactly Enigma's lesson.

Six questions, six failures, and none of them required cryptanalysis to find.

32. Detecting noise against resisting an adversary

Trade off

WEP's central category error, laid out. Fill the blanks.

Comparison matrix

Checksum (CRC-32)MAC (HMAC)
Designed againstline noise and burst errorsan adversary who chooses the modification
Involves a secret?noyes — a shared key
Linear?yes — which is what makes the forgery workno
Costa few operations per bytetwo hash computations
Appropriate fordetecting transmission errorsany setting with an adversary

Both append a value the receiver checks, and they answer different questions. Substituting one for the other is the error, and the two rows that separate them are 'involves a secret' and 'linear'.

33. Could WEP have been fixed without changing the packet format?

Counterexample

Replacing WEP meant new hardware for many devices. Suppose you had to keep the 24-bit IV field.

Discussion prompt

Could the protocol have been made secure within that constraint?

Hint: Ask what the IV is actually for, and whether 24 bits used differently would suffice.

Answer:

Use the field as a counter rather than a random value, and the birthday bound disappears entirely — 2²⁴ ≈ 17 million packets before a repeat instead of 4096. That is a four-thousand-fold improvement from reinterpreting the same 24 bits.

Rekey before the counter wraps. A fresh session key every few million packets means the counter never repeats under one key at all.

Derive the RC4 key by hashing rather than concatenating, so related-key weaknesses in the key schedule are not exposed. Same field, different combination.

But the CRC cannot be fixed within the format, because a MAC needs its own bytes and there is nowhere to put them. Integrity would have to move into the payload, which is a format change in all but name.

So three of the four flaws were fixable within the constraint, and the fourth was not — which is roughly what WPA with TKIP did as an interim measure, running on existing hardware while WPA2 waited for new silicon.

The exercise is worth doing because it separates the flaws that were design errors from the one that was a structural limitation. Three were choices; one was a missing field.

34. Why is the randomness category the largest?

Explain it to yourself

Across this course, more systems failed on randomness than on any other cause.

Discussion prompt

Explain why, in terms of where the requirement lives and who is responsible for it.

Hint: Ask where in the codebase a nonce requirement appears, and who reads it.

Answer:

The requirement is stated in the cryptography and satisfied somewhere else. 'Choose a fresh random k' appears in the signature scheme's specification; the value is actually produced by a generator seeded by an operating system, in code no cryptographer reads.

A failure is invisible from both sides. The cryptographic code looks correct — it calls a random function. The system code looks correct — it returns bytes. Nothing in either place says the pool was empty at boot.

The output looks fine. A weak generator produces bytes that pass inspection, so there is no artefact to notice. Contrast a mode-of-operation bug, which produces a visibly repeating ciphertext.

And the consequence is total rather than gradual. A predictable nonce gives up a private key entirely; a weak seed collapses the whole key space. There is no partial failure to notice early.

Which is why the mitigation is structural rather than vigilant: deterministic nonces where possible, blocking entropy sources, hardware random sources at manufacture, and never generating long-term keys at first boot.

The general principle: a security requirement that crosses a component boundary is the one most likely to be dropped, because nobody on either side owns it.

35. Which system would you expect to fail next?

Commit first

Four systems, all using current primitives correctly.

Predict first

Which is most likely to be compromised in the next five years?

  • A system using AES-256 with a 96-bit random nonce, 10⁶ messages per key
  • A system generating keys on embedded devices at first boot
  • A system using SHA-256 for file integrity
  • A system using RSA-3072 for certificate signatures

Correct: A system generating keys on embedded devices at first boot

Notice that the question is not about which cryptography is weakest — all four are equally sound. It is about which process is most likely to violate a hypothesis, and that is where this chapter says to look.

The mitigation is cheap and well known: provision a hardware seed at manufacture, or refuse to generate long-term keys until the pool has entropy. It is not done because a device that boots slowly looks broken and a device with a weak key looks fine.

Why: First-boot key generation on embedded devices is precisely where the 2012 surveys found their shared factors, and the conditions have not changed — devices still boot with empty entropy pools, and the failure is invisible until someone runs a batch gcd across the internet. The other three are all comfortably within their parameters: 10⁶ messages against a 96-bit nonce is nowhere near 2⁴⁸, and both hash and signature choices are current.

36. How much can a protocol borrow?

Edge cases

WEP borrowed RC4 from cryptography and CRC-32 from networking, and combined them.

Discussion prompt

What has to be checked when a component designed for one purpose is used for another?

Hint: Each component was designed against a specific adversary, or against none.

Answer:

What adversary was it designed against? CRC-32 was designed against noise, which has no strategy. Using it against an attacker who chooses the corruption is a category change the component's specification never contemplated.

What does it guarantee, and over what range of inputs? RC4 is a keystream generator, guaranteeing nothing about related keys — so concatenating a varying IV onto a fixed key is outside what its analysis covered.

What does it assume about its inputs? A stream cipher assumes a fresh key per message. WEP's IV was an attempt to satisfy that, sized without checking.

And what happens at the seams? The CRC is computed over the plaintext and encrypted with it, so the integrity check is inside the confidentiality layer — which is what makes the linear forgery possible. Encrypt-then-MAC would have put it outside.

The rule: a component's security argument is scoped to the setting it was analysed in. Borrowing it into another setting means the argument does not transfer, and someone has to redo it.

This is the same statement as Chapter 4's, about hypotheses of a proof — and it is why 'we used standard components' is not a security argument.

37. What the three case studies share

Concept

Enigma, RSA key generation, and WEP have nothing in common technically. The failure has the same shape in all three.

  1. Every primitive was sound. Enigma's rotors, RSA's arithmetic, RC4's keystream — none was attacked, and none needed to be.
  2. The failure was in a parameter, an assumption, or a category error. A guaranteed property, a seed's entropy, a field's width, a checksum used as an authenticator.
  3. The flaw was invisible from inside the component. Nothing about RC4 tells you the IV is too short; nothing about RSA tells you the seed was a timestamp.
  4. And the designers were not careless. WEP's authors included an IV because they knew about keystream reuse; Enigma's reflector was a deliberate engineering choice; Netscape's ephemeral keys were good practice.

That last point is the one worth sitting with. These are not stories about incompetence. They are stories about the difficulty of reasoning across a boundary — where a component's guarantee ends and the system's requirement begins.

Figure (svg): The pattern across all three case studies: sound primitives, and a failure in the assembly around them.

The chapter's thesis, tabulated: cryptography fails at the joints.

38. Order the WEP flaws by how much damage each does

Ranking

Four separate problems, and fixing them in the wrong order is what actually happened.

Put in order

  1. The 40-bit key
  2. The related-key structure of WEPKey ‖ IV
  3. The 24-bit IV colliding after ~4000 packets
  4. CRC-32 used as an authenticator

Why: The key length is the least damaging: it was fixable and was fixed, and the system stayed broken. The related-key structure enables the Fluhrer-Mantin-Shamir key-recovery attack, which is severe but needs traffic. The IV collision gives keystream reuse and — worse — the ability to inject traffic without the key, after only thousands of packets. And CRC-32 lets an attacker forge a verifying, redirected message with no repeated IV and no key at all, which is the most direct path to harm. The industry fixed them in exactly the reverse order of importance.

39. Which category of failure?

Definition probe

Sort these failures from across the whole course by what was actually wrong.

Sort into buckets

Classify each.

The mathematics was attacked
SHA-1 collisions being found
A parameter aged or was mis-sized
DES's 56-bit key becoming searchable
The wrong construction, or the wrong primitive
ECB mode revealing an image; WEP's CRC-32 checksum
The randomness failed
Netscape's timestamp seed; The PlayStation 3's constant signature nonce
math
Only SHA-1 in this list. Real cryptanalysis found a collision below the generic bound, after twenty years of effort — this is the rarest category by a wide margin.
param
DES's key length was correctly forecast as inadequate within months of publication. Parameters age predictably, which is the one category you can plan for.
constr
ECB uses a sound cipher in a mode that leaks; WEP uses an error-detecting code where an authenticator was needed. Both are category errors rather than weaknesses.
rand
A timestamp seed and a constant nonce. Both violated a stated hypothesis of a security argument, and both were invisible to anyone reading the cryptographic code.

40. Why was the IV sent in the clear?

Socratic

WEP transmits the IV unencrypted alongside every packet, which is what lets Eve see collisions happen.

Discussion prompt

Why was that necessary, and could it have been avoided?

Hint: Ask what the router needs in order to decrypt.

Answer:

The router needs the IV to reconstruct the RC4 key, and it does not remember which IV it sent — the protocol note says so explicitly. So the IV must travel with the packet.

And it does not need to be secret. An IV's job is uniqueness, not confidentiality, exactly as with CBC's IV in Chapter 6 and a password salt in Chapter 7. Sending it openly is correct.

So the visibility is not the flaw. The flaw is that a value which must not repeat was given 24 bits, and the birthday bound was not applied. Had it been 96 bits, sending it in the clear would be entirely fine — that is what AES-GCM does.

Could it have been avoided? Yes, by using a counter rather than a random value. A per-session counter cannot repeat until it wraps, and 24 bits of counter would give 16.7 million packets rather than 4096. Even the same field width would have been an order of magnitude better used.

The lesson generalises: where a design needs a non-repeating value, a counter beats randomness by a square, and randomness must be sized against the birthday bound rather than against the total count.

41. What replaced WEP, and why

Comparison

WPA and WPA2 fixed the flaws one by one. Fill the blanks.

Comparison matrix

FlawWEPWPA2
CipherRC4 with a related-key structureAES in CCM mode
IntegrityCRC-32 — linear, forgeableCBC-MAC — a real authenticator
IV / nonce width24 bits, colliding after ~4000 packets48 bits, with a packet counter
Key per stationone key shared by everyone on the routerper-session keys derived from a handshake
Replay protectionnonethe packet counter is checked

Five rows, and only the first is about the cipher. WPA2 is what WEP would have been if each requirement had been matched to the right primitive.

42. Fix WEP by lengthening the key

Counterexample

The obvious response to a 40-bit key is to make it 104 bits, which is what the industry did.

Discussion prompt

Show that each of the three remaining attacks is entirely unaffected.

Hint: Write down what each attack actually uses.

Answer:

The IV collision is unchanged. The birthday bound depends on the IV's 24 bits and nothing else. 4096 packets still gives a repeat, and a longer WEP key does not widen the IV field.

The keystream-reuse consequence is unchanged. Once Eve has the keystream for an IV she can encrypt with it, and she never needed the WEP key — of any length.

The CRC-32 forgery is unchanged. It uses linearity of the checksum and bit-for-bit XOR of the stream cipher. Neither mentions the key.

**And the related-key attack gets better for the attacker in one sense:** a longer key means more key bytes to recover, but the Fluhrer-Mantin-Shamir attack recovers them incrementally, so it scales gently.

So three of four attacks are untouched and the fourth is barely slowed. This is the clearest demonstration in the book that fixing the parameter everyone can see is not the same as fixing the system — and it is Chapter 1's key-length argument arriving with a real deployment behind it.

43. The same failures, in this decade

Real world

The three case studies date from 1941, 1995 and 1997. The categories have not changed.

Discussion prompt

Name a recent instance of each of the chapter's three failure types.

Hint: A guaranteed property, a weak seed, and a mis-sized field.

Answer:

A guaranteed property, exploited: compression before encryption. CRIME and BREACH exploited the guarantee that compressed length reflects redundancy, so an attacker who can inject text into a request learns whether her guess matches the secret — from the ciphertext length, which no cipher hides.

A weak seed: the 2012 shared-factor surveys are the headline, and the pattern continued. Embedded devices generating keys at first boot, virtual machines cloned with their entropy pools, and containers starting from identical images have all produced duplicate keys since.

A mis-sized field: Sweet32 in 2016 — 64-bit block ciphers in long-lived TLS and VPN connections, where the birthday bound on the block gives a repeat after 32 GB. Exactly WEP's arithmetic, in a different field, twenty years later.

And the category error keeps recurring too: using a hash where a MAC is needed, which is Chapter 11's length extension, still appears in API authentication schemes written this year.

The value of this chapter is not the history. It is that the four categories are stable, so they can be checked for.

44. Where would you look in a new design?

Commit first

You have limited time to review an unfamiliar cryptographic protocol.

Predict first

Which single question finds the most problems?

  • Which cipher is used, and is it modern?
  • Which values must never repeat, how wide are they, and how are they generated?
  • How long are the keys?
  • Is the code constant-time?

Correct: Which values must never repeat, how wide are they, and how are they generated?

The runner-up is the third category: is any value used as an authenticator that was designed as an error-detecting code, and is any hash being used where a MAC is needed?

The cipher choice is almost never the problem. Every system in this chapter used a reasonable primitive for its era, and the review time is better spent elsewhere.

Why: Nonces, IVs, salts and signature nonces are where this chapter's failures live, and where Chapters 4, 5, 6, 10 and 13 placed their failures too — Venona, WEP, the PlayStation 3, Debian, the shared factors. One question covers all of them, and the answer is usually either 'we did not size it' or 'from the system clock'.

45. Complete the chapter's rules

Faded example

Four rules, one from each failure.

Fill in the blanks

Guarantee nothing about the ciphertext, because any guaranteed property is a free filter. Audit the seed, not the algorithm. Size any non-repeating value against the birthday bound. And never use an error-detecting code where a MAC is required.

Why: Four rules, four case studies, and each is checkable in a design review without running any cryptanalysis. That is what makes them useful: they turn a class of failures that took decades to discover into questions anyone can ask on a first reading of a specification.

46. Detection or authentication?

Discrimination

The WEP failure was a category error, and the category is easy to mistake.

Sort into buckets

Sort each mechanism by what adversary it withstands.

Accidental corruption only
CRC-32; A parity bit; A plain SHA-256 digest sent alongside the message
An adversary who chooses the modification
HMAC-SHA256; An RSA signature
acc
CRCs and parity bits are linear and public, so an adversary computes the matching value for any change she likes. A plain hash is worse than it looks: it is unkeyed, so an attacker who alters the message simply recomputes the digest — it protects only when the digest itself travels by a channel she does not control.
adv
Both involve a secret: a shared key for the MAC, a private key for the signature. That is what makes the tag unforgeable by someone who alters the message, and there is no unkeyed construction that achieves it.

47. How fast does a birthday collision arrive?

Cost model

One formula, and it would have caught two of this chapter's failures at design time.

Annotate

On: \( \text{expected draws before a repeat} \approx 1.25\sqrt{N} \)

  • 1.25 × 4096 ≈ 5100 packets. A busy access point reaches that in minutes.
  • About 5 × 10⁹ blocks, or 32 GB — reachable on a long-lived HTTPS connection, which is Sweet32.
  • About 3 × 10¹⁴ messages. Never reached, which is what a correctly sized field looks like.
  • About 1250 primes drawn before a repeat — and the illustration in the book uses 2000, which is comfortably past it.
  • Take every field in the protocol that must be unique, compute 1.25√N, and compare with the number of values the system will draw in its lifetime. Two of this chapter's three case studies fail that comparison on the first line.

It is one square root, and it is the single most productive calculation to perform on an unfamiliar design.

48. Explain why WEP failed to a network engineer

Explain it

A colleague asks why WEP was replaced when RC4 was a respected cipher at the time.

Discussion prompt

Explain without attacking RC4, and give the one-sentence summary.

Hint: The cipher was never the problem, and saying so first makes the rest land.

Answer:

Start by conceding the point: RC4 was fine for its era, and no attack on WEP begins by breaking it.

Then the IV. WEP changes the encryption key per packet using a 24-bit counter sent in the open. Twenty-four bits sounds like plenty until you realise a repeat becomes likely after about four thousand packets — seconds of traffic. Two packets with the same key means the encryption cancels between them.

Then the consequence they will care about: once an attacker has recovered the keystream for one of those repeated values, she can send traffic through the access point. Not read it — send it. She is on the network.

Then the checksum. WEP checks integrity with a CRC, which is designed to catch line noise, not an attacker. Because a CRC is linear, an attacker can alter a packet in a chosen way and fix up the checksum without knowing what the packet says — the book's example redirects a message to the attacker's own IP address.

The one-sentence summary: WEP used good components to build a system whose non-repeating value repeated in seconds and whose integrity check was designed for noise rather than for an adversary.

49. When is a cryptographic review finished?

Edge cases

The primitives are standard, the key sizes are current, and the code compiles.

Discussion prompt

What still has to be checked before a design can be signed off?

Hint: This chapter supplies four categories, and earlier chapters supply two more.

Answer:

Every value that must not repeat, with its width compared against 1.25√N and the system's lifetime volume — and whether it is a counter or random, and what resets it.

Every place a guarantee is made about the output, since a guaranteed property is a filter. Deterministic encryption, fixed-length outputs, and anything that 'always' holds.

Every check that distinguishes accidental from adversarial change, and whether a secret is involved in it.

Every source of randomness, back to its seed — Chapter 5's rule, and the one that has caused the most real damage.

Every construction, asking whether it is standard or invented: H(K‖m), a hand-rolled mode, a custom padding scheme. Chapter 6 and Chapter 11 both showed sound primitives in unsound wrappers.

And every parameter's expiry date, with a plan to change it — because Chapter 7's DES lesson is that the number will need to move within the system's life.

Six checks, none of which requires cryptanalysis, and between them they cover essentially every failure in this book.

50. Design the wireless protocol WEP should have been

Constraint

Same problem, 1997 constraints — modest hardware, a shared password, and packets of a few hundred bytes.

Discussion prompt

Specify it, and say which WEP flaw each decision removes.

Hint: Take the four flaws in turn and choose the right primitive for each.

Answer:

Derive a per-session key from the shared password and a handshake nonce, rather than using the password directly. This removes the related-key structure: RC4 never sees a key differing only in its first bytes.

Use a 48-bit packet counter as the nonce, not a 24-bit random IV. A counter cannot repeat until it wraps, so the birthday bound does not apply at all — 2⁴⁸ packets rather than 4096.

Rekey when the counter approaches its limit, so wrapping never happens in practice.

Authenticate with a MAC over the ciphertext and the nonce, not a CRC over the plaintext. This removes the forgery and, by covering the nonce, also removes replay when combined with the counter check.

Reject any packet whose counter is not greater than the last accepted one. Replay protection, one integer per peer.

And per-station session keys, so one compromised laptop does not give access to every other station's traffic — which WEP's single shared key did.

Five decisions, each removing one named flaw, and all of them available in 1997. That is roughly what WPA2 turned out to be.

51. What would you ask about a protocol you have not seen?

Missing information

You are handed a specification for a new cryptographic protocol and have one page of questions.

Discussion prompt

Write the questions, in the order that finds the most problems fastest.

Hint: This chapter has just given you the ordering.

Answer:

1. What must never repeat, how wide is it, and how is it generated? Nonces, IVs, salts, signature nonces. This finds the most, fastest.

2. What provides integrity, and does it involve a secret? A CRC, a plain hash or a truncated checksum here is a category error.

3. Where does the randomness come from, and what happens at first boot or after a restore? The Netscape flaw, the shared factors, the Debian bug and the PlayStation 3 all live here.

4. What does the ciphertext guarantee? Determinism, fixed lengths, ordered fields — every guarantee is a filter.

5. Which constructions are standard and which were invented for this document? Invented ones need a reason, and rarely have one.

6. What is the plan when a parameter or algorithm ages? Is there a version field, a negotiation, a migration path?

And the meta-question: which of the answers depends on an assumption about the world rather than about mathematics? Those are the ones that quietly stop being true.

52. Match each case study to the rule it teaches

Matching

Four failures, four rules — and each rule is checkable without any cryptanalysis.

Match the pairs

  • a1. Enigma's no-self-map guarantee
  • a2. Netscape's timestamp seed
  • a3. WEP's 24-bit IV
  • a4. WEP's CRC-32 checksum
  • b1. Guarantee nothing about the ciphertext — any promise is a free filter
  • b2. Audit the seed, not the algorithm
  • b3. Size every non-repeating value against 1.25 times the square root of its space
  • b4. Never use an error-detecting code where an authenticator is required

Why: Four rules that fit on a card, and between them they cover the whole chapter. What makes them valuable is that none requires expertise to apply: reading a specification and asking these four questions would have caught three of the four failures before any code was written, and the fourth — Enigma's — is the one that genuinely needed a cryptanalyst.

53. The four categories of cryptographic failure

Pattern

Fourteen chapters of attacks sort cleanly into four boxes, and their sizes are wildly uneven.

  1. The mathematics was attacked. Rare. MD5 and SHA-1 collisions, differential cryptanalysis on reduced rounds. Decades of effort by specialists, and usually a slow decline rather than a sudden break.
  2. A parameter aged or was mis-sized. Predictable. DES's key, WEP's IV, MD5's digest, 64-bit blocks. The one category you can forecast, and the one where a calculation at design time would have sufficed.
  3. The wrong construction or the wrong primitive. Common. ECB, length extension, unhashed signing, a CRC used as a MAC. A sound component in an unsound wrapper.
  4. The randomness failed. Most common of all. Venona, Netscape, WEP, Debian, the PlayStation 3, the shared factors. Almost always invisible from inside the cryptographic code.

The practical consequence is a review order: randomness first, constructions second, parameters third, and the primitive last — which is close to the reverse of how most reviews are conducted.

Figure (svg): The pattern across all three case studies: sound primitives, and a failure in the assembly around them.

The chapter's thesis, tabulated: cryptography fails at the joints.

54. Our primitives are standard, so we are secure

Trap

The trap

The trap. The design uses AES-256, SHA-256, RSA-3072 and a well-reviewed library. Every primitive is standard, current and unbroken. Therefore the system is secure, and the review can concentrate on other things.

This is a reasonable-sounding position, and it is the position the designers of WEP were in — RC4 and CRC-32 were both standard, respected and correctly implemented.

The fix

Why it fails. Not one of this chapter's failures involved a broken primitive. Enigma's rotors were sound and a design guarantee gave away the key. Netscape's RSA was correct and a timestamp seed collapsed the key space. WEP's RC4 was fine and a 24-bit field, a linear checksum and a shared key finished it.

A primitive's guarantee has boundaries, and systems fail at the boundaries. AES guarantees a permutation of one block; it says nothing about the second block, about who sent it, about whether it is fresh, or about where the key came from. Every one of those is somebody else's job.

And the standardness of the components can make things worse, by creating exactly this confidence. A team that has chosen good primitives feels finished, and the questions that remain are the ones this chapter's failures live in.

The correct claim is much narrower: using standard primitives removes one category of risk — the rarest one. It leaves the other three untouched, and they account for almost every failure in this book.

The habit: after checking the primitives, treat the review as not yet started. Then ask the six questions.

55. Check: the missing letter

Check

Work it out before you click.

Check your understanding

An Enigma ciphertext contains every letter of the alphabet except Q. What does that suggest?

  • A. The key had a Q in it
  • B. The plaintext was probably all Q (correct)
  • C. The message was too short
  • D. Nothing — letters are missing by chance

Answer: B

Why: Enigma's reflector guaranteed no letter encrypts to itself, so a plaintext of all Q could never produce a Q in the ciphertext. An absent letter in a message of any length is therefore evidence about the plaintext, obtained for free. This is exactly Mavis Batey's 1941 deduction with L, and it gave the day's key.

Why A tempts people
The key sets the rotor positions and plugboard, and has no such direct relationship to which letters appear.
Why C tempts people
In a short message a missing letter would be unremarkable — which is precisely why the observation required a message long enough for the absence to be striking.
Why D tempts people
This would be true of a cipher that guaranteed nothing. It is false here exactly because the design made a promise about its output.

56. Check: the IV arithmetic

Check

Apply the birthday bound to WEP's field.

Check your understanding

WEP uses a random 24-bit IV. After roughly how many packets is a repeat likely?

  • A. 2²⁴ ≈ 17 million
  • B. 2¹² = 4096 (correct)
  • C. 24
  • D. 2⁴⁸

Answer: B

Why: The birthday bound gives √N = 2¹² = 4096 — a few seconds of traffic on a busy access point. A repeated IV means a repeated RC4 keystream, which is Section 4.3's two-time pad; and recovering that keystream lets an attacker inject traffic without ever learning the WEP key.

Why A tempts people
This is the full IV space, which is how many packets it would take to exhaust every value — not how many before two coincide. Confusing the two is exactly the miscalculation WEP's designers made.
Why C tempts people
The bit width, not a count of packets.
Why D tempts people
This would be the bound for a 96-bit IV. WEP's field is a quarter of that width.

57. Check: the category error

Check

Identify what WEP's checksum was doing wrong.

Check your understanding

Why is CRC-32 unsuitable as WEP's integrity check?

  • A. It is too short
  • B. It is linear and unkeyed, so an attacker can compute the checksum of a chosen change and forge a verifying message (correct)
  • C. It is too slow
  • D. It was not standardised

Answer: B

Why: ch(M ⊕ M₁) = ch(M) ⊕ ch(M₁), so an attacker who wants to flip specific bits computes the corresponding checksum change without knowing the message. Combined with a stream cipher's bit-for-bit XOR, this lets her modify a packet in a chosen way and have it accepted. A CRC detects accidental corruption, which is what it was designed for; resisting an adversary needs a secret, and a CRC has none.

Why A tempts people
Length is not the issue — a 32-bit MAC would be weak but not forgeable this way. The linearity is what makes the forgery deterministic rather than a one-in-four-billion guess.
Why C tempts people
CRC-32 is extremely fast; that is why it was chosen.
Why D tempts people
It is a well-established standard. It is simply a standard for a different problem.

58. Write the review checklist

Connect it up

This chapter's value is a checklist, and writing it out is the way to keep it.

Draw it

List the four categories of failure with one example each from this course. Then write the six review questions in the order that finds problems fastest, and beside each write the case study from this chapter that it would have caught. Finish with the birthday formula and four worked instances: WEP's IV, a 64-bit block, a 96-bit nonce, and a prime generator with a million outputs.

Keep the checklist. Every chapter from here to the end of the book is protocols and applications, and these are the questions to read them with.

59. Exit ticket

Exit ticket

One question, about what this chapter is for.

Predict first

What do the Enigma feature, Netscape's RSA primes and WEP have in common?

  • All three used weak cryptographic primitives
  • In all three the primitives were sound and the failure was in a parameter, an assumption or a category error around them
  • All three were broken by exhaustive search
  • All three were deliberately weakened

Correct: In all three the primitives were sound and the failure was in a parameter, an assumption or a category error around them

Why: Enigma's rotors, RSA's arithmetic and RC4's keystream were all sound and none was attacked. What failed was a guaranteed property that acted as a filter, a seed with almost no entropy, and a protocol combining a 24-bit non-repeating field with an error-detecting code used as an authenticator. Every break was on the outside of the mathematics, which is why the chapter exists and why it sits immediately before the protocols chapter.

60. What to carry into Chapter 15

Recap

Three case studies, four categories, and a checklist.

Chapter 15 next. Security protocols proper — intruders in the middle, key distribution, Kerberos, public key infrastructure, X.509 certificates, PGP, SSL and TLS. Every one of them is an assembly, and this chapter is the right frame to read them with.

Figure (svg): The pattern across all three case studies: sound primitives, and a failure in the assembly around them.

The chapter's thesis, tabulated: cryptography fails at the joints.

Sources

  1. Introduction to Cryptography with Coding Theory, 3rd edition — Wade Trappe and Lawrence C. Washington — Pearson, 2020 (ISBN 978-0-13-485906-4)
  2. Chapter 14 — What Can Go Wrong (sections 14.1-14.3) — Trappe & Washington, 3rd edition, pp. 282-289

Want this taught 1-on-1? Alexander tutors Cryptography — $55/session, free consultation.

Book on Wyzant · Text (657) 465-8108