Encryption process

The AES (Advanced Encryption Standard) algorithm has a fixed block size of 128 bits. The size of the key, though, can be of 128, 192 and 256 bits.

The ecryption process consists of a variable number of rounds that depends exclusively on the key size; 10 rounds for a 128 bits key, 12 rounds for a 192 bits key and 14 rounds for a 256 bits key.

AES operates on a 4x4 bytes matrix called state on which it performs the needed modifications.

The scheme of the process is as follows:

1 - Key expansion using the Rijndael key schedule.

2 - First round:
AddRoundKey

3 - Rounds:
SubBytes - Non linear subtitution where each byte is replaced with another one in correspondance with a search table..
ShiftRows - Transposition where each row of the state matrix is rotated in a cyclic way a certain number of times.
MixColumns - Mixing operation that operates in the columns of the state, combining the four bytes in each column by using a linear transformation.
AddRoundKey - Each byt of the state is combined with the round key; each round key is derived from the encryption key using a key iteration.

4 - Final round, in which the following operations are performed:
SubBytes
ShiftRows
AddRoundKey

The rounds (point 3) are the ones that are repeated depending on the size of the key. For keys of 128 bits, where the number of round is ten, this rounds repeats a total of 9 times that plus the final round (in which the MixColumns operation is not performed) sums the 10 rounds that we were mentioning. For bigger key sizes, the process will be similar.