Skip to main content

Colonel

Challenge

Encrypted blob with partially unknown base64-ish AES key characters.

Solution

Key solve code:

ct = Path('flag.enc').read_bytes()
iv = b'1234567890123456'
base = list('Xx+KvRQ1NQRR56IxSM5VjjrRKg09Fl2e')
idx = [0, 12, 23, 29]
chars = string.ascii_letters + string.digits + '+/'

for c0, c1, c2, c3 in itertools.product(chars, repeat=4):
k = base.copy()
k[idx[0]] = c0
k[idx[1]] = c1
k[idx[2]] = c2
k[idx[3]] = c3
key = ''.join(k).encode()
pt = AES.new(key, AES.MODE_CBC, iv).decrypt(ct)
# printable-score filter used to stop on likely plaintext

Flag

Not recovered in current notes.