diff --git a/scripts/lidl_auskey_decode.py b/scripts/lidl_auskey_decode.py index 4605341..6fc3046 100644 --- a/scripts/lidl_auskey_decode.py +++ b/scripts/lidl_auskey_decode.py @@ -33,6 +33,7 @@ from binascii import unhexlify import struct from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +from cryptography.hazmat.backends import default_backend def _aschar(b): return struct.unpack("b", bytes([b & 0xFF]))[0] @@ -58,9 +59,9 @@ def _get_bytes(a): a = input("Encoded aus-key as hex string line %d>" % (n+1)) encoded_key += _get_bytes(a) -cipher = Cipher(algorithms.AES(kek), modes.ECB()) +cipher = Cipher(algorithms.AES(kek), modes.ECB(), default_backend()) decryptor = cipher.decryptor() auskey = decryptor.update(encoded_key) + decryptor.finalize() print("Auskey:", auskey.decode("ascii")) -print("Root password:", auskey[-8:].decode("ascii")) \ No newline at end of file +print("Root password:", auskey[-8:].decode("ascii"))