AES

Why
The AES is important because it is the more secure replacement for the DES and it is more computationally efficient to compute

Specification

 * 128, 192, 256 bit keys
 * 128 bit block size

How
The AES works as following:



Split Up Key and Message Blocks
Take the input key and input block and divide them up into 16 parts each. We then place these parts into 4 x 4 matricies.

Perform the Rounds
In general, a round in the Rijndael is performed like this


 * Round(State, RoundKey)

State is the input and then output message block and the RoundKey is the key matrix that is derived from the input key via key scheduling

Number of Rounds
The number of rounds vary depending on key sizes
 * 10 rounds for 128 bit keys
 * 12 rounds for 196 bit keys
 * 14 rounds for 256 bit keys

Defining a Round
The round function specifically works as following
 * 1) SubBytes(State)
 * 2) ShiftRows(State)
 * 3) MixColumns(State)
 * 4) AddRoundKey(State, RoundKey)

Defining the Final Round
The final round is the same as the regular round function but with MixColumns removed.

SubBytes Implementation
SubBytes is designed to substitute each byte in the message nonlinearly with another byte. This nonlinearity is important to prevent differential cryptanalysis

ShiftRows Step
Each row is rotated a number of bytes in this step. This captures the mixing property we need for a good cipher.

MixColumns Step
Each column is treated as a degree 3 polynomial and then multiplied with a fixed degree 3 polynomial and then modulo against $$x^4 + 1$$ to get a degree 3 polynomial at the end and then put back into column form.

AddRoundKey Step
The round key is added to the state byte by byte and bit by bit using XOR.