import base64
from math import ceil
-from .utils import bytes_to_intlist
+from .utils import bytes_to_intlist, intlist_to_bytes
BLOCK_SIZE_BYTES = 16
@returns {int[]} decrypted data
"""
expanded_key = key_expansion(key)
- block_count = int(ceil(float(len(data)) // BLOCK_SIZE_BYTES))
+ block_count = int(ceil(float(len(data)) / BLOCK_SIZE_BYTES))
decrypted_data=[]
for i in range(block_count):
return temp
decrypted_data = aes_ctr_decrypt(cipher, key, Counter())
- plaintext = ''.join(map(lambda x: chr(x), decrypted_data))
+ plaintext = intlist_to_bytes(decrypted_data)
return plaintext