Temporal Key Integrity Protocol

TKIP (Temporal Key Integrity Protocol) was the encryption method introduced with WPA to address WEP's catastrophic security flaws while maintaining compatibility with existing 802.11 hardware. It represents a clever engineering solution to fix a broken protocol without requiring hardware replacement.

Design Goals and Constraints

Primary Objectives

Hardware Limitations

TKIP Key Hierarchy

Passphrase (8-63 characters)
    ↓ (PBKDF2 - 4096 iterations)
PMK (Pairwise Master Key) - 256 bits
    ↓ (4-way handshake)
PTK (Pairwise Transient Key) - 512 bits
    ├── KCK (Key Confirmation Key) - 128 bits
    ├── KEK (Key Encryption Key) - 128 bits  
    ├── TK (Temporal Key) - 128 bits
    └── MIC Keys - 128 bits (64 bits each direction)

TKIP Per-Packet Key Generation

The core innovation of TKIP is generating a unique encryption key for every packet:

Input Parameters

Two-Phase Key Mixing

Phase 1 Mixing (Computed every 65,536 packets)

Inputs: TK[0-15], TA[0-5], TSC[2-5]
Process:
- Mix temporal key with transmitter address
- Incorporate upper 32 bits of sequence counter
- Produces 80-bit intermediate value (TTAK)
- Cached result used for next 65,536 packets

Phase 2 Mixing (Per packet)

Inputs: TTAK (from Phase 1), TK, TSC[0-1], first 4 bytes of packet
Process:
- Mix Phase 1 result with lower TSC bits
- Include packet-specific data
- Generate final 128-bit WEP key for RC4
- Includes 24-bit IV and 104-bit key

Key Mixing Algorithm Details

Phase 1: Every 2^16 packets
TTAK[0] = TSC[1] | (TSC[0] << 8)
TTAK[1] = TSC[3] | (TSC[2] << 8)  
TTAK[2] = TSC[5] | (TSC[4] << 8)
TTAK[3] = TA[1] | (TA[0] << 8)
TTAK[4] = TA[3] | (TA[2] << 8)
// Plus complex mixing with TK and S-box operations

Phase 2: Per packet
WEPkey[0-2] = TSC[0], TSC[1], (TSC[0] | 0x20)  // IV
// Mix TTAK with remaining TK and packet data for 104-bit key

Michael Message Integrity Code (MIC)

TKIP includes Michael algorithm for integrity protection:

Michael Algorithm

MIC Calculation Process

Inputs: 64-bit MIC key, packet data, addresses
1. Append padding to make message multiple of 4 bytes
2. Process in 32-bit blocks using Michael function
3. Include source/destination addresses
4. Final 64-bit result appended to packet

Michael Function (Core)

michael_block(L, R):
    R ^= rotleft(L, 17)
    L += R
    R ^= ((L & 0xff00ff00) >> 8) | ((L & 0x00ff00ff) << 8)
    L += R
    R ^= rotleft(L, 3)
    L += R
    R ^= rotrright(L, 2)
    L += R
    return L, R

TKIP Sequence Counter (TSC)

Purpose: Prevents replay attacks and provides key diversity

Structure

Replay Protection

TKIP Frame Format

802.11 Header | IV/KeyID | Encrypted Data | MIC | ICV
    24 bytes  |  8 bytes |   variable     | 8B  | 4B

IV/KeyID Field:
TSC0 | WEPSeed1 | TSC1 |  KeyID+ExtIV | TSC2 | TSC3 | TSC4 | TSC5
 1B  |    1B    |  1B  |     1B       |  1B  |  1B  |  1B  |  1B

Field Details

Security Improvements Over WEP

Key Diversity

Replay Protection

Integrity Protection

Key Management

TKIP Vulnerabilities and Attacks

Beck-Tews Attack (2008)

Ohigashi-Morii Attack (2009)

MIC Key Recovery

Chopchop and Fragmentation Attacks

Countermeasures and Limitations

MIC Failure Countermeasures

TSC Management

Limited Lifetime

Why TKIP Was Deprecated

Fundamental Design Issues

WPA2 Advantages

Industry Transition

TKIP served as a crucial bridging technology, providing significantly improved security over WEP while allowing existing hardware to remain useful. However, its complexity and reliance on RC4 made it inherently vulnerable to sophisticated attacks, leading to its eventual replacement by the more robust AES-CCMP protocol in WPA2.