Professional Documents
Culture Documents
cipher. It’s block length is fixed to be 128 bits and key length can vary like 128, 192 or 256
bits where the encryption requires 10, 12 and 14 rounds respectively to get the cipher text. In
this every input and output of an operation is termed as a state which is an array of 4X4 bytes.
Hexadecimal : 00 04 12 14 12 04 12 00 0C 00 13 11 08 23 19 19
State representation
AES encryption involves four transformations which transforms the state given as the input to
a different state. The four transformations are:
1. Sub Bytes
2. Shift Rows
3. Mix Columns
4. Add Round key
The values in the state is substituted by another values according to a lookup table called S-
box.
S-Box
ShiftRows method operates on the rows of the state, the nth row is shifted left circular by n-1
bytes.
Multiplication with 2: Left shift with no carry. In addition to that XOR with 0X1B if the shifted
bit is 1.
Multiplication with 3: Perform multiplication with 2 then XOR with the initial value.
Here each byte of the input state is combined with corresponding byte of the subkey by doing
bitwise XOR. The subkey for each round is generated by Rijndael’s key expansion method.
The value is replaced by using the lookup table given above as follows :
o C3 => 2E
3. Rcon : The value is XORed with the round constant depending on the round number.
wi = wi-1 ⊕ wi-4
wi = temp ⊕ wi-4
wi-1 => Left shift 8 bits => S-Box => ⊕ Rconi/4 => tempi
Now, the AES encryption can be done in 11 rounds, where the initial round, Round 0 involves
an Add Round Key transformation with the initial key comprising of w0, w1, w2 and w3.
Following 9 rounds comprises of Sub Bytes, Shift Rows, Mix Columns followed by Add
Round key with the subkey generated for that round. The final round involves all the above
rounds except Mix Columns. After that the cipher text is ready.
AES encryption and decryption