Advanced Encryption Standards
Advanced Encryption Standards
AES
Advanced Encryption standards
• AES was established by the U.S. National
Institute of standards and Technology NIST in
2001
• AES is been adopted by the US government
and is now used world wide.
• It supersedes the DES which was published in
1977
• The AES is a symmetric key algorithm.
• AES is a block cipher
Advanced Encryption standards
• AES encrypts messages in blocks of 128bits
• AES allows three different key lengths 128,192
and 256 bits.
• The number of rounds in Encryption and
Decryption is dependent on the key length
• 128 bit key → 10 rounds
• 192 bit key → 12 rounds
• 256 bit key → 14 rounds
Message Message Message Message
(128 bits) (128 bits) (128 bits) (128 bits)
AES ENCRYPTION
CIPHER TEXT
Key expansion in AES
• Key in Text= satishcjisboring
b1 b5 b9 b13 73 73 69 72
b2 b6 b10 b14 61 68 73 69
b3 b7 b11 b15 74 63 62 6e
b4 b8 b12 b16 69 6a 6f 67
Key expansion in AES
b1 b5 b9 b13 • Size of each value
b2 b6 b10 b14 in the byte is 8
b3 b7 b11 b15 bits e.g. b1
b4 b8 b12 b16 • So b1 + b2 + b3 +b4
= 32 bits
Word 0 Word 3
Word 1 Word 2 • Expand the key
from 4 words i.e.
Word = 32 bits w1,w2,w3,w4 to
w43 words
• Expand the key from 4 words i.e. w1,w2,w3,w4 to
w43 words
W4 W5 W6 W7
• What is the Function g ? W4=W0 XOR g(W3)
f9
9f
85
40are in generating key for Round 1 XOR R1
• Since we
with Y1
8b
fe
= g(W3) f1
29
How to generate subkeys for Round 1
Sub Key -0
W0 W1 W2 W3
g
73 73 69 72
61 68 73 69
74 63 62 6e
69 6a 6f 67
W4 W5 W6 W7
8b f8 91 e3
fe 96 e5 8c
f1 92 f0 9e
29 43 2c 4b
Message Message Message Message
(128 bits) (128 bits) (128 bits) (128 bits)
Sub key 0 = W0 W1 W2 W3
AES ENCRYPTION
CIPHER TEXT
Add Round Key
Message
(128 bits) secretmessagenow =128bits
Convert to 16 bytes
• 73 65 63 72 65 74 6d 65 73 73 61 67 65 6e 6f 77
73 65 73 65 73 73 69 72
65 74 73 6e 61 68 73 69
63 6d 61 6f 74 63 62 6e
72 65 67 77 69 6a 6f 67
w0 w1 w2 w3
subkey 0
Add Round Key
73 65 73 65 73 73 69 72
65 74 73 6e 61 68 73 69
63 6d 61 6f 74 63 62 6e
72 65 67 77 69 6a 6f 67
Input Message w0 w1 w2 w3
subkey 0
00 16 1a 17
04 1c 00 07
Output → 17 0e 03 01
1b 0f 0f 10
• Need to understand a round ?
Sub key 1 = W4 W5 W6 W7
AES ENCRYPTION
CIPHER TEXT
Message Message Message Message
(128 bits) (128 bits) (128 bits) (128 bits)
AES ENCRYPTION
CIPHER TEXT
Message Message Message Message
(128 bits) (128 bits) (128 bits) (128 bits)
AES ENCRYPTION
CIPHER TEXT
Step-1:Byte Substitution
• Does a simple replacement of each byte of the block data using a
S-box
• Left 4 bits determine the row, right four bits determine the column
00 16 1a 17
04 1c 00 07
17 0e 03 01
1b 0f 0f 10
63
Step-1:Byte Substitution
• Does a simple replacement of each byte of the block data using a
S-box
• Left 4 bits determine the row, right four bits determine the column
00 16 1a 17
04 1c 00 07
17 0e 03 01
1b 0f 0f 10
63 47
Step-1:Byte Substitution
• Does a simple replacement of each byte of the block data using a
S-box
• Left 4 bits determine the row, right four bits determine the column
00 16 1a 17
04 1c 00 07
17 0e 03 01
1b 0f 0f 10
63 47 a2 f0
f2 9c 63 c5
f0 ab 7b 7c
af 76 76 ca
Step 2: Shift Rows
• Shift Rows ,simply byte shift the rows
1. First Row: No Change
2. Second Row: one byte cyclic left shift
3. Third Row: Two byte cyclic left shift
4. Fourth Row: Three byte cyclic left shift
Step 2: Shift Rows
63 47 a2 f0
f2 9c 63 c5
f0 ab 7b 7c
af 76 76 ca
63 47 a2 f0
9c 63 c5 f2
7b 7c f0 ab
ca af 76 76
Step 3:Mix Columns
• Multiply the matrix from the previous step with a
standard matrix
r1 r5 r9 r13
r2 r6 r10 r14 • Finite Field
r3 r7 r11 r15 Arithmetic
r4 r8 r12 r16
Step 4: Add round Key
W4 W5 W6 W7
8b f8 91 e3
fe 96 e5 8c
f1 92 f0 9e
29 43 2c 4b
•Similar operation
from round 2 to
round 9
•Round 10 Does not
support Mix Columns
Decryption
Decryption
Decryption Round
• Round has the following step
1. Substitution Bytes
2. Shift Rows
3. Mixing Columns (Not applicable for round 10)
4. Add round key
Decryption Round-Substitution Bytes
• Substitution Bytes- An inverse S box is used for
byte substitution
Decryption Round- Shift Rows
• Shift rows- Rows are shifted right in
decryption
• Shift Rows ,simply byte shift the rows
1. First Row: No Change
2. Second Row: one byte cyclic right shift
3. Third Row: Two byte cyclic right shift
4. Fourth Row: Three byte cyclic right shift
Decryption Round- 2 .Shift Rows
63 47 a2 f0
9c 63 c5 f2
7b 7c f0 ab
ca af 76 76
63 47 a2 f0
f2 9c 63 c5
f0 ab 7b 7c
af 76 76 ca
Decryption Round- 3 . Mix columns
Decryption Round- 4 . Add Round Key