Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- p1 = b'Das ist ein Test'
- c1 = bytes.fromhex('68a9df14210b1f79aee2e61da467da17')
- # c1 = bytes.fromhex('95cca68c5ef0bf6ffdf346ab1c4299ad')
- c = b''
- rounds = 0
- while c != c1:
- bkey = int(rounds).to_bytes(16, byteorder='big')
- cipher = AES.new(bkey, AES.MODE_ECB)
- c = cipher.encrypt(p1)
- if c == c1:
- print(f'den Key gefunden: {bkey}')
- rounds += 1;
- #b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\xaf\xfe'#key
- #caffe
- c2 = bytes.fromhex('91bafe05baec7f2b207724967a5d27df')
- print(cipher.decrypt(c2)) # b'Du hast gewonnen'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement