Added chall and some stuff
This commit is contained in:
21
challs/cryptoMedium/chall1.py
Normal file
21
challs/cryptoMedium/chall1.py
Normal file
@@ -0,0 +1,21 @@
|
||||
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']
|
||||
Reference in New Issue
Block a user