skip to content

Why is WEP's encrypted CRC-32 ICV not an integrity check, and what kind of code does a protocol need instead?

level: middleimportance: should knowfreq 30%

answer

  1. detects accidents, not forgery
  2. no secret in the checksum
  3. predictable effect of a change
  4. encryption does not hide it
  5. needs a keyed code

basics

~20 s

WEP's ICV is a CRC-32 of the payload. A CRC has no secret and responds predictably to changes, and RC4 passes bit changes through unchanged, so encrypting it does not authenticate anything. Integrity needs a keyed code.

solid answer

~40 s

The ICV is a CRC-32 over the payload, appended and encrypted with it. A CRC is an error-detecting code: how a change in the message changes the checksum is predictable without any key. RC4 is a stream cipher, so the same bits change in the ciphertext whether or not the data is encrypted, which means encrypting the CRC hides nothing that matters. A modified frame can therefore still carry a valid ICV, and the receiver accepts it. Real integrity needs a *keyed* code, a message authentication code, whose changes are unpredictable without the secret. TKIP added the Michael MIC as a stopgap, and CCMP carries an 8-octet MIC.

go deeper

for a junior

Recall that the ICV is a CRC-32, that a CRC catches accidents, and that it is not integrity against an adversary.

for a middle

Explain linearity plus the stream cipher: why the encrypted CRC still predicts the effect of a change, and what a keyed code does differently.

for a senior

State the consequence for the estate: frames on a WEP SSID cannot be assumed unmodified, and nothing but retirement or protection above the link addresses it.

for a principal

Use it to show why an interim generation had to add a keyed code, and why 'has an integrity field' is never an assurance by itself.

## What the ICV is Each WEP data frame ends with a 4-octet **integrity check value**, the `IEEE80211_WEP_ICV_LEN` of the Linux header. The sender computes a **CRC-32** over the payload, appends it, and encrypts payload and checksum together with the RC4 keystream. The receiver decrypts, recomputes the CRC over the payload and discards the frame if the two differ (NIST SP 800-97, section 3.2.3). The designers believed that encrypting the CRC would make it hard to tamper with. The name "integrity check" suggests protection against an adversary, but a CRC was designed for another job. ## Error detection versus integrity | Question | CRC-32 | Message authentication code | |---|---|---| | Uses a secret key? | No | Yes | | Catches random bit errors? | Yes | Yes | | Can a third party compute a valid value? | Yes | No, not without the key | | Effect of a message change on the code | Predictable without any key | Unpredictable without the key | | Fit for stopping deliberate modification? | No | Yes | NIST SP 800-97 puts it this way: CRCs are efficient, but are "only designed to protect against random bit errors, not intentional forgeries". ## Why encrypting it does not help 1. A CRC-32 is **linear**: a change in the message produces a change in the checksum that depends only on the change, not on the rest of the message. Nobody needs the key to know which checksum bits change. 2. RC4 is a **stream cipher**, so encryption is a XOR with the keystream. A bit that flips in the ciphertext flips in the plaintext. NIST says the creators "did not realize" that bit flipping "survives the encryption process", and that the encrypted ICV therefore "offers no additional protection against bit flipping". 3. Together they mean a frame can be altered in a way that leaves the encrypted ICV valid. The consequence for the operator is that **WEP gives no assurance that the frame the access point or client accepted is the frame that was sent**. How such a change is made is not needed to reason about this and is out of scope here. ## What the ICV does cover - It does detect **accidental** corruption, which is what it was good at. - It covers the **payload**, not the key or the IV. - It does nothing about **replay**: NIST SP 800-97 section 3.2.4 notes that WEP has no counter, timestamp or other temporal data, so a replayed frame is not detectable by the cryptography. ## What replaced it - **TKIP** (the interim WPA generation) added the **Michael MIC**, a keyed 64-bit code chosen to run on WEP-era hardware, together with a sequence counter. It was a stopgap and is itself retired. - **CCMP** (WPA2) protects each frame with an 8-octet MIC (`IEEE80211_CCMP_MIC_LEN`) from CBC-MAC and an 8-octet CCMP header (`IEEE80211_CCMP_HDR_LEN`) that carries a packet number. The general rule that ciphertext which can be modified predictably is insecure even when unreadable, and why authenticated modes exist, belongs to the material on cipher modes. The WEP-specific lesson is that a name containing "integrity" is not evidence of a keyed check. ## What an operator concludes - A WEP SSID cannot be trusted to deliver unmodified data, so **do not carry anything on it that depends on frame integrity** without protection above the link. - No setting adds a keyed check to WEP. - The remedy is a generation that has one: retire WEP. ## How it is noticed The only event the ICV can produce is a frame discarded because the recomputed CRC-32 did not match; a few of those are ordinary on a noisy channel. A frame that was modified so that the check still passes produces no event at all, so **the absence of ICV errors is not evidence of integrity**. The exposure is therefore found from configuration and monitoring, as a WEP security type on an SSID, and not from a log line. ## Common slips - "It is encrypted, so it is protected": encryption and authentication are different properties. - "32 bits is long enough to stop guesses": the problem is not guessing, it is predictability. - Mixing up the ICV with the **FCS**, the CRC-32 that every 802.11 frame also carries for error detection and that is likewise unkeyed.

  • Would a longer or randomly chosen IV have repaired WEP's integrity problem?
    No. The integrity flaw is in the checksum: a CRC-32 has no secret, and a stream cipher passes bit changes through. A longer IV would affect keystream reuse but would leave the ICV exactly as predictable, so the check would still not be a message authentication code.
  • What does a keyed integrity code provide that the ICV lacks?
    Its value depends on a secret key, so a change to the message changes the code in a way no one can predict or recompute without the key. Receivers can then reject frames that were not produced by a key holder. NIST SP 800-97 calls these cryptographic checksums or message authentication codes.
  • If the ICV cannot stop tampering, is it still doing anything useful?
    Yes, as an error-detecting code. It catches random corruption on a noisy radio link and the receiver discards such frames. What it cannot do is separate accidental damage from deliberate change, which is what the word integrity is expected to mean in a security protocol.

A CRC is like the check digit on a card number: it catches a mistyped digit, but anyone can work out a valid check digit for a number they invented, so it says nothing about who wrote the number.

  • Encrypting a checksum with RC4 turns it into a MAC.
  • A 32-bit CRC is strong enough to resist deliberate modification.
  • WEP's ICV covers the frame header addresses as well.
  • The ICV also stops replayed frames.
  • A longer IV would have fixed WEP's integrity check.