Symmetric Cryptography: Advanced Encryption Standard(AES)
Symmetric Cryptography: Advanced Encryption Standard(AES)
AES is a block cipher, which takes 128 bits message and encrypt the message into 128 bits ciphertext. The key of AES can be 128 bits(with 10 rounds of encryption), 192 bits(with 12 rounds of encryptio) or 256 bits(with 14 rounds of encryption). Here, we look at AES-128(the key size is 128 bits).
The encryption process is as follows:
Let’s now look at the process in detail.
AES starts by arranging the 128 bits message in 4 × 4
matrix:
Then we come to the key addition layer. We have a 128-bit key, and by key schedule we can obtain ten 128-bit round keys. Each round key can also be represented as 4 × 4
matrix. Therefore, in the key addition layer, we simply XOR
the key matrix to the message matrix:
After key additon, we step into round 1, which consists of four stages. The first stage is byte substitution. Each byte in the current 4 x 4
message matrix is used as an index to the S-box, obtaining a new byte for that position. For example, we have a 4 x 4
message matrix and the S-box:
For the first btye 19
(hex value), by looking up the table, we can substitute it with d4
. And for the second btye 3d
(hex value), we can substitute it with 27
. We can keep looking up the table and substitute the whole matrix.
After the byte substitution, we come into the diffusion layer, which has two sub-layers. Firstly we shift the rows of the message matrix:
Then we mix the columns, which is achieved by “matrix multiplication”:
Note that the “matrix multiplication” is a special operation:
After the diffusion layer, we come to the key additon layer, which is same as the previous key addtion layer.