MCPcopy Create free account
hub / github.com/secdev/scapy / customPRF512

Function customPRF512

scapy/modules/krack/crypto.py:40–52  ·  view source on GitHub ↗

Source https://stackoverflow.com/questions/12018920/

(key, amac, smac, anonce, snonce)

Source from the content-addressed store, hash-verified

38
39
40def customPRF512(key, amac, smac, anonce, snonce):
41 """Source https://stackoverflow.com/questions/12018920/"""
42 A = b"Pairwise key expansion"
43 B = b"".join(sorted([amac, smac]) + sorted([anonce, snonce]))
44
45 blen = 64
46 i = 0
47 R = b''
48 while i <= ((blen * 8 + 159) // 160):
49 hmacsha1 = hmac.new(key, A + chb(0x00) + B + chb(i), hashlib.sha1)
50 i += 1
51 R = R + hmacsha1.digest()
52 return R[:blen]
53
54# TKIP - WEPSeed generation
55# Tested against pyDot11: tkip.py

Callers 1

install_unicast_keysMethod · 0.90

Calls 4

chbFunction · 0.90
joinMethod · 0.80
newMethod · 0.80
digestMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…