Cryptanalysis of the Advanced Encryption Standard
Vincent Rijmen
Albena 2013
Cryptanalysis of the Advanced Encryption Standard Vincent Rijmen - - PowerPoint PPT Presentation
Cryptanalysis of the Advanced Encryption Standard Vincent Rijmen Albena 2013 Content AES Bounding the EDP of differentials over 2, 4 rounds of AES AES and the hypothesis of stochastic equivalence The Advanced Encryption
Cryptanalysis of the Advanced Encryption Standard
Vincent Rijmen
Albena 2013
Content
AES
The Advanced Encryption Standard
Key Schedule
round
. . . . .
round round round
Mixing transformation S S S S S S S S S
AES round transformation
– SubBytes: non-linearity – ShiftRows: inter-column diffusion – MixColumns: inter-byte diffusion within columns – AddRoundKey
Message input representation
a0,0 a1,0 a2,0 a3,0 a0,1 a1,1 a2,1 a3,1 a0,2 a1,2 a2,2 a3,2 a0,3 a1,3 a2,3 a3,3 a0,4 a1,4 a2,4 a3,4 a0,5 a1,5 a2,5 a3,5 a0,6 a1,6 a2,6 a3,6 a0,7 a1,7 a2,7 a3,7
Key input representation
– 4 rows – 4, 6, or 8 columns (128-, 192-, 256-bit key)
k0,0 k1,0 k2,0 k3,0 k0,1 k1,1 k2,1 k3,1 k0,2 k1,2 k2,2 k3,2 k0,3 k1,3 k2,3 k3,3 k0,4 k1,4 k2,4 k3,4 k0,5 k1,5 k2,5 k3,5 k0,6 k1,6 k2,6 k3,6 k0,7 k1,7 k2,7 k3,7
Round step 1: SubBytes
(simplicity)
a0,0 a0,1 a0,2 a0,3 a1,0 a1,1 a1,2 a1,3 a2,0 a2,1 a2,2 a2,3 a3,0 a3,1 a3,2 a3,3 b0,0 b0,1 b0,2 b0,3 b1,0 b1,1 b1,2 b1,3 b2,0 b2,1 b2,2 b2,3 b3,0 b3,1 b3,2 b3,3
ai,j bi,j
S-box
The Rijndael S-box
S[x] = P(x-1)
– Optimally resistant against linear and differential cryptanalysis – Output functions with maximal nonlinear degree (7)
9
Round step 3: MixColumns
– based on theory of error-correcting (MDS) codes b0,0 b0,1 b0,2 b0,3 b1,0 b1,1 b1,2 b1,3 b2,0 b2,1 b2,2 b2,3 b3,0 b3,1 b3,2 b3,3 a0,0 a0,1 a0,2 a0,3 a1,0 a1,1 a1,2 a1,3 a2,0 a2,1 a2,2 a2,3 a3,0 a3,1 a3,2 a3,3
a1,j a0,j a2,j a3,j b1,j b0,j b2,j b3,j
10
Round step 2: ShiftRows
– Interaction with MixColumns – Bits flip in minimum 25 active S-boxes per 4 rounds m n
g h i j w x y z b c d e m n
h i j g
y z
w x e b c d
Key schedule
1+ 10/12/14 round keys k0,0 k1,0 k2,0 k3,0 k0,1 k1,1 k2,1 k3,1 k0,2 k1,2 k2,2 k3,2 k0,3 k1,3 k2,3 k3,3 k0,4 k1,4 k2,4 k3,4 k0,5 k1,5 k2,5 k3,5 k0,6 k1,6 k2,6 k3,6 k0,7 k1,7 k2,7 k3,7
round key table (virtual)
Key schedule for 128-bit keys
k0,0 k1,0 k2,0 k3,0 k0,1 k1,1 k2,1 k3,1 k0,2 k1,2 k2,2 k3,2 k0,3 k1,3 k2,3 k3,3 k0,4 k1,4 k2,4 k3,4 k0,5 k1,5 k2,5 k3,5 k0,6 k1,6 k2,6 k3,6 k0,7 k1,7 k2,7 k3,7 + + + + k1,3 k2,3 k3,3 k0,3
Substitution
RC +
Key schedule for 192-bit keys
k0,0 k1,0 k2,0 k3,0 k0,3 k1,3 k2,3 k3,3 k0,4 k1,4 k2,4 k3,4 k0,5 k1,5 k2,5 k3,5 k0,6 k1,6 k2,6 k3,6 k0,9 k1,9 k2,9 k3,9 k0,10 k1,10 k2,10 k3,10 k0,11 k1,11 k2,11 k3,11 + + + + k1,5 k2,5 k3,5 k0,5
Substitution
RC + k0,1 k1,1 k2,1 k3,1 k0,7 k1,7 k2,7 k3,7 + k0,2 k1,2 k2,2 k3,2 k0,8 k1,8 k2,8 k3,8 +
Key schedule for 256-bit keys
k0,0 k1,0 k2,0 k3,0 k0,3 k1,3 k2,3 k3,3 k0,5 k1,5 k2,5 k3,5 k0,7 k1,7 k2,7 k3,7 k0,8 k1,8 k2,8 k3,8 k0,11 k1,11 k2,11 k3,11 k0,13 k1,13 k2,13 k3,13 k0,15 k1,15 k2,15 k3,15 + + + + k1,7 k2,7 k3,7 k0,7
Substitution
RC + k0,1 k1,1 k2,1 k3,1 k0,9 k1,9 k2,9 k3,9 + k0,2 k1,2 k2,2 k3,2 k0,10 k1,10 k2,10 k3,10 +
Substitution
k0,6 k1,6 k2,6 k3,6 k0,14 k1,14 k2,14 k3,14 + k0,4 k1,4 k2,4 k3,4 k0,12 k1,12 k2,12 k3,12 +
Alternative representations
S S S S MC S S S S MC S S S S MC S S S S MC
+ + + + + + + + + + + + + + + +
S S S S MC S S S S MC S S S S MC S S S S MC
+ + + + + + + + + + + + + + + +
– with EDP(a, e)
– with EDP(Q)
– EDP(a, b, d, e) = ∏i DPS(ai, bi) ∏j DPS(dj, ej)
Super Box differentials
S S S S
MixColumns
+ + + + S S S S a b d = c c = MC × b e
Branch number
Mixing transformation L X Y
Branch number and codes
Mixing transformation L X Y XX L(X)
Bound on EDP [Park+ ‘03]
When all S-boxes are the same:
Example
S S S S
L
+ + + + S S S S a0 b0 d0 d1 d4 e0 e1 S S e4 +
entries in a row or column
combine largest with the largest, …
[Hong+ ’00]
Hence:
The AES S-box
– x –1 in GF(28) – L: affine mapping
– those of x –1 – L: deterministic
x –1 L-1
S
= a c b
Differential properties of x –1
x –1 + (x + a)-1 = b
(x + a) + x = b(x + a)x (x/a)2 + x/a + 1/ab = 0
x254 + (x + a)254 = b
– only if b = a-1 – Solutions are: 0, a, va, v2a with v2+v+1=0
DP over AES S-box
– 2–6 if ab = 1, – 2–7 if Tr(a–1b–1) = 0 – 0 if Tr(a–1b–1) = 1
– 1 b with DP(a,b) = 2-6 – 126 b’s with DP(a, b) = 2-7
AES Super box EDP bounds
Differential properties of x –1
– Maps extension field GF(28) to ground field GF(2) – Linear mapping:
GF(2)
a vector space of dimension 7
Example differential
S S S S
MixColumns
+ + + + S S S S a0 b0 d0 d1 d2 d3 e0 e1 e2 e3
– 255 possible values for b0 – d = (2b0 , b0 , b0 , 3b0)
– di = ud
i b0 fixed ratio
define a characteristic with DP > 0 – Tr(a0
–1L(b0)–1) = 0
– Tr(di
–1L(ei)–1) = 0
Example differential
S S S S
MixColumns
+ + + + S S S S a0 b0 d0 d1 d2 d3 e0 e1 e2 e3
vector space on b0
–1
– dimension is 8 minus dimension of vector space generated by {ud
i L(ei –1)}i
– minimum 4, maximum 7 – straight conditions
– due to presence of L – blurred condition – can be approached statistically:
hypergeometric distribution
Differentials with 5 active S-boxes
fixed ratios
α: dimension of: {ud
i L(ei –1)}i
β: number of different nonzero elements in: (a0, ub
0) (a1, ub 1) (a2, ub 2) (a3, ub 3)
mean and variance determined by α and β
AES Superboxes
Highest EDP values occur for
differentials with 5 active S-boxes ... with small values for α and β
Presence of L in S-box has important impact
values:
if absent: all conditions become straight Max EDP would increase from 13.25 × 2–32 (12 differentials) to 19.75 × 2–32 (3825 differentials)
AES megabox
+ + + + + + + + + + + + + + + +
MC MC MC MC Super box Super box Super box Super box Super box Super box Super box Super box
Megabox bounds
– We would need all the EDP-values over the Super boxes – Computation has been finished for differentials where all trails have exactly 25 active S-boxes and where the S-box is pure inversion:
Plateau characteristics
distribution
Often assumed distribution of DP(Q)
Pr(DP(Q) = i) ≈ z(i – EDP(Q))
EDP(Q) DP(Q)
Hypothesis of stochastic equivalence
Fraction
2-round mapping
– Differential (a, b) over R, followed by – Differential (b, c) over S
S R
a b c
+
k B[k]
Right pairs for a characteristic
DP(a,b,c) = DP(a,b) × DP(b,c)
right pairs (b, c) right pairs (a, b)
Structure in the set of right pairs of (a,b)
If DP(a,b) = 21-n
If DP(a,b) = 22-n
= p + span{a,p+q} If DP(a,b) = 1
In all these cases: set of right pairs = affine subspace
Planar differential
– Inputs of right pairs (x, x + a) form an affine subspace – Outputs of right pairs (y, y + b) form an affine subspace
Refresher: affine subspaces
– Translated vector subspace – Up = p + U = { p + u | u ∈ U }
– Up ∩ Vq = r + (U ∩ V) if (p + q) ∈ (U + V)
– Up ∩ Vq = ∅ otherwise
Plateau characteristic theorem
= 2height(Q) × 2 – n
S R
a b c
+
k B[k]
Proof
– (a, b): affine subspace Up – (b, c): affine subspace Vq – (a, b, c): intersection
= 0 else
Possible distributions of DP(Q)
21-n 22-n 23-n 24-n
EDP DP
Q1 Q2 Q3
#(k)
Structure in the set of right pairs
Up ∩ Vq = r + (U ∩ V), or ∅
space
space
structure
S S S S Linear mixing layer S S S S S S S S S S S S
AES superbox
S S S S MixColumns + + + + k S S S S
AES superbox characteristics
characteristics
plateau characteristics
all superbox characteristics
AES superbox characteristics
1 2 3 4 5 5 48.0 47.5 36.2 26.4 11.0 6 62.7 53.4 33.4 17.5 7 75.9 50.9 24.9 8 87.9 54.1 15.0
height(Q) # active S-boxes
Binary logarithms
Concluding remarks
interesting mathematical structures
– Applies also to other ciphers
– Related-key – biclique