Link Layer Security

Network Security: Link Layer Security

3.1 ARP Cache Poisoning

Link Layer Addressing Fundamentals

Two Types of Addresses:

  • IP Address (32-bit): Network-layer address used for routing packets to destination networks across the internet
  • MAC Address (48-bit): Link-layer (physical/Ethernet) address used to identify source and destination on the same local network
    • Most LANs use globally unique 48-bit addresses
    • Some LANs use configurable addresses (function of IP address)
    • Special broadcast address exists for sending to all nodes on the network

Address Resolution Protocol (ARP)

Purpose: ARP resolves IP addresses to MAC addresses on a local area network (LAN). When a device knows another device’s IP address but needs to communicate at the link layer, it must discover the corresponding MAC address.
ARP Table Components:

Every IP node (host or router) on a LAN maintains an ARP table containing:

  • IP address: The network layer address
  • MAC address: The corresponding link layer address
  • TTL (Time To Live): Expiration time for the mapping (typically 20 minutes)

ARP Protocol Mechanism (RFC 826)

Scenario: Host A wants to send a datagram to Host C. A knows C’s IP address but not C’s MAC address, and C is not in A’s ARP table.

  1. ARP Request (Broadcast):
    • A broadcasts an ARP query packet to all machines on the subnet
    • Contains: Sender IP (A’s IP), Sender MAC (A’s MAC), Target IP (C’s IP)
    • All machines on the subnet receive this broadcast
  2. ARP Response (Unicast):
    • C recognizes its IP address in the request
    • C replies directly to A with its MAC address
    • Response is sent as unicast to A’s MAC address
  3. Learning and Caching:
    • A caches the <IP, MAC> pair in its ARP table
    • C learns A’s IP-MAC mapping from the request
    • Other hosts (B, D) typically ignore the exchange but could learn from it
    • Entries are “soft state” – discarded after period of inactivity

Sniffing on Shared Media

Passive Eavesdropping (Sniffing):

Sniffing is trivially easy on shared media networks:

  • Shared Media Examples:
    • Hub-based Ethernet networks (all traffic visible to all ports)
    • Wireless networks (WiFi – radio signals broadcast to all nearby devices)
    • Same collision domain on Ethernet cable
  • Attack Method:
    • Promiscuous Mode: Network adapters can be configured to capture ALL packets, not just those addressed to them
    • No special hardware required – available on most network adapters
    • Wireless makes this even easier – “war driving” with long-range WiFi antennas
  • Access Requirements:
    • Physical access to shared media (same cable/hub)
    • Within range of wireless access point
    • Located in same collision domain as sender/recipient

ARP Poisoning Attack (ARP Spoofing)

Attack Overview:

Attackers on isolated (switched) network segments can use ARP poisoning to intercept traffic between two hosts, positioning themselves as a Man-in-the-Middle (MITM).

Attack Scenario:

  1. Initial State: Alice wants to communicate with Bob on a switched network. Eve (attacker) is also on the network but on an isolated segment (switch prevents direct sniffing).
  2. ARP Request: Alice broadcasts an ARP request asking “Who has Bob’s IP? Tell me your MAC address.”
  3. Malicious Response: Eve responds to Alice’s ARP request claiming to have Bob’s IP address, but provides Eve’s MAC address instead of Bob’s actual MAC address.
  4. MITM Position:
    • Alice’s ARP table now maps Bob’s IP to Eve’s MAC address
    • All traffic Alice sends to Bob actually goes to Eve first
    • Eve can inspect, modify, or log the traffic
    • Eve forwards packets to Bob to avoid detection (becoming a transparent MITM)

ARP Poisoning Methods

Method Description Effectiveness
Spoofed ARP Request Send ARP request with false sender IP/MAC mapping. Some hosts will update their tables based on ARP requests even without querying. Works on hosts that cache from requests
Spoofed ARP Response (Racing) Monitor network for legitimate ARP requests, then race to respond with attacker’s MAC address before legitimate host responds. Improved by loading destination’s segment/host to slow legitimate response
Unsolicited ARP Response Send ARP responses without any corresponding request. Some hosts will update their ARP tables even without making a request (gratuitous ARP). Works on hosts that accept gratuitous ARP

Defenses Against ARP Poisoning

Defense Mechanism Description Limitations
Static ARP Tables Manually configure and maintain IP-to-MAC mappings, preventing dynamic updates from ARP messages
  • Poor scalability – difficult to manage in large networks
  • High churn – when machines move or NICs are replaced
  • Administrative overhead
Ignore Unsolicited Mappings Configure systems to only accept ARP responses they specifically requested, ignoring gratuitous ARP and request-based updates Reduces attack surface but doesn’t eliminate racing attacks
Network Monitoring Deploy monitoring systems to detect ARP poisoning packets and suspicious port activity (multiple MAC addresses claiming same IP) Reactive rather than preventive; requires constant monitoring and rapid response
Network Segmentation with Routers Use routers instead of switches to separate network segments, limiting ARP broadcast domains More expensive; may impact performance; attacker could shift to DNS poisoning
Security Principle Violation: The question “What security principle are we violating here?” refers to the lack of authentication and integrity checking in ARP. The protocol violates:

  • Principle of Complete Mediation: ARP accepts responses without verifying the sender’s authority
  • Principle of Least Privilege: Any host can claim any IP-MAC mapping
  • Principle of Fail-Safe Defaults: ARP trusts by default rather than verifying

3.2 Wireless Security Basics

Wireless Networking Overview

802.11 Standards: The IEEE 802.11 family of standards (802.11b/a/g/n/ac/ax) has become the dominant technology for wireless local-area networks. These standards define protocols for wireless communication at the physical and data link layers.

Network Architecture Models

Architecture Description Use Cases
Infrastructure Mode (Base Station Approach)
  • Wireless hosts communicate through an Access Point (AP)
  • AP serves as base station connecting wireless and wired networks
  • BSS (Basic Service Set): “Cell” containing wireless hosts and one AP
  • APs are connected to wired infrastructure
  • Home networks
  • Corporate networks
  • Campus WiFi
  • Public hotspots
Ad Hoc Mode
  • No Access Point – peer-to-peer communication
  • Wireless hosts communicate directly with each other
  • May require multi-hop routing (A→X→Y→Z→B)
  • Decentralized network topology
  • Conference room meetings
  • Vehicle-to-vehicle communication
  • Personal device interconnection
  • Military/battlefield scenarios
  • Emergency response networks

Joining a Wireless Network (BSS)

Discovery Methods:

Method 1: Passive Scanning (Beacon Frames)

  • APs broadcast beacon frames every ~100ms (configurable)
  • Beacon Contents (~50 bytes):
    • Timestamp (for network synchronization)
    • Beacon Interval
    • Capability Information
    • SSID (Service Set Identifier – network name)
    • Supported data rates
    • Parameter sets (channel info, etc.)
  • Clients listen passively for beacons to discover networks

Method 2: Active Scanning (Probe Request/Response)

  • Client broadcasts Probe Request frames
  • APs respond with Probe Response containing network information
  • Faster than passive scanning

Authentication and Association:

  1. Node selects network based on beacon/probe information
  2. Node authenticates itself to the AP using:
    • Open System: No actual authentication, just SSID verification
    • Shared Key: WEP/WPA/WPA2 keys for cryptographic authentication
  3. Upon successful authentication, node associates with AP and can begin communication

The Fundamental Security Problem

Wireless Communication = Radio Communication

The fundamental challenge with wireless networking security:

  • Broadcast Nature: Radio signals propagate in all directions within range
  • No Physical Boundary: Unlike wired networks with defined physical access points
  • Anyone with a Radio Can:
    • Eavesdrop: Passively intercept all wireless transmissions within range
    • Inject Traffic: Actively transmit packets on the wireless network
    • Jam Communications: Interfere with legitimate transmissions

Attacker Advantages:

  • Long-range directional antennas can intercept from significant distances
  • No physical intrusion required – attacks possible from parking lots, adjacent buildings, etc.
  • “War driving” – mobile attackers scanning for vulnerable networks

Basic Wireless Attacks

Attack Types:

Attack Description Difficulty
Passive Sniffing Capturing and analyzing wireless traffic within range. Trivial with appropriate wireless adapter and software. Very Easy
Active Jamming Transmitting radio interference to disrupt legitimate communications. Denial-of-service at physical layer. Hard to Defend
Rogue Access Points Attacker sets up fake AP with stronger signal or same SSID. Victims connect to attacker’s AP, giving complete MITM position. Moderate

Basic Security Measures (Pre-WPA)

Inadequate Security Mechanisms

Mechanism Implementation Security Level Bypass Method
Open System Requires correct SSID to associate with AP Minimal SSIDs transmitted in clear text, easily observable
MAC Whitelisting AP maintains list of allowed MAC addresses; only those MACs can associate Low
  • Sniff traffic to identify legitimate MAC addresses
  • Spoof MAC address to match whitelist entry
  • Poor scalability for home users
SSID Hiding (Network Cloaking) Disable SSID broadcast in beacon frames Very Low
  • SSIDs still transmitted during probe requests/responses
  • SSIDs visible in association/reassociation frames
  • Default SSIDs predictable (LinkSYS, NETGEAR, D-Link)
  • Only effective against completely casual users
WEP (Wired Equivalent Privacy) Link-layer encryption with shared cryptographic key Broken Multiple cryptographic weaknesses (see Section 3.3)

WEP (Wired Equivalent Privacy) – Initial Design

WEP Goals:

Industry solution designed to provide security equivalent to wired networks:

  • Access Control: Prevent unauthorized network access via authentication
  • Confidentiality: Encrypt data to prevent eavesdropping
  • Data Integrity: Detect and prevent injection of spoofed packets
  • Simplicity: Use shared key among all devices on the network

Design Philosophy (from WEP specification):
“Security relies on the difficulty of discovering the secret key through a brute-force attack”

Note: This assumption proved to be fundamentally flawed – security should not rely solely on key secrecy.

WEP Components

Component Purpose Implementation
Shared Key Symmetric encryption key known to all authorized devices 40-bit or 104-bit key (plus 24-bit IV = 64-bit or 128-bit total)
WEP Authentication Verify that connecting device knows the shared key Challenge-response protocol using RC4 encryption
WEP Data Encapsulation Encrypt data packets and provide integrity checking RC4 stream cipher with CRC-32 integrity check

3.3 WEP Weeps (WEP Vulnerabilities)

WEP Shared Key Authentication

Authentication Process:

  1. Authentication Request: Client (station) sends authentication request to AP
  2. Challenge: AP responds with 128-byte challenge text (nonce) sent in plaintext
  3. Response: Client encrypts the challenge using RC4 with shared WEP key and sends encrypted challenge back to AP
  4. Verification: AP decrypts response using shared key:
    • If decrypted nonce matches original challenge → Authentication succeeds
    • If decrypted nonce doesn’t match → Authentication fails

Shared Secret Distribution: The WEP key must be distributed out-of-band (manually configured on all devices) – no key exchange protocol defined in WEP.

WEP Data Encryption Mechanism

Encryption Process:

  1. Integrity Checksum: Compute CRC-32 checksum c(M) of original message M
  2. Plaintext Construction: Create plaintext P = <M, c(M)> (message concatenated with checksum)
  3. Keystream Generation:
    • Concatenate 24-bit Initialization Vector (IV) with WEP key K
    • Generate keystream using RC4: RC4(IV, K)
    • IV is chosen for each packet (method varies by implementation)
  4. Encryption: XOR plaintext with keystream:
    C = P ⊕ RC4(IV, K)
  5. Transmission: Transmit both IV (in clear) and ciphertext C

Decryption Process:

  1. Extract IV: Read IV from packet header (transmitted in plaintext)
  2. Regenerate Keystream: Use extracted IV and shared key K to regenerate keystream: RC4(IV, K)
  3. Decrypt: XOR ciphertext with keystream:
    P’ = C ⊕ RC4(IV, K) = (P ⊕ RC4(IV,K)) ⊕ RC4(IV,K) = P
  4. Integrity Check:
    • Split P’ into message M’ and checksum c’
    • Recompute checksum c(M’) and compare with c’
    • If c(M’) = c’ → Integrity check passes
    • If c(M’) ≠ c’ → Packet rejected

WEP Key Structure

Key Type IV Size Key Size Total Notes
Original WEP (40-bit) 24 bits 40 bits 64 bits
  • Limited by 1990s US export restrictions
  • Extremely vulnerable to brute force
  • Often marketed as “64-bit WEP”
Extended WEP (104-bit) 24 bits 104 bits 128 bits
  • Introduced after export restrictions lifted (1998)
  • Misleadingly marketed as “128-bit WEP”
  • Still vulnerable due to protocol flaws
Critical Context: 802.11 was drafted when US regulations limited cryptographic key export to 40 bits. Even though this restriction was lifted in 1998, the standard was already finalized with 40-bit keys. Vendors later extended to 104-bit keys, but retained the problematic 24-bit IV design.

WEP Attack 1: Keystream Reuse

The Problem: IV Reuse

WEP allows Initialization Vectors (IVs) to be reused across different frames, and many implementations handle IVs poorly:

  • Fixed IV: Some cards set IV=0 for all packets (802.11 compliant!)
  • Reset on Reboot: Some cards reinitialize IV to 0 each time device powers up
  • IV Wraparound: 24-bit IV space = only 2^24 = 16,777,216 possible values
    • At 5 Mbps with 1500-byte packets: IV wraps in less than 12 hours
    • Birthday paradox: expect IV collision within ~5000 packets (minutes of traffic)

Attack Mechanism:

When two packets use the same IV with the same key:

C₁ = P₁ ⊕ RC4(IV, K)
C₂ = P₂ ⊕ RC4(IV, K)
Then: C₁ ⊕ C₂ = P₁ ⊕ P₂

Exploitation:

  1. XOR Ciphertexts: C₁ ⊕ C₂ = P₁ ⊕ P₂ (XOR of two plaintexts)
  2. Known Plaintext Attack: If attacker knows or can guess P₁, can solve for P₂
  3. Cryptanalysis: Even without known plaintext, statistical analysis of P₁ ⊕ P₂ can reveal both plaintexts using known techniques

WEP Attack 2: Decryption Dictionary

Building a Decryption Dictionary:

Goal: Pre-compute keystreams for all possible IVs to enable instant decryption of any intercepted packet.

Method:

  1. Obtain Known Plaintext-Ciphertext Pairs:
    • Wait for predictable traffic (DHCP, ARP, DNS queries with known structure)
    • Inject known packets from outside the network
    • Observe broadcast traffic encrypted and sent in clear
  2. Extract Keystream: For known pair (P, C) with IV:
    • RC4(IV, K) = P ⊕ C
    • Now have the keystream for this specific IV
  3. Store in Dictionary: Save <IV, RC4(IV, K)> pair in database
  4. Decrypt Future Packets: When intercepting new packet with known IV:
    • Look up keystream for that IV in dictionary
    • P = C ⊕ RC4(IV, K)
    • Instant decryption without key recovery

Storage Requirements:

  • 2^24 possible IVs = ~16.7 million entries
  • Each entry: IV (3 bytes) + keystream (1500 bytes for max Ethernet frame) ≈ 1503 bytes
  • Total storage: ~24 GB for complete dictionary
  • Practical for modern storage capacity

Comparison to Brute Force:

  • Brute forcing 40-bit key: 2^40 = ~1 trillion attempts (feasible but time-consuming)
  • Brute forcing 104-bit key: 2^104 operations (computationally infeasible)
  • Dictionary attack: Works equally well against both key sizes!

WEP Attack 3: Message Modification

The Integrity Problem: CRC is Linear

WEP uses CRC-32 for integrity checking, but CRC is a linear function over the Galois Field GF(2), where addition is XOR:

CRC Homomorphic Property:
c(x ⊕ y) = c(x) ⊕ c(y)

This mathematical property allows attackers to modify ciphertext in predictable ways without knowing the key or plaintext!

Attack Mechanism:

  1. Intercepted Ciphertext:
    C = RC4(IV, K) ⊕ (M, c(M))
  2. Desired Modification:
    Attacker wants to change message from M to M’ = M ⊕ Δ
  3. Compute Modified Ciphertext:
    C’ = C ⊕ (Δ, c(Δ))
  4. Verification (this is why it works):
    C’ = C ⊕ (Δ, c(Δ))
       = RC4(IV, K) ⊕ (M, c(M)) ⊕ (Δ, c(Δ))
       = RC4(IV, K) ⊕ (M ⊕ Δ, c(M) ⊕ c(Δ))
       = RC4(IV, K) ⊕ (M’, c(M ⊕ Δ))    ← CRC linearity
       = RC4(IV, K) ⊕ (M’, c(M’))       ← CRC linearity again
  5. Result: Modified ciphertext C’ will decrypt to M’ and pass the integrity check!

Attack Power:

  • No key required – attacker doesn’t need to know K
  • No plaintext required – attacker doesn’t need to know M
  • Blind modification – can modify encrypted messages in predictable ways
  • No detection – modified packets pass WEP integrity check

Example Attack: Modify encrypted IP packet to change destination address without knowing packet contents or key.

WEP Attack 4: Traffic Injection

Unauthorized Packet Injection:

If attacker knows one plaintext-ciphertext pair, can inject arbitrary traffic:

Given:

  • Known plaintext M
  • Corresponding ciphertext C
  • IV value v used for that packet
  • Relationship: C = RC4(v, k) ⊕ (M, c(M))

Attack Steps:

  1. Extract Keystream:
    RC4(v, k) = C ⊕ (M, c(M))
    Attacker now knows the keystream for IV=v
  2. Create New Message: Craft arbitrary message M’ with checksum c(M’)
  3. Encrypt New Message:
    C’ = RC4(v, k) ⊕ (M’, c(M’))
  4. Inject Packet: Send packet with IV=v and ciphertext C’
    • AP will decrypt successfully
    • Integrity check will pass
    • Attacker’s message accepted as legitimate traffic

Note on IV Reuse: Attacker is reusing the same IV (v) for injection, but WEP specification allows this! The standard doesn’t prohibit IV reuse across different packets.

Impact: Complete bypass of WEP access control – attacker can inject arbitrary frames without knowing WEP key.

WEP Attack 5: Authentication Spoofing

Exploiting Challenge-Response Authentication:

WEP’s shared key authentication is vulnerable to replay attacks:

  1. Attacker Observes Legitimate Authentication:
    • Challenge (nonce in plaintext): N
    • Response (nonce encrypted): RC4(IV, K) ⊕ N
  2. Extract Keystream:
    RC4(IV, K) = (RC4(IV, K) ⊕ N) ⊕ N
    Attacker knows both challenge and response, can compute keystream
  3. Authenticate as Legitimate User:
    • Send authentication request to AP
    • Receive new challenge N’
    • Encrypt N’ using captured keystream: RC4(IV, K) ⊕ N’
    • Send response with same IV as captured exchange
  4. Result: Authentication succeeds without knowing WEP key!

Fundamental Flaw: Authentication should prove knowledge of secret key, but due to keystream reuse, observing one successful authentication allows unlimited future authentications.

WEP Attack 6: IP Redirection

Using AP as Decryption Oracle:

Attacker can trick the AP into decrypting arbitrary ciphertext:

  1. Intercept Encrypted Packet: Capture packet with ciphertext C containing unknown message M
  2. Modify Destination Address: Use message modification attack (CRC linearity) to change encrypted IP destination to attacker’s IP address:
    • Compute Δ such that original_dest ⊕ Δ = attacker_IP
    • Modify C to C’ = C ⊕ (Δ, c(Δ))
    • C’ now decrypts to M’ with destination = attacker_IP
  3. Inject Modified Packet: Send C’ back into network
  4. AP Decrypts and Forwards: AP decrypts packet, passes integrity check, and forwards to attacker’s IP
  5. Attacker Receives Plaintext: Packet arrives at attacker’s machine in plaintext form

Result: Attacker obtains decryption of any intercepted packet without knowing the WEP key.

WEP Attack 7: Ultimate Break – Key Recovery

Fluhrer-Mantin-Shamir (FMS) Attack (2001):

The most devastating attack: recovers the actual WEP key from intercepted traffic.

Attack Characteristics:

  • Type: Passive cryptanalytic attack on RC4 key scheduling algorithm
  • Target: Exploits relationship between RC4 output and key
  • Requirement: Specific “weak IVs” that leak key information
  • Success Rate: ~15% of all IVs are “weak”

Attack Process:

  1. Capture Packets: Collect large number of encrypted packets (4-6 million packets typically required)
  2. Identify Weak IVs: Filter packets to find those using weak IVs (specific patterns in first few bytes)
  3. Statistical Analysis: Use weak IV packets to derive key bytes:
    • Each weak IV packet votes for most likely value of specific key byte
    • Statistical analysis resolves key one byte at a time
    • First byte recovered first, then second byte, etc.
  4. Key Reconstruction: After sufficient packets, recover complete WEP key with high probability

Practical Implementation (AT&T Labs Tech Report):

Metric Value
Development Time < 2 hours of coding
Packets Required ~4-6 million packets (~40-bit key)
~5-7 million packets (~104-bit key)
Attack Duration Few hours of passive packet capture on busy network
Hardware Required Off-the-shelf wireless adapter and laptop
Success Rate 256 probable cases resolved to single key
Key Recovery Full WEP key recovered (40-bit or 104-bit)

Attack Acceleration:

  • Active Injection: Inject packets to force AP to generate more traffic with weak IVs
  • Packet Replay: Replay captured ARP requests to stimulate responses
  • Tools Available: Aircrack-ng suite automates entire attack
  • Modern Implementation: Can crack WEP in minutes on moderately busy network

WEP Security Failure Timeline

Date Event
1997 802.11 WEP standard released – marketed as “Wired Equivalent Privacy”
Mar 2000 Simon, Aboba, Moore publish early warnings about WEP weaknesses
Oct 2000 Jesse Walker: “Unsafe at any key size” – identifies fundamental design flaws
Jan 2001 Borisov, Goldberg, Wagner: Seven serious attacks on WEP
Comprehensive breakdown of WEP security published
Mar 2001 Arbaugh: “Your 802.11 network has no clothes” – confirms WEP is fundamentally broken
May 2001 Arbaugh: Additional attacks discovered
Jun 2001 Newsham: Dictionary attacks on WEP keys demonstrated
Aug 2001 Fluhrer, Mantin, Shamir: Efficient passive attack on RC4 in WEP
Complete key recovery from passive traffic capture
Feb 2002 Arbaugh, Mishra: Additional attack vectors documented
2003 WPA introduced as interim replacement for WEP
2004 WPA2 (802.11i) ratified as long-term solution

Lesson Learned: WEP’s failures resulted from:

  • Relying on security through obscurity (key secrecy alone)
  • Using inappropriate cryptographic primitives (CRC for integrity)
  • Poor implementation choices (small IV space, IV reuse allowed)
  • Lack of cryptographic review before standardization
  • Export restrictions limiting key space during design phase

3.4 WPA & WPA2

Wi-Fi Protected Access (WPA) – 2003

WPA as Emergency Response:

After WEP was comprehensively broken, the Wi-Fi Alliance needed an immediate solution that could:

  • Deploy Quickly: Work with existing WEP hardware (firmware upgrades only)
  • Fix Critical Flaws: Address WEP’s most serious vulnerabilities
  • Maintain Compatibility: Allow gradual migration from WEP
  • Bridge to Future: Serve as interim solution until WPA2 (802.11i) completed

Design Philosophy: “Good enough now” rather than “perfect later” – prioritized rapid deployment over ideal solution.

WPA Security Enhancements

TKIP (Temporal Key Integrity Protocol)

Key Improvements Over WEP:

Feature WEP WPA/TKIP Improvement
IV Size 24 bits 48 bits Extended IV prevents wraparound: 2^48 = 281 trillion values
Key Size 40 or 104 bits 128 bits Larger key space resists brute force
Key Management Static shared key Dynamic per-packet keys
  • Temporal keys automatically generated and rotated
  • Per-packet key mixing prevents reuse attacks
  • Unique keys for each session and direction
Integrity Check CRC-32 (linear, unkeyed) MIC (Message Integrity Check)
  • Keyed cryptographic hash (Michael algorithm)
  • Prevents message modification attacks
  • Not vulnerable to CRC linearity
Replay Protection None Sequence counter Prevents packet replay attacks

Per-Packet Key Construction

TKIP Key Hierarchy:

  1. Pair-wise Master Key (PMK): Derived from authentication (PSK or 802.1X)
  2. Pair-wise Transient Key (PTK): Session key derived from PMK, client MAC, AP MAC, and nonces
  3. Per-Packet Key: Unique encryption key for each packet generated by mixing:
    • PTK
    • Transmitter MAC address
    • 48-bit packet sequence number (TKIP Sequence Counter)
  4. Result: Even if attacker captures keystream for one packet, it’s useless for other packets

Key Rotation:

  • Temporal keys automatically updated periodically
  • Prevents long-term key compromise from revealing all traffic
  • Rotation frequency configurable (typical: 10,000 packets or 1 hour)

Authentication and Key Management

EAP (Extensible Authentication Protocol):

WPA introduces proper authentication framework based on EAP:

  • Flexibility: Framework supports multiple authentication methods
  • Credential Types:
    • Digital certificates (most secure)
    • Username and password (most common)
    • Secure ID tokens
    • Biometric credentials
    • Pre-shared keys (WPA-Personal)
  • Mutual Authentication: Both client and authentication server verify each other’s identity
  • Key Distribution: Integrates with existing key distribution methods:
    • Kerberos
    • RADIUS
    • Key Distribution Centers (KDC)
    • Diameter

WPA Authentication Process

802.1X/EAP Authentication Flow:

  1. Association: Client associates with AP (link-layer connection established)
  2. EAP Identity Request: AP requests client identity
  3. EAP Identity Response: Client provides identity (e.g., username@domain.xyz)
  4. RADIUS Access Request: AP forwards identity to Authentication Server (often RADIUS server)
  5. EAP Method Negotiation:
    • Server proposes authentication method (EAP-TLS, EAP-TTLS, PEAP, etc.)
    • Client and server exchange authentication data
    • Multiple request-response exchanges possible depending on method
  6. Authentication Server Decision:
    • If successful: Generate encryption keys (PMK) and session parameters
    • If failed: Reject access
  7. EAP-Success: AP notifies client of successful authentication
  8. Key Distribution: Encryption keys distributed securely to client and AP
  9. Data Communication: Encrypted communication begins using derived keys

Session Key Distribution (Simplified)

Three-Party Key Distribution:

Participants:

  • Client (C): Has long-term key K_c shared with Authentication Server
  • Access Point (AP): Has long-term key K_s shared with Authentication Server
  • Authentication Server (AS): Knows both K_c and K_s

Goal: Establish session key K_cs shared between Client and AP

Protocol:

  1. Client Request:
    C → AS: {C, AP, nonce}
    Client requests session with AP, includes fresh nonce for replay protection
  2. Server Response to Client:
    AS → C: {K_cs, AP, nonce}_{K_c}
    Server encrypts session key K_cs and request info using client’s long-term key
  3. Server Response to AP:
    AS → AP: {K_cs, C, nonce}_{K_s}
    Server encrypts session key K_cs and client info using AP’s long-term key
  4. Secure Communication:
    C ↔ AP: {data}_{K_cs}
    Client and AP communicate using session key K_cs

Security Properties:

  • Confidentiality: Long-term keys K_c and K_s never transmitted (used only once per session)
  • Key Freshness: New session key K_cs generated for each session
  • Forward Secrecy: Compromise of long-term key doesn’t reveal past session keys
  • Mutual Authentication: Both parties can decrypt messages only if they know correct long-term keys

WPA vs WPA2

Feature WPA (2003) WPA2 (2004)
Standard Wi-Fi Alliance interim solution IEEE 802.11i (full standard)
Encryption TKIP with RC4 stream cipher CCMP with AES block cipher
Encryption Mode RC4 stream cipher (improved from WEP) AES-CTR (Counter Mode) for encryption
Integrity Michael algorithm (MIC) CBC-MAC (Cipher Block Chaining Message Authentication Code)
Combined Mode Separate encryption and integrity CCMP (Counter Mode with CBC-MAC Protocol) – combined AES mode
Key Size 128-bit 128-bit AES
Hardware Requirement WEP hardware compatible (firmware upgrade) Requires new hardware (AES acceleration)
Security Level Significant improvement over WEP, but still some vulnerabilities Strong security (no practical attacks when properly configured)
Status Deprecated (legacy support only) Current standard – mandatory for Wi-Fi Alliance certification since 2006

WPA2 Technical Details

CCMP (Counter Mode with CBC-MAC Protocol):

WPA2 uses AES-CCMP, which provides both confidentiality and authenticity in a single cryptographic operation:

  • AES-CTR (Counter Mode):
    • Block cipher operated as stream cipher
    • Counter value incremented for each block
    • Provides confidentiality (encryption)
    • Each packet has unique counter value preventing reuse attacks
  • CBC-MAC (Cipher Block Chaining Message Authentication Code):
    • Cryptographically secure integrity check
    • Keyed hash function using AES
    • Prevents message modification attacks
    • Not vulnerable to CRC linearity like WEP
  • Combined Operation:
    • Single pass through data (efficient)
    • Authenticated encryption (encryption + integrity in one)
    • Strong security proofs in cryptographic literature

WPA/WPA2 Deployment Modes

Mode Authentication Use Case Security Level
WPA2-Personal
(WPA2-PSK)
  • Pre-Shared Key (password)
  • 8-63 character passphrase
  • Same password shared by all users
  • Derived using PBKDF2 with SSID as salt
  • Home networks
  • Small businesses
  • Simple deployment
Good – if strong passphrase used

  • Vulnerable to password cracking
  • No per-user accountability
WPA2-Enterprise
(WPA2-802.1X)
  • 802.1X with EAP
  • Individual user credentials
  • RADIUS/Authentication Server
  • Certificates or username/password
  • Corporate networks
  • Universities (eduroam)
  • Large deployments
Excellent

  • Individual authentication
  • Centralized management
  • Per-user keys
  • Audit trails

WPA2 Vulnerabilities

Despite strong cryptography, WPA2 has some attack vectors:

1. Password-Based Attacks (WPA2-Personal)

PBKDF2 Key Derivation:

  • Function: PBKDF2-SHA1 with 4096 iterations
  • Inputs: Passphrase + SSID (as salt) → 256-bit PMK
  • Purpose: Slow down brute force attacks

Attack Methods:

  • Offline Dictionary Attack:
    • Capture 4-way handshake during client authentication
    • Handshake contains encrypted data verifiable with correct password
    • Test passwords offline without network access
    • Tools: Aircrack-ng, Hashcat, John the Ripper
  • Acceleration:
    • GPU acceleration: Millions of passwords per second
    • Rainbow tables: Pre-computed hashes for common SSIDs
    • Cloud computing: Massive parallel cracking
  • Mitigation: Use strong, random passphrases (20+ characters)

2. KRACK Attack (2017)

Key Reinstallation Attack:

  • Exploits vulnerability in 4-way handshake implementation
  • Forces reuse of encryption keys (nonce reuse)
  • Allows packet decryption and injection
  • Fix: Patched in all modern devices (software update)

3. Weak Passphrases

Common Weaknesses:

  • Short passwords (< 8 characters – actually prohibited, but barely)
  • Dictionary words
  • Common patterns (Password123, Admin2024)
  • Default passwords (manufacturer-provided)

4. Rogue AP / Evil Twin

Despite encryption, WPA2 doesn’t prevent:

  • Attacker creating fake AP with same SSID
  • Stronger signal attracts victims
  • User connects, provides credentials to attacker
  • Mitigation: Certificate validation (WPA2-Enterprise)

Enterprise Wireless: eduroam Example

eduroam (education roaming):

International wireless roaming service for education and research community demonstrating WPA2-Enterprise at scale.

Architecture:

  1. Client Device: User’s laptop/phone with eduroam credentials
  2. Local Access Point: Campus AP user connects to
  3. Local RADIUS Server: University’s authentication server
  4. Hierarchy of RADIUS Servers:
    • US RADIUS federation servers
    • Global RADIUS infrastructure
  5. Home RADIUS Server: User’s home institution authentication server

Authentication Flow:

  1. Association: Client associates with local campus AP
  2. 802.1X/EAP Start: AP initiates EAP authentication
  3. Identity Request/Response: Client provides identity (username@institution.edu)
  4. RADIUS Proxy Chain:
    • Local RADIUS forwards to US RADIUS
    • US RADIUS forwards to Global RADIUS
    • Global RADIUS routes to home institution’s RADIUS
  5. TLS Tunnel Establishment: Encrypted tunnel created between client and home RADIUS for credential verification
  6. Credential Exchange: Username/password or certificate verification occurs in encrypted tunnel
  7. Success/Failure Propagated: Result travels back through RADIUS hierarchy
  8. Key Distribution: Session keys distributed to client and local AP
  9. Encrypted Communication: User accesses network with full encryption

Security Features:

  • Individual Authentication: Each user has unique credentials
  • Mutual Authentication: Both user and network verified via certificates
  • Encrypted Credentials: Passwords never sent in clear (TLS tunnel)
  • Per-User Keys: Each session gets unique encryption keys
  • Roaming Security: Strong security maintained across institutions

Beyond WPA2: Current and Future Standards

Standard Year Key Features
WPA3-Personal 2018
  • SAE (Simultaneous Authentication of Equals) replaces PSK
  • Forward secrecy for each session
  • Protection against offline dictionary attacks
  • 128-bit encryption minimum
WPA3-Enterprise 2018
  • 192-bit security mode (optional)
  • Stronger encryption: AES-256
  • Integrity: HMAC-SHA-384
  • Key derivation: HKDF-SHA-384
Wi-Fi 6/6E (802.11ax) 2019/2021
  • WPA3 mandatory
  • Enhanced Open (OWE) for public networks
  • Improved efficiency and capacity

Other Wireless Technologies

Beyond 802.11 WiFi:

Many other wireless technologies require security considerations:

  • Cellular Networks:
    • GSM (Global System for Mobile Communications) – 2G
    • LTE (Long-Term Evolution) – 4G
    • 5G NR (New Radio)
    • Proprietary protocols with own security mechanisms
  • Satellite Communications:
    • Satellite telephony (Iridium, Globalstar)
    • Satellite internet (Starlink, OneWeb)
    • Different security models than terrestrial wireless
  • Internet of Things (IoT):
    • Zigbee, Z-Wave (home automation)
    • LoRaWAN (long-range low-power)
    • Bluetooth / BLE
    • Often proprietary with varying security levels
  • Emerging Technologies:
    • Drones and UAV communication
    • Vehicle-to-vehicle (V2V) networks
    • Cyber-Physical Systems (CPS)

Note: Most commercial wireless protocols are proprietary, making security analysis challenging. Academic and industry research continues to discover vulnerabilities in these systems.

Summary and Key Takeaways

Link Layer Security Principles

  1. ARP is Fundamentally Insecure: No authentication or integrity – trust-based protocol vulnerable to poisoning attacks
  2. Wireless Requires Strong Encryption: Broadcast nature of radio makes eavesdropping trivial without cryptographic protection
  3. WEP Was Catastrophically Broken: Multiple fundamental flaws – never use WEP under any circumstances
  4. WPA2 is Current Standard: Strong security when properly configured with strong passphrases
  5. Defense in Depth: Link layer security must be combined with higher-layer protections (TLS, VPNs, application encryption)

Practical Recommendations

Context Recommendation
Home Networks
  • Use WPA2 or WPA3
  • Strong passphrase (20+ random characters)
  • Change default SSID
  • Disable WPS (WiFi Protected Setup)
  • Regular firmware updates
Enterprise Networks
  • WPA2-Enterprise with 802.1X
  • Certificate-based authentication preferred
  • RADIUS infrastructure
  • Network segmentation
  • Monitoring and intrusion detection
Public WiFi
  • Assume network is hostile
  • Use VPN for all traffic
  • HTTPS everywhere
  • Avoid sensitive transactions
  • Verify AP legitimacy (certificate validation)