Professional Documents
Culture Documents
DES challenge
DES
Challenge
1997 1 96
R.Verser
-DESHALL
-
- 24.6%
II
1998 1 41
Distributed.Net - 22,000
- 50,000 CPU
II-2
1998 7 56
EFF
III
1999 1 22
15
EFF
-Deep Crack
&
- 10 PC
Distrubuted.Net - 2,450
Aes
1998
15
1999
2001
Rijndael
: 128
: 128/192/256
: J.Daemen, v.Rijmen
AES Pseudo
AES(in,out,key)
{
KeyExpansion(Key,RoundKey)
state = in
AddRoundKey (state,RoundKey[0])
for round=1 step 1 to Nr-1
SubBytes(stats)
ShiftRows(stats)
MixColumns(stats)
AddRoundKey(stats,RoundKey[i]
end for
SubBytes(stats)
ShiftRows(stats)
AddRoundKey(stats,RoundKeyp[Nr])
out = stats
}
Rijndeal Structure
: 128 , : 128/192/256
: 10 / 12 / 14 SPN
Nr
- Byte
- layer
Linear mixing
layer
Nb=4
Nb=6
Nb=8
Nk=4
10
12
14
Nk=6
12
12
14
Nr : rounds
Nk=8
14
14
14
Nb : block size /
32bit
ShiftRow(state) ,
MixColumn(state)
state EXOR
AddRoundKey(state)
Nk : key size /
32bit
State
Rijndael (state) 2
State 2 . 4 ,
Nb .
A0,0
A0,1
A0,2
A0,3
K0,0
K0,1
K0,2
K0,3
A1,1
A1,1
A1,2
A1,3
K1,1
K1,1
K1,2
K1,3
A2,0
A2,1
A2,2
A2,3
K2,0
K2,1
K2,2
K2,3
A3,0
A3,1
A3,2
A3,3
K3,0
K3,1
K3,2
K3,3
Nb =4 block state Nk = 4
key state
ex) 128 : EA 83 5C F0 04 45 33 2D 65 5D 98 AD
85 96 B0 C5
EA
04
65
85
83
45
5D
96
5C
33
98
B0
F0
2D
AD
C5
GF(28)
GCD(d,f)=1 d modulo f .
d<f , dd-1=1 mod f d-1<f
Extended Euclid(d,f)
1. (X1, X2, X3)<-(1,0,f);(Y1, Y2, Y3)<-(0,1,d)
2. If X3= 0 return X3=GCD(d,f); no inverse
3. If X3 = 1 return Y3=GCD(d,f); Y2=d-1 mod f
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0 1 0
0 0 1 0 1 0 0 1
1 0 0 1 0 1 0 0
0 1 0 0 1 0 1 0
b1
b2
b3
b4
b5
b6
b7
1
0
1
0
0
0
0
0
Inverse S-box
Mix Column
Mix column state column GF() a(x)
c(x) a(x) c(x) mod (x4+1) .
c(x) = 03 x3 + 01 x2 + 01 x + 02
d(x) = 0Bx3 + 0Dx2 + 09x + 0E
m(x) = x4+1
4 a(x) b(x)
a(x)= a3x3 +a2x2 +a1x+a0 , b(x)= b3x3 +b2x2 +b1x+b0
c(x)= a(x)b(x)
c(x)= c6x6 +c5x5 +c4x4 +c3x3 +c2x2 +c1x1+c0
c0 = a0b0
c1 = a1b0
c2 = a2b0
c3 = a3b0
a0b3
c4 = a3b1
c5 = a3b2
c6 = a3b3
a0 b1
a1b1 a0b2
a2b1 a1b2
a2b2 a1b3
a2b3
Mix Column
c(x) 4 mod m(x)
.
c(x)mod m(x)= d(x) = d3x3 +d2x2 +d1x+d0
= c3x3 +c2x2+c6x2 +c1x+c5x+c4
+c0
d0 = a0b0 a3b1 a2b2
d1 = a1b0 a0b1 a3b2
d2 = a2b0 a1b1 a0b2
d3 = a3b0 a2b1 a1b2
.
a0
a3 a
2 a1
d2
d3
a1b3
a2 b3
a3 b3
a0 b3
b0
d0
a1 a0 a3 a2
=
a2 a1 a0 a3
b1
d1
b2
d2
02 03 01 01 b
0
01 02 03 01 b1
=
01 01 02 03 b2
a3 a2 a1 a0
b3
d3
03 01 01 02 b3
d0
d1
Mix Column
02 03 01 01
01 02 03 01
01 01 02 03
03 01 01 02
87
6E
46
A6
47
37
94
ED
Key expansion
128 4Nr+4 32