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

Module 2 Symmetric Encryption Algorithms

Uploaded by

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

Module 2 Symmetric Encryption Algorithms

Uploaded by

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

BCSE309L – Cryptography and Network

Security
Advanced Encryptionm Standard (AES)
Advanced Encryption Standard
• Specification for the encryption of electronic data established by the U.S
National Institute of Standards and Technology (NIST) in 2001.
• AES is widely used today as it is much stronger than DES and triple DES
despite being harder to implement.

• AES is a block cipher.


• The key size can be 128/192/256 bits.
• Encrypts data in blocks of 128 bits each.

• It takes 128 bits as input and outputs 128 bits of encrypted cipher text as
output.
• AES relies on substitution-permutation network principle which
means it is performed using a series of linked operations which involves
replacing and shuffling of the input data.
Advanced Encryption Standard
• AES performs operations on bytes of data rather than
in bits.
• Since the block size is 128 bits, the cipher processes
128 bits (or 16 bytes) of the input data at a time.
• 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
Advanced Encryption Standard
Advanced Encryption Standard

P XOR K

General design of AES encryption standard


Advanced Encryption Standard
• A Key Schedule algorithm is used to calculate all the round keys
from the key.
• So the initial key is used to create many different round keys
which will be used in the corresponding round of the encryption

Encryption
• AES considers each block as a 16 byte (4 byte x 4 byte = 128 )
grid in a column major arrangement.
Advanced Encryption Standard
Advanced Encryption Standard
K
P
Advanced Encryption Standard
• Each round comprises of 4 steps :
1. SubBytes
2. ShiftRows
3. MixColumns
4. Add Round Key
• The last round doesn’t have the MixColumns round
• SubBytes does the substitution
• ShiftRows and MixColumns perform permutation in the
algorithm
• AddRoundKey is used to perform the XOR operation in
the encryption and decryption process.
Advanced Encryption Standard

SubBytes
Advanced Encryption Standard
Advanced Encryption Standard

(a) S-Box (b) SubBytes Transformation


Advanced Encryption Standard
Advanced Encryption Standard
Shift rows
Advanced Encryption Standard
Advanced Encryption Standard

Inverse Shift rows


Advanced Encryption Standard

(a) ShiftRows Transformation; (b) Example


Advanced Encryption Standard
MixColumns
Advanced Encryption Standard

(a) MixColumns; (b) InverseMixColumns


Advanced Encryption Standard
Example of MixColumn
Advanced Encryption Standard
Advanced Encryption Standard

Sample Calculation of 02 * 4A
Advanced Encryption Standard
Advanced Encryption Standard
Advanced Encryption Standard

Do the same for all


Advanced Encryption Standard
Example 2:

Example of MixColumn
Advanced Encryption Standard
AddRoundKey
Advanced Encryption Standard

Result of Round 1 :
40 = 0100 0000 EB40F21E592E38848BA113E71BC342D6
19 = 0001 1001
= 0101 1001 Repeat the same processes for all the remaining
5 9 rounds ( till round 10) to generate the ciphertext
Ans : 59
Advanced Encryption Standard

Key Expansion
128 bits  16 bytes = 4 * 4 bytes Advanced Encryption Standard
4 bytes(32 bits – 1 cell  1word
Wi  4 words (128 bits 1 column  1 Round Key

8 bits
8 bits
8 bits
8 bits
1 time left
Round 0 key shift

Round Constant
Advanced Encryption Standard
Key Expansion
Advanced Encryption Standard
Example
Advanced Encryption Standard
Example

1 time left
shift
AES

d2  1101 0010
01  0000 0001
= 1101 0011
= d3
AES

1 time left
shift

d2  1101 0010
01  0000 0001
= 1101 0011
= d3
Advanced
Encryption
Standard
Example for Practice
Plaintext Key Round Constant

S-Box Mix Column Fixed Matrix

Cipher Text?
Round 0
Key Generation

B7 XOR 01
B7  1011 0111
01  0000 0001
XOR  1011 0110
 B 6

w(0) = 54 68 61 74
G(w[3]) = B6 5A 9D 85
= E2 32 FC F1
Keys
Key Generation

B7 XOR 01
B7  1011 0111
01  0000 0001
XOR  1011 0110
 B 6

w(0) = 54 68 61 74
G(w[3]) = B6 5A 9D 85
= E2 32 FC F1
CipherText

Inverse Mixcolumn
Fixed Matrix

Inverse S-Box

Plaintext ?
Practice
Given the plaintext [0000 0101 0202 0303 0405 0607 0809 0A0B] and the key [0101 0101 0202 0202
0303 0303 0404 0404]. Apply AES algorithm to find the cipher text
a. Show the original contents of state, displayed as a 4x4 matrix.

b. Show the value of state after initial AddRoundKey.

c. Show the value of State after SubBytes.

d. Show the value of State after ShiftRows.

e. Show the value of State (First two rows b0, b4, b8, b12, b1, b5, b9 and b13) after MixColumns.

59
Practice

Given the plaintext [0210 1121 A232 4453 6107 B6E7 D8F9 0CDB] and the
key [0000 1111 2222 3333 4444 5555 6666 7777]. Apply AES algorithm to find
the encrypted plaintext after Round1.

60
Practice
The following four words corresponding to the input key in Advanced
Encryption Standard (AES) that uses a 128 bit key are W0, W1, W2 and W3.
W0 – 5A 7C 12 23
W1 – 31 42 41 11
W2 – 25 63 B2 43
W3 – 22 45 31 62
Discuss the key expansion procedure and determine the next four words W4,
W5, W6 and W7 that will be derived from W0, W1, W2 and W3 to be used in
the encryption process. Show all the steps that led to the result in your answer.

61

You might also like