The AES Cipher - Rijndael
designed by Rijmen-Daemen in Belgium
AES is a block cipher.
The key size can be 128/192/256 bits.
Encrypts data in blocks of 128 bits each.
The number of rounds depends on the key
length as follows :
128 bit key – 10 rounds
192 bit key – 12 rounds
256 bit key – 14 rounds
AES Encryption Process
AES
Encryption
Process
AES Structure
Encryption Process
Each round comprise of four sub-processes.
AES Round
AES Structure
data block of 4 columns of 4 bytes is state
key is expanded to array of words
Round operation
byte substitution (1 S-box used on every byte)
shift rows (permute bytes between groups/columns)
mix columns (subs using matrix multiply of groups)
add round key (XOR state with key material)
Byte Substitution (SubBytes)
The 16 input bytes are substituted by looking up a fixed table (S-
box) given in design. The result is in a matrix of four rows and four
columns.
Substitute Bytes
Substitute Bytes Example
Shift Rows
a circular byte shift in each each
1st row is unchanged
2nd row does 1 byte circular shift to left
3rd row does 2 byte circular shift to left
4th row does 3 byte circular shift to left
decrypt inverts using shifts to right
Shift Rows :
This step is just as it sounds. Each row is shifted a
particular number of times.
The first row is not shifted
The second row is shifted once to the left.
The third row is shifted twice to the left.
The fourth row is shifted thrice to the left.
(A left circular shift is performed.)
[ b0 | b1 | b2 | b3 ] [ b0 | b1 | b2 | b3 ]
| b4 | b5 | b6 | b7 | -> | b5 | b6 | b7 | b4 |
| b8 | b9 | b10 | b11 | | b10 | b11 | b8 | b9 |
[ b12 | b13 | b14 | b15 ] [ b15 | b12 | b13 | b14 ]
Shift Rows
Mix Columns
each column is processed separately
each byte is replaced by a value
dependent on all 4 bytes in the column
effectively a matrix multiplication
Mix Columns
Mix Columns Example
Add Round Key
XOR state with 128-bits of the round key
again processed by column (though
effectively a series of byte operations)
Add Round Key
AES Round
AES Key Expansion
Ittakes a single key up during the first
stage, which is later expanded to multiple
keys used in individual rounds.
AES Key Expansion
AES Decryption
AES decryption is not identical to
encryption since steps done in reverse
but can define an equivalent inverse
cipher with steps as for encryption
but using inverses of each step
with a different key schedule
AES Decryption
summary