Sub topic 18
Wi-Fi Security: WPA2 and WPA3
This chapter assumes you know how a device scans for, authenticates to, and associates with an access point (AP), as covered in the chapter on joining a network. It explains what the security step protects, how WPA2 and WPA3 differ, and the errors that cause most real-world problems.
What Wi-Fi security has to protect
Radio waves travel through walls and past the edge of your property. Anyone nearby with a radio can capture your frames, so Wi-Fi security must do three jobs:
- Authenticate: prove that a device is allowed to join, and that the AP is the real one.
- Encrypt: make captured frames unreadable to anyone without the keys.
- Protect integrity: detect frames that were altered or replayed.
Encryption in Wi-Fi covers the link between a device and its AP only. Once the AP forwards a frame onto the wired network, the Wi-Fi encryption no longer applies. For end-to-end protection you still need TLS or a similar protocol.
A short history
| Generation | Cipher | Status |
|---|---|---|
| WEP | RC4 with a short, weak key scheme | Broken. Keys can be recovered in minutes. Never use it. |
| WPA | RC4 with TKIP | Deprecated. It was a stopgap for old hardware. |
| WPA2 | AES-CCMP | Still widely used and acceptable with a strong passphrase. |
| WPA3 | AES-CCMP or AES-GCMP, plus SAE | Current recommendation. |
The Wi-Fi Alliance certifies products under the names WPA, WPA2 and WPA3. The IEEE 802.11i amendment defines the underlying mechanisms that WPA2 uses.
WPA2: the model
WPA2 has two modes.
- WPA2-Personal (PSK): every device uses one shared passphrase. The passphrase and the SSID are fed through PBKDF2 (4096 iterations of HMAC-SHA1) to produce a 256-bit pre-shared key, the PMK.
- WPA2-Enterprise (802.1X): each user or device authenticates to a RADIUS server, usually with EAP. Every client gets its own PMK, so one leaked credential does not expose everyone.
After the device associates, both sides run a 4-way handshake. It proves each side knows the PMK without sending it, and derives a fresh pairwise transient key (PTK) for that session. The PTK encrypts unicast traffic. A separate group key encrypts broadcast and multicast traffic.
The weakness of WPA2-Personal
An attacker who captures a handshake can test passphrase guesses offline. Each guess is run through PBKDF2 and compared against the captured message integrity code (MIC). Nothing limits the guess rate except the attacker's hardware. A short or common passphrase falls quickly. A random passphrase of 16 or more characters is not practical to guess.
Two further problems affect WPA2:
- No forward secrecy. If someone learns the passphrase later, they can decrypt any handshake and traffic they recorded earlier.
- Unprotected management frames. In plain WPA2, deauthentication and disassociation frames are unauthenticated. Anyone can forge them and knock a client off the network.
The 2017 KRACK attack also showed that clients could be tricked into reinstalling a key in the handshake. Vendors patched it, so keep client and AP firmware updated.
WPA3: what changes
WPA3 keeps the same overall structure but fixes the weaknesses above.
- SAE replaces PSK in Personal mode. Simultaneous Authentication of Equals is a password-authenticated key exchange (a form of Dragonfly). The client and AP prove knowledge of the password and derive a fresh key without exposing anything that can be tested offline. An attacker must interact with the AP once per guess, so the AP can rate-limit attempts.
- Forward secrecy. Each session key is independent. Learning the password later does not reveal old captures.
- Protected Management Frames (PMF, 802.11w) are mandatory. Forged deauthentication frames are rejected.
- Stronger Enterprise options. WPA3-Enterprise offers an optional 192-bit mode using GCMP-256 and stronger key derivation.
- Enhanced Open (OWE). For open networks such as cafés, Opportunistic Wireless Encryption encrypts each client's traffic with no password. It does not authenticate the AP, so it stops passive eavesdropping but not an impostor AP.
SAE has its own risks. Early implementations ("Dragonblood", 2019) leaked timing and cache information. They were fixed in software updates.
Transition mode and compatibility
Many networks need to serve both old and new devices. WPA2/WPA3 transition mode advertises both methods under one SSID. WPA3-capable clients use SAE. Older clients use PSK.
The trade-off: because the AP still accepts WPA2-PSK, an attacker can target the PSK path and attempt a downgrade. Offline guessing against the PSK remains possible. Transition mode is a migration step. Use WPA3-only once your devices support it.
Also note that some older devices fail to connect when an SSID advertises WPA3 or requires PMF. Test before switching.
Common errors
- Choosing TKIP or "WPA/WPA2 mixed" mode. TKIP also drags the network down: 802.11n and later amendments cannot use their top speeds with TKIP. Select AES (CCMP) only.
- Weak shared passphrases. Use a long random passphrase, not a word or a phone number. The SSID is part of the PBKDF2 salt, so common SSIDs such as "linksys" or "NETGEAR" make precomputed tables possible.
- Relying on a hidden SSID. Hiding the SSID only removes it from beacons. It still appears in probe requests and association frames, and tools reveal it quickly. It is not security.
- MAC filtering as protection. MAC addresses are visible in every frame and can be copied. Treat filtering as bookkeeping only.
- Leaving WPS PIN enabled. The PIN setup can be brute-forced. Disable it.
- Assuming Wi-Fi encryption protects the whole path. It ends at the AP.
- Sharing one PSK with many people. Anyone who has the passphrase can derive the keys needed to decrypt other WPA2 users' captured traffic. Use Enterprise or per-device passwords where you can.
Checking what a network uses
On Linux, iw shows whether a scanned network advertises RSN (WPA2 or WPA3) information and which authentication suite it uses.
# Show security-related information elements for nearby networks
sudo iw dev wlan0 scan | grep -E 'SSID:|RSN:|Authentication suites:|Pairwise ciphers:'In the output, Authentication suites: PSK indicates WPA2-Personal. SAE indicates WPA3-Personal. Seeing both indicates transition mode. IEEE 802.1X indicates Enterprise. Pairwise ciphers: CCMP is the AES mode you want. If you see TKIP, change the AP configuration.
You can also parse a saved scan with Python to flag weak configurations:
def classify(suites, ciphers):
"""Return a short security label from auth suites and pairwise ciphers."""
suites = {s.upper() for s in suites}
ciphers = {c.upper() for c in ciphers}
if "TKIP" in ciphers:
return "weak: TKIP enabled"
if "SAE" in suites and "PSK" in suites:
return "WPA3 transition mode"
if "SAE" in suites:
return "WPA3-Personal"
if "PSK" in suites:
return "WPA2-Personal"
if "IEEE 802.1X" in suites:
return "Enterprise"
return "unknown or open"
print(classify(["PSK"], ["CCMP"])) # WPA2-Personal
print(classify(["SAE", "PSK"], ["CCMP"])) # WPA3 transition mode
print(classify(["PSK"], ["TKIP", "CCMP"])) # weak: TKIP enabledChoosing a configuration
- Home or small office: WPA3-Personal if all clients support it. Otherwise transition mode with a long random passphrase.
- Guest network: a separate SSID and VLAN, with Enhanced Open if clients support it, or a rotated passphrase.
- Organization: WPA2- or WPA3-Enterprise with 802.1X, so access can be revoked per user.
- IoT devices that only do WPA2: put them on their own SSID so the main network can stay WPA3-only.
Exercise
A scan shows one SSID with "Authentication suites: SAE PSK" and "Pairwise ciphers: CCMP". What mode is it in, and what is the main risk compared with WPA3-only?
Show answer
It is WPA2/WPA3 transition mode. Because the AP still accepts WPA2-PSK, an attacker can capture a handshake on the PSK path and guess the passphrase offline, and can try to push clients toward the weaker method. WPA3-only removes that path.
Exercise
Why does SAE resist offline dictionary attacks when WPA2-PSK does not?
Show answer
In WPA2-PSK, a captured four-way handshake contains enough data to check a passphrase guess locally, so guesses are limited only by attacker hardware. In SAE, each guess needs a live exchange with the AP, which can rate-limit attempts, and the exchange gives a captured observer nothing to test guesses against.
Exercise
A colleague says hiding the SSID and enabling MAC filtering makes the network secure. Give two reasons this is wrong.
Show answer
The SSID still appears in probe requests and association frames, so it is easy to discover. MAC addresses are sent in the clear in every frame, so an attacker can copy an allowed address. Neither measure encrypts traffic or authenticates devices.