From my understanding this is how WPA2 works for home networks:
- PSK (Pre-Shared Key) is used to generate PMK (Pairwise Master Key), which is used together with ANonce (AP Nonce) to create PTK (Pairwise Transient Key).
- PTK is devided into KCK (Key Confirmation Key, 128 bit), KEK (Key Encryption Key, 128 bit) and TEK (Temporal Encryption Key, 128 bit).
- KCK is used to construct MAC in EAPOL packets 2,3 and 4.
- KEK is used to encrypt some data sent to client(for example GTK).
- TEK is used for encrypting traffic between client and AP, later during session.
Now the WPA 4-way handshake:
- AP sends ANonse (AP Nonce) to client, which is basically a random Integer of 256 bits.
- Client use the ANonce and PMK to generate PTK (Pairwise Transient Key), and send CNonce (Client Nonce) and MAC.
- AP sends MAC and GTK (Group Temporal Key) to client.
- Client send ACK with MAC.
Now, how does handshake cracking work (for example dictionary attack) if the whole PTK isn't used (KCK and KEK are used during handshake, but TEK isn't)? I understand that the words from dictionary are used as PSK to generate PMK and Anonce (which is also captured in handshake) to generate PTK, but how can I know when PTK is correct when 1/3 of the key is never used?