Advertisement
Tenac451

Untitled

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