0% found this document useful (0 votes)
2 views

Unit 2 Part 6

The document outlines the AES algorithm, detailing its encryption process which includes preprocessing, substitution, shift rows, mix columns, and key addition, with a total of 10 rounds plus one preprocessing step. It emphasizes the need for key expansion to generate 44 words from a 4-word key for secure encryption. Additionally, it briefly introduces the RC4 algorithm as a stream cipher used in WiFi security, highlighting its initialization and permutation processes.

Uploaded by

Rajalakshmi G
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Unit 2 Part 6

The document outlines the AES algorithm, detailing its encryption process which includes preprocessing, substitution, shift rows, mix columns, and key addition, with a total of 10 rounds plus one preprocessing step. It emphasizes the need for key expansion to generate 44 words from a 4-word key for secure encryption. Additionally, it briefly introduces the RC4 algorithm as a stream cipher used in WiFi security, highlighting its initialization and permutation processes.

Uploaded by

Rajalakshmi G
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

AES Algorithm

I love
Problem Statement Hi funny, matrices
I want to share 16 only
Bunny step coke recipe.
Funny
This is my original Input & key
Buddy
Hey Buddy,
I need four steps to make my
encryption secure. +
One more initial step
1. Preprocessing
2. Substitution
3. Shift Rows
4. Mix Columns
5. Add Key
Oops - I need very strong 10 rounds +1 preprocessing
step but I have only 4 words of key?????
Soln: Key Expansion to get 44 words of key ( 4 for every round)
Step 1: I don’t want to reveal original instructions to any
round of encryption.
I try to do Pre-processing.

1 5 9 D

2 6 A E
=
3 7 B E1

4 8 C E2
Step 2a) Substitution
Step 2b) Shift Rows
Step 2c) Mix Columns
Step 2d) AddKey
w4-w7

Great End of Round 1 … Repeat the same for 9


more rounds!!!!!!!!!!!!!!!!!!!!!!!!
1 bit = 0/1
Key Points of AES Algorithm 1 byte = 8bits
1 word = 4 bytes

Length of Input Length of Key Name Number of Rounds

128 bits / 128 bits AES-128 10


16 bytes/ 192 bits AES-192 12
4words 256 bits AES -256 14

Name of Array Dimensions Purpose

Input Array 4X4 To store input bytes.


Data stored in columnar fashion.
Each cell has 1 byte of information.

State Array 4X4 To store intermediary results.


Each cell has 1 byte of information.

Key Array 4X4 To store 16 bytes of key.


Each cell has 1 byte of information.
Key Points Continued…..
Step No Name of Step Operation

Initial Key Expansion 4 word key expanded into 44 word keys as 4 words of
key is needed at each step and totally there are
1 preprocessing + 10 rounds = total 11 steps

1. Preprocessing 4X4 I/P is ex-or with first four words of the key

2 Round 1 a) Substitution using S-box table


b) Shift Rows - Left shift elements in matrix
c) Mix Columns - Multiply each column with
constant 4X4 matrix
d) Add Key - Ex-or column wise 4 word key with the
result of mix column step.

Round 2 to 9 Repeat Previous Steps

Round 10 Repeat previous steps except mix columns.

● It does not use feistel structure.


● Every stage is reversible
Transformation Functions
1. Substitution
1. The forward substitute byte
transformation, called SubBytes, is a
simple table lookup.
2. AES defines a 16 * 16 matrix of byte
values, called an S-box , that contains
a permutation of all possible 256 8-bit
values.
3. Each individual byte of State is mapped
into a new byte in the following way:
The leftmost 4 bits of the byte are used
as a row value and the rightmost 4 bits
are used as a column value.
4. These row and column values serve as
indexes into the S-box to select a
unique 8-bit output value.
Transformation Functions
2. Shift Row
Transformation Functions—------3. Mix Columns

❖ addition is the bitwise XOR operation


❖ multiplication of a value by x can be implemented as a 1-bit left shift followed by a
conditional bitwise XOR if the leftmost bit of the original value (prior to the shift) is 1.
Transformation Functions -4. Add Round Key
AES Decryption - Inverse/Reverse of every operation is
used.
1. The inverse substitute byte transformation, called InvSubBytes, makes use of
the inverse S-box.
2. The inverse shift row transformation, called InvShiftRows, performs the
circular shifts in the opposite direction for each of the last three rows, with a
1-byte circular right shift for the second row, and so on
Pseudo Random Number Generator
Import design considerations for a stream cipher
1. The encryption sequence should have a large period. A pseudorandom
number generator uses a function that produces a deterministic stream of bits
that eventually repeats( period should be long)
2. The keystream should approximate the properties of a true random number
stream as close as possible. For example, there should be an approximately
equal number of 1s and 0s
3. To guard against brute-force attacks, the key needs to be sufficiently long.
RC4 Algorithm
● It is a stream cipher with variable key size stream cipher with byte-oriented
operations.
● based on the use of a random permutation.
● RC4 is used in the WiFi Protected Access (WPA) protocol that are part of the
IEEE 802.11 wireless LAN standard.
● variable-length key of from 1 to 256 bytes (8 to 2048 bits) is used to initialize a
256-byte state vector S, with elements S[0],S[1], . . . ,S[255].
● At all times, S contains a permutation of all 8-bit numbers from 0 through 255.
For encryption and decryption, a byte k is generated from S by selecting one
of the 255 entries in a systematic fashion.
● As each value of k is generated, the entries in S are once again permuted
Step 1a) Initialization of S and T ( Simple eg using 3 bits
and 8 entries)
S = [ 0 1 2 3 4 5 6 7]
K = [1 2 3 6]
PLAIN = [1 2 2 2]

/* Initialization */
for i = 0 to 7 do
S[i] = i;
T[i] = K[i mod keylen];
Step 1b) Permutation of S with respect to T.
S = [ 0 1 2 3 4 5 6 7]

K = [1 2 3 6]

PLAIN = [1 2 2 2]
Step 2. Stream Generation

You might also like