liveBook · Manning

Pre-shared key

As explained in Hacking Cryptography

Secret keying material configured in advance and shared by the communicating parties.

A pre-shared key (PSK) is secret keying material configured on communicating devices before use. In WEP, the administrator shared the PSK as the Wi-Fi password; each packet concatenated it with a publicly transmitted three-byte initialization vector to form an RC4 key. section 4.3.2

WEP’s PSK arrangement fails because RC4 key scheduling exposes biases for carefully selected weak IVs. Repeated observations of known plaintext and ciphertext reveal keystream bytes, allowing the FMS attack to infer PSK bytes statistically. section 4.3.2

Recovering a WEP PSK

A packet generator creates IVs of the form [targetIndex, 255, random byte], concatenates each IV with the PSK, and encrypts a known SNAP header. After collecting 50,000 packets per byte, the exploit recovers "helloworld123"; with only 500 packets, several bytes are incorrect. section 4.3.2

Figure 4.13 WEP setup showing preshared keys and initialization vectors as input to RC4
figure

Use the WEP setup figure to follow how the PSK and public initialization vector become each packet’s RC4 key. section 4.3.2

How Hacking Cryptography covers it

How deep it goes
Traces key construction, RC4 scheduling bias, weak-IV selection, statistical recovery, and failure from insufficient message volume.
Examples
Uses WEP packets, the key helloworld123, weak-IV Go code, and 50,000-versus-500-message recovery tests.
What you can do after
Evaluate how WEP’s PSK construction enables practical key recovery through weak IVs and RC4 statistical bias.
How it connects
Connects pre-shared keys to WEP, RC4, initialization vectors, stream ciphers, known plaintext, and the FMS attack.

Also explained in

Compare how 3 books explain pre-shared key →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Hacking Cryptography. The section links point to the parts of the book it draws on.