provable security against side-channel attacks

92
Provable Security against Side-Channel Attacks Matthieu Rivain [email protected] MCrypt Seminar – Aug. 11th 2014

Upload: others

Post on 16-Oct-2021

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Provable Security against Side-Channel Attacks

Provable Security againstSide-Channel Attacks

Matthieu Rivain

[email protected]

MCrypt Seminar – Aug. 11th 2014

Page 2: Provable Security against Side-Channel Attacks

Outline

1 � Introduction

2 � Modeling side-channel leakage

3 � Achieving provable security against SCA

Page 3: Provable Security against Side-Channel Attacks

Outline

1 � Introduction

2 � Modeling side-channel leakage

3 � Achieving provable security against SCA

Page 4: Provable Security against Side-Channel Attacks

Side-channel attacks

Page 5: Provable Security against Side-Channel Attacks

Side-channel attacks

Page 6: Provable Security against Side-Channel Attacks

Side-channel attacks

Page 7: Provable Security against Side-Channel Attacks

Side-channel attacks

Page 8: Provable Security against Side-Channel Attacks

Side-channel attacks

Page 9: Provable Security against Side-Channel Attacks

Side-channel attacks

Sound and temperature

� Proofs of concept in idealized conditions

� Minor practical threats on embedded systems

Running time

� Trivial solution: constant-time implementations

� Must be carefully addressedI timing flaw still discovered in OpenSSL in 2011!I timing flaws can be induced by the processor (cache, branch

prediction, ...)

Page 10: Provable Security against Side-Channel Attacks

Side-channel attacks

Power consumption and EM emanations

� Close by nature (switching activity)

� Can be modeled as weighted sums of the transitions

� EM can be more informative (placing of the probe) butassume a raw access to the circuit

� Both are noisy i.e. non-deterministic

� Noise amplification by generating random switching activity

This talk: leakage = power consuption + EM emanations

Page 11: Provable Security against Side-Channel Attacks

Side-channel attacks

Power consumption and EM emanations

� Close by nature (switching activity)

� Can be modeled as weighted sums of the transitions

� EM can be more informative (placing of the probe) butassume a raw access to the circuit

� Both are noisy i.e. non-deterministic

� Noise amplification by generating random switching activity

This talk: leakage = power consuption + EM emanations

Page 12: Provable Security against Side-Channel Attacks

Provable securityTraditional approach� define an adversarial model (e.g. chosen plaintext attacker)� define a security goal (e.g. distinguish two ciphertexts)

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗

b̂b̂?= b

Challenger

E(k, ·)m

c

k

Oracle

Security reduction: If A exists with non-negligible |Pr[b̂ = b]− 1/2|then I can use A to efficiently solve a hard problem.

Page 13: Provable Security against Side-Channel Attacks

Provable securityTraditional approach� define an adversarial model (e.g. chosen plaintext attacker)� define a security goal (e.g. distinguish two ciphertexts)

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗

b̂b̂?= b

Challenger

E(k, ·)m

c

k

Oracle

Security reduction: If A exists with non-negligible |Pr[b̂ = b]− 1/2|then I can use A to efficiently solve a hard problem.

Page 14: Provable Security against Side-Channel Attacks

Provable securityTraditional approach� define an adversarial model (e.g. chosen plaintext attacker)� define a security goal (e.g. distinguish two ciphertexts)

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗

b̂b̂?= b

Challenger

E(k, ·)m

c

k

Oracle

Security reduction: If A exists with non-negligible |Pr[b̂ = b]− 1/2|then I can use A to efficiently solve a hard problem.

Page 15: Provable Security against Side-Channel Attacks

Provable security... in the presence of leakage

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗

b̂b̂?= b

Challenger

E(k, ·)m

c

k

Oracle

Issue: how to model the leakage?

Page 16: Provable Security against Side-Channel Attacks

Provable security... in the presence of leakage

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗, `∗

b̂b̂?= b

Challenger

E(k, ·)m

c,`

k

Oracle

Issue: how to model the leakage?

Page 17: Provable Security against Side-Channel Attacks

Provable security... in the presence of leakage

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗, `∗1, . . . , `∗q

b̂b̂?= b

Challenger

E(k, ·)m

c,`

k

Oracle

Issue: how to model the leakage?

Page 18: Provable Security against Side-Channel Attacks

Provable security... in the presence of leakage

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗, `∗1, . . . , `∗q

b̂b̂?= b

Challenger

E(k, ·)m

c,`

k

Oracle

Issue: how to model the leakage?

Page 19: Provable Security against Side-Channel Attacks

Outline

1 � Introduction

2 � Modeling side-channel leakage

3 � Achieving provable security against SCA

Page 20: Provable Security against Side-Channel Attacks

Modeling side-channel leakage

The encryption oracle cannot be seen as a mathematical functionE(k, ·) : m 7→ c anymore, but as a computation.

� Two classical approaches to model computation:I Turing machines (programs)I Circuits

� How to model leaking computation?

Page 21: Provable Security against Side-Channel Attacks

Modeling side-channel leakage

Chronology

� Probing model (circuits, 2003)

� Physically observable cryptography (Turing machines, 2004)

� Leakage resilient cryptography (2008)

� Further leakage models for circuits (2010)

� Noisy leakage model (2013)

Presentation

� Leakage models for circuits

� Leakage models for programs

Page 22: Provable Security against Side-Channel Attacks

Modeling side-channel leakage

Chronology

� Probing model (circuits, 2003)

� Physically observable cryptography (Turing machines, 2004)

� Leakage resilient cryptography (2008)

� Further leakage models for circuits (2010)

� Noisy leakage model (2013)

Presentation

� Leakage models for circuits

� Leakage models for programs

Page 23: Provable Security against Side-Channel Attacks

Modeling side-channel leakage

Chronology

� Probing model (circuits, 2003)

� Physically observable cryptography (Turing machines, 2004)

� Leakage resilient cryptography (2008)

� Further leakage models for circuits (2010)

� Noisy leakage model (2013)

Presentation

� Leakage models for circuits

� Leakage models for programs

Page 24: Provable Security against Side-Channel Attacks

Leakage Models for Circuits

� [Ishai-Sahai-Wagner. CRYPTO 2003]

� Directed graph whose nodes are gates and edges are wires

in1

in2

in3

$

Op1

copy

Op2 mem

Op3 copy

Op4

out1

out2

� At each cycles, the circuit leaks f(w1, w2, . . . , wn)

Page 25: Provable Security against Side-Channel Attacks

Leakage Models for Circuits

� [Ishai-Sahai-Wagner. CRYPTO 2003]

� Directed graph whose nodes are gates and edges are wires

in1

in2

in3

$

Op1

copy

Op2 mem

Op3 copy

Op4

out1

out2

w1

w2

w3

w7

w4

w5

w6

w9

w8

w11

w10

w12

w13

� At each cycles, the circuit leaks f(w1, w2, . . . , wn)

Page 26: Provable Security against Side-Channel Attacks

Leakage Models for Circuits

� Probing security model [Ishai-Sahai-Wagner. CRYPTO 2003]I the adversary gets (wi)i∈I for some chosen set |I| ≤ t

� AC0 leakage model [Faust et al. EUROCRYPT 2010]I the leakage function f belongs to the AC0 complexity classI i.e. f is computable by circuits of constant depth d

� Noisy circuit-leakage model [Faust et al. EUROCRYPT 2010]I f : (w1, w2, . . . , wn) 7→ (w1 ⊕ ε1, w2 ⊕ ε2, . . . , wn ⊕ εn)

with εi =

{1 with proba p < 1/20 with proba 1− p

� These models fail in capturing EM and PC leakages!

� Circuits not convenient to model software implementations(or algorithms / protocols)

Page 27: Provable Security against Side-Channel Attacks

Leakage Models for Circuits

� Probing security model [Ishai-Sahai-Wagner. CRYPTO 2003]I the adversary gets (wi)i∈I for some chosen set |I| ≤ t

� AC0 leakage model [Faust et al. EUROCRYPT 2010]I the leakage function f belongs to the AC0 complexity classI i.e. f is computable by circuits of constant depth d

� Noisy circuit-leakage model [Faust et al. EUROCRYPT 2010]I f : (w1, w2, . . . , wn) 7→ (w1 ⊕ ε1, w2 ⊕ ε2, . . . , wn ⊕ εn)

with εi =

{1 with proba p < 1/20 with proba 1− p

� These models fail in capturing EM and PC leakages!

� Circuits not convenient to model software implementations(or algorithms / protocols)

Page 28: Provable Security against Side-Channel Attacks

Leakage Models for Circuits

� Probing security model [Ishai-Sahai-Wagner. CRYPTO 2003]I the adversary gets (wi)i∈I for some chosen set |I| ≤ t

� AC0 leakage model [Faust et al. EUROCRYPT 2010]I the leakage function f belongs to the AC0 complexity classI i.e. f is computable by circuits of constant depth d

� Noisy circuit-leakage model [Faust et al. EUROCRYPT 2010]I f : (w1, w2, . . . , wn) 7→ (w1 ⊕ ε1, w2 ⊕ ε2, . . . , wn ⊕ εn)

with εi =

{1 with proba p < 1/20 with proba 1− p

� These models fail in capturing EM and PC leakages!

� Circuits not convenient to model software implementations(or algorithms / protocols)

Page 29: Provable Security against Side-Channel Attacks

Physically Observable Cryptography

� [Micali-Reyzin. TCC’04]

� Framework for leaking computation

� Strong formalism using Turing machines

� Assumption: Only Computation Leaks (OCL)

� Computation divided into subcomputations y ← SC(x)

� Each SC accesses a part of the state x and leaks f(x)

� f adaptively chosen by the adversary

� No actual proposal for f

Page 30: Provable Security against Side-Channel Attacks

Leakage Resilient Cryptography

� Model introduced in [Dziembowski-Pietrzak. STOC’08]

� Specialization of the Micali-Reyzin framework

� Leakage functions follow the bounded retrieval model[Crescenzo et al. TCC’06]

f : {0, 1}n → {0, 1}λ for some constant λ < n

Page 31: Provable Security against Side-Channel Attacks

Leakage Resilient Cryptography

� Example: LR stream cipher [Pietrzak. EUROCRYPT’09]

� Many further LR crypto primitives published so far

� Generic LR compilersI [Goldwasser-Rothblum. FOCS’12]I [Dziembowski-Faust. TCC’12]

Page 32: Provable Security against Side-Channel Attacks

Leakage Resilient Cryptography

� Limitation: the leakage of a subcomputation is limited toλ-bit values for λ < n (the input size)

� Side-channel leakage far bigger than n bitsI although it may not remove all the entropy of x

Figure: Power consumption of a DES computation.

Page 33: Provable Security against Side-Channel Attacks

Noisy Leakage Model

� [Prouff-Rivain. EUROCRYPT 2013]

� OCL assumption (Micali-Reyzin framework)

� New class of noisy leakage functions

� An observation f(x) introduces a bounded bias in Pr[x]I very generic

Page 34: Provable Security against Side-Channel Attacks

Notion of bias

� Bias of X given Y = y:

β(X|Y = y) = ‖Pr[X]− Pr[X|Y = y]‖with ‖ · ‖ = Euclidean norm.

� Bias of X given Y :

β(X|Y ) =∑y∈Y

Pr[Y = y] β(X|Y = y) .

� β(X|Y ) ∈[0;√

1− 1|X |

](indep. / deterministic relation)

� Related to MI by:

1

ln 2β(X|Y ) ≤ MI(X;Y ) ≤ |X |

ln 2β(X|Y )

Page 35: Provable Security against Side-Channel Attacks

Noisy Leakage Model

� Every subcomputation leaks a noisy function f of its inputI noise modeled by a fresh random tape argument

� ψ is some noise parameter

� f ∈ N (1/ψ) ⇒ β(X|f(X)

)< 1

ψ

� Capture any form of noisy leakage

Page 36: Provable Security against Side-Channel Attacks

Noisy Leakage Model

� In practice, the multivariate Gaussian model is widely admitted

f(x) ∼ N (~mx,Σ) ∀x ∈ X

� The bias can be efficiently computed:

β(X|f(X)) =∑~y

p~y

(∑x

(px|~y − 1/|X |

)2)1/2

with p~y =∑

xφΣ(~y−~mx)∑~z φΣ(~z−~mx) and px|~y = φΣ(~y−~mx)∑

v φΣ(~y−~mv)

where φΣ : ~y 7→ exp(− 1

2 ~y · Σ · ~y).

Page 37: Provable Security against Side-Channel Attacks

Noisy Leakage ModelIllustration: univariate Hamming weight model with Gaussian noise

f(X) = HW(X) +N (0, σ2)

50 100 150 200

!3.0

!2.5

!2.0

!1.5

Figure: log10 β(X|f(X)) w.r.t. σ.

Page 38: Provable Security against Side-Channel Attacks

Noisy Leakage ModelIllustration: univariate Hamming weight model with Gaussian noise

f(X) = HW(X) +N (0, σ)

50 100 150 200

500

1000

1500

2000

2500

Figure: ψ = 1β(X|f(X)) w.r.t. σ.

Page 39: Provable Security against Side-Channel Attacks

Outline

1 � Introduction

2 � Modeling side-channel leakage

3 � Achieving provable security against SCA

Page 40: Provable Security against Side-Channel Attacks

Achieving provable security against SCA

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗, `∗1, . . . , `∗q

b̂b̂?= b

Challenger

E(k, ·)m

c,`

k

Oracle

� Describe a (protected) implementation of E(k, ·)� Model the leakage� Provide a security reduction

� What about generic security against SCA?I for any cryptosystem, security goal, adversarial model

Page 41: Provable Security against Side-Channel Attacks

Achieving provable security against SCA

A

Adversary

k$← K

b$← {0, 1}

c∗ ← E(k,mb)

m0,m1

c∗, `∗1, . . . , `∗q

b̂b̂?= b

Challenger

E(k, ·)m

c,`

k

Oracle

� Describe a (protected) implementation of E(k, ·)� Model the leakage� Provide a security reduction

� What about generic security against SCA?I for any cryptosystem, security goal, adversarial model

Page 42: Provable Security against Side-Channel Attacks

General setting

A

Adversary

SecurityGame O

LeakageOracle

(mi, k)

`(mi, k)

0/1

� Security: ∀Dist : Adv(DistO(·)) ≤ 2−κ

⇒ ∀A : Adv(A-SGO(·)) ≈ Adv(A-SGO$(·))

� Information theoretic security: MI((m, k); `(m, k)) ≤ 2−κ

IT Security ⇒ Security

Page 43: Provable Security against Side-Channel Attacks

General setting

A SecurityGame O

LeakageOracle

Distinguisher

(mi, k)

`(mi, k)

0/1

� Security: ∀Dist : Adv(DistO(·)) ≤ 2−κ

⇒ ∀A : Adv(A-SGO(·)) ≈ Adv(A-SGO$(·))

� Information theoretic security: MI((m, k); `(m, k)) ≤ 2−κ

IT Security ⇒ Security

Page 44: Provable Security against Side-Channel Attacks

General setting

A SecurityGame O

LeakageOracle

Distinguisher

(mi, k)

`($, $)

0/1

� Security: ∀Dist : Adv(DistO(·)) ≤ 2−κ

⇒ ∀A : Adv(A-SGO(·)) ≈ Adv(A-SGO$(·))

� Information theoretic security: MI((m, k); `(m, k)) ≤ 2−κ

IT Security ⇒ Security

Page 45: Provable Security against Side-Channel Attacks

General setting

A

Adversary

SecurityGame O

LeakageOracle

Distinguisher

(mi, k)

`(mi, k)

0/1

� Security: ∀Dist : Adv(DistO(·)) ≤ 2−κ

⇒ ∀A : Adv(A-SGO(·)) ≈ Adv(A-SGO$(·))

� Information theoretic security: MI((m, k); `(m, k)) ≤ 2−κ

IT Security ⇒ Security

Page 46: Provable Security against Side-Channel Attacks

General setting

A

Adversary

SecurityGame O

LeakageOracle

Distinguisher

(mi, k)

`(mi, k)

0/1

� Security: ∀Dist : Adv(DistO(·)) ≤ 2−κ

⇒ ∀A : Adv(A-SGO(·)) ≈ Adv(A-SGO$(·))

� Information theoretic security: MI((m, k); `(m, k)) ≤ 2−κ

IT Security ⇒ Security

Page 47: Provable Security against Side-Channel Attacks

General setting

A

Adversary

SecurityGame O

LeakageOracle

Distinguisher

(mi, k)

`(mi, k)

0/1

� Security: ∀Dist : Adv(DistO(·)) ≤ 2−κ

⇒ ∀A : Adv(A-SGO(·)) ≈ Adv(A-SGO$(·))

� Information theoretic security: MI((m, k); `(m, k)) ≤ 2−κ

IT Security ⇒ Security

Page 48: Provable Security against Side-Channel Attacks

Using random sharing

Principle

� Randomly share the internal state of the computation

� A d-sharing of x ∈ F is a tuple (x1, x2, . . . , xn) s.t.

x1 + x2 + · · ·+ xn = x

with n− 1 degrees of randomness

� Subcomputations y ← SC(x) are replaced by

(y1, y2, . . . , yn)← SC′(x1, x2, . . . , xn)

Page 49: Provable Security against Side-Channel Attacks

Using random sharing

Soundness

� [Chari et al. CRYPTO’99]

� Univariate Gaussian leakage model: `i ∼ xi +N (µ, σ2)

� Distinguishing((`i)i|x = 0

)from

((`i)i|x = 1

)takes q

samples:q ≥ cst · σn

� Limitations:I univariate leakage model, Gaussian noise assumptionI static leakage of the shares (i.e. without computation)I no scheme proposed to securely compute on a shared state

Page 50: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner Scheme

� [Ishai-Sahai-Wagner. CRYPTO 2003]

� Binary circuit model

� Goal: security against t-probing attacks

� Every wire w is shared in n wires w1, w2, . . . , wn

� Issue: how to encode logic gates?I NOT gates and AND gates

� NOT gates encoding:

w = w1 ⊕ w2 · · · ⊕ wn

Page 51: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · b

a · b =(⊕

iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 52: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 53: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 a1b3a2b1 a2b2 a2b3a3b1 a3b2 a3b3

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 54: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 a1b30 a2b2 a2b30 0 a3b3

⊕ 0 0 0a2b1 0 0a3b1 a3b2 0

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 55: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 a1b30 a2b2 a2b30 0 a3b3

⊕0 a2b1 a3b1

0 0 a3b20 0 0

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 56: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 ⊕ a2b1 a1b3 ⊕ a3b10 a2b2 a2b3 ⊕ a3b20 0 a3b3

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 57: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 ⊕ a2b1 a1b3 ⊕ a3b10 a2b2 a2b3 ⊕ a3b20 0 a3b3

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 58: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 ⊕ a2b1 a1b3 ⊕ a3b10 a2b2 a2b3 ⊕ a3b20 0 a3b3

⊕0 r1,2 r1,3

0 0 r2,3

0 0 0

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 59: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 a1b2 ⊕ a2b1 a1b3 ⊕ a3b10 a2b2 a2b3 ⊕ a3b20 0 a3b3

⊕ 0 r1,2 r1,3

r1,2 0 r2,3

r1,3 r2,3 0

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 60: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1r1,2 a2b2 (a2b3 ⊕ r2,3)⊕ a3b2r1,3 r2,3 a3b3

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 61: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1r1,2 a2b2 (a2b3 ⊕ r2,3)⊕ a3b2r1,3 r2,3 a3b3

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 62: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1r1,2 a2b2 (a2b3 ⊕ r2,3)⊕ a3b2r1,3 r2,3 a3b3

c1

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 63: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1r1,2 a2b2 (a2b3 ⊕ r2,3)⊕ a3b2r1,3 r2,3 a3b3

c1 c2

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 64: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1r1,2 a2b2 (a2b3 ⊕ r2,3)⊕ a3b2r1,3 r2,3 a3b3

c1 c2 c3

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 65: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner SchemeAND gates encoding

� Input: (ai)i, (bi)i s.t.⊕

i ai = a,⊕

i bi = b

� Output: (ci)i s.t.⊕

i ci = a · ba · b =

(⊕iai)(⊕

ibi)

=⊕

i,jaibj

� Example (n = 3):a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1r1,2 a2b2 (a2b3 ⊕ r2,3)⊕ a3b2r1,3 r2,3 a3b3

c1 c2 c3

a1b1 (a1b2 ⊕ r1,2)⊕ a2b1 (a1b3 ⊕ r1,3)⊕ a3b1

Page 66: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner Scheme

Sketch of security proof

� t-probing adversary ⇒ n = 2t+ 1 shares

� probed wires: v1, v2, . . . , vt

� construct a set I = {raw and column indices of vk}

� (v1, v2, . . . , vt) perfectly simulated from (ai)i∈I and (bi)i∈I

� |I| ≤ 2t < n ⇒ (ai)i∈I and (bi)i∈I are random |I|-tuples

Page 67: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner Scheme

bb

bb

bb

bb

bb

bb

b

b

b

bb

bb

bb

(ai)i

c0

c1

c2

(bi)i $ $ $

Figure: AND gate for n = 3

Page 68: Provable Security against Side-Channel Attacks

Ishai-Sahai-Wagner Scheme

� Can be transposed to the dth-order security modelI the adversary must combined the leakage of at least d

subcomputations to recover informationI in presence of noise d is a relevant security parameter

[Chari et al. CRYPTO’99]

� Many dth-order secure schemes based on ISW scheme

� Not fully satisfactoryI an relevant adversary should use all the leakage

Page 69: Provable Security against Side-Channel Attacks

Security in the noisy model

� [Prouff-Rivain. EUROCRYPT 2013]

� Every y ← SC(x) leaks f(x) where β(X|f(X)

)< 1

ψ

� Information theoretic security proof:

MI((m, k); `(m, k)) < O(ω−d)

� Assumtpion: the noise parameter ψ can be linearly increased

� Need of a leak-free component for refreshing

x = (x0, x1, . . . , xd)︸ ︷︷ ︸⊕i xi=x

7−→ x′ = (x′0, x′1, . . . , x

′d)︸ ︷︷ ︸⊕

i x′i=x

with (x | x) and (x′ | x) mutually independent.

Page 70: Provable Security against Side-Channel Attacks

Overview of the proof

� Consider a SPN computation

Figure: Example of SPN round.

Page 71: Provable Security against Side-Channel Attacks

Overview of the proof

� Classical implementation protected with sharing

Figure: Example of SPN round protected with sharing.

Page 72: Provable Security against Side-Channel Attacks

S-Box computation

� [Carlet et al. FSE’12]

� Polynomial evaluation over GF(2n)

� Two types of elementary calculations:I linear functions (additions, squares, multiplication by

coefficients)I multiplications over GF(2n)

Page 73: Provable Security against Side-Channel Attacks

Linear functions� Given a sharing X = X0 ⊕X1 ⊕ · · · ⊕Xd

X0

�(X0)

� � �

X1

�(X1) �(Xd)

Xd

· · ·

� For fi ∈ N (1/ψ) with ψ = O(|X | 12 ω), we show

MI(X; (f0(X0), f1(X1), . . . , fd(Xd))

)≤ 1

ωd+1

Page 74: Provable Security against Side-Channel Attacks

Linear functions� Given a sharing X = X0 ⊕X1 ⊕ · · · ⊕Xd

f0(X0)

X0

�(X0)

� � �

X1

�(X1) �(Xd)f1(X1) fd(Xd)

Xd

· · ·

� For fi ∈ N (1/ψ) with ψ = O(|X | 12 ω), we show

MI(X; (f0(X0), f1(X1), . . . , fd(Xd))

)≤ 1

ωd+1

Page 75: Provable Security against Side-Channel Attacks

Linear functions� Given a sharing X = X0 ⊕X1 ⊕ · · · ⊕Xd

f0(X0)

X0

�(X0)

� � �

X1

�(X1) �(Xd)f1(X1) fd(Xd)

Xd

· · ·

� For fi ∈ N (1/ψ) with ψ = O(|X | 12 ω), we show

MI(X; (f0(X0), f1(X1), . . . , fd(Xd))

)≤ 1

ωd+1

Page 76: Provable Security against Side-Channel Attacks

Multiplications

� Inputs: sharings⊕

iAi = g(X) and⊕

iBi = g(X) whereX = s-box input

� First step: cross-products

A0 ⇥B0 A0 ⇥B1 · · · A0 ⇥Bd

A1 ⇥B0 A1 ⇥B1 · · · A1 ⇥Bd

......

. . ....

Ad ⇥B0 Ad ⇥B1 · · · Ad ⇥Bd

� For fi,j ∈ N (1/ψ) with ψ = O(|X | 32d ω) we show

MI(X; (fi,j(Ai, Bj))i,j

)≤ 1

ωd+1

Page 77: Provable Security against Side-Channel Attacks

Multiplications

� Inputs: sharings⊕

iAi = g(X) and⊕

iBi = g(X) whereX = s-box input

� First step: cross-products

A0 ⇥B0 A0 ⇥B1 · · · A0 ⇥Bd

A1 ⇥B0 A1 ⇥B1 · · · A1 ⇥Bd

......

. . ....

Ad ⇥B0 Ad ⇥B1 · · · Ad ⇥Bd

f0,0(A0, B0) f0,1(A0, B1) · · · f0,d(A0, Bd)f1,0(A1, B0) f1,1(A1, B1) · · · f1,d(A1, Bd)

......

. . ....

fd,0(Ad, B0) fd,1(Ad, B1) · · · fd,d(Ad, Bd)

� For fi,j ∈ N (1/ψ) with ψ = O(|X | 32d ω) we show

MI(X; (fi,j(Ai, Bj))i,j

)≤ 1

ωd+1

Page 78: Provable Security against Side-Channel Attacks

Multiplications

� Inputs: sharings⊕

iAi = g(X) and⊕

iBi = g(X) whereX = s-box input

� First step: cross-products

A0 ⇥B0 A0 ⇥B1 · · · A0 ⇥Bd

A1 ⇥B0 A1 ⇥B1 · · · A1 ⇥Bd

......

. . ....

Ad ⇥B0 Ad ⇥B1 · · · Ad ⇥Bd

� For fi,j ∈ N (1/ψ) with ψ = O(|X | 32d ω) we show

MI(X; (fi,j(Ai, Bj))i,j

)≤ 1

ωd+1

Page 79: Provable Security against Side-Channel Attacks

Multiplications

� Second step: refreshing

� Apply on each column and one row of

A0 ⇥B0 A0 ⇥B1 · · · A0 ⇥Bd

A1 ⇥B0 A1 ⇥B1 · · · A1 ⇥Bd

......

. . ....

Ad ⇥B0 Ad ⇥B1 · · · Ad ⇥Bd

� We get a fresh (d+ 1)2-sharing of A×B

V0,0 V0,1 · · · V0,d

V1,0 V1,1 · · · V1,d...

.... . .

...Vd,0 Vd,1 · · · Vd,d

Page 80: Provable Security against Side-Channel Attacks

Multiplications

� Third step: summing rows

� Takes d elementary calculations (XORs) per row:

Ti,1 Vi,0 � Vi,1

Ti,2 Ti,1 � Vi,2

...

Ti,d Ti,d�1 � Vi,d

� For fi,j ∈ N (1/ψ) with ψ = O(|X | 32ω), we show

MI(X; (F0, F1, . . . , Fd)

)≤ 1

ωd+1

where Fi =(fi,1(Vi,0, Vi,1), fi,2(Ti,1, Vi,2), . . . , fi,d(Ti,d−1, Vi,d)

)

Page 81: Provable Security against Side-Channel Attacks

Multiplications

� Third step: summing rows

� Takes d elementary calculations (XORs) per row:

...

Ti,1 Vi,0 � Vi,1

Ti,2 Ti,1 � Vi,2

...

Ti,d Ti,d�1 � Vi,d

fi,d(Ti,d�1, Vi,d)

fi,1(Vi,0, Vi,1)

fi,2(Ti,1, Vi,2)

� For fi,j ∈ N (1/ψ) with ψ = O(|X | 32ω), we show

MI(X; (F0, F1, . . . , Fd)

)≤ 1

ωd+1

where Fi =(fi,1(Vi,0, Vi,1), fi,2(Ti,1, Vi,2), . . . , fi,d(Ti,d−1, Vi,d)

)

Page 82: Provable Security against Side-Channel Attacks

Multiplications

� Third step: summing rows

� Takes d elementary calculations (XORs) per row:

...

Ti,1 Vi,0 � Vi,1

Ti,2 Ti,1 � Vi,2

...

Ti,d Ti,d�1 � Vi,d

fi,d(Ti,d�1, Vi,d)

fi,1(Vi,0, Vi,1)

fi,2(Ti,1, Vi,2)

� For fi,j ∈ N (1/ψ) with ψ = O(|X | 32ω), we show

MI(X; (F0, F1, . . . , Fd)

)≤ 1

ωd+1

where Fi =(fi,1(Vi,0, Vi,1), fi,2(Ti,1, Vi,2), . . . , fi,d(Ti,d−1, Vi,d)

)

Page 83: Provable Security against Side-Channel Attacks

Putting everything together

� Several sequences of subcomputations, each leaking Lt with

MI((m, k);Lt) ≤1

ωd+1

� Use of share-refreshing between each sequenceI (Lt)t are mutually independent given (m, k)

� We hence have

MI((m, k); (L1, L2, . . . , LT )

)≤

T∑t=1

MI((m, k);Lt) ≤T

ωd+1

Page 84: Provable Security against Side-Channel Attacks

Improved security proof

� [Duc-Dziembowski-Faust. EUROCRYPT 2014]

� Security reduction: probing model ⇒ noisy model

� ISW scheme secure in the noisy model

� No need for leak-free component !

Page 85: Provable Security against Side-Channel Attacks

Improved security proof

� Consider y1 ← SC1(x1), y2 ← SC2(x2), . . . , yn ← SCn(xn)

� t-probing model: ` = (xi)i∈I with |I| = t

� ε-random probing model: ` = (ϕ1(x1), ϕ2(x2), . . . , ϕn(xn))

I where ϕi is a ε-identity function i.e.

with ϕi(x) =

{x with proba ε⊥ with proba 1− ε

� δ-noisy model: ` = (f1(x1), f2(x2), . . . , fn(xn))

with β(X|fi(X)) ≤ δ (here ‖ · ‖ = L1)

t-probing security ⇒ ε-random probing security ⇒ δ-noisy security

Page 86: Provable Security against Side-Channel Attacks

Improved security proof

� Consider y1 ← SC1(x1), y2 ← SC2(x2), . . . , yn ← SCn(xn)

� t-probing model: ` = (xi)i∈I with |I| = t

� ε-random probing model: ` = (ϕ1(x1), ϕ2(x2), . . . , ϕn(xn))

I where ϕi is a ε-identity function i.e.

with ϕi(x) =

{x with proba ε⊥ with proba 1− ε

� δ-noisy model: ` = (f1(x1), f2(x2), . . . , fn(xn))

with β(X|fi(X)) ≤ δ (here ‖ · ‖ = L1)

t-probing security ⇒ ε-random probing security ⇒ δ-noisy security

Page 87: Provable Security against Side-Channel Attacks

From probing to random probing� ε-random probing adv. Arp ⇒ t-probing adv. Ap

I with t = 2nε− 1

� Ap works as follows

I sample (z1, z2, . . . , zn) where zi =

{1 with proba ε0 with proba 1− ε

I set I = {i | zi = 1}, if |I| > t return ⊥I get (xi)i∈I

I call Arp on (y1, y2, . . . , yn) where yi =

{xi if i ∈ I⊥ if i /∈ I

� If |I| ≤ t : (y1, y2, . . . , yn) ∼ (ϕ1(x1), ϕ2(x2), . . . , ϕn(xn))

� Chernoff bound: Pr[|I| > t] ≤ exp(−t/6)

� ∀Arp ∃Ap : Adv(Ap) ≤ Adv(Arp)− exp(−t/6)

Page 88: Provable Security against Side-Channel Attacks

From probing to random probing� ε-random probing adv. Arp ⇒ t-probing adv. Ap

I with t = 2nε− 1

� Ap works as follows

I sample (z1, z2, . . . , zn) where zi =

{1 with proba ε0 with proba 1− ε

I set I = {i | zi = 1}, if |I| > t return ⊥I get (xi)i∈I

I call Arp on (y1, y2, . . . , yn) where yi =

{xi if i ∈ I⊥ if i /∈ I

� If |I| ≤ t : (y1, y2, . . . , yn) ∼ (ϕ1(x1), ϕ2(x2), . . . , ϕn(xn))

� Chernoff bound: Pr[|I| > t] ≤ exp(−t/6)

� ∀Arp : Adv(Arp) ≤ maxAp Adv(Ap) + exp(−t/6)

Page 89: Provable Security against Side-Channel Attacks

From random probing to noisy leakage

� Main lemma: every f s.t. β(X|f(X)) ≤ δ can be written:

f = f ′ ◦ ϕwhere ϕ is an ε-identity function with ε ≤ δ|X |, and

f efficient to samplePr[f(x) = y] eff. computable

}⇒ f ′ efficient to sample

� δ-noisy adversary An ⇒ ε-random probing adv. ArpI get (ϕ1(x1), ϕ2(x2), . . . , ϕn(xn))

I call An on (f ′1 ◦ ϕ1(x1), f ′2 ◦ ϕ2(x1), . . . , f ′n ◦ ϕn(xn))

� ∀An ∃Arp : Adv(Arp) = Adv(An)

Page 90: Provable Security against Side-Channel Attacks

From random probing to noisy leakage

� Main lemma: every f s.t. β(X|f(X)) ≤ δ can be written:

f = f ′ ◦ ϕwhere ϕ is an ε-identity function with ε ≤ δ|X |, and

f efficient to samplePr[f(x) = y] eff. computable

}⇒ f ′ efficient to sample

� δ-noisy adversary An ⇒ ε-random probing adv. ArpI get (ϕ1(x1), ϕ2(x2), . . . , ϕn(xn))

I call An on (f ′1 ◦ ϕ1(x1), f ′2 ◦ ϕ2(x1), . . . , f ′n ◦ ϕn(xn))

� ∀An : Adv(An) ≤ maxArp Adv(Arp)

Page 91: Provable Security against Side-Channel Attacks

Combining both reductions

� Security against t-probing ⇒ security against δ-noisy

where δ =t+ 1

2n|X |I exp(−t/6) must be negligible ⇒ t ≥ 8.65 κ

� ISW scheme with d-sharing is secure against δ-noisy attackers

where δ =d

n|X | (and d ≥ 17.5 κ)

� For ISW-multiplication n = O(d2) and X = F× F giving

δ = O(1/d|F|2) ⇒ ψ = O(d|F|2)

� Limitation: ψ is still in O(d)

Page 92: Provable Security against Side-Channel Attacks

Conclusion

� New practically relevant model for leaking computation: thenoisy model

� Need for practical investigations for the bias estimation

� Only 2 works proposing formal proofs in this model

� Open issues:I a scheme secure with constant noise

I secure implementations with different kind of randomization(e.g. exponent/message blinding for RSA/ECC)