PBKDF2 and SHA-1 question
#3
if you include openssl:

#include <openssl/evp.h>
#include <openssl/sha.h>
#include <openssl/hmac.h>

PMK is calculated by:
PKCS5_PBKDF2_HMAC((const char*)psk, psklen, (unsigned char*)essid,  essidlen, 4096, EVP_sha1(), 32, pmk)
successfull if result > 0

PMKID is calculated by:
HMAC(EVP_sha1(), pmk, 32, salt, 20, pmkid, NULL);
successfull if result > 0

and the salt is calculated by:

char *pmkname = "PMK Name";
uint8_t salt[32];
memcpy(&salt, pmkname, 8);
memcpy(&salt[8], mac_ap, 6);
memcpy(&salt[14], mac_sta, 6);

That's all.
Reply


Messages In This Thread
PBKDF2 and SHA-1 question - by ilya980 - 04-06-2019, 10:49 PM
RE: PBKDF2 and SHA-1 question - by philsmd - 04-06-2019, 10:58 PM
RE: PBKDF2 and SHA-1 question - by ZerBea - 04-07-2019, 11:18 AM
RE: PBKDF2 and SHA-1 question - by Caster - 10-20-2022, 05:35 PM
RE: PBKDF2 and SHA-1 question - by ilya980 - 04-09-2019, 05:16 AM
RE: PBKDF2 and SHA-1 question - by ZerBea - 04-09-2019, 08:40 AM