66
From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx 2016, 14 Aug, UCSB

From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

From obfuscation to white-box crypto:

relaxation and security notions

Matthieu Rivain

WhibOx 2016, 14 Aug, UCSB

Page 2: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What does this program do?

([]+/H/)[1&11>>1]+(+[[]+(1-~1<<1)+(~1+1e1)+(1%11)+(1|1>>1|1)+(~1+1e1)+(.1^!1)])[[([]+!![

11])[11^11]+[[{}]+{}][1/1.1&1][1]]+([[]+111/!1][+!1][([{}]+{})[1e1>>1]+[[],[]+{}][1&11>>

1][1|[]]+([]+[][111])[1&1]+[{},1e1,!1+{}][~~(1.1+1.1)][1^1<<1]+(11/!{}+{})[1-~1<<1]+[!!{

}+[]][+(11>11)][[]+1]+(/^/[1.11]+/&/)[.1^!1]+[{},[{}]+{},1][1&11>>1][1+1e1+1]+([]+!!{})[

.1^!1]+([]+{}+[])[[]+1]+[!!{}+{}][!11+!111][[]+1]]+[])[(!/~/+{})[1|1<<1]+[/=/,[]+[][1]][

1&11>>1][1&1>>1]+([]+{})[~~(1.1+1.1)]+[1,!1+{}][1%11][1^1<<1]+(111/[]+/1/)[~1+1e1+~1]+[!

!/-/+[]][+(11>11)][1]]((1<<1^11)+((+(1<1))==([]+/-/[(!![11]+[])[+!1]+(!!/-/+{})[1-~1]+([

]+!/~/)[1-~1]+(!!/-/+{})[!111+!111]])[11%11]),-~11>>1)](~1-~1e1<<1<<1)+([]+{111:1111}+[]

)[11111.1%11.1*111e11|!11]+({}+/W/)[1+~1e1-(~11*1.1<<1)]+(+[[]+(1|1>>1)+(1|1>>1|1)+(11-1

>>1)+(1e1>>1|1)+(1e1>>1)+(1>>11)+(11>>>1)])[[(!!{}+[])[11>>>11]+[[]+{}][.1^!1][111%11]]+

([11/[]+[]][111%111][([{}]+[{}])[1e1>>1]+[[],[{}]+[{}]][1|1>>1|1][1|[]]+([][11]+[])[[]+1

]+[{},1e1,![1]+/~/][1<<!1<<1][1<<1^1]+(1/!1+{})[11+1>>1]+[!!/-/+{}][+(111>111)][111%11]+

([][11]+/&/)[1&1>>1]+[{},[]+{}+[],1][[]+1][11-~1+11>>1]+([]+!!/-/)[11>>11]+([]+{})[1|1>>

1|1]+[[]+!!{}][1>>>1][1&11]]+[])[(!{}+[])[1^1<<1]+[/=/,[]+[][1]][1<<1>>1][!111+!111]+([]

+{}+[])[1<<1^1>>1]+[1,![11]+[]][1|1>>1][1|1<<1|1]+(11/[]+/1/)[-~11>>1]+[!![111]+{}][+[]]

[1|1>>1]]((1e1-1)+((1&1>>1)==([]+/-/[(!!{}+{})[+(1>1)]+(!!/-/+{})[1|1<<1]+(!1+{})[1|1<<1

|1]+(!!/-/+{})[11.11>>11.11]])[1&1>>1]),1-~1<<1)](~1-~1e1<<1<<1)+(/^!/+[])[1+!![11%111]]

Page 3: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What does this program do?

([]+/H/)[1&11>>1]+(+[[]+(1-~1<<1)+(~1+1e1)+(1%11)+(1|1>>1|1)+(~1+1e1)+(.1^!1)])[[([]+!![

11])[11^11]+[[{}]+{}][1/1.1&1][1]]+([[]+111/!1][+!1][([{}]+{})[1e1>>1]+[[],[]+{}][1&11>>

1][1|[]]+([]+[][111])[1&1]+[{},1e1,!1+{}][~~(1.1+1.1)][1^1<<1]+(11/!{}+{})[1-~1<<1]+[!!{

}+[]][+(11>11)][[]+1]+(/^/[1.11]+/&/)[.1^!1]+[{},[{}]+{},1][1&11>>1][1+1e1+1]+([]+!!{})[

.1^!1]+([]+{}+[])[[]+1]+[!!{}+{}][!11+!111][[]+1]]+[])[(!/~/+{})[1|1<<1]+[/=/,[]+[][1]][

1&11>>1][1&1>>1]+([]+{})[~~(1.1+1.1)]+[1,!1+{}][1%11][1^1<<1]+(111/[]+/1/)[~1+1e1+~1]+[!

!/-/+[]][+(11>11)][1]]((1<<1^11)+((+(1<1))==([]+/-/[(!![11]+[])[+!1]+(!!/-/+{})[1-~1]+([

]+!/~/)[1-~1]+(!!/-/+{})[!111+!111]])[11%11]),-~11>>1)](~1-~1e1<<1<<1)+([]+{111:1111}+[]

)[11111.1%11.1*111e11|!11]+({}+/W/)[1+~1e1-(~11*1.1<<1)]+(+[[]+(1|1>>1)+(1|1>>1|1)+(11-1

>>1)+(1e1>>1|1)+(1e1>>1)+(1>>11)+(11>>>1)])[[(!!{}+[])[11>>>11]+[[]+{}][.1^!1][111%11]]+

([11/[]+[]][111%111][([{}]+[{}])[1e1>>1]+[[],[{}]+[{}]][1|1>>1|1][1|[]]+([][11]+[])[[]+1

]+[{},1e1,![1]+/~/][1<<!1<<1][1<<1^1]+(1/!1+{})[11+1>>1]+[!!/-/+{}][+(111>111)][111%11]+

([][11]+/&/)[1&1>>1]+[{},[]+{}+[],1][[]+1][11-~1+11>>1]+([]+!!/-/)[11>>11]+([]+{})[1|1>>

1|1]+[[]+!!{}][1>>>1][1&11]]+[])[(!{}+[])[1^1<<1]+[/=/,[]+[][1]][1<<1>>1][!111+!111]+([]

+{}+[])[1<<1^1>>1]+[1,![11]+[]][1|1>>1][1|1<<1|1]+(11/[]+/1/)[-~11>>1]+[!![111]+{}][+[]]

[1|1>>1]]((1e1-1)+((1&1>>1)==([]+/-/[(!!{}+{})[+(1>1)]+(!!/-/+{})[1|1<<1]+(!1+{})[1|1<<1

|1]+(!!/-/+{})[11.11>>11.11]])[1&1>>1]),1-~1<<1)](~1-~1e1<<1<<1)+(/^!/+[])[1+!![11%111]]

Answer: it prints “hello world”

Page 4: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What does this program do?#define _ -F<00||--F-OO--;

int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()

{

_-_-_-_

_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_

_-_-_-_

}

Page 5: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What does this program do?#define _ -F<00||--F-OO--;

int F=00,OO=00;main(){F_OO();printf("%1.3f\n",4.*-F/OO/OO);}F_OO()

{

_-_-_-_

_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_-_-_-_-_

_-_-_-_-_-_-_-_

_-_-_-_

}

Answer: it computes π

Page 6: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is (cryptographic) obfuscation?

Page 7: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is obfuscation?

Obfuscation is the deliberate act of creating obfuscated code, i.e.[...] that is difficult for humans to understand.

Obfuscators make reverse engineering more difficult [...] but donot alter the behavior of the obfuscated application.

– wikipedia

⇒ make a program unintelligible while preserving its functionality

Page 8: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is obfuscation?

Obfuscation is the deliberate act of creating obfuscated code, i.e.[...] that is difficult for humans to understand.

Obfuscators make reverse engineering more difficult [...] but donot alter the behavior of the obfuscated application.

– wikipedia

⇒ make a program unintelligible while preserving its functionality

Page 9: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Why obfuscation?∎ To protect some secret inside a program

▸ the algorithm itself (e.g. a factoring program)

efficientfactoringalgorithm

intelligble program

N = p · q (p, q)

▸ some private data used by the program (e.g. conditional dataaccess)

privatedata

if pwd correctthen disclose f(data)

pwd, f f(data)

∎ Obfuscating a hello-word program is useless

Page 10: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Defining obfuscationProgram

∎ word in a formal (programming) language P ∈ L∎ function execute ∶ L × {0,1}∗ → {0,1}∗

execute ∶ (P, in)↦ out

∎ P implements a function f ∶ A→ B if

∀a ∈ A ∶ execute(P,a) = f(a)

denoted P ≡ f∎ P1 and P2 are functionally equivalent if

P1 ≡ f ≡ P2 for some f

denoted P1 ≡ P2

Page 11: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Defining obfuscation

Obfuscator

∎ algorithm O mapping a program P to a program O(P ) st:

∎ functionality: O(P ) ≡ P∎ efficiency: O(P ) is efficiently executable

∎ security:▸ (informal) O(P ) is hard to understand▸ (informal) O(P ) protects its data

How to formally define the security property?

Page 12: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Virtual Black-Box (VBB) Obfuscation∎ O(P ) reveals nothing more than the I/O behavior of P

∎ Any adversary on O(P ) can be simulated with a black-boxaccess to P

AO(P )

{0

1

Adversary

' S⊥{0

1

P

x P (x)

Simulator

∣Pr[A(O(P ))) = 1] −Pr[SP (�) = 1]∣ ≤ ε

Page 13: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Virtual Black-Box (VBB) Obfuscation∎ O(P ) reveals nothing more than the I/O behavior of P

∎ Any adversary on O(P ) can be simulated with a black-boxaccess to P

AO(P )

{0

1

Adversary

' S⊥{0

1

P

x P (x)

Simulator

∣Pr[A(O(P ))) = 1] −Pr[SP (�) = 1]∣ ≤ ε

Page 14: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Impossibility result

∎ VBB-O does not exist on general programs (CRYPTO’01)

∎ Counterexample:

uint128_t cannibal (prog P, uint128_t password)

{

uint128_t secret1 = 0xe075b4f4eabf4377c1aa7202c8cc1ccb;

uint128_t secret2 = 0x94ff8ec818de3bd8223a62e4cb7c84a4;

if (password == secret1) return secret2;

if (execute(P, null , secret1) == secret2) return secret1;

return 0;

}

O(cannibal)(O(cannibal),0) = secret1

Page 15: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Indistinguishability obfuscation (iO)

∎ Restricted to circuits i.e. programs without branches/loops

∎ For any two programs P1 and P2 st P1 ≡ P2 and ∣P1∣ = ∣P2∣,the obfuscated programs O(P1) and O(P2) areindistinguishable

'AO(P1)

{0

1AO(P2)

{0

1

∣Pr[A(O(P1)) = 1] −Pr[A(O(P2)) = 1]∣ ≤ ε

Page 16: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Best possible obfuscation∎ Anything that can be learned (efficiently) from O(P ) can be

learned from any P ′ ≡ P with ∣P ′∣ ≈ ∣P ∣

AO(P )

{0

1

Adversary

' SP ′

{0

1

Simulator

P ′P ≡O

∣Pr[A(O(P ))) = 1] −Pr[S(P ′) = 1]∣ ≤ ε

Page 17: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

AO(P1)

{0

1AO(P2)

{0

1

∎ We use iO in the rest of the presentation

Page 18: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

AO(P1)

{0

1AO(P2)

{0

1

∎ We use iO in the rest of the presentation

Page 19: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

AO(P1)

{0

1AO(P2)

{0

1

SP1

{0

1

∎ We use iO in the rest of the presentation

Page 20: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

'

AO(P1)

{0

1AO(P2)

{0

1

SP1

{0

1

∎ We use iO in the rest of the presentation

Page 21: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

' '

AO(P1)

{0

1AO(P2)

{0

1

SP1

{0

1

∎ We use iO in the rest of the presentation

Page 22: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

'

' '

AO(P1)

{0

1AO(P2)

{0

1

SP1

{0

1

∎ We use iO in the rest of the presentation

Page 23: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

iO and BPO are equivalent∎ iO ⇒ BPO

AO(P )

{0

1' O A

SP ′

{0

1

∎ BPO ⇒ iO

'

' '

AO(P1)

{0

1AO(P2)

{0

1

SP1

{0

1

∎ We use iO in the rest of the presentation

Page 24: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is white-box cryptography?

Page 25: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is white-box cryptography?

“the attacker is assumed to have [...] full access to the encryptingsoftware and control of the execution environment”

⇒ obfuscation restricted to encryption (or another crypto primitive)

“Our main goal is to make key extraction difficult.”

⇒ relaxed security requirements

“While an attacker can clearly make use of the software itself [...],forcing an attacker to use the installed instance at hand is often of

value to DRM systems providers.”

⇒ encryption software ≠ secret key

– Chow et al. (DRM 2002)

Page 26: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is white-box cryptography?

“the attacker is assumed to have [...] full access to the encryptingsoftware and control of the execution environment”⇒ obfuscation restricted to encryption (or another crypto primitive)

“Our main goal is to make key extraction difficult.”

⇒ relaxed security requirements

“While an attacker can clearly make use of the software itself [...],forcing an attacker to use the installed instance at hand is often of

value to DRM systems providers.”

⇒ encryption software ≠ secret key

– Chow et al. (DRM 2002)

Page 27: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is white-box cryptography?

“the attacker is assumed to have [...] full access to the encryptingsoftware and control of the execution environment”⇒ obfuscation restricted to encryption (or another crypto primitive)

“Our main goal is to make key extraction difficult.”⇒ relaxed security requirements

“While an attacker can clearly make use of the software itself [...],forcing an attacker to use the installed instance at hand is often of

value to DRM systems providers.”

⇒ encryption software ≠ secret key

– Chow et al. (DRM 2002)

Page 28: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is white-box cryptography?

“the attacker is assumed to have [...] full access to the encryptingsoftware and control of the execution environment”⇒ obfuscation restricted to encryption (or another crypto primitive)

“Our main goal is to make key extraction difficult.”⇒ relaxed security requirements

“While an attacker can clearly make use of the software itself [...],forcing an attacker to use the installed instance at hand is often of

value to DRM systems providers.”⇒ encryption software ≠ secret key

– Chow et al. (DRM 2002)

Page 29: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What is white-box cryptography?

∎ Obfuscation restricted to a specific class of crypto primitives

∎ Typically, SPN ciphers:

m LL

k1

S

S

S

S

S

S

S

S

LL

k2

S

S

S

S

S

S

S

S

LL

k3

S

S

S

S

S

S

S

S

LL

kn

S

S

S

S

S

S

S

S

c

∎ Running example: F = {AESk(⋅) ∣ k ∈ {0,1}128}∎ White-box obfuscator: k ↦WB-AESk ≡ AESk(⋅)

Page 30: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Strongest possible WBC

∎ VBB obfuscation restricted to AES

AWB-AESk

{0

1

Adversary

' S⊥{0

1

AESk(·)

m c

Simulator

∎ Impossibility result does not apply

∎ The AES-LUT program achieves VBB▸ but does not fit into 109 ⋅ 109 ⋅ 109 TB

∎ How to build a compact VBB AES implementation?▸ could be impossible to achieve

Page 31: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What does iO-AES mean?

∎ iO restricted to AES: O(Pk) ≃ O(P ′k) for any Pk ≡ P ′

k ≡ AESk

∎ Example of iO AES obfuscator:

1. k ← extract-key(Pk)2. return reference implem AESk

▸ probably inefficient obfuscator!

∎ If a (compact) VBB AES implementation exists

O(Pk) ≃ O(VBB-AESk) ⇒ efficient iO⇔ VBB

∎ So what does iO-AES means?

Page 32: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Defining WBC

simpleAES

VBBAES

iOAES

?

Obfuscation scale

∎ We need something▸ relaxed compared to VBB▸ meaningful compared to iO

Page 33: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Defining WBC

simpleAES

VBBAES

iOAES

?

Obfuscation scale

further white-box

security notions

∎ We need something▸ relaxed compared to VBB▸ meaningful compared to iO ⇒ further notions

Page 34: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What could we expect from WBC?

Page 35: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What could we expect?

∎ The least requirement: key extraction must be difficult

AWB-AESk k

∎ Easy to satisfy for some variant of AES:

Ek(⋅) = AESh(⋅) with h =H(k)▸ H one-way ⇒ simple AESh implem unbreakable

∎ We should expect more

Page 36: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

What could we expect?

∎ Code-lifting cannot be avoided▸ the adversary can always use the software

∎ Code-lifting could be made unavoidable▸ force the adversary to use the software

∎ The software should then constrain the adversary▸ be less convenient to distribute▸ have restricted functionalities▸ include security features

Page 37: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Less convenient to distribute

∎ Example: make the implementation huge and incompressible

AWB-AESk

> 10 GB

AESk< 10 KB

∎ Possible use case: DRM

Page 38: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Restrict the software functionalities

∎ Example: make the implementation one-way

AWB-AESk

m

c

m

∎ Namely: turning AES into a public-key cryptosystem

∎ Possible use case: light-weight signature scheme

Page 39: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Include security features

∎ Example: adding a password

WB-AESk,π

if (π == π)return AESk(m)

else return ⊥A

π m

c

c = AESk(m)

takes time O(2|π|)

∎ WB implem ⇒ software secure element

∎ Possible use case: payment with token

Page 40: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Include security features

∎ Example: include a tracing mechanism

AWB-AESk,id Π ≡ AESk(·) T id

∃ T st ∀A ∶ WB-AESk,id ↦ Π ≡ AESk(⋅) ⇒ T (Π) = id

∎ Possible use case: pay-TV

Page 41: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Include security features

∎ Example: include a tracing mechanism

AWB-AESk,id Π ≡ AESk(·) T

WB-AESk,id1

WB-AESk,id2

WB-AESk,idt

id ∈ {id1, id2, . . . , idt}

∃ T st ∀A ∶ WB-AESk,id ↦ Π ≡ AESk(⋅) ⇒ T (Π) = id

∎ Possible use case: pay-TV

Page 42: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

White-box security notions

Page 43: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Security notions for symmetric ciphers

∎ Encryption scheme: E = (K,M,E,D)▸ E,D ∶ K ×M→M▸ E(k, ⋅) =D(k, ⋅)−1

∎ White-box compiler: CE ∶ (k, r)↦ [Erk] ≡ E(k, ⋅)

∎ Attack model:▸ target: a white-box encryption program [Ek] =CE(k,$)▸ CPA (chosen plaintext attack) – unavoidable▸ CCA (chosen ciphertext attack) – oracle for D(k, ⋅)▸ RCA (recompilation attack) – oracle for CE(k,$)

∎ Attack goals:▸ break (extract k), compress, inverse, be untraced

Page 44: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Unbreakability

A

k ← $, r ← $

[Erk] = CE(k, r)

[Erk]

kk

?= k

Challenger

D(k, ·)

CE(k, $)

UBK-CCA

UBK-RCA

c′

m′

[Er′k ]

CE is (τ, ε)-secure wrt UBK-{CPA/CCA/RCA}⇔

∀A running in time τ : Pr[k = k] ≤ ε

Page 45: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

One-Wayness

A

k ← $, r ← $

[Erk] = CE(k, r)

m← $

c = E(k,m)[Er

k], c

mm

?= m

Challenger

D(k, ·)

CE(k,R)

OW-CCA

OW-RCA

c′

m′

[Er′k ]

CE is (τ, ε)-secure wrt OW-{CPA/CCA/RCA}⇔

∀A running in time τ : Pr[m =m] ≤ ε

Page 46: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Incompressibility

∎ Distance between a program P and a function f ∶ X → Y

∆(P, f) = ∣{x ∈ X st P (x) ≠ f(x)}∣∣X ∣

∎ If ∆(P, f) = 0 then P ≡ f

Page 47: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Incompressibility

A

Challenger

k ← $, r ← $

[Erk] = CE(k, r)

[Erk]

P∆(P,E(k, ·))

?6 δ and |P | ?

< λ

D(k, ·)

CE(k, $)

INC-CCA

INC-RCA

c′

m′

[Er′k ]

CE is (τ, ε)-secure wrt (λ, δ)-INC-{CPA/CCA/RCA}⇔

∀A running in time τ : Pr[∆(P,E(k, ⋅)) ≤ δ ∧ ∣P ∣ ≤ λ] ≤ ε

Page 48: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Incompressibility

(λ, δ)-INC only makes sense for:

δ ≈ 0

and

∣ ref implem ∣ < λ <mink,r

∣ [Erk] ∣

Page 49: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Toy example

∎ Encryption scheme E

E ∶ (k,m)↦me ∈ G D ∶ (k,m)↦me−1 mod ω ∈ G▸ k = (G, ω, e)▸ G : RSA group with secret order ω▸ e ∈ [2, ω) coprime to ω

∎ White-box compiler CE ∶ (k, r)↦ [Erk]

▸ [Erk] computes mf in G

▸ blinded exponent: f = e + r ⋅ ω

Page 50: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Toy example

∎ CE is OW-CPA under RSA[G]

▸ RSA[G]: it’s hard to compute x1/e for x$←Ð G

∎ CE is (λ,0)-INC-CPA (with λ ≈ log f) under ORD[G]

▸ ORD[G]: it’s hard to compute the order of x$←Ð G

▸ wrt an adversary producing algebraic programs

Page 51: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Toy example

∎ Disclaimer: toy example▸ OW part = RSA▸ INC part inefficient (linear in the size)

∎ Designing E with (efficient) OW CE = designing a PKencryption scheme

∎ Designing E with (efficient) INC CE = designing anincompressible encryption scheme

∎ White-box crypto is about designing a compiler for anexisting encryption scheme

∎ Real challenge: design a OW and/or INC compiler for AES

Page 52: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ White-box implem of the decryption (pay-TV use case)

∎ Principle: include secret perturbations of the decryptionfunctionality

[Drk,C] =CE(k, r;C)

where

[Drk,C](c) =

⎧⎪⎪⎨⎪⎪⎩� if c ∈ C ⊆MDk(c) otherwise

Page 53: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ Perturbation-Value Hiding (PVH) security:

A

k ← $, r ← $

[Drk,C ] = CE(k, r | C)

c$← C [Dr

k,C ], c

mm

?= D(k, c)

Challenger

CE(k, $ | C′)C′ ⊇ C

[Dr′k,C′ ]

CE is (τ, ε)-secure wrt C-PVH⇔

∀A running in time τ : Pr[m =D(k, c)] ≤ ε

Page 54: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ User i gets Pi =CE(k, ri;Ci)▸ for random sets C1 ⊆ C2 ⊆ ⋯ ⊆ Cn ⊆M

∎ Pirate program from t traitors: Π = A(Pi1 , Pi2 , . . . , Pit)▸ with ∆(Π,D(k, ⋅)) negligible

∎ PVH security ⇒ linear tracing procedure

p(i) = Pr[c $←Ð Ci/Ci−1 ∶ Π(c) =D(k, c)]

1

0

p(i)

i1 i2 i3 n

majorityoutput

unanimousoutput

PVH

insecurity

PVH

security

Page 55: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ User i gets Pi =CE(k, ri;Ci)▸ for random sets C1 ⊆ C2 ⊆ ⋯ ⊆ Cn ⊆M

∎ Pirate program from t traitors: Π = A(Pi1 , Pi2 , . . . , Pit)▸ with ∆(Π,D(k, ⋅)) negligible

∎ PVH security ⇒ linear tracing procedure

p(i) = Pr[c $←Ð Ci/Ci−1 ∶ Π(c) =D(k, c)]

1

0

p(i)

i1 i2 i3 n

majorityoutput

unanimousoutput

PVH

insecurity

PVH

security

Page 56: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ User i gets Pi =CE(k, ri;Ci)▸ for random sets C1 ⊆ C2 ⊆ ⋯ ⊆ Cn ⊆M

∎ Pirate program from t traitors: Π = A(Pi1 , Pi2 , . . . , Pit)▸ with ∆(Π,D(k, ⋅)) negligible

∎ PVH security ⇒ linear tracing procedure

p(i) = Pr[c $←Ð Ci/Ci−1 ∶ Π(c) =D(k, c)]

1

0

p(i)

i1 i2 i3 n

majorityoutput

unanimousoutput

PVH

insecurity

PVH

security

Page 57: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ User i gets Pi =CE(k, ri;Ci)▸ for random sets C1 ⊆ C2 ⊆ ⋯ ⊆ Cn ⊆M

∎ Pirate program from t traitors: Π = A(Pi1 , Pi2 , . . . , Pit)▸ with ∆(Π,D(k, ⋅)) negligible

∎ PVH security ⇒ linear tracing procedure

p(i) = Pr[c $←Ð Ci/Ci−1 ∶ Π(c) =D(k, c)]

1

0

p(i)

i1 i2 i3 n

majorityoutput

unanimousoutput

PVH

insecurity

PVH

security

Page 58: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Traceability

∎ User i gets Pi =CE(k, ri;Ci)▸ for random sets C1 ⊆ C2 ⊆ ⋯ ⊆ Cn ⊆M

∎ Pirate program from t traitors: Π = A(Pi1 , Pi2 , . . . , Pit)▸ with ∆(Π,D(k, ⋅)) negligible

∎ PVH security ⇒ linear tracing procedure

p(i) = Pr[c $←Ð Ci/Ci−1 ∶ Π(c) =D(k, c)]

1

0

p(i)

i1 i2 i3 n

majorityoutput

unanimousoutput

PVH

insecurity

PVH

security

Page 59: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Security hierarchy

∎ If E is a secure encryption scheme

VBB�

INC⇓

VBB ⇒

OW ⇒ UBK ⇐ PVH

⇐ VBB

Page 60: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Security hierarchy

∎ If E is a secure encryption scheme

VBB�

INC⇓

VBB ⇒ OW ⇒ UBK ⇐ PVH ⇐ VBB

Page 61: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Security hierarchy

∎ If E is a secure encryption scheme

VBB�

INC⇓

VBB ⇒ OW ⇒ UBK ⇐ PVH ⇐ VBB

Page 62: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Conclusion

Page 63: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Conclusion

∎ WBC can be define as a restriction of cryptographicobfuscation

▸ subset of programs (e.g. keyed permutation)▸ relaxed security notions

∎ More work needed to▸ refine / define alternative security notions▸ build candidate white-box compiler

∎ Open challenge: INC/OW/PVH-implementation of AES

Page 64: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Final thoughts

∎ Science is overstepped by industrial usage in the field of WBC▸ Digital content protection (pay-TV, DRM)▸ Mobile payments▸ Software protection

∎ Yet no secure solution available in the public literature

∎ Should we rely on the secret-spec model?▸ Academic cryptographer: “over my dead body!”▸ Industrial cryptographer: “only choice I have (for now)”

∎ Open question: who beats who?▸ secret-spec designer vs. state-of-the-art cryptanalyst

Page 65: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Biblio∎ Obfuscation notions (VBB, iO, BPO)

▸ “On the (Im)possibility of Obfuscating Programs” (Barak et al. CRYPTO 2001)

▸ “On Best-Possible Obfuscation” (Goldwasser–Rothblum, TCC 2007)

∎ White-box crypto (introduction, first constructions)

▸ “A White-Box DES Implementation for DRM Applications” (Chow et al. DRM 2002)

▸ “White-Box Cryptography and an AES Implementation” (Chow et al. SAC 2002)

∎ Presented white-box security notions

▸ “White-Box Security Notions for Symmetric Encryption Schemes” (Delerablee et al. SAC 2013)

∎ Related works

▸ “Towards Security Notions for White-Box Cryptography” (Saxena–Wyseur–Preneel, ISC 2009)

▸ “White-Box Cryptography Revisited: Space-Hard Ciphers” (Bogdanov–Isobe, CCS 2015)

▸ “Efficient and Provable White-Box Primitives” (Fouque et al. ePrint 2016)

Page 66: From obfuscation to white-box crypto: relaxation and security … · 2017. 1. 26. · From obfuscation to white-box crypto: relaxation and security notions Matthieu Rivain WhibOx

Questions ?