On the Subject of the AES CM

A machine that knows no bounds when it comes to ciphers.

Write the 5 hexadecimal characters on screen 1 top to bottom. Then write the 5 hexadecimal characters on screen 2 to the right of the previous characters, top to bottom. This will be referred to as the Round Key.

For each letter of the encrypted word, do the following:

  • Copy each hexadecimal character from the Round Key in reading order and turn the copies into binary to get 5 rows of 8 bit binary sequences.
  • Take the Nth letter's alphabetic position, minus 1 (A0Z25) and convert it into a 5 bit binary sequence and place each bit at the end of each row with the most significant bit written at the top row.
  • For each row of the binary sequence: If the amount of 1s is odd, the resulting bit is a 1. Otherwise, the resulting bit is a 0.
  • If the Nth bit on screen 3 is a 1, invert the resulting bits.
  • Turn the resulting binary sequence back into a letter (A0Z25) to get your Nth decrypted letter. You can get rid of the binary sequence.
  • Create a new Round Key by taking the top hexadecimal pair and putting it at the bottom.
  • Take the new top pair of the Round Key and use it in the S-BOX Table to get a new top hexadecimal pair.
  • For each hexadecimal pair after the top pair, XOR it with the hexadecimal pair above it.
  • The resulting hexadecimal pairs becomes your new Round Key.

Hexadecimal to Binary

01234567
00000001001000110100010101100111
89ABCDEF
10001001101010111100110111101111

Letter to Binary

A00000J01001S10010
B00001K01010T10011
C00010L01011U10100
D00011M01100V10101
E00100N01101W10110
F00101O01110X10111
G00110P01111Y11000
H00111Q10000Z11001
I01000R10001

S-BOX

-0-1-2-3-4-5-6-7-8-9-A-B-C-D-E-F
0-637C777BF26B6FC53001672BFED7AB76
1-CA82C97DFA5947F0ADD4A2AF9CA472C0
2-B7FD9326363FF7CC34A5E5F171D83115
3-04C723C31896059A071280E2EB27B275
4-09832C1A1B6E5AA0523BD6B329E32F84
5-53D100ED20FCB15B6ACBBE394A4C58CF
6-D0EFAAFB434D338545F9027F503C9FA8
7-51A3408F929D38F5BCB6DA2110FFF3D2
8-CD0C13EC5F974417C4A77E3D645D1973
9-60814FDC222A908846EEB814DE5E0BDB
A-E0323A0A4906245CC2D3AC629195E479
B-E7C8376D8DD54EA96C56F4EA657AAE08
C-BA78252E1CA6B4C6E8DD741F4BBD8B8A
D-703EB5664803F60E613557B986C11D9E
E-E1F8981169D98E949B1E87E9CE5528DF
F-8CA1890DBFE6426841992D0FB054BB16

Example

Encrypted Word: BXEU
Screen 1: 7DDE6
Screen 2: ECC6C
Screen 3: 0010

B → 00001

7E → 01111110 + 0 → 0
DC → 11011100 + 0 → 1
DC → 11011100 + 0 → 1
E6 → 11100110 + 0 → 1
6C → 01101100 + 1 → 1

01111 + 0 → P

DC → 86
DC XOR 86 → 5A
E6 XOR 5A → BC
6C XOR BC → D0
7E XOR D0 → AE

X → 10111

86 → 10000110 + 1 → 0
5A → 01011010 + 0 → 0
BC → 10111100 + 1 → 0
D0 → 11010000 + 1 → 0
AE → 10101110 + 1 → 0

00000 + 0 → A

5A → BE
BC XOR BE → 02
D0 XOR 02 → D2
AE XOR D2 → 7C
86 XOR 7C → FA

E → 00100

BE → 10111110 + 0 → 0
02 → 00000010 + 0 → 1
D2 → 11010010 + 1 → 1
7C → 01111100 + 0 → 1
FA → 11111010 + 0 → 0

01110 + 1 → R

02 → 77
D2 XOR 77 → A5
7C XOR A5 → D9
FA XOR D9 → 23
BE XOR 23 → 9D

U → 10100

77 → 01110111 + 1 → 1
A5 → 10100101 + 0 → 0
D9 → 11011001 + 1 → 0
23 → 00100011 + 0 → 1
9D → 10011101 + 0 → 1

10011 + 0 → T

Decrypted Word: PART