Analysis and Improvement of Differential Computation Attacks against Internally-Encoded White-Box Implementations
Matthieu Rivain 1 Junwei Wang 1,2,3
1CryptoExperts 2University of Luxembourg 3University Paris 8
Analysis and Improvement of Differential Computation Attacks against - - PowerPoint PPT Presentation
Analysis and Improvement of Differential Computation Attacks against Internally-Encoded White-Box Implementations Matthieu Rivain 1 Junwei Wang 1,2,3 1 CryptoExperts 2 University of Luxembourg 3 University Paris 8 CHES 2019, Atalanta White-Box
1CryptoExperts 2University of Luxembourg 3University Paris 8
Goal: to extract a cryptographic key, · · · Where: from a software impl. of cipher Who: malwares, co-hosted applications, user
How: (by all kinds of means)
◮ analyze the code ◮ spy on the memory ◮ interfere the execution ◮ · · · 2
Goal: to extract a cryptographic key, · · · Where: from a software impl. of cipher Who: malwares, co-hosted applications, user
How: (by all kinds of means)
◮ analyze the code ◮ spy on the memory ◮ interfere the execution ◮ · · ·
2
Digital Content Distribution videos, music, games, e-books, · · · Host Card Emulation mobile payment without a secure element
Digital Content Distribution videos, music, games, e-books, · · · Host Card Emulation mobile payment without a secure element
X R1 R2 Rr Y
4
X R1 ε1 R2 ε2
ε−1
1
Rr
ε−1
r−1
Y
pairwise annihilating parasitic functions (e.g. encodings)
4
X R1 ε1 R2 ε2
ε−1
1
Rr
ε−1
r−1
Y
pairwise annihilating parasitic functions (e.g. encodings)
look-up tables
4
5
plaintext ciphertext
side-channel leakages (noisy)
e.g. power/EM/time/· · ·
plaintext ciphertext
computational leakage (perfect)
e.g. registers/accessed memory/· · ·
6
Differential power analysis techniques on computational leakages
group by predictions collect traces
ϕk ( · ) = ϕk ( · ) = 1
average trace differential trace
7
◮ partly experimental (in particular for wrong key guesses) ◮ Only known to work on nibble encodings ◮ Only known to work on the first and last rounds ◮ Success probability is unknown
8
x ϕk(·) s input sensitive variable n m ε(·) v intermediate variable m m
A key-dependent (n, m) selection function ϕk in a block cipher A random selected m-bit bijection ε ε ◦ ϕk, as a result of some table look-ups, is leaked in the memory To exploit the leakage of ε ◦ ϕk, it is necessary that n > m
9
Based on well-established theory – Boolean correlation, instead of dif- ference of means: for any key guess k ρk = Cor
ε(·)
10
Based on well-established theory – Boolean correlation, instead of dif- ference of means: for any key guess k ρk = Cor
ε(·)
10
Based on well-established theory – Boolean correlation, instead of dif- ference of means: for any key guess k ρk = Cor
ε ◦ ϕk∗(·)[j]
ε(·)
10
Based on well-established theory – Boolean correlation, instead of dif- ference of means: for any key guess k ρk = Cor
ε ◦ ϕk∗(·)[j]
ε(·)
DCA success (roughly) requires:
k×
Ideal assumption:
11
Ideal assumption:
Correct key guess k∗, ρk∗ = 22−mN∗ − 1 where N∗ ∼ HG(2m, 2m−1, 2m−1) . Only depends on m.
ϕk(·) ε(·) n m m
11
Ideal assumption:
Correct key guess k∗, ρk∗ = 22−mN∗ − 1 where N∗ ∼ HG(2m, 2m−1, 2m−1) . Only depends on m. Incorrect key guess k×, ρk× = 22−nN× − 1 where N× ∼ HG(2n, 2n−1, 2n−1) . Only depends on n.
ϕk(·) ε(·) n m m
11
Lemma Let B(n) be the set of balanced n-bit Boolean function. If f ∈ B(n) and g
$
← − B(n) independent of f , then the balanceness of f + g is B(f + g) = 4 · N − 2n where N ∼ HG(2n, 2n−1, 2n−1) denotes the size of {x : f (x) = g(x) = 0}. With Cor(f + g) = 1 2n B(f + g) ⇒ ρk∗ = 22−mN∗ − 1 and ρk× = 22−nN× − 1 where N∗ ∼ HG(2m, 2m−1, 2m−1) and N× ∼ HG(2n, 2n−1, 2n−1) .
12
0.25 0.50 0.75
0.1 0.2 0.3 0.4 n = 8, m = 4 PMF ρk∗ modeled ρk× modeled
13
0.25 0.50 0.75
0.1 0.2 0.3 0.4 n = 8, m = 4 PMF ρk∗ modeled ρk× modeled 1,000 2,000 3,000 4,000 Counts ρk∗ simulated ρk× simulated
13
4 6 8 10 12 14 16 0.25 0.5 0.75 n Pr
|ρk∗| > maxk× |ρk×|
DCA success probability converges towards ≈ 1 − PrN∗ 2m−2 for n ≥ 2m + 2.
14
4 6 8 10 12 14 16 0.25 0.5 0.75 n Pr
|ρk∗| > maxk× |ρk×|
m = 5 m = 6 m = 7 m = 8 m = 9 m = 10 m = 11 m = 12
DCA success probability converges towards ≈ 1 − PrN∗ 2m−2 for n ≥ 2m + 2.
14
Byte encoding protected DCA has failed to break it before this work
15
Byte encoding protected DCA has failed to break it before this work Our approach: target a output byte of MixColumn in the first round
X1 X2
x1 x2
15
Byte encoding protected DCA has failed to break it before this work Our approach: target a output byte of MixColumn in the first round
X1 X2 ARK,SB
Sbox(x1 ⊕ k1) Sbox(x2 ⊕ k2) Sbox(k3) Sbox(k4)
15
Byte encoding protected DCA has failed to break it before this work Our approach: target a output byte of MixColumn in the first round
X1 X2 ARK,SB SR
Sbox(x1 ⊕ k1) Sbox(x2 ⊕ k2) Sbox(k3) Sbox(k4)
15
Byte encoding protected DCA has failed to break it before this work Our approach: target a output byte of MixColumn in the first round
X1 X2 ARK,SB SR MC
2 · Sbox(x1 ⊕ k1) ⊕ 3 · Sbox(x2 ⊕ k2) ⊕ Sbox(k3) ⊕ Sbox(k4)
15
Byte encoding protected DCA has failed to break it before this work Our approach: target a output byte of MixColumn in the first round
X1 X2 ARK,SB SR MC
2 · Sbox(x1 ⊕ k1) ⊕ 3 · Sbox(x2 ⊕ k2) ⊕ c
15
Byte encoding protected DCA has failed to break it before this work Our approach: target a output byte of MixColumn in the first round
X1 X2 ARK,SB SR MC
ϕk1||k2(x1||x2) = 2 · Sbox(x1 ⊕ k1) ⊕ 3 · Sbox(x2 ⊕ k2)
ε′ = ε ◦ ⊕c , n = 16, m = 8 , |K| = 216.
15
Attack results: ∼ 1800 traces Similar attack can be applied to a “masked” white-box implementation,
16
17
x1 x2 x3 x4
N inputs & raw traces
x1 x2 x3 x4
N inputs & raw traces
ψk(x1, x2) ψk(x1, x3) ψk(x1, x4) ψk(x2, x3) ψk(x2, x4) ψk(x3, x4)
N
2
ψk(x1, x2) :=
x1 x2 x3 x4
N inputs & raw traces
ψk(x1, x2) ψk(x1, x3) ψk(x1, x4) ψk(x2, x3) ψk(x2, x4) ψk(x3, x4)
N
2
Cor
m 2
Predictions 1 2 3 4 5 6 key guesses k1 k∗ “collides”
⇒ N = O
m 2
Predictions 1 2 3 4 5 6 key guesses k1 k2 k3 k4 k∗ “collides”
⇒ N = O
m 2
Same to DCA: targeting at one 1-st round MixColumn output byte Attack results: 60 traces 0.5 1 Sample Correlation
k× k∗ 21
DCA against internal encodings has been analysed in depth
◮ Allows to attack wider encodings
Computation traces have been further exploited
◮ Showcase to attack variables beyond the first round of the cipher ◮ New class of collision attack with very low trace complexity
Hence, protecting AES with internal encodings in the beginning rounds is
22
ia.cr/2019/076