Wireless security: WEP to WPA3
Overview of wireless LAN security evolution from WEP (broken RC4/IV design) through WPA/TKIP and WPA2/CCMP to WPA3 (SAE, OWE, stronger ciphers), with exact definitions, handshake derivations, numerical examples and exam-focused notes.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Wireless networks (IEEE 802.11) are common in campus, lab and product networks. An engineer uses these protocols and attacks knowledge when designing secure Wi‑Fi deployments, auditing network security, or writing firmware/drivers that implement WPA/WPA2/WPA3. Understanding the exact failures of WEP and the protections in WPA2/WPA3 is necessary to choose configurations and to explain trade-offs to auditors.
Key ideas
Stream cipher: encryption that produces a keystream XORed with plaintext. RC4 is a stream cipher used in WEP/TKIP.
Message Integrity Code (MIC) / Message Authentication Code (MAC): a short cryptographic checksum (MAC is generic; MIC often refers to TKIP's Michael). A MAC provides integrity and authentication when keyed.
WEP (Wired Equivalent Privacy): defined by early 802.11. Uses RC4 with a 24‑bit IV + secret key, and a CRC‑32 ICV (integrity check value) for integrity. Exact failure points:
- IV space too small (24 bits) → frequent IV reuse (collisions). Draw: timeline of packets showing repeated IV values.
- RC4 key scheduling weaknesses (Fluhrer, Mantin and Shamir, FMS attack) allow recovery of the WEP key by capturing many packets that include statistically 'weak' IVs; IVs are chosen by the transmitter, so attackers typically capture large volumes (often stimulating traffic) rather than choosing IV patterns.
- CRC‑32 ICV is not cryptographic → allowing bit‑flips to be steered by attackers.
WPA (Wi‑Fi Protected Access): intermediate fix to WEP. Two modes:
- WPA‑Personal (pre‑shared key, PSK) uses TKIP (Temporal Key Integrity Protocol) to keep RC4 but add per‑packet key mixing and a MIC (Michael).
- WPA‑Enterprise uses 802.1X/EAP to deliver keys. TKIP improved WEP but retained RC4; still vulnerable to some attacks and now deprecated.
TKIP concepts: per‑packet sequence counter (to avoid replay), per‑packet key mixing to produce unique RC4 keys, and the Michael MIC (weak; “TKIP countermeasures” specify that two MIC failures within 60 seconds trigger disassociation and rekey/blackout to mitigate active forgeries).
802.11i / WPA2: modern mandatory security for many years. Uses RSN (Robust Security Network) with AES in CCMP mode (AES‑CCM) for confidentiality and integrity. CCMP uses a 48‑bit Packet Number (PN) as a nonce and for replay protection; it appears in an 8‑byte CCMP header along with a 2‑bit KeyID. Key terms:
- PMK (Pairwise Master Key): the long‑term key shared between authenticator and supplicant (either derived from PSK or from 802.1X EAP exchange).
- PTK (Pairwise Transient Key): per‑session key derived from PMK via the 4‑way handshake.
- GTK (Group Temporal Key): key used for broadcast/multicast frames, distributed by the AP after the 4‑way handshake.
- 4‑way handshake: exchanges nonces and derives PTK, verifies possession of PMK and installs keys (explained in worked example and diagram below). Draw: four messages labelled Message 1..4 with fields (ANonce, SNonce, MIC, GTK encrypted).
WPA3 (modern replacement): introduces SAE (Simultaneous Authentication of Equals) for PSK authentication (resists offline dictionary attacks), OWE (Opportunistic Wireless Encryption) for encrypted open networks (no auth but per‑client keys), mandates Protected Management Frames (PMF/802.11w), and updates cipher suites (WPA3‑Personal mandates AES‑CCMP‑128; WPA3‑Enterprise mandates at least 128‑bit security and offers an optional 192‑bit mode that requires GCMP‑256 and SHA‑384). SAE is a password‑authenticated key exchange based on Dragonfly/PAKE concepts.
Cryptographic modes:
- CCM (Counter with CBC‑MAC): provides authenticated encryption; used in CCMP (WPA2) with AES‑128.
- GCM (Galois/Counter Mode): an AEAD mode (often accelerated in hardware); GCMP is AES‑GCM adapted for 802.11; GCMP‑128 and GCMP‑256 exist, with GCMP‑256 required only in WPA3‑Enterprise 192‑bit mode.
Threats and mitigations summary:
- WEP: broken (don’t use).
- WPA/TKIP: deprecated, avoid.
- WPA2/CCMP: acceptable if configured (strong passwords, 802.1X for enterprise).
- WPA3/SAE/GCMP‑256/OWE: preferred when available; avoid WPA2/WPA3 transition mode where possible due to downgrade risks (e.g., Dragonblood).
Formulas
p ≈ 1 - exp(-N(N-1)/(2·M)) — collision probability by birthday paradox approximation, where p is probability of at least one collision, N is number of packets observed, M is number of distinct IV values (unitless). Applies when N << M but gives good approximation for moderate N.
N50 ≈ 1.2 · sqrt(M) — rough number of samples for ~50% collision probability, where M is the IV space size (unitless).
PTK = PRF(PMK, "Pairwise key expansion", Min(MAC_A,MAC_B) || Max(MAC_A,MAC_B) || Min(ANonce,SNonce) || Max(ANonce,SNonce)) — descriptive form used in 802.11i. PRF is a pseudo‑random function (unitless outputs in bytes); MAC_A/MAC_B are 48‑bit MAC addresses, ANonce and SNonce are nonces (unitless byte strings). This is a standard textual specification rather than a single algebraic formula.
IV_space = 2^b where b is the IV bit length (e.g., WEP b=24, so IV_space = 16,777,216). Unitless.
Notes on symbols: exp() is the exponential function, sqrt() is square root. Nonce/IV sizes are measured in bits; PRF output lengths depend on cipher suite.
Worked examples
WEP IV collision probability (numerical). Problem: WEP uses 24‑bit IV (M = 2^24). How many packets N are needed for ~50% chance of an IV collision? Steps:
- Use
N50 ≈ 1.2·sqrt(M). - Compute sqrt(M) = sqrt(2^24) = 2^12 = 4096.
- Multiply: N50 ≈ 1.2 · 4096 = 4915.
- So about 4915 packets give ~50% chance of an IV reuse (explain: many real flows send far more packets so reuse is trivial).
Exact via formula:
p ≈ 1 - exp(-N(N-1)/(2·2^24)). For N=5000, p ≈ 1 - exp(-5000·4999/(2·16777216)) ≈ 0.526 ≈ 52.6%.
- Use
4‑way handshake trace (conceptual, exam style). Setup: AP (authenticator) has PMK, STA (supplicant) has PMK.
- Message 1: AP → STA: ANonce (random), AP's MAC address. Purpose: give nonce.
- Message 2: STA → AP: SNonce (random), STA's MAC, MIC computed over the EAPOL‑Key frame using the KCK from the freshly derived PTK (STA derives PTK after receiving ANonce; the MIC proves possession of the PMK).
- Message 3: AP → STA: GTK encrypted + MIC. AP sends group key and confirms.
- Message 4: STA → AP: ACK (final install) with MIC. Explain key derivation: both sides compute PTK = PRF(PMK, "Pairwise key expansion", MACs || nonces). PTK is partitioned into KCK (Key Confirmation Key, for EAPOL MIC), KEK (Key Encryption Key, to encrypt/distribute the GTK), and TK (Temporal Key, for data protection). The handshake authenticates possession of PMK and binds nonces and addresses into PTK, preventing simple replay.
Why SAE resists offline dictionary attacks (model answer). Short model answer steps:
- WPA2‑PSK: PSK is used directly in the 4‑way handshake; an eavesdropper sees the handshake and can offline test passwords by simulating PMK → PTK → MIC computations.
- SAE (a PAKE): uses a password‑authenticated Diffie‑Hellman style exchange where each side contributes ephemeral values derived from the password; the exchange yields a shared secret but does not leak verifiable data that allows offline password guesses.
- Therefore, eavesdropper cannot test guesses offline; each guess requires active interaction with a party that knows the password.
Common mistakes
- Forgetting to include MAC addresses and nonces in PTK derivation description for the 4‑way handshake.
- Thinking WPA2 PSK prevents offline attacks — it does not; PSK exposes to offline dictionary attacks unless SAE (WPA3) is used.
- Mixing up CCMP and TKIP capabilities — CCMP provides authenticated encryption; TKIP provided retrofitting of RC4 and a weak MIC.
For your exam
Typical question types:
- Definitions: e.g., define IV, PTK, PMK, RSN, SAE, OWE.
- Short notes: describe WEP failures, explain WPA2 4‑way handshake, compare TKIP vs CCMP.
- Derivations: show PTK derivation expression and explain each field; derive IV collision probability using birthday approximation.
- Numericals: compute probability of IV collision for given IV lengths and packet counts (use formulas above).
- Diagrams: draw the 4‑way handshake (label messages, nonces, MIC, GTK) and WEP packet structure (IV | data | ICV).
What full‑marks answers include:
- Precise definitions with sizes (e.g., WEP IV 24 bits), the handshake message sequence, and explanation of why an attack succeeds (e.g., how IV reuse plus RC4 KSA leaks key bytes). For SAE, mention PAKE concept and resistance to offline guessing.
Quick check
- What is the IV length in classic WEP? 2. Name the WPA2 mode that uses AES‑CCM. 3. Which WPA3 feature resists offline dictionary attacks? Answers: 1) 24 bits. 2) CCMP (AES‑CCM) used in WPA2. 3) SAE (Simultaneous Authentication of Equals).
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?