Source https://stackoverflow.com/questions/12018920/
(key, amac, smac, anonce, snonce)
| 38 | |
| 39 | |
| 40 | def 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 |
no test coverage detected
searching dependent graphs…