diff --git a/dragino/LoRaWAN/DataPayload.py b/dragino/LoRaWAN/DataPayload.py index dae69d1..aa90557 100644 --- a/dragino/LoRaWAN/DataPayload.py +++ b/dragino/LoRaWAN/DataPayload.py @@ -59,7 +59,7 @@ def decrypt_payload(self, key, direction, mic): cipher = AES.new(bytes(key)) s = cipher.encrypt(bytes(a)) - padded_payload = bytearray() + padded_payload = [] padding=[0x00] * 16 for i in range(k): idx = (i + 1) * 16 @@ -88,8 +88,8 @@ def encrypt_payload(self, key, direction, data): cipher = AES.new(bytes(key)) s = cipher.encrypt(bytes(a)) - padded_payload = bytearray() - padding=bytearray([0x00]*16) + padded_payload = [] + padding=[0x00]*16 for i in range(k): idx = (i + 1) * 16 padded_payload += (data[idx - 16:idx] + padding)[:16]