Created
April 10, 2019 22:27
-
-
Save Ge0rg3/27dd766a649e4017e96d2b8bc58b8a05 to your computer and use it in GitHub Desktop.
16 bit AES bruteforce challenge for Sunshine CTF '19 https://2019.sunshinectf.org/challenges#16-bit-AES
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Crypto.Cipher import AES | |
from itertools import product | |
import binascii | |
for val in product(range(256), repeat=2): | |
key = bytes(val)*8 | |
cipher = AES.new(key, AES.MODE_ECB) | |
msg = cipher.encrypt("hellothisisatest") | |
z = binascii.hexlify(msg).decode('utf-8') | |
if z == "d9bf38ed407349d227b859eac20d5394": | |
print(key) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment