AES(Advanced Encryption Standard)
AES is a symmetric block cipher standardized by NIST in 2001 (FIPS PUB 197).
It was based on the Rijndael algorithm, designed by Daemen and Rijmen.
Block size: Fixed at 128 bits.
Key sizes: 128, 192, or 256 bits.
Number of rounds:
10 rounds for 128-bit keys
12 rounds for 192-bit keys
14 rounds for 256-bit keys
The input to the encryption and decryption algorithms is a single 128-bit block. this block is
depicted as a 4 * 4 square matrix of bytes. This block is copied into the State array, which is
modified at each stage of encryption or decryption. After the final stage, State is copied to an
output matrix. These operations are depicted in the below Figure. Similarly, the key is depicted
as a square matrix of bytes. This key is then expanded into an array of key schedule words. Each
word is four bytes, and the total key schedule is 44 words for the 128-bit key.
The cipher consists of N rounds, where the number of rounds depends on the key length: 10 rounds for a
16-byte key, 12 rounds for a 24-byte key, and 14 rounds for a 32-byte key . The first N - 1 rounds consist
of four distinct transformation functions: SubBytes, ShiftRows, MixColumns, and AddRoundKey, which
are described subsequently. The final round contains only three transformations, and there is a initial
single transformation (AddRoundKey) before the first round, which can be considered Round 0.
The below figure shows the AES cipher in more detail, indicating the sequence of
transformations in each round and showing the corresponding decryption function.
Four different stages are used, one of permutation and three of substitution:
• Substitute bytes: Uses an S-box to perform a byte-by-byte substitution of
the block
• ShiftRows: A simple permutation
• MixColumns: A substitution that makes use of arithmetic over GF(28)
• AddRoundKey: A simple bitwise XOR of the current block with a portion
of the expanded key
The structure is quite simple. For both encryption and decryption, the cipher begins with an
AddRoundKey stage, followed by nine rounds that each includes all four stages, followed by a
tenth round of three stages
Substitute Bytes Transformation
The forward substitute byte transformation, called SubBytes, is a simple table lookup .AES
defines a 16 * 16 matrix of byte values, called an S-box that contains a permutation of all
possible 256 8-bit values. Each individual byte of State is mapped into a new byte in the
following way: The leftmost 4 bits of the byte are used as a row value and the rightmost 4 bits
are used as a column [Link] row and column values serve as indexes into the S-box to
select a unique 8-bit output value. For example, the hexadecimal value {95} references row
9,column 5 of the S-box, which contains the value {2A}. Accordingly, the value {95} is mapped
into the value {2A}.
ShiftRows Transformation
Forward and Inverse Transformati ons The forward shift row transformation, called ShiftRows,
is depicted in Figure 5.7a. The first row of State is not altered. For the second row, a 1-byte
circular left shift is performed. For the third row, a 2-byte circular left shift is performed. For the
fourth row, a 3-byte circular left shift is performed.
The following is an example of ShiftRows.
MixColumns Transformation
The forward mix column transformation,called MixColumns, operates on each column
individually. Each byte of a column is mapped into a new value that is a function of all four
bytes in that column. The transformation can be defined by the following matrix multiplication
on State
AddRoundKey Transformation
In the forward add round key transformation,called AddRoundKey, the 128 bits of State are
bitwise XORed with the 128 bits of the round key. the operation is viewed as a column wise
operation between the 4 bytes of a State column and one word of the round key; it can also be
viewed as a byte-level operation. The following is an example of AddRoundKey:
The first matrix is State, and the second matrix is the round key.
Key Expansion Algorithm
The AES key expansion algorithm takes as input a four-word (16-byte) key and produces a linear
array of 44 words (176 bytes). This is sufficient to provide a four word round key for the initial
AddRoundKey stage and each of the 10 rounds of the cipher.