NS Assignment
NS Assignment
Shiftrows
Each of the four rows of the matrix is shifted to the left. Any entries that ‘fall
off’ are re-inserted on the right side of row. Shift is carried out as follows −
• First row is not shifted.
• Second row is shifted one (byte) position to the left.
• Third row is shifted two positions to the left.
• Fourth row is shifted three positions to the left.
• The result is a new matrix consisting of the same 16 bytes but shifted with
respect to each other.
MixColumns
Each column of four bytes is now transformed using a special mathematical
function. This function takes as input the four bytes of one column and outputs
four completely new bytes, which replace the original column. The result is
another new matrix consisting of 16 new bytes. It should be noted that this step
is not performed in the last round.
Addroundkey
The 16 bytes of the matrix are now considered as 128 bits and are XORed to the
128 bits of the round key. If this is the last round then the output is the cipher
text. Otherwise, the resulting 128 bits are interpreted as 16 bytes and we begin
another similar round.
Decryption Process
The process of decryption of an AES ciphertext is similar to the encryption
process in the reverse order. Each round consists of the four processes
conducted in the reverse order −
• Add round key
• Mix columns
• Shift rows
• Byte substitution
Since sub-processes in each round are in reverse manner, unlike for a Feistel
Cipher, the encryption and decryption algorithms needs to be separately
implemented, although they are very closely related.
• Assuming a 128-bit key, the key is also arranged in the form of an array of 4 ×
4 bytes. As with the input block, the first word from the key fills the first
column of the array, and so on.
• The four column words of the key array are expanded into a schedule of 44
words. (As to how exactly this is done, we will explain that later in Section 8.8.)
Each round consumes four words from the key schedule.
• The following figure depicts the arrangement of the encryption key in the form
of 4-byte words and the expansion of the key into a key schedule consisting of
44 4-byte words. Of these, the first four words are used for adding to the input
state array before any round-based processing can begin, and the remaining 40
words used for the ten rounds of processing that are required for the case a 128-
bit encryption key.
k 0 k 4 k 8 k 12
k 1 k 5 k 9 k 13
k 2 k 6 k 10 k 14
k 3 k 7 k 11 k 15
w 0 w 1 w 2 w 3 w 4 w 5 w 42 w 43
This figure shows the four words of the original 128-bit key being expanded
into a key schedule consisting of 44 words. Section 8.8 explains the procedure
used for this key expansion.
Overall AES Structure
THE FOUR STEPS IN EACH ROUND OF PROCESSING
The entries in the lookup table are created by using the notions of
multiplicative inverses in GF (2^8) and bit scrambling to destroy the bit-
level correlations inside each byte.
STEP 2: (called ShiftRows for shifting the rows of the state array during the
forward process) (The corresponding transformation
• The goal of this transformation is to scramble the byte order inside each
128-bit block.
The shift-rows step along with the mix-column step causes each bit
of the ciphertext to depend on every bit of the plain- text after 10
rounds of processing.
Recall the avalanche effect from our discussion on DES in Lecture
3. In DES, one bit of plaintext affected roughly 31 bits of
ciphertext. But now we want each bit of the plaintext to affect
every bit position of the ciphertext block of 128 bits.
STEP 4: (called AddRoundKey for adding the round key to the output of the
previous step during the forward process) (The cor- responding step during
decryption is denoted InvAddRound- Key for inverse add round key
transformation.)
AES Analysis