challenge 3 · MixColumns removed

AES without MixColumns

Part of Break AES, one missing step at a time. Use aes.py from there.

Now MixColumns is missing. Mallory tricked the server into encrypting 256 messages that she chose: message v is the byte v repeated 16 times. She also has one normal known pair, and one intercepted ciphertext.

What we have

P0 = "Hello, students!"
C0 = 8d 16 ec b2 e4 48 a4 52 7c bc 85 21 2f fc 48 f3

# 256 chosen plaintexts, block v is the byte v sixteen times
E(00 00 00 ... 00) = 54 09 e3 d0 7e 02 34 0c 80 9c 95 74 1c 3d a8 02
E(01 01 01 ... 01) = f6 27 a3 e9 a4 40 22 db 0f 1d 2e 5d 7b 63 26 4c
E(02 02 02 ... 02) = 1e 0e ca 27 c6 e2 c1 0a 6c 12 2a 6e f0 db 68 86
...
E(ff ff ff ... ff) = b3 59 be 7d 83 22 fb 6d 99 4a ed fe 0e ec 3a 4b

C1 = af c2 58 80 d5 cf bc 96 7c b3 a1 bf db b7 ab 7b      # the target

All 256 lines are in c3_table.txt.

Our task

Recover the plaintext of C1.

Hints

Hint 1

Without MixColumns, no step combines two bytes. Each ciphertext byte depends on exactly one plaintext byte.

Hint 2

The block where every byte is v tells us what v becomes at every position at once. So the 256 blocks give sixteen full lookup tables.

Hint 3

ShiftRows still moves bytes. After ten rounds, a byte in row r has moved 10r columns to the left. Use P0 and C0 to check the positions.

Check your answer

Type the plaintext you recovered. The page compares its SHA-256 hash with the right one, so the answer itself is not on this page.