Advertisement
Tenac451

Untitled

Apr 6th, 2020
314
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. p1 = b'Das ist ein Test'
  2. c1 = bytes.fromhex('68a9df14210b1f79aee2e61da467da17')
  3. # c1 = bytes.fromhex('95cca68c5ef0bf6ffdf346ab1c4299ad')
  4. c = b''
  5. rounds = 0
  6. while c != c1:
  7. bkey = int(rounds).to_bytes(16, byteorder='big')
  8. cipher = AES.new(bkey, AES.MODE_ECB)
  9. c = cipher.encrypt(p1)
  10. if c == c1:
  11. print(f'den Key gefunden: {bkey}')
  12. rounds += 1;
  13. #b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c\xaf\xfe'#key
  14. #caffe
  15. c2 = bytes.fromhex('91bafe05baec7f2b207724967a5d27df')
  16. print(cipher.decrypt(c2)) # b'Du hast gewonnen'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement