I was studying WPA2 and it's security when I came across this problem. I know that WPA2 uses PBKDF2 to generate a Pairwise Master Key. It does something like this;

DK = PBKDF2(prf=HMAC-SHA1, key=password, salt=ssid, DkLen=64, iterations=4096).

I get that. But what I don't is the PRF module itself. HMAC itself is h(k + h(k+m)) So, The rest of the part I get, but within the HMAC,

  • What goes in as the KEY and the MESSAGE?
  • Are both the same?
  • if not what are they?
  • 1
    $\begingroup$ Possible duplicate of Encryption algorithm used in WPA/WPA2. If the answer does not satisfy you. Let us know. $\endgroup$
    – kelalaka
    Aug 28 '19 at 11:59
  • $\begingroup$ Sure, but that duplicate doesn't quite explain which one is the key or the message $\endgroup$
    – C0DEV3IL
    Aug 28 '19 at 16:14
  • 1
    $\begingroup$ In PBKDF2 the binary password is used as key to the HMAC function. The salt is the SSID of the Wi-Fi connection. The salt + a counter value is used as the initial input to the HMAC function. This is quite clear from that answer. m = initial input and key = binary password $\endgroup$
    – kelalaka
    Aug 28 '19 at 16:22
  • 1
    $\begingroup$ Thanks Kelalaka. Got it right this time. Thanks a lot $\endgroup$
    – C0DEV3IL
    Aug 29 '19 at 8:38