2019. 4. 23. 07:11, 워게임/root-me.org
Plain, Cipher, Key를 다 알려줬기 때문에 처음의 블럭에 대해 $Dec(C) \oplus Plain$을 수행해 $IV$를 복원할 수 있습니다.
from Crypto.Cipher import AES
import base64
Plain = 'Marvin: "I am at a rough estimat'
Cipher = base64.b64decode('cY1Y1VPXbhUqzYLIOVR0RhUXD5l+dmymBfr1vIKlyqD8KqHUUp2I3dhFXgASdGWzRhOdTj8WWFTJPK0k/GDEVUBDCk1MiB8rCmTZluVHImczlOXEwJSUEgwDHA6AbiCwyAU58e9j9QbN+HwEm1TPKHQ6JrIOpdFWoYjS+cUCZfo/85Lqi26Gj7JJxCDF8PrBp/EtHLmmTmaAVWS0ID2cJpdmNDl54N7tg5TFTrdtcIplc1tDvoCLFPEomNa5booC')[:32]
Key = base64.b64decode('AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRqrHB0eHyA=')
aes = AES.new(Key, AES.MODE_ECB)
estimate = aes.decrypt(Cipher)
#print(estimate)
for i in range(32):
print(chr(estimate[i]^ord(Plain[i])),end='')
'워게임 > root-me.org' 카테고리의 다른 글
[Cryptanalysis] Service - Timing attack (0) | 2019.04.10 |
---|---|
[Cryptanalysis] RSA - Decipher Oracle (0) | 2019.04.10 |
[Cryptanalysis] RSA - Factorisation (0) | 2019.04.10 |
[Cryptanalysis] LFSR - Known plaintext (0) | 2019.04.10 |
[Cryptanalysis] AES - ECB (0) | 2019.04.04 |
[Cryptanalysis] AES - CBC - Bit-Flipping Attack (0) | 2019.03.19 |
Comments