I'm trying to learn how ephemeral keys in WPA2 4-way handshake are derived.

Starting from 4 EAPOL packets sniffing, I successfully derived PMK and PTK reading ANonce, SNonce, and knowing ASCII-PSK and the SSID.

From PTK I derived, by splitting it, the KCK (128bit), the KEK (128bit), TK for ENC (128bit) and the TK for MIC (128bit).

I'm stuck in a GTK derivation.

If I understood correctly, the GTK is transmitted encrypted from AP to ST in WPA Key Data field using the chiper suite described in first field of Key Information, in my case "AES Cipher.

In WPA2 AES is used in CTR mode for confidentiality, so i tried to decrypt the Key Data using OpenSSL, using KEK as key and filed Key IV as IV. I obtain 6c 1b 11 38 1f 8e 01 ee e1 d0 7b [...] from decryption, but reading the IEEE 802.11 I saw that the first Key Data's octect in EAPOL Key Frame is Type and should be0xdd, so decryption fails.

What's wrong?

  • 2
    Exactly, about which "first Key Data's octet" are you talking? Do you mean your original captured handshake is wrong, or the resulting decrypted GTK?
    – Michael
    Commented May 6, 2015 at 12:54
  • what is the length of the PSK (ASCII) ? plz update Commented Oct 30, 2016 at 10:31

2 Answers 2


It seems using key decryption found in OpenSSL isn't really going to do it. If you are using a Linux box that has apt-get you can apt-get install pyrit, which is designed to crack WPA2 using various techniques. Even if it doesn't crack, you will get a better idea how a cracking application like this works simply by typing the command followed by the -h option.


At minimum you need to have the preshared key/wireless password as well as have captured the EAPOL packets between the router and Device B to decrypt the packets.

With AES and PBKDF2 used in WPA and WPA2, they are designed to not be able to be decripted without the key/password.

Cracking the key is designed to be infeasible on consumer equipment for a very long time.

  • 1
    How AES and PBKDF2 is implemented in WPA and WPA2 is not what he/she asked. The fact that it was created to be implausible to be cracked by bruteforce on consumer-grade equipment is not what he/she asked. Hence, this answer makes no sense in relation to the question.
    – Yokai
    Commented Oct 31, 2016 at 7:01
  • Dealing with intelligence agency budgets and hardware is beyond the scope of stackexchange, thus one could assume that they don't have such budget nor money, thus the assumption that consumer equipment is relevant.
    – MikeP
    Commented Oct 31, 2016 at 20:28
  • 1
    It is possible that the OP may be looking into learning the guts of key derivation to locate an unknown zero day exploit for bug bounties. Actually cracking keys isn't effective any longer but if one can find exploits in key processing/handling, and bypass having to crack any keys, this would be a worthy cause for learning me thinks.
    – Yokai
    Commented Nov 1, 2016 at 7:14
  • @Yokai, This site is not for that. "IT Security Stack Exchange is for Information Security professionals to discuss protecting assets from threats and vulnerabilities..."; "questions on the deeper aspects of cryptography belong on crypto.SE."
    – MikeP
    Commented Dec 4, 2016 at 3:25
  • 1
    "IT Security Stack Exchange is for Information Security professionals to discuss protecting assets from threats and vulnerabilities..." I would say that securing assets is crypto's staple purpose... To declare the deeper aspects to not be fit for IT security professionals is disingenuous to the community. Stop trying to port off questions you don't know the answer to on others.
    – Yokai
    Commented Dec 4, 2016 at 6:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .