Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update to criptography library calls #28

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions scripts/lidl_auskey_decode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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"))
print("Root password:", auskey[-8:].decode("ascii"))