Chapter 06-AC-Dolin - 20241002
Chapter 06-AC-Dolin - 20241002
Network Security
Eighth Edition, Global Edition
by William Stallings
k0 k4 k8 k12
k1 k5 k9 k13
k2 k6 k10 k14
k3 k7 k11 k15
w0 w1 w2 • • • w42 w43
SubBytes S S S S S S S S S S S S S S S S
State
ShiftRows
State
MixColumns M M M M
State
State
(a) S-box
Byte to bit b0
' 0 0 1 0 0 1 0 1 b0 1
column vector b1' 1 0 0 1 0 0 1 0 b1 0
b'2 0 1 0 0 1 0 0 1 b2 1
'
b3 1 0 1 0 0 1 0 0 b3 0
' b0 ' = 0 b4
+
b0 1 0 0 0 1 1 1 1 1 b4 1 0 1 0 0 1 0 0
b1' 1 1 0 0 0 1 1 1 b1 1 '
b5 0 0 1 0 1 0 0 1 b5 0
'
b2 1 1 1 0 0 0 1 1 b2 0 '
b6 1 0 0 1 0 1 0 0 b6 0
b'3 1 1 1 1 0 0 0 1 b3 0 '
b7 0 1 0 0 1 0 1 0 b7 0
= +
'
b4 1 1 1 1 1 0 0 0 b4 0
'
b5 0 1 1 1 1 1 0 0 b5 1
'
b6 0 0 1 1 1 1 1 0 b6 1 Bit column
b'7 0 0 0 1 1 1 1 1 b7 0 vector to byte
S(yx) IS(yx)
SubBytes
S-box
ShiftRows
02 03 01 01
01 02 03 01
MixColumns
01 01 02 03
03 01 01 02
MixColumns matrix
Round
key
AddRoundKey
State matrix
at end
of round
Constant inputs Variable input
• Key is copied into the first four words of the expanded key
• The remainder of the expanded key is filled in four words at a
time
w0 w1 w2 w3 g
B1 B2 B3 B0
S S S S
w'
(b) Function g
w40 w41 w42 w43
Description Value
i (decimal) 36
temp = w[i - 1] 7F8D292F
RotWord (temp) 8D292F7F
w12 = w8 Å z3 = c0 af df 39 RotWord(w15)= ae 7e c0 b1 = x 4
SubWord(x3)= e4 f3 ba c8 = y 4
w13 = w12 Å w9 = 89 2f 6b 67 Rcon(4)= 08 00 00 00
w14 = w13 Å w10 = 57 51 ad 06
y4 Å Rcon(4)= ec f3 ba c8 = 4
Key Expansion w15 = w14 Å w11 = b1 ae 7e c0
RotWord(w19)= 8c dd 50 43 = x 5
w16 = w12 Å z4 = 2c 5c 65 f1
w17 = w16 Å w13 = a5 73 0e 96 SubWord(x4)= 64 c1 53 1a = y 5
Rcon(5)= 10 00 00 00
w18 = w17 Å w14 = f2 22 a3 90
y5 Å Rcon(5)= 74 c1 53 1a = z 5
for w19 = w18 Å w15 = 43 8c dd 50
w20 = w16 Å z5 = 58 9d 36 eb RotWord(w23)= 40 46 bd 4c = x 6
SubWord(x5)= 09 5a 7a 29 = y 6
w21 = w20 Å w17 = fd ee 38 7d Rcon(6)= 20 00 00 00
w22 = w21 Å w18 = 0f cc 9b ed y6 Å Rcon(6)= 29 5a 7a 29 = z 6
w23 = w22 Å w19 = 4c 40 46 bd
AES Example w24 = w20 Å z6 = 71 c7 4c c2 RotWord(w27)= a5 a9 ef cf = x 7
SubWord(x6)= 06 d3 df 8a = y 7
w25 = w24 Å w21 = 8c 29 74 bf
Rcon(7)= 40 00 00 00
w26 = w25 Å w22 = 83 e5 ef 52
y7 Å Rcon(7)= 46 d3 df 8a = z 7
w27 = w26 Å w23 = cf a5 a9 ef
w28 = w24 Å z7 = 37 14 93 48 RotWord(w31)= 7d a1 4a f7 = x 8
SubWord(x7)= ff 32 d6 68 = y 8
w29 = w28 Å w25 = bb 3d e7 f7 Rcon(8)= 80 00 00 00
w30 = w29 Å w26 = 38 d8 08 a5 y8 Å Rcon(8)= 7f 32 d6 68 = z 8
w31 = w30 Å w27 = f7 7d a1 4a
w32 = w28 Å z8 = 48 26 45 20 RotWord(w35)= be 0b 38 3c = x 9
w33 = w32 Å w29 = f3 1b a2 d7 SubWord(x8)= ae 2b 07 eb = y 9
Rcon(9)= 1B 00 00 00
w34 = w33 Å w30 = cb c3 aa 72
y9 Å Rcon(9)= b5 2b 07 eb = z 9
w35 = w34 Å w32 = 3c be 0b 38
w36 = w32 Å z9 = fd 0d 42 cb RotWord(w39)= 6b 41 56 f9 = x 10
SubWord(x9)= 7f 83 b1 99 = y 10
w37 = w36 Å w33 = 0e 16 e0 1c Rcon(10)= 36 00 00 00
w38 = w37 Å w34 = c5 d5 4a 6e y10 Å Rcon(10)= 49 83 b1 99 = z 10
w39 = w38 Å w35 = f9 6b 41 56
w40 = w36 Å z10 = b4 8e f3 52
w41 = w40 Å w37 = ba 98 13 4e
w42 = w41 Å w38 = 7f 4d 59 20
w43 = w42 Å w39 = 86 26 18 76
AES
EXAMPLE
Avalanche
Effect
in AES:
Change
in Plaintext
721eb200ba06206dcbd4bce704fa654e
AES: 5
5955c91b4e769f3cb4a94768e98d5267
81
0ad9d85689f9f77bc1c5f71185e5fb14
6 70
Change in dc60a24d137662181e45b8d3726b2920
db18a8ffa16d30d5f88b08d777ba4eaa
Key 7
fe8343b8f88bef66cab7e977d005a03c
74
f91b4fbfe934c9bf8f2f85812b084989
8 67
da7dad581d1725c5b72fa0f9d9d1366a
cca104a13e678500ff59025f3bafaa34
9 59
0ccb4c66bbfd912f4b511d72996345e0
ff0b844a0853bf7c6934ab4364148fb9
10 53
fc8923ee501a7d207ab670686839996b
Copyright © 2023 Pearson Education, Ltd. All Rights Reserved..
AES Implementation
• AES decryption cipher is
not identical to the Two separate changes are
encryption cipher needed to bring the
decryption structure in line
• The sequence of with the encryption structure
transformations differs
although the form of the
key schedules is the
same The first two stages of the
decryption round need to be
• Has the disadvantage interchanged
that two separate
software or firmware
modules are needed for
applications that require The second two stages of the
both encryption and decryption round need to be
decryption interchanged
If we view the
key as a
The sequence of
transformations words, then
These two
AddRoundKey both
operations are
and AddRoundKey
linear with
InvMixColumns and
respect to the
do not alter the InvMixColumns
column input
sequence of operate on
bytes in State State one
column at a
time
Round 1
Inverse mix cols
w[36, 39] •
•
•
Round 9
Inverse mix cols
Round 10
Expand key Inverse shift rows
Key Plaintext