Reuse this key list instead of creating a new one each loop.
This commit is contained in:
parent
ce789e105e
commit
40644921dc
1 changed files with 3 additions and 1 deletions
|
@ -51,12 +51,14 @@ def stringhash(str, aeskey):
|
|||
|
||||
def prepare_key(arr):
|
||||
pkey = [0x93C467E3, 0x7DB0C7A4, 0xD1BE3F81, 0x0152CB56]
|
||||
key = [0, 0, 0, 0]
|
||||
for r in range(0x10000):
|
||||
for j in range(0, len(arr), 4):
|
||||
key = [0, 0, 0, 0]
|
||||
for i in range(4):
|
||||
if i + j < len(arr):
|
||||
key[i] = arr[i + j]
|
||||
else:
|
||||
key[i] = 0
|
||||
pkey = aes_cbc_encrypt_a32(pkey, key)
|
||||
return pkey
|
||||
|
||||
|
|
Loading…
Reference in a new issue