def run(self, objHmac, mk, ssid, fast=False):
#Requires Python 2.7.8 or later
#Ubuntu 14.04 LTS generally only updates to 2.7.6 :(
#if fast==True:
# return hashlib.pbkdf2_hmac('sha1', mk, ssid, 4095)
x1 = objHmac.load(mk, ssid + '\0\0\0\1', fast)
x2 = objHmac.load(mk, ssid + '\0\0\0\2', fast)
f1 = a2b_hex(x1)
f2 = a2b_hex(x2)
for x in xrange(4095):
x1 = objHmac.load(mk, a2b_hex(x1), fast)
x2 = objHmac.load(mk, a2b_hex(x2), fast)
f1 = self.xorString(a2b_hex(x1), f1)
f2 = self.xorString(a2b_hex(x2), f2)
out = b2a_hex(f1) + b2a_hex(f2)
return out[0:64]
评论列表
文章目录