replace PyCrypto with PyCryptodome

This commit is contained in:
ThomasV 2017-03-09 10:47:53 +01:00
parent 60b300d6ed
commit 8fabd1245d
1 changed files with 1 additions and 3 deletions

View File

@ -88,14 +88,12 @@ TYPE_SCRIPT = 2
# AES encryption
try:
from Crypto.Cipher import AES
from Cryptodome.Cipher import AES
except:
AES = None
def aes_encrypt_with_iv(key, iv, data):
if AES:
AES.block_size = 16
AES.key_size = 32
padlen = 16 - (len(data) % 16)
if padlen == 0:
padlen = 16