Files
CariddiCTF/challs/cryptoMedium/chall1.py
2026-02-12 22:52:30 +01:00

22 lines
497 B
Python

from aes import AES
from secret import flag
import os
cipher = AES(flag, rounds = 1)
p = []
c = []
for _ in range(2):
plaintext = os.urandom(16)
p.append(plaintext.hex())
ciphertext = cipher.encrypt_block(plaintext)
c.append(ciphertext.hex())
print('plaintexts = ', p)
print('ciphertexts = ', c)
# plaintexts = ['ae976f8d95e5bd2eaf40a0efcec97e0d', 'e99c923581939d80e1cf25ee19c891e4']
# ciphertexts = ['ce3776b4dc0551217e856bdfb25251b3', '70439bebea8c21e2b8eb7bad1723656b']