Loading content...
IEEE 802.11i, ratified in June 2004, represents the definitive specification for wireless LAN security. The Wi-Fi Alliance's certification program implementing 802.11i is called WPA2—a name that emphasizes continuity with WPA while signaling substantive improvements.
Unlike WPA, which was constrained to work with WEP-era hardware, WPA2 requires hardware support for the Advanced Encryption Standard (AES). This requirement enabled a complete cryptographic redesign using modern symmetric cryptography, eliminating the compromises that made TKIP necessary.
By the end of this page, you will understand the AES block cipher foundations, how CCMP (Counter Mode with CBC-MAC Protocol) provides authenticated encryption, the structure of 802.11i RSN (Robust Security Network), the key hierarchy and derivation functions, and why WPA2 remained the standard for over 15 years.
WPA2-AES remains secure for most deployments when configured properly with strong passphrases or enterprise authentication. KRACK attacks (2017) exposed implementation issues rather than fundamental protocol flaws. WPA3 adds forward secrecy and improved handshake security, but WPA2 with proper configuration remains adequate for many use cases.
The Advanced Encryption Standard (AES) was selected by NIST in 2001 after a rigorous five-year public competition. Originally known as Rijndael (designed by Belgian cryptographers Joan Daemen and Vincent Rijmen), AES replaced the aging DES standard and has become the most widely used symmetric cipher in the world.
AES Core Properties:
Why AES Over RC4:
| Property | RC4 (WEP/TKIP) | AES (WPA2) |
|---|---|---|
| Type | Stream cipher | Block cipher |
| Key scheduling | Simple, exploitable | Complex, secure |
| Hardware acceleration | Limited | Universal (AES-NI) |
| Cryptographic margin | Theoretical breaks | No known attacks |
| Standardization | Proprietary | NIST/government standard |
AES Internal Structure:
Each AES round applies four operations:
The final round omits MixColumns. The combination of non-linear substitution and linear diffusion provides the mathematical properties needed for strong encryption.
Hardware Acceleration:
Modern CPUs include dedicated AES instructions (Intel AES-NI, ARM AES extensions). These provide:
This acceleration means WPA2-AES is actually faster than WPA-TKIP on modern hardware, reversing the performance concerns of 2004.
The best publicly known attack against AES-128 (biclique attack, 2011) reduces the effective key strength from 128 bits to approximately 126.1 bits—requiring 2¹²⁶ operations instead of 2¹²⁸. This remains completely impractical; 2¹²⁶ operations would take billions of years on all computing hardware on Earth combined.
Counter Mode with CBC-MAC Protocol (CCMP) is WPA2's mandatory encryption protocol. CCMP is an implementation of CCM (Counter with CBC-MAC) mode using AES as the underlying cipher.
What Makes CCMP Special:
CCMP is an Authenticated Encryption with Associated Data (AEAD) scheme. This means it provides:
These three properties are cryptographically bound—you cannot strip the authentication or tamper with protected headers.
CCMP Components:
CCMP combines two AES modes:
1. CTR (Counter) Mode for Encryption:
Counter₀ = Nonce || 0x0001
Counterᵢ = Nonce || (i + 1)
Keystream = AES(K, Counter₀) || AES(K, Counter₁) || ...
Ciphertext = Plaintext ⊕ Keystream
2. CBC-MAC for Authentication:
MAC₀ = AES(K, Nonce || message_length)
MACᵢ = AES(K, MACᵢ₋₁ ⊕ Blockᵢ)
Final MIC = Truncate(MAC_final, 64 bits)
| Property | TKIP | CCMP |
|---|---|---|
| Cipher | RC4 (stream) | AES-128 (block) |
| Key mixing | Per-packet via S-boxes | Counter mode nonce |
| Integrity | Michael (64-bit, weak) | CBC-MAC (64-bit, strong) |
| Nonce size | 48 bits | 48 bits (packet number) |
| Replay protection | TSC sequencing | PN sequencing |
| Hardware required | RC4 (legacy) | AES (modern chipset) |
| Known attacks | Beck-Tews, dictionary | Dictionary only (PSK) |
CCMP's AEAD construction means you cannot accidentally misuse it the way WEP misused RC4. The encryption and authentication are inseparable—you always get both, computed correctly, or neither. This 'secure by default' property prevents the class of errors that broke WEP.
Understanding CCMP requires tracing how a packet is encrypted and authenticated:
CCMP Encryption Steps:
Step 1: Construct the Nonce (13 bytes)
Nonce = Priority (1 byte) || A2 (6 bytes) || PN (6 bytes)
Step 2: Construct Additional Authentication Data (AAD)
AAD = FC || A1 || A2 || A3 || SC || A4 (if present) || QoS (if present)
The AAD is authenticated but not encrypted—attackers cannot modify addresses or headers without detection.
Step 3: Compute CBC-MAC over AAD and Plaintext
B₀ = Flags || Nonce || PlaintextLength
B₁ = AAD length || AAD (padded)
Bₙ = Plaintext blocks (padded to 16 bytes)
T₀ = AES(TK, B₀)
Tᵢ = AES(TK, Tᵢ₋₁ ⊕ Bᵢ)
Step 4: Encrypt Plaintext with Counter Mode
A₀ = Flags || Nonce || 0x0000
Aᵢ = Flags || Nonce || i
E_MIC = T_final ⊕ AES(TK, A₀) // Encrypt the MIC
Cᵢ = Pᵢ ⊕ AES(TK, Aᵢ) // Encrypt plaintext blocks
Step 5: Construct CCMP MPDU
[MAC Header] [CCMP Header (8 bytes)] [Encrypted Payload] [Encrypted MIC (8 bytes)]
The CCMP header contains:
Decryption and Verification:
The receiver performs the inverse process:
Security Note: Unlike TKIP, CCMP does not need countermeasures for MIC failures. The cryptographic strength of CBC-MAC means forgery attempts cannot succeed—there's no need to throttle because the attack is computationally infeasible, not merely slow.
The 48-bit PN must never repeat for a given temporal key. At 10 million packets/second, exhaustion would take 890 years. However, implementations should rekey before PN reaches 2⁴⁸ - 1. Most networks rekey via Group Key Handshake periodically regardless.
WPA2 uses the same key hierarchy as WPA, with modifications for CCMP:
Master Keys:
PMK (Pairwise Master Key) — 256 bits:
PMK = PBKDF2(SHA256, Passphrase, SSID, 4096, 256)PSK Derivation Detail:
DK = PBKDF2(PRF, Password, Salt, Iterations, KeyLength)
Where:
PRF = HMAC-SHA1
Password = user passphrase (8-63 characters)
Salt = SSID (network name)
Iterations = 4096
KeyLength = 256 bits
The SSID as salt means the same password on different networks produces different PMKs. This prevents pre-computed rainbow tables from working across networks (though tables exist for common SSIDs like 'linksys' or 'default').
Session Keys (via 4-Way Handshake):
PTK (Pairwise Transient Key) — 384 bits for CCMP:
PTK = PRF-384(PMK, "Pairwise key expansion",
min(AA,SPA) || max(AA,SPA) ||
min(ANonce,SNonce) || max(ANonce,SNonce))
Where:
PTK Decomposition for CCMP:
PTK (384 bits) = KCK (128 bits) || KEK (128 bits) || TK (128 bits)
KCK: Key Confirmation Key
- Used for MIC in 4-way handshake messages
- Proves possession of PMK during key negotiation
KEK: Key Encryption Key
- Encrypts GTK when transmitted in handshake message 3
- Protects group key distribution
TK: Temporal Key
- The actual key for CCMP encryption/decryption
- Used for all unicast data traffic
Group Keys:
GTK (Group Temporal Key) — 128 bits:
GMK (Group Master Key) — 256 bits:
GTK = PRF-128(GMK, "Group key expansion", AA || GNonce)Key Lifetime Considerations:
| Key | Typical Lifetime | Rotation Trigger |
|---|---|---|
| PMK | Until password change | Password change, certificate expiry |
| PTK | Until reassociation | Client roaming, explicit reauth |
| GTK | Hours (configurable) | Timer, client departure, AP policy |
Short GTK lifetimes limit the impact of insider attacks (any client knowing GTK can decrypt broadcast traffic).
TKIP uses 512-bit PTK (includes separate MIC keys). CCMP uses 384-bit PTK (CBC-MAC uses the same TK as encryption). This is why mixed mode access points negotiate cipher suites—the PTK size differs based on the selected protocol.
802.11i defines the Robust Security Network (RSN) framework that encompasses the complete security architecture:
RSN Information Element (RSN IE):
Access points advertise their security capabilities in beacon frames via the RSN IE. This includes:
RSN IE Structure:
├── Element ID (0x30 = RSN)
├── Length
├── Version (1 for 802.11i)
├── Group Cipher Suite (broadcast encryption)
├── Pairwise Cipher Suite Count
├── Pairwise Cipher Suites (unicast encryption options)
├── AKM Suite Count
├── AKM Suites (authentication methods)
├── RSN Capabilities (optional features)
├── PMKID Count (for fast BSS transition)
└── PMKIDs (cached PMK identifiers)
Cipher Suite Selectors:
Authentication and Key Management (AKM) Selectors:
00-0F-AC:01 — 802.1X (EAP with RADIUS)
00-0F-AC:02 — PSK (Pre-Shared Key)
00-0F-AC:03 — FT over 802.1X (Fast BSS Transition)
00-0F-AC:04 — FT over PSK
00-0F-AC:05 — 802.1X with SHA-256
00-0F-AC:06 — PSK with SHA-256
00-0F-AC:08 — SAE (WPA3-Personal)
00-0F-AC:12 — OWE (Opportunistic Wireless Encryption)
RSN Association Process:
Mixed Mode Operation:
Access points can advertise multiple cipher suites for backward compatibility:
Note: Using TKIP as group cipher when CCMP is available for pairwise slightly reduces broadcast security.
When an AP allows both TKIP and CCMP clients, it must transmit broadcast with the weakest cipher (TKIP). A single TKIP client therefore degrades security for all clients. Modern best practice: CCMP-only configuration.
In October 2017, researcher Mathy Vanhoef disclosed KRACK (Key Reinstallation Attacks)—a class of vulnerabilities affecting the implementation of 802.11i's 4-way handshake. KRACK was significant not because it broke WPA2's cryptography, but because it exposed dangerous edge cases in protocol state machines.
The Vulnerability:
During the 4-way handshake:
The 802.11i specification didn't clearly define the behavior. Many implementations:
Why Nonce Reuse Breaks CCMP:
CCMP's counter mode security relies on unique (Key, Nonce) pairs. If the same TK is used with the same PN:
C₁ = P₁ ⊕ AES(TK, Nonce)
C₂ = P₂ ⊕ AES(TK, Nonce)
C₁ ⊕ C₂ = P₁ ⊕ P₂ (keystream cancels)
The attacker learns the XOR of plaintexts. With partial knowledge of P₁ (e.g., HTTP headers are predictable), P₂ can be recovered.
KRACK Attack Procedure:
| Platform | Severity | Reason |
|---|---|---|
| Linux/Android (wpa_supplicant 2.4+) | Critical | Reinstalled all-zero encryption key |
| Windows | Moderate | Rejected retransmitted Message 3 (by accident) |
| iOS/macOS | Moderate | Limited key reinstallation scenarios |
| Access Points (4-way) | Low | Most APs don't accept retransmitted Message 4 |
| Access Points (GTK) | Variable | Group key handshake similarly affected |
KRACK demonstrated that protocol specifications must define behavior for all state transitions, including error cases and retransmissions. The fix was simple (ignore retransmitted handshake messages after key installation), but required patching millions of devices. WPA3's SAE handshake explicitly addresses these state machine issues.
Despite WPA3's availability, WPA2 remains widely deployed and secure when properly configured. The following practices maximize WPA2 security:
PSK Configuration:
Passphrase Entropy Calculation:
Random lowercase + digits (36 chars): log₂(36) = 5.17 bits per character
12 characters: ~62 bits (weak)
20 characters: ~103 bits (strong)
30 characters: ~155 bits (excellent)
Random printable ASCII (95 chars): log₂(95) = 6.57 bits per character
12 characters: ~79 bits (moderate)
20 characters: ~131 bits (very strong)
Attack Time Estimates (1 billion guesses/second):
Aim for 80+ bits of entropy for long-term security.
Network Configuration:
Disabling PMF leaves networks vulnerable to deauthentication attacks that force handshake recapture. WPS PIN mode can be brute-forced in hours. TKIP compatibility mode degrades security for all clients. Management interface exposed to wireless allows router compromise.
WPA2 represents the mature, production-grade wireless security standard that has protected networks for nearly two decades. Its design demonstrates how proper cryptographic construction creates lasting security.
WPA2's Place in History:
WPA2 succeeded because it used well-understood cryptographic primitives (AES, CBC-MAC) in a straightforward construction (CCM). Unlike WEP, which tried to be clever and failed, WPA2 followed established cryptographic engineering principles.
The few issues discovered (KRACK, Hole196) were implementation and edge-case problems, not fundamental cryptographic breaks. This validates the design philosophy of using standardized, well-analyzed components.
What's Next:
The next page covers WPA3, the latest generation of WiFi security. WPA3 addresses WPA2's remaining weaknesses: dictionary attacks via SAE, forward secrecy via ephemeral key exchange, and stronger protection for open networks via OWE.
You now understand WPA2's architecture: AES-CCMP for authenticated encryption, the complete key hierarchy from PMK to per-packet keys, RSN framework for capability negotiation, and the KRACK vulnerability that exposed implementation edge cases. WPA2 remains secure for most deployments with proper passphrase strength and configuration.