Block Ciphers Implementations Provably Secure Against Second Order - - PowerPoint PPT Presentation

block ciphers implementations provably secure against
SMART_READER_LITE
LIVE PREVIEW

Block Ciphers Implementations Provably Secure Against Second Order - - PowerPoint PPT Presentation

8 + Block Ciphers Implementations Provably Secure Against Second Order Side Channel Analysis Matthieu Rivain 1 , 2 , Emmanuelle Dottax 1 & Emmanuel Prouff 1 Oberthur Card Systems University of Luxembourg February 11, 2008 M. Rivain, E.


slide-1
SLIDE 1

8 +

Block Ciphers Implementations Provably Secure Against Second Order Side Channel Analysis

Matthieu Rivain1,2, Emmanuelle Dottax1 & Emmanuel Prouff1

Oberthur Card Systems University of Luxembourg

February 11, 2008

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-2
SLIDE 2

8 +

Outline

1

Introduction to (Second Order) Side Channel Analysis

2

Block Ciphers Implementations Secure Against 2O-SCA

3

S-box Implementations Secure Against 2O-SCA

4

Improvement

5

Comparison & Implementation Results

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-3
SLIDE 3

8 +

Side Channel Analysis

Side Channel Analysis (SCA) is a strong cryptanalytic technique targeting physical implementations The physical leakage of the execution of any algorithm depends on the intermediate variables SCA exploits leakage on sensitive variables that depend on the secret key

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-4
SLIDE 4

8 +

Side Channel Analysis

V depends on a few key bits

⇒ possible key recovery attack exploiting L(V )

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-5
SLIDE 5

8 +

Side Channel Analysis

V depends on a few key bits

⇒ possible key recovery attack exploiting L(V )

Classical statistical distinguishers:

◮ correlation techniques – generic ◮ maximum likelihood – strong adversary model

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-6
SLIDE 6

8 +

Masking & Higher Order SCA

One or several random values – the masks – are added to every sensitive variable

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-7
SLIDE 7

8 +

Masking & Higher Order SCA

One or several random values – the masks – are added to every sensitive variable First order masking: one single mask

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-8
SLIDE 8

8 +

Masking & Higher Order SCA

One or several random values – the masks – are added to every sensitive variable First order masking: one single mask Second Order Side Channel Analysis

◮ M : random mask ◮ V ⊕ M : masked variable

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-9
SLIDE 9

8 +

Masking & Higher Order SCA

One or several random values – the masks – are added to every sensitive variable First order masking: one single mask Second Order Side Channel Analysis

◮ M : random mask ◮ V ⊕ M : masked variable

To thwart 2O-SCA: use second order masking

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-10
SLIDE 10

8 +

Masking & Higher Order SCA

One or several random values – the masks – are added to every sensitive variable First order masking: one single mask Second Order Side Channel Analysis

◮ M : random mask ◮ V ⊕ M : masked variable

To thwart 2O-SCA: use second order masking dth order masking is broken by (d + 1)th order SCA

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-11
SLIDE 11

8 +

Why Using Masking ?

[Chari+ CRYPTO’99] SCA complexity increases

◮ exponentially with the masking order ◮ polynomially with hiding-like countermeasures (noise addition,

  • peration order randomization, ...)

Incrementing the masking order is of great interest for SCA resistance

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-12
SLIDE 12

8 +

Why Using Masking ?

[Chari+ CRYPTO’99] SCA complexity increases

◮ exponentially with the masking order ◮ polynomially with hiding-like countermeasures (noise addition,

  • peration order randomization, ...)

Incrementing the masking order is of great interest for SCA resistance Many papers focus on improving 2O-SCA A few papers deal with resistant implementations

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-13
SLIDE 13

8 +

Why Using Masking ?

[Chari+ CRYPTO’99] SCA complexity increases

◮ exponentially with the masking order ◮ polynomially with hiding-like countermeasures (noise addition,

  • peration order randomization, ...)

Incrementing the masking order is of great interest for SCA resistance Many papers focus on improving 2O-SCA A few papers deal with resistant implementations First step: provable security against 2O-SCA

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-14
SLIDE 14

8 +

Security Against 2O-SCA

Definition (2O-SCA Security)

A cryptographic algorithm is said to be secure against 2O-SCA if every pair of its intermediate variables is independent of any sensitive variable. An algorithm security can be formally proved

◮ listing all intermediate variables ◮ checking every pair independency

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-15
SLIDE 15

8 +

Block Cipher Description

Iterated block cipher

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-16
SLIDE 16

8 +

Block Cipher Description

Iterated block cipher Round transformation: ρ[k](·) = λ ◦ γ ◦ σ[k](·)

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-17
SLIDE 17

8 +

Securing Block Ciphers Implementations

Second order masking:

◮ p = p0 ⊕ p1 ⊕ p2 ◮ k = k0 ⊕ k1 ⊕ k2

(p1, p2) and (k1, k2) randomly generated

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-18
SLIDE 18

8 +

Securing Block Ciphers Implementations

Second order masking:

◮ p = p0 ⊕ p1 ⊕ p2 ◮ k = k0 ⊕ k1 ⊕ k2

(p1, p2) and (k1, k2) randomly generated Goal: perform a round transformation from the 3 shares

◮ The shares must be process separately ◮ The completeness relation must be preserved

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-19
SLIDE 19

8 +

Securing the Round Transformation

Linear layer: simple

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-20
SLIDE 20

8 +

Securing the Round Transformation

Linear layer: λ(p) = λ(p0) ⊕ λ(p1) ⊕ λ(p2)

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-21
SLIDE 21

8 +

Securing the Round Transformation

Linear layer: λ(p) = λ(p0) ⊕ λ(p1) ⊕ λ(p2) Key addition layer: simple

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-22
SLIDE 22

8 +

Securing the Round Transformation

Linear layer: λ(p) = λ(p0) ⊕ λ(p1) ⊕ λ(p2) Key addition layer: σ[k](p) = σ[k0](p0) ⊕ σ[k1](p1) ⊕ σ[k2](p2)

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-23
SLIDE 23

8 +

Securing the Round Transformation

Linear layer: λ(p) = λ(p0) ⊕ λ(p1) ⊕ λ(p2) Key addition layer: σ[k](p) = σ[k0](p0) ⊕ σ[k1](p1) ⊕ σ[k2](p2) Non-linear layer: issue

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-24
SLIDE 24

8 +

Securing the Round Transformation

Linear layer: λ(p) = λ(p0) ⊕ λ(p1) ⊕ λ(p2) Key addition layer: σ[k](p) = σ[k0](p0) ⊕ σ[k1](p1) ⊕ σ[k2](p2) Non-linear layer: issue

◮ Problem: secure an S-box implementation

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-25
SLIDE 25

8 +

Secure S-box Implementation – Problem

S : n × m S-box

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-26
SLIDE 26

8 +

Secure S-box Implementation – Problem

S : n × m S-box ˜ x = x ⊕ r1 ⊕ r2 : n-bit masked input, (r1, r2) : n-bit input masks

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-27
SLIDE 27

8 +

Secure S-box Implementation – Problem

S : n × m S-box ˜ x = x ⊕ r1 ⊕ r2 : n-bit masked input, (r1, r2) : n-bit input masks (s1, s2) : m-bit output masks

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-28
SLIDE 28

8 +

Secure S-box Implementation – Problem

S : n × m S-box ˜ x = x ⊕ r1 ⊕ r2 : n-bit masked input, (r1, r2) : n-bit input masks (s1, s2) : m-bit output masks Goal : process S(x) ⊕ s1 ⊕ s2 Requirement : every pair of inter. var. must be indep. of x

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-29
SLIDE 29

8 +

Our Proposition

Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. r3 ← rand(n)
  • 2. r′ ← (r1 ⊕ r3) ⊕ r2
  • 3. for a from 0 to 2n − 1 do

4. a′ ← a ⊕ r′ 5. T[a′] ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 6. return T[r3]
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-30
SLIDE 30

8 +

Our Proposition

Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. r3 ← rand(n)
  • 2. r′ ← (r1 ⊕ r3) ⊕ r2
  • 3. for a from 0 to 2n − 1 do

4. a′ ← a ⊕ r′ 5. T[a′] ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 6. return T[r3]

When a = r1 ⊕ r2 :

◮ ˜

x ⊕ a = x – desired masked output

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-31
SLIDE 31

8 +

Our Proposition

Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. r3 ← rand(n)
  • 2. r′ ← (r1 ⊕ r3) ⊕ r2
  • 3. for a from 0 to 2n − 1 do

4. a′ ← a ⊕ r′ 5. T[a′] ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 6. return T[r3]

When a = r1 ⊕ r2 :

◮ ˜

x ⊕ a = x – desired masked output

◮ a′ = r3

– stored in T[r3]

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-32
SLIDE 32

8 +

Our Proposition

Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. r3 ← rand(n)
  • 2. r′ ← (r1 ⊕ r3) ⊕ r2
  • 3. for a from 0 to 2n − 1 do

4. a′ ← a ⊕ r′ 5. T[a′] ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 6. return T[r3]

When a = r1 ⊕ r2 :

◮ ˜

x ⊕ a = x – desired masked output

◮ a′ = r3

– stored in T[r3]

Every pair of inter. var. is indep. of x

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-33
SLIDE 33

8 +

Another Proposition

compare(x, y) = if x = y 1 if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. for a from 0 to 2n − 1 do

2. cmp ← compare(a ⊕ r1, r2) 3. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 4. return R0
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-34
SLIDE 34

8 +

Another Proposition

compare(x, y) = if x = y 1 if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. for a from 0 to 2n − 1 do

2. cmp ← compare(a ⊕ r1, r2) 3. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 4. return R0

When a = r1 ⊕ r2:

◮ ˜

x ⊕ a = x – desired masked output

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-35
SLIDE 35

8 +

Another Proposition

compare(x, y) = if x = y 1 if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. for a from 0 to 2n − 1 do

2. cmp ← compare(a ⊕ r1, r2) 3. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 4. return R0

When a = r1 ⊕ r2:

◮ ˜

x ⊕ a = x – desired masked output

◮ cmp = 0

– stored in R0

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-36
SLIDE 36

8 +

Another Proposition

compare(x, y) = if x = y 1 if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. for a from 0 to 2n − 1 do

2. cmp ← compare(a ⊕ r1, r2) 3. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 4. return R0

When a = r1 ⊕ r2:

◮ ˜

x ⊕ a = x – desired masked output

◮ cmp = 0

– stored in R0

However there is a flaw: (cmp, ˜ x ⊕ a) depends on x!

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-37
SLIDE 37

8 +

Another Proposition

compare(x, y) = if x = y 1 if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. for a from 0 to 2n − 1 do

2. cmp ← compare(a ⊕ r1, r2) 3. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 4. return R0
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-38
SLIDE 38

8 +

Another Proposition

compare(x, y) = if x = y 1 if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. b ← rand(1)
  • 2. for a from 0 to 2n − 1 do

3. cmp ← compare(a ⊕ r1, r2) 4. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 5. return R0
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-39
SLIDE 39

8 +

Another Proposition

compareb(x, y) = b if x = y ¯ b if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. b ← rand(1)
  • 2. for a from 0 to 2n − 1 do

3. cmp ← compareb(a ⊕ r1, r2) 4. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 5. return R0
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-40
SLIDE 40

8 +

Another Proposition

compareb(x, y) = b if x = y ¯ b if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. b ← rand(1)
  • 2. for a from 0 to 2n − 1 do

3. cmp ← compareb(a ⊕ r1, r2) 4. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 5. return Rb
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-41
SLIDE 41

8 +

Another Proposition

compareb(x, y) = b if x = y ¯ b if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. b ← rand(1)
  • 2. for a from 0 to 2n − 1 do

3. cmp ← compareb(a ⊕ r1, r2) 4. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 5. return Rb

The security relies on the compareb implementation

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-42
SLIDE 42

8 +

Another Proposition

compareb(x, y) = b if x = y ¯ b if x = y Input: ˜ x = x ⊕ r1 ⊕ r2, (r1, r2), (s1, s2) Output: S(x) ⊕ s1 ⊕ s2

  • 1. b ← rand(1)
  • 2. for a from 0 to 2n − 1 do

3. cmp ← compareb(a ⊕ r1, r2) 4. Rcmp ←

  • S(˜

x ⊕ a) ⊕ s1

  • ⊕ s2
  • 5. return Rb

The security relies on the compareb implementation Less efficient than the previous solution but less memory consuming

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-43
SLIDE 43

8 +

Improvement

Both methods process a loop on every possible S-box output Improvement: process several S-box outputs at the same time

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-44
SLIDE 44

8 +

Improvement

Both methods process a loop on every possible S-box output Improvement: process several S-box outputs at the same time

◮ e.g. 4 S-box outputs can be stored in one µP word

S(1..1, 11) S(0..0, 00) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(0..0, 01)

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-45
SLIDE 45

8 +

Improvement

Both methods process a loop on every possible S-box output Improvement: process several S-box outputs at the same time

◮ e.g. 4 S-box outputs can be stored in one µP word

S(xH, xL) xH S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11) xL

S′(xH) =

  • S(xH, 00), S(xH, 01), S(xH, 10), S(xH, 11)
  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-46
SLIDE 46

8 +

Improvement

Without improvement – S : n × m S-box

(˜ x, r1, r2) SecSBox(S) S(x) ⊕ s1 ⊕ s2 (s1, s2) n m m

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-47
SLIDE 47

8 +

Improvement

Without improvement – S : n × m S-box

(˜ x, r1, r2) SecSBox(S) S(x) ⊕ s1 ⊕ s2 (s1, s2) n m m

With improvement – S′ : (n − 2) × 4m S-box

4m (s′

1, s′ 2)

S′(xH) ⊕ s′

1 ⊕ s′ 2

SecSBox(S′) (˜ xH, r1,H, r2,H) n-2 4m

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-48
SLIDE 48

8 +

Improvement

Without improvement – S : n × m S-box

(˜ x, r1, r2) SecSBox(S) S(x) ⊕ s1 ⊕ s2 (s1, s2) n m m

With improvement – S′ : (n − 2) × 4m S-box

4m (s′

1, s′ 2)

S′(xH) ⊕ s′

1 ⊕ s′ 2

SecSBox(S′) (˜ xH, r1,H, r2,H) n-2 4m

◮ 4 times faster !

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-49
SLIDE 49

8 +

Improvement

Without improvement – S : n × m S-box

(˜ x, r1, r2) SecSBox(S) S(x) ⊕ s1 ⊕ s2 (s1, s2) n m m

With improvement – S′ : (n − 2) × 4m S-box

4m (s′

1, s′ 2)

S′(xH) ⊕ s′

1 ⊕ s′ 2

SecSBox(S′) (˜ xH, r1,H, r2,H) n-2 4m

◮ 4 times faster ! ◮ Returns the whole line of the matrix containing the masked output

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-50
SLIDE 50

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11)

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-51
SLIDE 51

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

Second step: extract masked S(x) ⊕ s1 ⊕ s2

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11)

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-52
SLIDE 52

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

Second step: extract masked S(x) ⊕ s1 ⊕ s2

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11) xL = 0?

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-53
SLIDE 53

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

Second step: extract masked S(x) ⊕ s1 ⊕ s2

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11) xL = 1?

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-54
SLIDE 54

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

Second step: extract masked S(x) ⊕ s1 ⊕ s2

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11) xL = 00

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-55
SLIDE 55

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

Second step: extract masked S(x) ⊕ s1 ⊕ s2

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11) xL = 01

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-56
SLIDE 56

8 +

Improvement

Returned value: S′(xH) ⊕ s′

1 ⊕ s′ 2

Second step: extract masked S(x) ⊕ s1 ⊕ s2

◮ Requires a Select algorithm which from a masked bit securely selects

the corresponding half

xH S(xH, 00) S(xH, 01) S(xH, 10) S(xH, 11) S(0..0, 00) S(0..0, 01) S(0..0, 10) S(0..0, 11) S(1..1, 00) S(1..1, 01) S(1..1, 10) S(1..1, 11) xL = 01

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-57
SLIDE 57

8 +

Schramm & Paar Solution (CT-RSA 2006)

Computation of a masked S-box : S⋆(y) = S(y ⊕ r1 ⊕ r2) ⊕ s1 ⊕ s2

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-58
SLIDE 58

8 +

Schramm & Paar Solution (CT-RSA 2006)

Computation of a masked S-box : S⋆(y) = S(y ⊕ r1 ⊕ r2) ⊕ s1 ⊕ s2 Schramm & Paar 1:

◮ Two table re-computations

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-59
SLIDE 59

8 +

Schramm & Paar Solution (CT-RSA 2006)

Computation of a masked S-box : S⋆(y) = S(y ⊕ r1 ⊕ r2) ⊕ s1 ⊕ s2 Schramm & Paar 1:

◮ Two table re-computations

Schramm & Paar 2:

◮ Involves the last masked S-box ◮ One single table re-computation ◮ Potential flaws for straightforward implementation

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-60
SLIDE 60

8 +

Schramm & Paar Solution (CT-RSA 2006)

Computation of a masked S-box : S⋆(y) = S(y ⊕ r1 ⊕ r2) ⊕ s1 ⊕ s2 Schramm & Paar 1:

◮ Two table re-computations

Schramm & Paar 2:

◮ Involves the last masked S-box ◮ One single table re-computation ◮ Potential flaws for straightforward implementation

Compared to our solutions:

◮ Fewer operations ◮ More memory

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-61
SLIDE 61

8 +

AES implementations

Solution cycles RAM (bytes) ROM (bytes) Schramm & Paar 1 1083 × 103 512 + 86 2247 Schramm & Paar 2 594 × 103 512 + 90 2336 Our solution 672 × 103 256 + 86 2215 AES implementations secure against 2O-DSCA on an 8-bit microcontroller

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-62
SLIDE 62

8 +

8 × 8 S-box Implementations

Solution Cycles RAM (bytes) ROM (bytes) 8-bit architecture Schramm & Paar 1 6703 512 + 3 119 + 256 Schramm & Paar 2 3638 512 + 7 89 + 256 Our solution 4142 256 + 3 88 + 256 16-bit architecture Schramm & Paar 1 6418 512 96 + 512 Schramm & Paar 2 3090 512 56 + 256 Our solution 4125 256 98 + 512 32-bit architecture Schramm & Paar 2 3359 512 na. Our solution 4143 256 na.

Comparison of 8 × 8 S-box implementations secure against 2O-SCA on 8-bit, 16-bit and 32-bit architectures.

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-63
SLIDE 63

8 +

8 × 8 S-box Implementations

Solution Cycles RAM (bytes) ROM (bytes) 8-bit architecture Schramm & Paar 1 6703 512 + 3 119 + 256 Schramm & Paar 2 3638 512 + 7 89 + 256 Our solution 4142 256 + 3 88 + 256 16-bit architecture Schramm & Paar 1 6418 512 96 + 512 Schramm & Paar 2 3090 512 56 + 256 Our solution 4125 256 98 + 512 Our improved solution 2099 256 260 + 256 32-bit architecture Schramm & Paar 2 3359 512 na. Our solution 4143 256 na. Our improved solution 1415 256 na.

Comparison of 8 × 8 S-box implementations secure against 2O-SCA on 8-bit, 16-bit and 32-bit architectures.

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA

slide-64
SLIDE 64

8 +

Conclusion

Block ciphers implementations provably secure against 2O-SCA Two new methods to secure S-box implementations against 2O-SCA Our solutions allow different efficiency/memory trade-offs Improvement when several S-box outputs can be stored on one microprocessor word The security of all our propositions is formally demonstrated

  • M. Rivain, E. Dottax & E. Prouff

Block Ciphers Implementations Provably Secure ag. 2O-SCA