Wireless Cryptography: Securing Your Wi-Fi Network

Wireless Cryptography: Securing Your Wi-Fi Network

There’s a particular kind of humbling experience in running your first packet capture against your own home Wi-Fi network and realizing just how much is technically visible in the air around you. Understanding the cryptography that protects (or fails to protect) that traffic is one of the more satisfying rabbit holes in networking — and a genuinely important one for anyone responsible for a network.

Why Wireless Needs Cryptography That Wired Doesn’t

On a wired network, physical access is a natural barrier to eavesdropping. On wireless networks, radio signals propagate through walls and into public spaces — anyone with a compatible receiver within range can capture every frame transmitted. Cryptography is the only mechanism standing between “anyone can read this” and “only authorized parties can read this.”

The Building Blocks: Encryption Algorithms Used in Wi-Fi

RC4 (Used in WEP and WPA/TKIP) — Deprecated

RC4 is a stream cipher that XORs a pseudorandom keystream with plaintext. WEP’s fatal flaw wasn’t RC4 itself but how it used a small 24-bit Initialization Vector (IV), which meant IV collisions became statistically likely quickly on busy networks, allowing key recovery through tools like aircrack-ng within minutes.

AES-CCMP (WPA2 standard)

WPA2 replaced RC4 entirely with AES (Advanced Encryption Standard) in CCMP mode (Counter Mode with Cipher Block Chaining Message Authentication Code Protocol). AES-CCMP provides:

This was a massive security improvement over WEP/TKIP and remains cryptographically sound today — WPA2’s real-world weaknesses come from handshake and implementation flaws, not from AES itself.

AES-GCMP (WPA3)

WPA3 introduced GCMP (Galois/Counter Mode Protocol), particularly GCMP-256 in WPA3-Enterprise’s 192-bit security suite, offering stronger authenticated encryption with better performance characteristics on modern hardware.

The Handshake: How Keys Actually Get Derived

WPA2’s 4-Way Handshake

sequenceDiagram
    participant Client
    participant AP as Access Point
    AP->>Client: ANonce (random number)
    Client->>Client: Derive PTK using PSK + ANonce + SNonce + MACs
    Client->>AP: SNonce + MIC
    AP->>AP: Derive PTK, verify MIC
    AP->>Client: GTK + MIC (encrypted)
    Client->>AP: ACK

The Pairwise Transient Key (PTK) is derived from the Pre-Shared Key (PSK), both parties’ nonces (ANonce/SNonce), and both MAC addresses, using PBKDF2 with the SSID as salt for the initial PSK derivation:

PSK = PBKDF2(HMAC-SHA1, passphrase, ssid, 4096, 256)

This is precisely why an attacker who captures this 4-way handshake can perform an offline dictionary attack — since the SSID (used as salt) and the exchanged nonces/MACs are visible in cleartext during the handshake, only the correct passphrase needs to be guessed:

# Illustrative example — only for authorized security testing on your own network
aircrack-ng -w wordlist.txt -b <BSSID> capture.cap

Weak, dictionary-guessable PSKs are the single biggest practical weakness in WPA2-Personal deployments — not the underlying AES cryptography.

WPA3’s SAE (Simultaneous Authentication of Equals)

WPA3 replaced the PSK-based 4-way handshake’s vulnerable initial exchange with SAE, based on the Dragonfly key exchange, a variant of a zero-knowledge proof protocol. Critically:

Comparing Wireless Cryptographic Protocols

ProtocolCipherKey ExchangeOffline Attack Feasible?Forward Secrecy
WEPRC4Shared key (static)Yes — trivially, minutesNo
WPA/TKIPRC4 (per-packet keys)4-way handshakeYes, with effortNo
WPA2/AES-CCMPAES4-way handshake (PSK-derived)Yes, if PSK weakNo
WPA3/AES-GCMPAESSAE (Dragonfly)No (requires live interaction)Yes

Real-World Vulnerability: KRACK

In 2017, researcher Mathy Vanhoef disclosed the KRACK (Key Reinstallation Attack), affecting WPA2’s 4-way handshake implementation across essentially every vendor. The attack worked by manipulating retransmissions of handshake message 3, tricking clients into reinstalling an already-in-use encryption key, resetting the nonce counter. This allowed packet decryption and, in some configurations, packet injection — without ever needing to know the actual password. It was a protocol implementation flaw, not a break of AES itself, and was addressed through patches (tracked under CVEs including CVE-2017-13077 through CVE-2017-13088) rather than a full protocol redesign.

Dragonblood: WPA3 Wasn’t Immune Either

In 2019, researchers disclosed Dragonblood, a set of vulnerabilities in certain WPA3 implementations’ SAE handshake, including side-channel timing/cache attacks that could leak information usable in password recovery, and downgrade attacks tricking clients into falling back to WPA2. This is an important lesson: cryptographic protocol design and cryptographic implementation are two different things, and both matter.

Practical Steps to Secure Your Wi-Fi Cryptography

  1. Use WPA3 wherever your hardware supports it. For WPA2/WPA3 transitional networks, ensure it’s a temporary bridge, not permanent.
  2. Use a strong, high-entropy passphrase for Personal networks — at least 16 random characters, since PSK-derived keys are only as strong as the passphrase’s entropy.
  3. Disable WPS — its PIN mechanism (typically 8 digits, with a design flaw reducing effective entropy to about 11,000 combinations) is brute-forceable regardless of the underlying Wi-Fi encryption strength.
  4. Keep firmware updated on both access points and client devices to patch implementation flaws like KRACK and Dragonblood.
  5. Enable 802.11w (Protected Management Frames) to cryptographically protect deauthentication and disassociation frames, mitigating a common precursor to handshake-capture attacks.
  6. Prefer WPA2/WPA3-Enterprise with EAP-TLS for organizations, eliminating shared-passphrase risk entirely in favor of individual certificate-based authentication.
  7. Monitor for downgrade attempts — WPA3-capable networks should log and alert on clients attempting WPA2 fallback where not expected.

Common Mistakes

Frequently Asked Questions

Can WPA2 traffic be decrypted without the password? Not directly through cryptographic breaks in AES itself. Attacks like KRACK exploited handshake implementation flaws to force key reuse, which is different from breaking AES encryption mathematically.

Is a longer Wi-Fi password always better? Generally yes, for PSK-based networks, since the PSK’s entropy directly determines resistance to offline dictionary/brute-force attacks. Twenty random characters is dramatically stronger than an eight-character dictionary word.

Does WPA3 fully eliminate the risk of Wi-Fi password cracking? It eliminates efficient offline cracking of captured handshakes because each guess requires live interaction with SAE. It doesn’t eliminate weak-password risk entirely, since online, rate-limited guessing is still theoretically possible against a poorly protected AP.

What is forward secrecy, and why does it matter for Wi-Fi? Forward secrecy means that even if your password is compromised in the future, previously captured encrypted traffic remains protected because session keys weren’t deterministically derivable from the password alone. WPA3’s SAE provides this; WPA2’s PSK-based handshake does not.

Summary and Recommendations

Wireless cryptography has evolved from RC4’s fundamentally broken design in WEP to AES-based CCMP in WPA2 and forward-secure GCMP with SAE in WPA3. The cryptography itself is generally sound at the protocol level in WPA2/WPA3 — real-world risk today comes overwhelmingly from weak passphrases, unpatched implementation flaws, and disabled protections like WPS remaining enabled.

Further reading:

Exit mobile version