How AES works

During AES algorithm processing, a 4 x 4 array of bytes known as the state is modified using multiple rounds. Full encryption requires 10 to 14 rounds, depending on the size of the key. The following table shows the key sizes and the required number of rounds:

Key size

Number of rounds required

128-bit

10 rounds

192-bit

12 rounds

256-bit

14 rounds

 

Once the state is initialized with the input to the cipher, four operations are performed in four stages to encrypt the input. These stages are: AddRoundKey, SubBytes, ShiftRows, and MixColumns:

  1. In the AddRoundKey step, the state array is XOR'd with a subkey, which is derived from the master key
  2. SubBytes is the substitution step where a lookup table (S-box) ...

Get Advanced Blockchain Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.