When a new client tries to connect with wi-fi, it enters a password which is provided by the wi-fi owner. I wonder what is so hard to capture this password by a hacker when it is being sent to router for authentication? Client can't encrypt this password because symmetric key for encryption/decryption are not exchanged till yet. Only the password is sent which must be in plain text.

Second thing, now suppose multiple clients are connected with the same wifi. Why can't they read traffic of one-another? Are all of them using different symmetric key?

Is pre-shared key same as the password which your wifi owner provides you to enter? If it is a password then there is no sense to call it as key because there is a huge difference between a password and a key. Passphrase=Password but both are not equal to key.


1 Answer 1


You're right that a key is not the same as a password. But a password can be used to derive a key. So some people just call the password a PSK, since it is pre-shared and is all one needs to know to derive an actual key.

In the case of WPA2-PSK, the password is indeed used to derive a key (using PBKDF, a slow hashing function). We call this key the Pairwise Master Key (PMK). Neither the password or the PMK are ever sent to the router. Instead, a four way handshake is used to ensure that the router knows that you know the PMK, and that you know that the router knows the PMK (i.e. a hacker didn't set up a fake router).

This handshake also allows both parties to derive another key, the Pairwise Transient key (PTK). This key is used to actually encrypt the connection.

So basically, no information that a hacker can use is sent over the connection. It only works if you and the router had the same initial password.

This also answers your second question. The PTK is different for every client, since it is based on the client's MAC address and some arbitrary numbers (nonces) sent in the handshake. As a result the PTKs are different for every client.

However, someone who knows the password (and therefore the PMK), and monitors the handshake (i.e. knows the MAC addresses and nonces) has enough information to reconstruct the PTK for another user. So it is possible to decrypt WPA2-PSK traffic provided you know the password.

  • $\begingroup$ So PTK is different because MAC is different. What if one of the connected user replicates his MAC Address with another user? Should PTK be same for both then? $\endgroup$
    – defalt
    Oct 6, 2016 at 2:23
  • $\begingroup$ No, because during the handshake, both the router and user exchange nonces (a nonce is an arbitrary number used only once, ever). The PTK is based on both these nonces, both MAC addresses, and the PMK. So even if a user replicates another's MAC address, and sends the same nonce, the router will still send a different nonce, resulting in a different PTK. However, I failed to mention this (I'll update my answer), but someone who knows the password, and listens in on the handshake has enough information to decrypt the other's traffic. My apologies for the mistake. $\endgroup$
    – bkjvbx
    Oct 6, 2016 at 9:50
  • $\begingroup$ Client enters password and this password is hashed with SSID to generate PMK. If this PMK is never sent to router then how does router authenticate that you have typed incorrect password? Shouldn't router simply proceed to send nonces because it thinks that you know PMK? $\endgroup$
    – defalt
    Oct 6, 2016 at 14:59
  • 1
    $\begingroup$ As shown in the link I gave, the client also sends a Message Integrity Code (MIC). This gives proof that the client knows the PMK, without revealing the PMK. I'm not sure on the exact nature of the MIC, but it could for example be a hash of the client's nonce concatenated with the PMK. $\endgroup$
    – bkjvbx
    Oct 6, 2016 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.