Yet another attack on whitebox AES implementation Patrick Derbez 1 , - - PowerPoint PPT Presentation

yet another attack on whitebox aes implementation
SMART_READER_LITE
LIVE PREVIEW

Yet another attack on whitebox AES implementation Patrick Derbez 1 , - - PowerPoint PPT Presentation

Yet another attack on whitebox AES implementation Patrick Derbez 1 , Pierre-Alain Fouque 1 , Baptiste Lambin 1 , Brice Minaud 2 1 Univ Rennes, CNRS, IRISA 2 Royal Holloway University of London Patrick Derbez Yet another attack on whitebox AES


slide-1
SLIDE 1

Yet another attack on whitebox AES implementation

Patrick Derbez 1, Pierre-Alain Fouque1, Baptiste Lambin1, Brice Minaud2

1Univ Rennes, CNRS, IRISA 2Royal Holloway University of London Patrick Derbez Yet another attack on whitebox AES implementation 1 / 31

slide-2
SLIDE 2

1

Introduction

2

The Baek, Cheon and Hong proposal

3

Dedicated Attack

4

Generic attack

Patrick Derbez Yet another attack on whitebox AES implementation 2 / 31

slide-3
SLIDE 3

Introduction

1

Introduction

2

The Baek, Cheon and Hong proposal

3

Dedicated Attack

4

Generic attack

Patrick Derbez Yet another attack on whitebox AES implementation 3 / 31

slide-4
SLIDE 4

Introduction

Black box vs. White box

in

AESK

  • ut

Black box model

Patrick Derbez Yet another attack on whitebox AES implementation 4 / 31

slide-5
SLIDE 5

Introduction

Black box vs. White box

in

AESK

  • ut

Black box model

in

key = 0x1337. . . key schedule(key)

  • ut = in

for i in 0. . .10 round i(out,key) return out

  • ut

White box model

Patrick Derbez Yet another attack on whitebox AES implementation 4 / 31

slide-6
SLIDE 6

Introduction

White box implementation

Attacker:

  • extracting key information from

the implementation

  • computing

decryption scheme from encryption scheme Designer:

  • provide sound and secure imple-

mentation Main application:

  • Digital Rights Management
  • Fast (post-quantum

) public-key encryption scheme

in

key = 0x1337. . . key schedule(key)

  • ut = in

for i in 0. . .10 round i(out,key) return out

  • ut

Patrick Derbez Yet another attack on whitebox AES implementation 5 / 31

slide-7
SLIDE 7

Introduction

Two main design strategies

Table lookup

First proposal by Chow et al. in 2002: broken Xiao and Lai in 2009: broken Karroumi et al. in 2011: broken Baek et al. in 2016: our target WhiteBlock from Fouque et al.: secure (but weird model)

ASASA-like designs

SASAS construction: broken in 2001 by Biryukov et al. ASASA proposals (Biryukov et al., 2014): broken Recent proposals at ToSC’17 by Biryukov et al. to use more layers, leading to SA. . . SAS

Patrick Derbez Yet another attack on whitebox AES implementation 6 / 31

slide-8
SLIDE 8

Introduction

CEJO Framework

Derived from Chow et al. first white-box candidate constructions. Block cipher decomposed into R round functions. Round functions obfuscated using encodings. Obfuscated round functions implemented and evaluated using several tables (of reasonable size) · · · ◦ f (r+1)−1 ◦ E (r) ◦ f (r)

  • table
  • f (r)−1 ◦ E (r−1) ◦ f (r−1)
  • table
  • . . .

Increase security with external encodings

Patrick Derbez Yet another attack on whitebox AES implementation 7 / 31

slide-9
SLIDE 9

Introduction

Baek et al.’s toolbox

Proposed by Baek, Cheon and Hong in 2016. Toolbox dedicated to SPN under CEJO framework

Generic method to recover non-linear part of encodings Generic algorithm to recover the linear component of encodings

Finding non-linear part not higher than recovering linear part New AES white-box construction

Based on CEJO framework Parallel AES Resisting their toolbox (110 bits of security) Our target

Patrick Derbez Yet another attack on whitebox AES implementation 8 / 31

slide-10
SLIDE 10

The Baek, Cheon and Hong proposal

1

Introduction

2

The Baek, Cheon and Hong proposal

3

Dedicated Attack

4

Generic attack

Patrick Derbez Yet another attack on whitebox AES implementation 9 / 31

slide-11
SLIDE 11

The Baek, Cheon and Hong proposal

The Baek, Cheon and Hong proposal

Round function of AES : AES(r) = MC ◦ SR ◦ SB ◦ ARK A(r)

256-bit

AES(r) AES(r)

  • A(r+1)−1

256-bit

A(r)

256-bit

K (r) K (r)

S . . . S S . . . S

  • A(r+1)−1

MC ◦ SR MC ◦ SR M(r)

table

256-bit Patrick Derbez Yet another attack on whitebox AES implementation 10 / 31

slide-12
SLIDE 12

The Baek, Cheon and Hong proposal

Sparse input encoding

A(x) =    A0,0 A0,1 A1,1 A1,2 ... ... A31,0 A31,31      x0 x1 . . . x31   ⊕   a0 a1 . . . a31   M = A−1 ◦ MC ◦ SR

1 Split M in columns blocks of size 8 s.t. M = (M0| . . . |M31) 2 M.x =

31

  • i=0

Mi.xi

3 16-bit to 256-bit mappings: Fi = Mi ◦ S ◦ ⊕(ki⊕ai) ◦ (Ai,i, Ai,i+1) 4 Round function:

F (r)(x0, . . . , x31) =

31

  • i=0

Fi(xi, xi+1)

Patrick Derbez Yet another attack on whitebox AES implementation 11 / 31

slide-13
SLIDE 13

The Baek, Cheon and Hong proposal

Complexity

Time complexity R AES rounds: 32R table lookups + 31R xor of 256-bits words. For R = 10: 320 table lookups + 310 xor of 256-bit words.

Very fast

Memory requirement R AES rounds: 32R 16-bit to 256-bit mappings. For R = 10: 320 16-bit to 256-bit mappings

≈ 160MB

Patrick Derbez Yet another attack on whitebox AES implementation 12 / 31

slide-14
SLIDE 14

The Baek, Cheon and Hong proposal

Issue

16-bit to 256-bit mappings: Fi = Mi ◦ S ◦ ⊕(ki⊕ai) ◦ (Ai,i, Ai,i+1) Remark Fi(x, 0) = Mi ◦ S ◦ ⊕(ki⊕ai) ◦ Ai,i(x) is a 8-bit to 256-bit mapping. Composing with right projection ⇒ affine equivalent to AES Sbox.

Patrick Derbez Yet another attack on whitebox AES implementation 13 / 31

slide-15
SLIDE 15

The Baek, Cheon and Hong proposal

Issue

16-bit to 256-bit mappings: Fi = Mi ◦ S ◦ ⊕(ki⊕ai) ◦ (Ai,i, Ai,i+1) Remark Fi(x, 0) = Mi ◦ S ◦ ⊕(ki⊕ai) ◦ Ai,i(x) is a 8-bit to 256-bit mapping. Composing with right projection ⇒ affine equivalent to AES Sbox. Possible to recover affine mappings in O

  • 225

using the affine equivalence algorithm from Biryukov et al..

Patrick Derbez Yet another attack on whitebox AES implementation 13 / 31

slide-16
SLIDE 16

The Baek, Cheon and Hong proposal

Affine Equivalence Algorithm

In 2003, Biryukov, De Canni` ere, Braeken and Preneel proposed an algorithm to solve the following problem: Given two bijections S1 and S2 on n bits, find affine mappings A and B such that S2 = B ◦ S1 ◦ A, if they exist. Ascertain whether such mappings exist Enumerate all solutions Time complexity in O

  • n322n

Patrick Derbez Yet another attack on whitebox AES implementation 14 / 31

slide-17
SLIDE 17

The Baek, Cheon and Hong proposal

Affine Equivalence Algorithm

In 2003, Biryukov, De Canni` ere, Braeken and Preneel proposed an algorithm to solve the following problem: Given two bijections S1 and S2 on n bits, find affine mappings A and B such that S2 = B ◦ S1 ◦ A, if they exist. Ascertain whether such mappings exist Enumerate all solutions Time complexity in O

  • n322n

Time complexity for linear version in O

  • n32n

Patrick Derbez Yet another attack on whitebox AES implementation 14 / 31

slide-18
SLIDE 18

The Baek, Cheon and Hong proposal

Baek et al. Proposal

To avoid this weakness, take 32 random 8-bit to 256-bit mappings hi. The 16-bit to 256-bit tables are defined as Ti(x, y) = Fi(x, y) ⊕ hi(x) ⊕ hi+1(y) And we can evaluate the encoded round function with

31

  • i=0

Ti(xi, xi+1) =

31

  • i=0

Fi(xi, xi+1) = F (r)(x0, . . . , x31) Security claim : 110-bit

Patrick Derbez Yet another attack on whitebox AES implementation 15 / 31

slide-19
SLIDE 19

Dedicated Attack

1

Introduction

2

The Baek, Cheon and Hong proposal

3

Dedicated Attack

4

Generic attack

Patrick Derbez Yet another attack on whitebox AES implementation 16 / 31

slide-20
SLIDE 20

Dedicated Attack

Overview of the attack

From encoded round functions F ≃ M ◦ S ◦ A with A ≃ ∗ ∗

∗ ∗

...

∗ ∗

  • 1 Reduce the problem to block diagonal encodings :

⇒ F = M ◦ S ◦ B with B block diagonal.

2 Compute candidates for each block: 1

Using a projection, P ◦ M ◦ S ◦ Bi is affine equivalent to S.

2

Use the affine equivalence algorithm from [BCBP03] to get some candidates for Bi.

3 Identify the correct blocks :

Use a MITM technique to filter the wrong candidates

Patrick Derbez Yet another attack on whitebox AES implementation 17 / 31

slide-21
SLIDE 21

Dedicated Attack

Reducing the problem to block diagonal encodings Decompose A in A = B ◦ A with: B block diagonal affine mapping built from Bi’s (unknown)

  • A with same structure as A, built from blocks (08 Id8) ◦ E −1

i

(known)

Patrick Derbez Yet another attack on whitebox AES implementation 18 / 31

slide-22
SLIDE 22

Dedicated Attack

Reducing the problem to block diagonal encodings Decompose A in A = B ◦ A with: B block diagonal affine mapping built from Bi’s (unknown)

  • A with same structure as A, built from blocks (08 Id8) ◦ E −1

i

(known) For all 0 ≤ i ≤ 31 :

1 compute Ker Li with Li = (Ai,i Ai,i+1) (8 × 16 matrix) 2 get a basis (e1, . . . , e8) of Ker Li 3 complete this basis ⇒ Ei = (e1 . . . e16) 4 ∃ Bi 8x8 invertible matrix s.t. Li = Bi ◦ (08 Id8) ◦ E −1

i

Patrick Derbez Yet another attack on whitebox AES implementation 18 / 31

slide-23
SLIDE 23

Dedicated Attack

Find Ker Li with Li = (Ai,i Ai,i+1) For any (a, b) ∈ F8

2 × F8 2 :

1 x ∈ Ker Ai,i ⇒ y → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) is constant 2 y ∈ Ker Ai,i+1 ⇒ x → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a ⊕ x, y) is constant 3

(x, y) ∈ Ker Li ⇒ Ti(a, b)⊕Ti(a⊕x, b)⊕Ti(a, b ⊕y)⊕Ti(a⊕x, b ⊕y) = 0

If x ∈ Ker Ai,i then :

Patrick Derbez Yet another attack on whitebox AES implementation 19 / 31

slide-24
SLIDE 24

Dedicated Attack

Find Ker Li with Li = (Ai,i Ai,i+1) For any (a, b) ∈ F8

2 × F8 2 :

1 x ∈ Ker Ai,i ⇒ y → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) is constant 2 y ∈ Ker Ai,i+1 ⇒ x → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a ⊕ x, y) is constant 3

(x, y) ∈ Ker Li ⇒ Ti(a, b)⊕Ti(a⊕x, b)⊕Ti(a, b ⊕y)⊕Ti(a⊕x, b ⊕y) = 0

If x ∈ Ker Ai,i then : Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) = fi [Ai,i(a ⊕ x) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ hi+1(b ⊕ y) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a) ⊕ hi+1(b ⊕ y)

Patrick Derbez Yet another attack on whitebox AES implementation 19 / 31

slide-25
SLIDE 25

Dedicated Attack

Find Ker Li with Li = (Ai,i Ai,i+1) For any (a, b) ∈ F8

2 × F8 2 :

1 x ∈ Ker Ai,i ⇒ y → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) is constant 2 y ∈ Ker Ai,i+1 ⇒ x → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a ⊕ x, y) is constant 3

(x, y) ∈ Ker Li ⇒ Ti(a, b)⊕Ti(a⊕x, b)⊕Ti(a, b ⊕y)⊕Ti(a⊕x, b ⊕y) = 0

If x ∈ Ker Ai,i then : Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) = fi [Ai,i(a ⊕ x) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ hi+1(b ⊕ y) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a) ⊕ hi+1(b ⊕ y)

Patrick Derbez Yet another attack on whitebox AES implementation 19 / 31

slide-26
SLIDE 26

Dedicated Attack

Find Ker Li with Li = (Ai,i Ai,i+1) For any (a, b) ∈ F8

2 × F8 2 :

1 x ∈ Ker Ai,i ⇒ y → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) is constant 2 y ∈ Ker Ai,i+1 ⇒ x → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a ⊕ x, y) is constant 3

(x, y) ∈ Ker Li ⇒ Ti(a, b)⊕Ti(a⊕x, b)⊕Ti(a, b ⊕y)⊕Ti(a⊕x, b ⊕y) = 0

If x ∈ Ker Ai,i then : Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) = fi [Ai,i(a ⊕ x) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ hi+1(b ⊕ y) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a) ⊕ hi+1(b ⊕ y) = fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a)

Patrick Derbez Yet another attack on whitebox AES implementation 19 / 31

slide-27
SLIDE 27

Dedicated Attack

Find Ker Li with Li = (Ai,i Ai,i+1) For any (a, b) ∈ F8

2 × F8 2 :

1 x ∈ Ker Ai,i ⇒ y → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) is constant 2 y ∈ Ker Ai,i+1 ⇒ x → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a ⊕ x, y) is constant 3

(x, y) ∈ Ker Li ⇒ Ti(a, b)⊕Ti(a⊕x, b)⊕Ti(a, b ⊕y)⊕Ti(a⊕x, b ⊕y) = 0

If x ∈ Ker Ai,i then : Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) = fi [Ai,i(a ⊕ x) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ hi+1(b ⊕ y) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a) ⊕ hi+1(b ⊕ y) = fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a)

Patrick Derbez Yet another attack on whitebox AES implementation 19 / 31

slide-28
SLIDE 28

Dedicated Attack

Find Ker Li with Li = (Ai,i Ai,i+1) For any (a, b) ∈ F8

2 × F8 2 :

1 x ∈ Ker Ai,i ⇒ y → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) is constant 2 y ∈ Ker Ai,i+1 ⇒ x → Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a ⊕ x, y) is constant 3

(x, y) ∈ Ker Li ⇒ Ti(a, b)⊕Ti(a⊕x, b)⊕Ti(a, b ⊕y)⊕Ti(a⊕x, b ⊕y) = 0

If x ∈ Ker Ai,i then : Ti(a ⊕ x, b ⊕ y) ⊕ Ti(a, b ⊕ y) = fi [Ai,i(a ⊕ x) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ hi+1(b ⊕ y) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a) ⊕ hi+1(b ⊕ y) = fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a ⊕ x) ⊕ fi [Ai,i(a) ⊕ Ai,i+1(b ⊕ y) ⊕ ci] ⊕ hi(a) = hi(a ⊕ x) ⊕ hi(a)

Patrick Derbez Yet another attack on whitebox AES implementation 19 / 31

slide-29
SLIDE 29

Dedicated Attack

Computing candidates for each block Bi

We decomposed A into B ◦ A where B is a block diagonal affine mapping. Hence

31

  • j=0

Tj ◦ A−1(0, . . . , xi, . . . , 0) is a 8-bit to 256-bit mapping of the form Mi ◦ S ◦ Bi.

1 Compute a projection Pi such that Pi ◦ Mi ◦ S ◦ Bi is a bijection over

F8

2.

2 Use Biryukov et al. affine equivalence algorithm to recover all possible

candidates for Bi (≈ 211 candidates for AES Sbox).

Patrick Derbez Yet another attack on whitebox AES implementation 20 / 31

slide-30
SLIDE 30

Dedicated Attack

Identifying the correct blocks

  • MC

   S . . . S     ◦

  • A−1

  

B−1 B−1

1

B−1

2

B−1

3

  

  • A(r+1)−1

 

C0 C5 C10 C15

 

  • A

A(r) ∆y0 ∆y1 ∆y2 ∆y3 ∆z0 ∆z1 ∆z2 ∆z3 ∆w0 x0 Tj

211 cand. MITM B0 · ∆y0 = ∆z0

Patrick Derbez Yet another attack on whitebox AES implementation 21 / 31

slide-31
SLIDE 31

Dedicated Attack

Identifying the correct blocks

  • MC

   S . . . S     ◦

  • A−1 ◦

  

B−1 B−1

1

B−1

2

B−1

3

    

C0 C5 C10 C15

 

  • A

A(r) ∆y0 ∆y1 ∆y2 ∆y3 ∆z0 ∆z1 ∆z2 ∆z3 ∆w0 x0 Tj

211 cand. MITM B0 · ∆y0 = ∆z0

Patrick Derbez Yet another attack on whitebox AES implementation 21 / 31

slide-32
SLIDE 32

Dedicated Attack

Identifying the correct blocks

  • MC

   S . . . S     ◦

  • A−1 ◦

  

B−1 B−1

1

B−1

2

B−1

3

    

C0 C5 C10 C15

  ◦

  • A

∆y0 ∆y1 ∆y2 ∆y3 ∆z0 ∆z1 ∆z2 ∆z3 ∆w0 x0 Tj

211 cand. MITM B0 · ∆y0 = ∆z0

Patrick Derbez Yet another attack on whitebox AES implementation 21 / 31

slide-33
SLIDE 33

Dedicated Attack

Identifying the correct blocks

  • MC

   S . . . S     ◦

  • A−1 ◦

  

B−1 B−1

1

B−1

2

B−1

3

    

C0 C5 C10 C15

  ◦

  • A

∆y0 ∆y1 ∆y2 ∆y3 ∆z0 ∆z1 ∆z2 ∆z3 ∆w0 x0 Tj

211 cand. MITM B0 · ∆y0 = ∆z0 211 cand.

Patrick Derbez Yet another attack on whitebox AES implementation 21 / 31

slide-34
SLIDE 34

Dedicated Attack

Identifying the correct blocks

  • MC

   S . . . S     ◦

  • A−1 ◦

  

B−1 B−1

1

B−1

2

B−1

3

    

C0 C5 C10 C15

  ◦

  • A

∆y0 ∆y1 ∆y2 ∆y3 ∆z0 ∆z1 ∆z2 ∆z3 ∆w0 x0 Tj

211 cand. MITM B1 · ∆y1 = ∆z1

Patrick Derbez Yet another attack on whitebox AES implementation 21 / 31

slide-35
SLIDE 35

Dedicated Attack

Identifying the correct blocks

  • MC

   S . . . S     ◦

  • A−1 ◦

  

B−1 B−1

1

B−1

2

B−1

3

    

C0 C5 C10 C15

  ◦

  • A

∆y0 ∆y1 ∆y2 ∆y3 ∆z0 ∆z1 ∆z2 ∆z3 ∆w0 x0 Tj

211 cand. MITM B1 · ∆y1 = ∆z1

Knowledge of each Bi and Ci ⇒ extract the key

Patrick Derbez Yet another attack on whitebox AES implementation 21 / 31

slide-36
SLIDE 36

Dedicated Attack

Implementation (Intel Core i7-6600U CPU @ 2.60GHz): ∼ 2000 C++ code lines Decomposition A = B ◦ A : < 1s Get candidates for each Bi, Ci : ∼ 10s

  • 64 × O
  • 225

Recovering the correct Bi and Ci : < 1s Recovering the externals encodings : < 1s Total time : ∼ 12s Theorical time complexity : O(231) Negligible memory

Patrick Derbez Yet another attack on whitebox AES implementation 22 / 31

slide-37
SLIDE 37

Dedicated Attack

Implementation (Intel Core i7-6600U CPU @ 2.60GHz): ∼ 2000 C++ code lines Decomposition A = B ◦ A : < 1s Get candidates for each Bi, Ci : ∼ 10s

  • 64 × O
  • 225

Recovering the correct Bi and Ci : < 1s Recovering the externals encodings : < 1s Total time : ∼ 12s Theorical time complexity : O(231) Negligible memory Fixing the construction for 60-bit security would require n = 213 parallel AES, leading to an implementation of size ∼ 212TB

Patrick Derbez Yet another attack on whitebox AES implementation 22 / 31

slide-38
SLIDE 38

Generic attack

1

Introduction

2

The Baek, Cheon and Hong proposal

3

Dedicated Attack

4

Generic attack

Patrick Derbez Yet another attack on whitebox AES implementation 23 / 31

slide-39
SLIDE 39

Generic attack

Generic Problem

Problem Let F be an n-bit to n-bit permutation such that F = B ◦ S ◦ A, where:

1 A and B are n-bit affine layers; 2 S = (S1, . . . , Sk) consists of the parallel application of k permutations

Si on m bits each (called S-boxes). Note that n = km. Knowing S, and given oracle access to F (but not F −1), find affine A′, B′ such that F = B′ ◦ S ◦ A′. Solving this problem ⇐ ⇒ Breaking white-box implementations (of SPN) following the CEJO framework

Patrick Derbez Yet another attack on whitebox AES implementation 24 / 31

slide-40
SLIDE 40

Generic attack

Remarks

Remark 1: F −1 can be built from F in 2n operations Remark 2: a priori the problem has many solutions Remark 3: When S is composed of a single S-box, this is precisely the affine equivalence problem tackled by Biryukov et al. (with the caveat that F −1 is not accessible)

Patrick Derbez Yet another attack on whitebox AES implementation 25 / 31

slide-41
SLIDE 41

Generic attack

Overview of the algorithm

Similar to our dedicated attack (but generic) 2-step algorithm:

1

Isolate the input and output subspaces of each Sbox

2

Apply the generic affine equivalence algorithm by Biryukov et al. to each Sbox separately

Patrick Derbez Yet another attack on whitebox AES implementation 26 / 31

slide-42
SLIDE 42

Generic attack

Finding input subspace of each S-box

Goal Build a subspace of dimension m of the input space, such that this subspace spans all 2m possible values at the input of a single fixed Sbox, and yields a constant value at the input of all other Sboxes. Idea:

1 Recover k subspaces of dimension n − m, each yielding a zero

difference at the input of a distinct S-box

2 Pick any k − 1 of these spaces and compute their intersection 3 Result is a subspace of dimension m that yields a zero difference at

the input of k − 1 Sboxes, and spans all values at the input of the remaining Sbox.

Patrick Derbez Yet another attack on whitebox AES implementation 27 / 31

slide-43
SLIDE 43

Generic attack

Finding input subspace of each S-box

New goal Build a subspace of dimension n − m of the input space that yields a zero difference at the input of one Sbox.

1 Pick uniformly at random an input difference ∆ 2 With probability 2−m, ∆ yields a zero difference at the input of a

particular Sbox.

3 Check that the set of output differences generated by input difference

∆ spans a subspace of dimension n − m.

4 Repeat this process few times to find n − m independent difference ∆. Patrick Derbez Yet another attack on whitebox AES implementation 28 / 31

slide-44
SLIDE 44

Generic attack

Recovering affine layers

1 From previous step, we know A′ such that:

F

  • A′−1 =
  • · · ·

Bi · · ·

  S . . . S    ◦    ... Di ...   

Patrick Derbez Yet another attack on whitebox AES implementation 29 / 31

slide-45
SLIDE 45

Generic attack

Recovering affine layers

1 From previous step, we know A′ such that:

F

  • A′−1 =
  • · · ·

Bi · · ·

  S . . . S    ◦    ... Di ...   

2 Compose with projections and run affine equivalence algorithm to

recover Di’s

Patrick Derbez Yet another attack on whitebox AES implementation 29 / 31

slide-46
SLIDE 46

Generic attack

Recovering affine layers

1 From previous step, we know A′ such that:

F

  • A′−1 ◦

   ... D−1

i

...    ◦     S−1 . . . S−1     =

  • · · ·

Bi · · ·

  • 2 Compose with projections and run affine equivalence algorithm to

recover Di’s

3 Retrieve Bi’s Patrick Derbez Yet another attack on whitebox AES implementation 29 / 31

slide-47
SLIDE 47

Generic attack

Complexities

Complexity of solving the problem: Biryukov et al.: O(n322n) Baek et al.: O(2n + n423m/m) Our (identical Sboxes): O

  • 2mn3 + 2mln3 + n4

m + 22mm2n

  • Our (different Sboxes): O
  • 2mn3 + 2mln3 + n4

m + 22mmn2

Application to Baek et al. proposal: generic attack: O

  • 235

(allows to decrypt but do not recover the key) dedicated attack: O

  • 231

(recover the key)

Patrick Derbez Yet another attack on whitebox AES implementation 30 / 31

slide-48
SLIDE 48

Generic attack

Thank you for your attention!

Patrick Derbez Yet another attack on whitebox AES implementation 31 / 31

slide-49
SLIDE 49

Generic attack

1-round attack

From M ◦ (S, . . . , S) ◦ B ◦ A, give an equivalent representation M ◦ (S, . . . , S) ◦ B ◦ A

  • · · ·
  • Mi

· · ·

  S . . . S    ◦    ...

  • Bi

...    ◦

  • A

. . . xi . . . . . . ∆yi . . . S ◦ Bi ∆z

∆z = Mi · ∆yi

T

Patrick Derbez Yet another attack on whitebox AES implementation 31 / 31

slide-50
SLIDE 50

Generic attack

Get the external encodings from the key

Suppose that we know the key Remains externals encodings : Mout ◦ (AES, AES) ◦ Min

Patrick Derbez Yet another attack on whitebox AES implementation 31 / 31

slide-51
SLIDE 51

Generic attack

Get the external encodings from the key

Suppose that we know the key and A(1) Remains externals encodings : Mout ◦ (AES, AES) ◦ A(1) ◦ Min

  • Min is known, built as

Min =

  • A(1)−1 ◦ Min ⇒ extract Min

Mout ◦ (AES, AES) ◦ A(1) z y x tables lookup Use 256+1 values of y to recover Mout

Patrick Derbez Yet another attack on whitebox AES implementation 31 / 31