Advance Encryption Standard: 3.1 The History
Advance Encryption Standard: 3.1 The History
Advance Encryption Standard: 3.1 The History
The elementary operation behind this cipher is astonishingly simple: byte wise
substitution, byte exchange, and XOR. If AES is working on 128 bits block then it
will use 4x4 matrixes as state and subkey respectively. The 128-bit algorithm
executes 10 rounds; for longer keys i.e. 192 and 256 bits size, this number is increased
to 12 and 14 rounds, respectively. For simplicity, in this research 128-bit keys and
128-bit data blocks have been chosen2.
2
http://csrc.nist.gov/CryptoToolkit/aes/
19
Chapter 3. Advance Encryption Standard
ShiftRows, MixColumns and AddRoundKey are used. In the final round only
SubBytes, ShiftRows and AddRoundKey will be used. AddRoundKey is in fact a
form of Vernam cipher and the other three stages SubBytes, ShiftRows and
MixColumns provides nonlinearity, confusion, and diffusion [22].
Plaintext Plaintext
01 dnuo R
Shift Rows Inverse shift rows
9 dnuo R
.
. Inverse shift rows
Substitute Bytes .
.
Shift Rows
.
Mix Columns Inverse mix cols
9 dnuo R
1 dnuo R
Shift Rows Inverse shift rows
01 dnuo R
Ciphertext Ciphertext
20
Chapter 3. Advance Encryption Standard
3.4.2 ShiftRows
It is a left shift operation in a row. In ShiftRows transformation rows of the
state are shifted in a cyclic way. The first row is not shifted, second row is shifted
with one byte from right to left, third row is shifted with two bytes and the last row is
shifted with three bytes shifted towards left. The bytes are inserted from the right side
of the same row i.e. left circular shift figure 3.3.
3.4.3 MixColumns
The Columns of the state perform MixColumns transformation by multiplying
each column of the state with the columns of the predefined block. (Equation 3.1 and
3.2). The first column of the state is multiplied with the first column of the block and
the resultant four bytes perform a XOR operation between them to generate a single
byte value. Same operation continues for the first column of the state being multiplied
by the second, third and fourth column of the predefined block. The first column of
21
Chapter 3. Advance Encryption Standard
the state is now replaced by the generate four bytes through this operation. Same
operation will continue for the second, third and fourth column of the state.
s 0' , j = (2 • S 0, j ) ⊕ (3 • S1, j ) ⊕ S 2, j ⊕ S 3, j
'
s1, j = S 0, j ⊕ (2 • S1, j ) ⊕ (3 • S 2, j ) ⊕ S 3, j
(3.2)
s 2' , j = S 0, j ⊕ S1, j ⊕ (2 • S 2, j ) ⊕ (3 • S 3, j )
'
s3, j = (3 • S 0, j ) ⊕ S1, j ⊕ S 2, j ⊕ (2 • S 3, j )
3.4.4 AddRoundKey
In this transformation each byte of the state performs a XOR operation with
the key. Eleven (11) keys of length 128 bits each (total 1408 bits) are stored in the
computational unit. AddRoundKey transformation takes the keys one by one and
XOR it with the state of the corresponding round. First 128 bits are used in the initial
round then the rest of the 10 keys are used for the next 10 rounds.
Keys are generated by the key expansion process in which a 128 bits long key
is expended to 1408 bits. In this research, it is assumed that keys are already
generated by the key expansion process and stored in memory for the use of
AddRoundKey transformation.
22
Chapter 3. Advance Encryption Standard
be 160 hexadecimal values. For 160 hexadecimal values the SubBytes operation
searches S-Box values 160 times for the replacements. There are two choices
available to implement SubBytes transformation. First, all the values of S-Box are put
in the memory to create a lookup table. In second choice, the replacing values
composing two transformations mentioned in [13, 19] can be calculated. The two
transformations are:
a) Multiplicative inverse of the value (1 byte) in GF (28). The zero
element is mapped to itself.
b) Affine transformation which can be expressed in matrix form (equation
3.3)
b0' 1 0 0 0 1 b0 1
1 1 1
'
b1 1 1 0 0 1 b1 1
0 1 1
b2' 1 1 1 0 1 b2 0
0 0 1
'
b3 = 1 1 1 1 1 b3 0
0 0 0
⊕ (3.3)
b ' 1 1 1 1 0 b4 0
1 0 0
4'
b5 0 1 1 1 0 b5 1
1 1 0
b ' 0 0 1 1 0 b6 1
1 1 0
6
b7' 0 0 0 1 1 1 0 1 b7 0
It will save the memory but it will increase the computational load. As the
available FPGAs have built-in memory features, so it is considerable to make use of
built-in features of FPGA there fore in this research S-Box is stored as lookup table.
23
Chapter 3. Advance Encryption Standard
and an XOR operation is performed between it and the same byte before shifting.
MixColumns transformation is not included in the final round.
24