skip to content

On a WPA3-Personal network, how does SAE's hash-to-element differ from hunting-and-pecking, and why does 6 GHz operation insist on it?

level: seniorimportance: should knowfreq 14%

answer

  1. how the password element is found
  2. loop versus direct mapping
  3. password-dependent iterations
  4. RFC 9380 hash-to-curve
  5. sae_pwe and the RSNXE bit

basics

~10 s

Hunting-and-pecking finds SAE's password element with a loop whose work depends on the password; hash-to-element maps the password directly with RFC 9380 hash-to-curve, without that loop. 6 GHz allows only hash-to-element.

solid answer

~50 s

Both methods derive the **password element (PWE)** that SAE's Commit is built on. **Hunting-and-pecking**, the original Dragonfly method, hashes the password, both MAC addresses and a counter, tests whether the result is a valid curve point and repeats until one is; the number of tries depends on the password, so code has to run a fixed minimum number of iterations (hostapd uses at least 40 for most elliptic-curve groups) to hide it. **Hash-to-element (H2E)** first derives a password token `PT` from the SSID and password (plus any password identifier) with RFC 9380's hash-to-curve, with no data-dependent loop, then combines `PT` with the MAC addresses. On 6 GHz — opened by Wi-Fi 6E and carried into Wi-Fi 7 — SAE uses H2E only: wpa_supplicant skips a 6 GHz network that does not advertise H2E, and hostapd turns H2E on for a 6 GHz BSS by itself.

go deeper

for a junior

Recall that SAE has two ways to turn the password into a starting point, an older loop and the newer hash-to-element, and that 6 GHz requires the newer one.

for a middle

Explain why a loop whose length depends on the password is a timing risk, and how hash-to-element avoids it while allowing precomputation.

for a senior

Show how you would verify H2E on the air (RSNXE bit, status 126, selector 123) and configure sae_pwe per band without locking out clients.

for a principal

Decide where hash-to-element-only is enforced beyond 6 GHz, weighing older clients on 2.4 and 5 GHz against removing the loop from the attack surface.

## The step both methods perform Every SAE exchange starts from a **password element (PWE)**: a point in the agreed group (on group 19, a point on the P-256 curve) that is derived from the shared password. The Commit's scalar and element are built on it. The two methods differ only in how the PWE is found, but that difference shaped both the 2019 side-channel findings and the rules for 6 GHz. ## Hunting-and-pecking The original method, described in RFC 7664 for Dragonfly and used by SAE since it first appeared: 1. Compute a seed by hashing the larger and smaller of the two **MAC addresses** with the password and an 8-bit **counter**. 2. Expand the seed into a candidate x-coordinate and test whether it gives a point on the curve. 3. If not, increment the counter and try again; if so, remember the point — and keep going. The "keep going" is the defence. The number of tries until the first hit depends on the password and the two addresses, so an implementation that stopped at the first hit would take a password-dependent amount of time. RFC 7664 therefore sets a security parameter `k`: at least `k` iterations always run. hostapd uses `k = 40` for most elliptic-curve groups. Drawbacks for an operator: - The PWE depends on both MAC addresses, so it must be recomputed **for every peer** — work that cannot be done in advance. - Making the loop truly uniform in time and memory access is hard. The 2019 findings showed real implementations leaking password-dependent timing and cache behaviour despite the minimum-iteration rule. ## Hash-to-element **Hash-to-element (H2E)** replaces the loop with a direct mapping: - A **password token `PT`** is derived from the **SSID** and the password (plus a **password identifier**, if one is used) and mapped to a curve point with the **hash-to-curve** method of **RFC 9380** (the simplified Shallue-van de Woestijne-Ulas map). - `PT` does not involve the MAC addresses, so an access point computes it once per SSID and password. - For each peer, the PWE is then computed from `PT` and the two MAC addresses with fixed arithmetic — no loop and no early exit. H2E is signalled on the air in three places: | Where | What it shows | |---|---| | RSNXE (RSN Extension element), SAE H2E capability bit | The device supports hash-to-element | | BSS membership selector 123 in the supported rates | The access point accepts hash-to-element only (hostapd adds it when it is H2E-only) | | Authentication frame status code 126 | This Commit uses hash-to-element | H2E also carries the list of groups a side has had rejected, and validating that list is meant to stop a peer being pushed onto a weaker group; hostapd 2.11 fixed that validation "to avoid downgrade attacks". ## How hostapd configures it hostapd, the open-source reference access point, controls this with `sae_pwe`: - `sae_pwe=0` — hunting-and-pecking only; the default when no password identifier is used; - `sae_pwe=1` — hash-to-element only; the default with a password identifier; - `sae_pwe=2` — both enabled. The hostapd.conf comment says the default is likely to change from 0 to 2 once H2E has had more interoperability testing. H2E support arrived in hostapd 2.10 (2022), and hostapd 2.12 (2026) mandates H2E whenever password identifiers are used. ## Why 6 GHz insists on it The 6 GHz band, opened to Wi-Fi by **Wi-Fi 6E** (802.11ax-2021) and used by **Wi-Fi 7** (802.11be-2024), came with no installed base of older clients, which allowed stricter security rules from day one: RSN only with no PSK AKMs, PMF required (hostapd refuses a 6 GHz BSS configured otherwise), and SAE with **H2E only**. The reference implementation shows the rule from both sides: - wpa_supplicant's source states that on the 6 GHz band only H2E is allowed, and it skips a 6 GHz network whose RSNXE does not advertise H2E support. - hostapd, given an SAE BSS on 6 GHz with `sae_pwe=0`, logs "SAE: Enabling SAE H2E on 6 GHz" and switches to `sae_pwe=2` on its own. On 2.4 and 5 GHz the operator still chooses, which is where compatibility with older clients that only know hunting-and-pecking becomes a decision. ## The point to make in an interview Hunting-and-pecking is correct but fragile: its safety depends on every implementation hiding a password-dependent loop. Hash-to-element removes the loop, lets the expensive part be precomputed per SSID, and is mandatory where the rules could be written fresh, on 6 GHz.

  • Why can an access point precompute hash-to-element's PT but not hunting-and-pecking's PWE?
    Hunting-and-pecking feeds both MAC addresses into every iteration, so its result is specific to one station and must be computed when that station arrives. Hash-to-element's PT depends only on the SSID, the password and any password identifier, so the access point derives it once at configuration time and only the cheap per-peer step remains.
  • What happens if a WPA3-Personal access point on 5 GHz is set to hash-to-element only and an older client knows only hunting-and-pecking?
    The client cannot complete SAE with that access point. The access point advertises H2E-only (in hostapd, BSS membership selector 123), and a client that does not understand it either skips the network or fails authentication. That compatibility cost is why `sae_pwe=2` exists for 2.4 and 5 GHz.

  • Hash-to-element is just a faster loop with fewer iterations
  • Hunting-and-pecking's PWE can be cached once per SSID
  • On 6 GHz, hunting-and-pecking remains acceptable as a fallback
  • Hash-to-element removes the need for a shared password
  • hostapd enables hash-to-element by default on every band

Assumes the Wi-Fi 7 era (802.11be-2024): 6 GHz, opened by Wi-Fi 6E (802.11ax-2021), admits SAE only with hash-to-element; hostapd added H2E in 2.10 (2022).