Differential Computation Analysis against Internally-Encoded - - PowerPoint PPT Presentation

differential computation analysis against internally
SMART_READER_LITE
LIVE PREVIEW

Differential Computation Analysis against Internally-Encoded - - PowerPoint PPT Presentation

Differential Computation Analysis against Internally-Encoded White-Box Implementations Junwei Wang Joint work with Matthieu Rivain WhibOx 2019, May 18, 2019 Overview 1 White-Box Context 2 DCA against Internal Encodings 3 Collision


slide-1
SLIDE 1

Differential Computation Analysis against Internally-Encoded White-Box Implementations

Junwei Wang

Joint work with Matthieu Rivain WhibOx 2019, May 18, 2019

slide-2
SLIDE 2

Overview

1 White-Box Context 2 DCA against Internal Encodings 3 Collision Attack against Internal Encodings 4 Can We Do Better?

2

slide-3
SLIDE 3

White-Box Threat Model

plaintext ciphertext

black-box model

knowing the cipher

  • bserving I/O behavior

e.g. linear/differential cryptanalysis

plaintext ciphertext

gray-box model

+ side-channel leakages (power/EM/time/· · · )

e.g. differential power analysis

plaintext ciphertext

white-box model [SAC02]

  • wning the binary

controlling the environment

3

slide-4
SLIDE 4

White-Box Threat Model

Goal: to extract a cryptographic key, · · · Where: from a software impl. of cipher Who: malwares, co-hosted applications, user

themselves, · · ·

How: (by all kinds of means)

◮ analyze the code ◮ spy on the memory ◮ interfere the execution ◮ · · ·

No provably secure white-box scheme for standard block ciphers.

4

slide-5
SLIDE 5

Typical Applications

Digital Content Distribution videos, music, games, e-books, · · · Host Card Emulation mobile payment without a secure element

5

slide-6
SLIDE 6

Differential Computation Analysis [CHES16]

plaintext ciphertext

gray-box model

side-channel leakages (noisy)

e.g. power/EM/time/· · ·

plaintext ciphertext

white-box model

computational leakage (perfect)

e.g. registers/accessed memory/· · ·

7

slide-7
SLIDE 7

Differential Computation Analysis [CHES16]

Differential power analysis techniques on computational leakages

group by predictions collect traces

ϕk ( · ) = ϕk ( · ) = 1

average trace differential trace

Implying strong linear correlation between the sensitive vari- ables ϕk and the leaked samples in the computational traces.

8

slide-8
SLIDE 8

Internal Encoding Countermeasure [SAC02]

X R1 R2 Rr Y

. . .

  • 1. Represent the cipher into a network of transformations
  • 2. Obfuscate the network by encoding adjacent transformations
  • 3. Store the encoded transformations into look-up tables

9

slide-9
SLIDE 9

Internal Encoding Countermeasure [SAC02]

X R1 ε1 R2 ε2

ε−1

1

Rr

ε−1

r−1

Y

. . .

pairwise annihilating parasitic functions (e.g. encodings)

  • 1. Represent the cipher into a network of transformations
  • 2. Obfuscate the network by encoding adjacent transformations
  • 3. Store the encoded transformations into look-up tables

9

slide-10
SLIDE 10

Internal Encoding Countermeasure [SAC02]

X R1 ε1 R2 ε2

ε−1

1

Rr

ε−1

r−1

Y

. . .

pairwise annihilating parasitic functions (e.g. encodings)

look-up tables

  • 1. Represent the cipher into a network of transformations
  • 2. Obfuscate the network by encoding adjacent transformations
  • 3. Store the encoded transformations into look-up tables

9

slide-11
SLIDE 11

Internal Encoding Leakage

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

10

slide-12
SLIDE 12

Understanding of DCA

  • 1. The seminal work [CHES16] lacks in-depth understanding of DCA
  • 2. The follow-up analysis [ACNS18] is

◮ 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

  • 3. The computational traces are only sub-optimally exploited

11

slide-13
SLIDE 13

DCA Analysis against Internal Encoding

Based on well-established theory – Boolean correlation, instead of dif- ference of means: for any key guess k ρk = Cor

  • ϕk(·)[i] ,

ε ◦ ϕk∗(·)[j]

  • ϕk(·)

ε(·)

DCA success (roughly) requires:

  • ρk∗
  • ≥ max

  • ρk×
  • 12
slide-14
SLIDE 14

ρk∗ and ρk×: Distributions

Ideal assumption:

  • ϕk
  • k are mutually independent random (n, m) functions

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

13

slide-15
SLIDE 15

Lemma

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) .

14

slide-16
SLIDE 16

ρk∗ and ρk×: Distributions

  • 0.75
  • 0.50
  • 0.25

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

15

slide-17
SLIDE 17

DCA Success Rate: |ρk∗| > maxk× |ρk×|

4 6 8 10 12 14 16 0.25 0.5 0.75 n Pr

|ρk∗| > maxk× |ρk×|

  • m = 4

4 6 8 10 12 14 16 0.25 0.5 0.75 n Pr

|ρk∗| > maxk× |ρk×|

  • m = 4

m = 5

4 6 8 10 12 14 16 0.25 0.5 0.75 n Pr

|ρk∗| > maxk× |ρk×|

  • m = 4

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.

16

slide-18
SLIDE 18

Attack a NSC Variant: a White-Box AES

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) ⊕ Sbox(k3) ⊕ Sbox(k4) c

ε′ = ε ◦ ⊕c , n = 16, m = 8 , |K| = 216.

17

slide-19
SLIDE 19

Attack a NSC Variant: a White-Box AES

Attack results: ∼ 1800 traces Similar attack can be applied to a “masked” white-box implementation,

which intends to resist DCA.

18

slide-20
SLIDE 20

Collision Attack

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

  • collision predictions & traces

Cor

  • ψk(·, ·) ,
  • ψk(x1, x2) :=
  • ϕk(x1) = ϕk(x2)
slide-21
SLIDE 21

Collision Attack: Explanation

Based on the principle: ϕk(x1) = ϕk(x2) ⇔ ε ◦ ϕk(x1) = ε ◦ ϕk(x2) Trace Complexity: N = O

  • 2

m 2

  • 21
slide-22
SLIDE 22

Collision Attack: Explanation

Predictions 1 2 3 4 5 6 key guesses k1 k2 k3 k4 k∗ “collides”

  • ∀k×, k∗ and k× are not “isomorphic”

⇒ N = O

  • 2

m 2

  • 22
slide-23
SLIDE 23

Attack the NSC Variant

Same target: a first round MixColumn output byte

X1 X2 ARK,SB SR MC ARK,SB

ϕk1||k2(x1||x2) = 2 · Sbox(x1 ⊕ k1) ⊕ 3 · Sbox(x2 ⊕ k2) ε′ = ε ◦ ⊕c

  • r

ε′′ = ε ◦ Sbox ◦ ⊕c⊕k′

1

Attack results: 60 traces 0.5 1 Sample Correlation

k× k∗

slide-24
SLIDE 24

Can We Do Better?

YES, WE CAN !!!

ARK,SB,SR MC ARK,SB,SR MC ARK,SB

ϕk1||k2||c

x1||x2 = 2 · Sbox

  • 2 · Sbox(x1 ⊕ k1) ⊕ 3 · Sbox(x2 ⊕ k2) ⊕ c
  • with

ε′ = ε ◦ ⊕c′ and n = 16, m = 8, |K| = 224 where c = Sbox(k3) ⊕ Sbox(k4) ⊕ k′

1

and c′ = 3 · Sbox(· · · ) · Sbox(· · · ) · Sbox(· · · ) .

slide-25
SLIDE 25

Conclusion

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

insufficient

26

slide-26
SLIDE 26

Thank You !

ia.cr/2019/076

27