Advanced Encryption Standard (AES) (CS-452)
Advanced Encryption Standard (AES) (CS-452)
Advanced Encryption Standard (AES) (CS-452)
(AES)
(CS-452)
…
AddRoundKey
the key (i.e. the first
AddRoundKey operation)
The “state” then undergoes N SubBytes
Round N-1
rounds of transformation where N ShiftRows
is: MixColumns
Ciphertext
CS-452: Data Security and Encryption Techniques 5/59
AES Structure (2) Plaintext
AddRoundKey
The first N - 1 rounds comprise 5
SubBytes
transformations on the plaintext:
ShiftRows
SubBytes: substitute
MixColumns
Round 1
…
ShiftRows AddRoundKey
MixColumns
AddRoundKey
SubBytes
The last round is similar to ShiftRows
Round N-1
previous rounds, but omits the MixColumns
MixColumns transformation.
AddRoundKey
SubBytes
Round N
ShiftRows
AddRoundKey
Ciphertext
CS-452: Data Security and Encryption Techniques 6/59
AES Structure: Structure of the Single Round
…
AddRoundKey
SubBytes
ShiftRows
MixColumns Round 2
…
AddRoundKey
Plaintext:
⊕ =
E.g. 47 ⊕ AC = EB
...
40 ⊕ 19 = 59
BC ⊕ 6A = D6
⊕ =
E.g. 47 ⊕ AC = EB
...
40 ⊕ 19 = 59
BC ⊕ 6A = D6
…
AddRoundKey
SubBytes
ShiftRows
MixColumns Round 2
…
AddRoundKey
Replace EA
with 87
87
𝐸𝐴 04 65 85 87 𝐹2 4𝐷 97
83
5𝐶
𝐹0
45
33
2𝐷
5𝐷
98
𝐴𝐷
96
𝐵0
𝐶5
֜ 𝐸𝐶
4𝐴
8𝐶
6𝐸
𝐶3
𝐷8
4𝐶
46
95
90
𝐸7
𝐴6
…
3 2 AddRoundKey
4 3
SubBytes
Example on the next slide
ShiftRows
MixColumns Round 2
AddRoundKey
Result:
87 𝐹2 4𝐷 97
Result:
87 𝐹2 4𝐷 97
6𝐸 4𝐶 90 𝐸𝐶
Result:
87 𝐹2 4𝐷 97
6𝐸 4𝐶 90 𝐸𝐶
46 𝐸7 4𝐴 𝐶3
Result:
87 𝐹2 4𝐷 97
6𝐸 4𝐶 90 𝐸𝐶
46 𝐸7 4𝐴 𝐶3
𝐴6 8𝐶 𝐷8 95
Result:
87 𝐹2 4𝐷 97
6𝐸 4𝐶 90 𝐸𝐶
46 𝐸7 4𝐴 𝐶3
𝐴6 8𝐶 𝐷8 95
Plaintext
Mixes the state columns.
AddRoundKey
Based on Arithmetic in the finite
SubBytes
field GF(28).
ShiftRows
Rationale: when performed after the MixColumns
Round 1
ShiftRows operation ensures that
…
AddRoundKey
each bit of the output depends on
each bit of the input.
2 3 1 1 SubBytes
The matrix 1 2 3 1
is multiplied by ShiftRows
1 1 2 3
the state 3 1 1 2
MixColumns Round 2
…
AddRoundKey
All intermediate additions and
multiplications of numbers is done
using GF(28) arithmetic.
CS-452: Data Security and Encryption Techniques 31/59
AES Encryption: The MixColumns Transformation (3)
7 8
2. 1 2 3
× 9 10 = 1 × 7 + 2 × 9 + 3 × 11 1 × 8 + 2 × 10 + 3 × 12
4 5 6
11 12
7 8
3. 1 2 3
× 9 10 = 1 × 7 + 2 × 9 + 3 × 11 1 × 8 + 2 × 10 + 3 × 12
4 5 6
11 12 4 × 7 + 5 × 9 + 6 × 11
7 8
1 2 3
4. 4 5 6
× 9 10 = 1 × 7 + 2 × 9 + 3 × 11 1 × 8 + 2 × 10 + 3 × 12
11 12 4 × 7 + 5 × 9 + 6 × 11 4 × 8 + 5 × 10 + 6 × 12
2 3 1 1
Example: 1 2 3 1
1 1 2 3
MixColumns multiples matrix 3 1 1 2
by the state using GF(28) arithmetic:
87 𝐹2 4𝐷 97
Consider state: 6𝐸 4𝐶 90 𝐸𝐶
46 𝐸7 4𝐴 𝐶3
𝐴6 8𝐶 𝐷8 95
2 3 1 1 87 𝐹2 4𝐷 97
What is 1 2 3 1 6𝐸 4𝐶 90 𝐸𝐶 ?
×
1 1 2 3 46 𝐸7 4𝐴 𝐶3
3 1 1 2 𝐴6 8𝐶 𝐷8 95
Example:
Following the rules of conventional matrix multiplication,
but replacing additions with XOR operations:
2 3 1 1 87 𝐹2 4𝐷 97
1 2 3 1 6𝐸 4𝐶 90 𝐸𝐶
× 46 𝐸7 4𝐴 𝐶3 =
1 1 2 3
3 1 1 2 𝐴6 8𝐶 𝐷8 95
2 × 87 ⊕ 3 × 6𝐸⊕ 1 × 46 ⊕ 1 × 𝐴6 … …
. How do we multiply in
. GF(28) finite field
. arithmetic?
E.g. 2 × 87?
Next slide…
The second half specifies the column index into the E-table.
19 is the
result
74 is the
result
Example:
Following the rules of conventional matrix multiplication,
but replacing additions with XOR operations:
2 3 1 1 87 𝐹2 4𝐷 97
1 2 3 1 6𝐸 4𝐶 90 𝐸𝐶
× 46 𝐸7 4𝐴 𝐶3 =
1 1 2 3
3 1 1 2 𝐴6 8𝐶 𝐷8 95
Answer: 15 ⊕ B2 ⊕ 46
⊕ A6 = 47
CS-452: Data Security and Encryption Techniques 43/59
AES Encryption: The MixColumns Transformation (15)
Example:
Repeat the same process for the rest of the
rows/columns.
2 3 1 1 87 𝐹2 4𝐷 97 47 40 𝐴3 4𝐶
1 2 3 1 6𝐸 4𝐶 90 𝐸𝐶 37 𝐷4 70 9𝐹
× 46 𝐸7 4𝐴 𝐶3 =
1 1 2 3 94 𝐸4 3𝐴 42
3 1 1 2 𝐴6 8𝐶 𝐷8 95 𝐸𝐷 𝐴5 𝐴6 𝐵𝐶
…
the state. AddRoundKey
…
𝐾1 𝐾5 𝐾9 𝐾13
𝐾2
𝐾3
𝐾6
𝐾7
𝐾10
𝐾11
𝐾14
𝐾15
֜ 𝑊0 𝑊1 𝑊2 𝑊3 AddRoundKey
𝑊0 𝑊1 𝑊2 𝑊3 …
𝑊43 SubBytes
ShiftRows
W0…W3 represent the key for the
MixColumns
first round. Round 1
…
AddRoundKey
W4…W7 represent the key for the
second round.
SubBytes
ShiftRows
MixColumns Round 2
…
AddRoundKey
𝑊0 𝑊1 𝑊2 𝑊3 …
𝑊43 : SubBytes
ShiftRows
MixColumns
Round 1
…
AddRoundKey
SubBytes
ShiftRows
MixColumns Round 2
…
AddRoundKey
Function g is defined in the next
slide.
𝑊0 𝑊1 𝑊2 𝑊3 …
𝑊43 : SubBytes
ShiftRows
Function g is defined in the next
MixColumns
slide g(W) where W is a 4-byte Round 1
…
AddRoundKey
word, works as follows:
Step 1: Perform a one-byte left
circular rotation on W.
SubBytes
Step 2:
ShiftRows
Perform the SubBytes step on the MixColumns Round 2
…
matrix.
AddRoundKey
𝑊0 𝑊1 𝑊2 𝑊3 …
𝑊43 : SubBytes
ShiftRows
Function g is defined in the next
MixColumns
slide g(W) where W is a 4-byte Round 1
…
AddRoundKey
word, works as follows:
Step 3: XOR the vector from step 2
with the round constant – a vector of SubBytes
four 4-byte words; different for
ShiftRows
each round.
MixColumns Round 2
Next slide gives the table for each
…
AddRoundKey
round.
𝑊0 𝑊1 𝑊2 𝑊3 …
𝑊43 : SubBytes
ShiftRows
Function g is defined in the next
MixColumns
slide g(W) where W is a 4-byte Round 1
…
AddRoundKey
word, works as follows:
Step 4: XOR the result from step 2
with the round key. SubBytes
ShiftRows
MixColumns Round 2
…
AddRoundKey
…
Encryption: InvMixColumns
SubBytes
ShiftRows
InvShiftRows
MixColumns
InvSubBytes
AddRoundKey Round N-1
AddRoundKey
Decryption (each operation except
AddRoundKey is an inverse of its InvMixColumns
encryption counterpart):
InvShiftRows InvShiftRows
Round N
InvSubBytes InvSubBytes
AddRoundKey AddRoundKey
InvMixColumns Plaintext
CS-452: Data Security and Encryption Techniques 54/59
AES Decryption (2) Ciphertext
AddRoundKey
InvShiftRows
Round N
InvSubBytes
AddRoundKey
Plaintext
CS-452: Data Security and Encryption Techniques 55/59
AES Decryption (3) Ciphertext
AddRoundKey
…
substitution/permutation operation InvMixColumns
there is an operation that can reverse
the effects of that substitution or
permutation InvShiftRows
InvShiftRows
Round N
InvSubBytes
AddRoundKey
Plaintext
CS-452: Data Security and Encryption Techniques 56/59
Attacks on AES
No successful, practical attacks to date.
Approaches were developed for executing timing attacks
against vulnerable AES implementations on some
systems.
Documents revealed by Edward Snowden showed that
NSA is investigating whether tau statistic can be used
to successfully break AES.