You are on page 1of 18

Chapter 5

AES
Prepared By: Sneha Padhiar
AES

 It is found at least six time faster than triple DES.


 A replacement for DES was needed as its key size was too small.
 With increasing computing power, it was considered vulnerable against exhaustive key
search attack.
 Triple DES was designed to overcome this drawback but it was found slow.
 The features of AES are as follows
Symmetric key symmetric block cipher
128-bit data, 128/192/256-bit keys
Stronger and faster than Triple-DES
Provide full specification and design details
 Plain text block size is 128 bits (16 bytes).
 Key size is depends on number of round 128, 192, or 256 bit.
 Based on key size AES is named as AES-128, AES-192, or AES-256.
 The input 128 bit block, this block is arranged in the form of 4 X 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.
 There is a initial single transformation (AddRoundKey) before the first round which can be
considered Round 0.
 The first N-1 rounds consist of four distinct transformation function:
 SubBytes
 ShiftRows
 MixColumns
 AddRoundKey

The final round contains only first three transformations of


above round
 Each transformation takes one or more 4 X 4 matrices as input and produces a 4 X 4
matrix as output.
 The key expansion function generates N+1 round key each of which is distinct 4 X 4
matrices. Each round key serves as one of the inputs to the AddRoundKey transformation
in each round.
Detail Structure of AES
Several comments about AES structure:
 It is not a Feistel structure. As we know in feistel structure half of the data block is used to modify the other
half of the data block and then the halves are swapped.
 While in AES we use full data block as a single matrix during each round.
 The key is expanded into an array of fourty-four 32-bit words. And such four word (128-bit) serves as round key for
each round.
 Four different stages are used one of permutation and three of substitution:
 SubBytes: 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 bytes.
 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 it begins with
AddRoundKey, followed by nine rounds of all four stages, followed by tenth round of
three stages.
AES Transformation Function

 Substitute bytes Transformation (Forward & Inverse)


 Substitute bytes transformation is simple table lookup. There is separate table for forward and inverse
operation.
 16 X 16 matrix of byte value called s-box that contains the permutation of all 256 8-bit values. Each
individual byte of state is mapped into a new byte in the following way.
 The left most 4-bit of the byte are used as row number and right most 4-bit are used as column number. Now
row and column number serves as index into the s-box to select unique 8-bit output value.
Forward
hexadecimal value 68 is referred to row
6 and column 8 and value in table at that
position is 45 so byte value 68 is
replaced with 45.
 For inverse substitute byte procedure is same but S-box is different. Reverse of above
example is shown in figure.
Shift Rows Transformation (Forward & Inverse)

The forward shift row transformation is performed as below:


1. The first row of state is not altered.
2. In second row we apply 1-byte circular left shift.
3. In third row we apply 2-byte circular left shift.
4. In fourth row we apply 3-byte circular left shift.
Mixing of columns

 Mix Columns After shifting the rows, we mix the columns. Each column is multiplied by
the matrix 1 4
 4 1
Add Round key

 Add Round Key


 The last stage of each round of encryption is to add the round key. (In fact,
 this is also done before the first round.) Before the first round, the first two words (W0
and W1) of
 the expanded key are added. In the first round, W2 and W3 are added. In the last round,
W4 and
 W5 are added. All additions are done modulo 2, that is, with XOR.
Key Expansion

 Key Expansion Key expansion is done very similarly to AES. The


four nibbles in the key are grouped into two 8-bit “words”, which
will be expanded into 6 words.
 The first part of the expansion, which produces the third and
fourth words, is shown below.
 The rest of the expansion is done in exactly the same way,
replacing W0 and W1 with W2 and W3, and replacing W2 and
W3 with W4 and W5.

You might also like