Randomness as countermeasures against Side Channel Attacks Nadia El - - PowerPoint PPT Presentation

randomness as countermeasures against side channel attacks
SMART_READER_LITE
LIVE PREVIEW

Randomness as countermeasures against Side Channel Attacks Nadia El - - PowerPoint PPT Presentation

Randomness as countermeasures against Side Channel Attacks Nadia El Mrabet nadia.el-mrabet@emse.fr Mines St Etienne WRACH2019, April 17, 2019 Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical


slide-1
SLIDE 1

Randomness as countermeasures against Side Channel Attacks

Nadia El Mrabet nadia.el-mrabet@emse.fr

Mines St Etienne

WRACH’2019, April 17, 2019

slide-2
SLIDE 2

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Presentation given here

Randomness and SCA Nadia El Mrabet 1 / 24

slide-3
SLIDE 3

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

In real life

What could be vulnerable ?

Randomness and SCA Nadia El Mrabet 2 / 24

slide-4
SLIDE 4

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

In real life

Existing attacks

Randomness and SCA Nadia El Mrabet 3 / 24

slide-5
SLIDE 5

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

In real life

Existing attacks

Randomness and SCA Nadia El Mrabet 4 / 24

slide-6
SLIDE 6

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

In real life

◮ Industrials are building teams to protect their product (Apple, Google, Wawai...)

Randomness and SCA Nadia El Mrabet 5 / 24

slide-7
SLIDE 7

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Attacks on Device

Randomness and SCA Nadia El Mrabet 6 / 24

slide-8
SLIDE 8

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The most important point

Figure – High level explanation of SCA

Randomness and SCA Nadia El Mrabet 7 / 24

slide-9
SLIDE 9

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The most important point

Figure – Selection according to guesses on the key

Randomness and SCA Nadia El Mrabet 8 / 24

slide-10
SLIDE 10

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The most important point

Figure – Real curve attack

Randomness and SCA Nadia El Mrabet 9 / 24

slide-11
SLIDE 11

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The Countermeasures

◮ Physical

Randomness and SCA Nadia El Mrabet 10 / 24

slide-12
SLIDE 12

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The Countermeasures

◮ Physical ◮ Algorithmic ◮ Arithmetical

Randomness and SCA Nadia El Mrabet 10 / 24

slide-13
SLIDE 13

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Physical countermeasures

Duplication of the circuit

Dual rail technology

Randomness and SCA Nadia El Mrabet 11 / 24

slide-14
SLIDE 14

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Physical countermeasures

Protection of the circuit

Shield Randomisation of the circuit

Randomness and SCA Nadia El Mrabet 12 / 24

slide-15
SLIDE 15

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

Double and add algorithm

Data: r = (rN . . . r0)2, P ∈ E Result: rP T ← P ; for i = N − 1 to 0 do T ← [2]T ; if ri = 1 then T ← T + P; end end return T = [r]P Algorithm 1: Double and add

Figure – SPA

Randomness and SCA Nadia El Mrabet 13 / 24

slide-16
SLIDE 16

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

Handle the leakages

T ← P ; for i = N − 1 to 0 do T ← 2T ; if ri = 1 then T ← T + P; else U ← T + P; end return T = rP Algorithm 2: Double and add always

Randomness and SCA Nadia El Mrabet 14 / 24

slide-17
SLIDE 17

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

Handle the leakages

T ← P ; for i = N − 1 to 0 do T ← 2T ; if ri = 1 then T ← T + P; else U ← T + P; end return T = rP Algorithm 4: Double and add always FAULT ATTACK STRIKES

Randomness and SCA Nadia El Mrabet 14 / 24

slide-18
SLIDE 18

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

Handle the leakages

T ← P ; for i = N − 1 to 0 do T ← 2T ; if ri = 1 then T ← T + P; else U ← T + P; end return T = rP Algorithm 6: Double and add always FAULT ATTACK STRIKES T0 ← P, T1 ← 2P ; for i = N − 1 to 0 do if ri = 1 then T0 ← T0 + T1, T1 ← 2T1 else T1 ← T0 + T1, T0 ← 2T0 end end return T0 Algorithm 7: Montgomery ladder

Randomness and SCA Nadia El Mrabet 14 / 24

slide-19
SLIDE 19

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

The Montgomery ladder is not sufficient

◮ Goubin’s attack : uses a special point (several variants, same method). ◮ Walter’s attack : uses leakage from the conditional branch. ◮ Correlation collision attack (vertical and horizontal). Template, deep learning attacks...

Generic protection

◮ Constant time implementation : necessary but not sufficient. ◮ The less conditional branches is the better.

Randomness and SCA Nadia El Mrabet 15 / 24

slide-20
SLIDE 20

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

Behind Montgomery ladder

◮ Joye’s double-add ◮ Add-Only ◮ Square Only (Remember Thomas presentation) ◮ Zero-less signed digit expansion ◮ Atomic block

Randomness and SCA Nadia El Mrabet 16 / 24

slide-21
SLIDE 21

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

First arithmetical countermeasures

Behind Montgomery ladder

◮ Joye’s double-add [Still safe] ◮ Add-Only [ Correlation collision attacks ] ◮ Square Only (Remember Thomas presentation) [ Correlation collision attacks ] ◮ Zero-less signed digit expansion [Still safe] ◮ Atomic block [Horizontal correlation collision attacks ]

Randomness and SCA Nadia El Mrabet 16 / 24

slide-22
SLIDE 22

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

ECC : representation of the curve

◮ Edwards curves, inverted Edwards curves ◮ Huff model, Hessian curves ◮ Jacobi curves

Randomness and SCA Nadia El Mrabet 17 / 24

slide-23
SLIDE 23

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

ECC : representation of the curve

◮ Edwards curves, inverted Edwards curves [Template attacks ] ◮ Huff model, Hessian curves ◮ Jacobi curves

Randomness and SCA Nadia El Mrabet 17 / 24

slide-24
SLIDE 24

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

ECC : representation of the curve

◮ Edwards curves, inverted Edwards curves [Template attacks ] ◮ Huff model, Hessian curves ◮ Jacobi curves

ECC : representation of the points

◮ Unified formulaes for Weieirstrass ⇒ Goubin’s, Izu-Takagi’s attacks (special point) ⇒ Amiel et al’s attack : uses SCA to distinguish a S from a M ⇒ Horizontal attacks

Randomness and SCA Nadia El Mrabet 17 / 24

slide-25
SLIDE 25

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

ECC : randomisation of the scalar

◮ Coron’s countermeasure ◮ Exponentiation splitting ◮ Trichina-Bellezza’s countermeasure : kP = (kr −1)rP ◮ Regular representation of the scalar ◮ Euclidien chain (Remember Christophe, Jean-Marc, Nicolas presentations) ◮ Chevallier-Mames Self-Randomised Exponentiation

Randomness and SCA Nadia El Mrabet 18 / 24

slide-26
SLIDE 26

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

ECC : randomisation of the scalar

◮ Coron’s countermeasure [Big attack] ◮ Exponentiation splitting [Big Mac attack] ◮ Trichina-Bellezza’s countermeasure : kP = (kr −1)rP [Still safe] ◮ Regular representation of the scalar [ Correlation collision attacks ] ◮ Euclidien chain (Remember Christophe, Jean-Marc, Nicolas presentations) [Big Mac attack] ◮ Chevallier-Mames Self-Randomised Exponentiation [Still safe]

Randomness and SCA Nadia El Mrabet 18 / 24

slide-27
SLIDE 27

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

ECC : randomisation of the scalar

◮ Coron’s countermeasure [Big attack] ◮ Exponentiation splitting [Big Mac attack] ◮ Trichina-Bellezza’s countermeasure : kP = (kr −1)rP [Still safe] ◮ Regular representation of the scalar [ Correlation collision attacks ] ◮ Euclidien chain (Remember Christophe, Jean-Marc, Nicolas presentations) [Big Mac attack] ◮ Chevallier-Mames Self-Randomised Exponentiation [Still safe]

ECC : A lot of counter measures, but much more attacks !

Randomness and SCA Nadia El Mrabet 18 / 24

slide-28
SLIDE 28

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

Pairing based cryptography

◮ Bilinear function, non degenerate. ◮ Very great for key schedule, hierarchical encryption, several signatures schemes... ◮ Natively sensitive to SCA. ◮ Counter measures for ECC can be used. ◮ e(P, Q) = e(aP, bQ), for a and b such that ab = 1 mod r. ◮ e(P, Q) = e(P + R, Q) e(R, Q) .

Randomness and SCA Nadia El Mrabet 19 / 24

slide-29
SLIDE 29

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The property of the cryptosystem

AES

Masking and masking or masking

Randomness and SCA Nadia El Mrabet 20 / 24

slide-30
SLIDE 30

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

The graal

White box cryptography

◮ The method is somehow an obfuscation of the algorithm. ◮ There is a contest organized within CHES. ◮ As far as I know, no resistant scheme is existing. ◮ I see one major drawback : the contradiction with Kerchoffs rules. ◮ Luca will maybe find a nice asymmetric protocole.

Randomness and SCA Nadia El Mrabet 21 / 24

slide-31
SLIDE 31

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Random multiplication flow

◮ For a given protocol, the instruction flow for the multiplication is different for each product. ◮ Somewhat, it comes back to a random circuit for each device. ◮ Could be resistant to reverse engineering, ◮ BUT very hard to deploy in practice. ◮ There is no guarantee that it would resist to SCA.

Randomness and SCA Nadia El Mrabet 22 / 24

slide-32
SLIDE 32

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Randomisation of the representation

Projectives coordinates for ECC

Let P be a point of an elliptic curve E, λ a scalar then we have (XP, YP, ZP) = (λXP, λYP, λZP).

Randomness and SCA Nadia El Mrabet 23 / 24

slide-33
SLIDE 33

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Randomisation of the representation

Projectives coordinates for ECC

Let P be a point of an elliptic curve E, λ a scalar then we have (XP, YP, ZP) = (λXP, λYP, λZP). ⇒ Special point attacks

Figure – Big Mac attack

Randomness and SCA Nadia El Mrabet 23 / 24

slide-34
SLIDE 34

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Randomisation of the arithmetic

Smart-Oswald-Page randomised representation

Instead of working modulo m within the range {0, . . . , m − 1} you work modulo C = c × m, for c a coprime integer to m in the range {0, . . . , C − 1}.

The ultimate solution

Randomness and SCA Nadia El Mrabet 24 / 24

slide-35
SLIDE 35

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Randomisation of the arithmetic

PMNS : the ultimate solution

◮ a ∈ Fp, a = n

0 aiγi for a given γ and ai ≤ ρ.

◮ This representation is highly redondant, a admits ρn−1 representations. ◮ PMNS allows efficient arithmetic over Fp and extensions of Fp, where p is a prime number.

Randomness and SCA Nadia El Mrabet 25 / 24

slide-36
SLIDE 36

Side channel attacks Physical counter measures Algorithmic counter measures Arithmetical counter measures

Randomisation of the arithmetic

PMNS : the ultimate solution

◮ a ∈ Fp, a = n

0 aiγi for a given γ and ai ≤ ρ.

◮ This representation is highly redondant, a admits ρn−1 representations. ◮ PMNS allows efficient arithmetic over Fp and extensions of Fp, where p is a prime number. ◮ In "Randomization of Arithmetic over Polynomial Modular Number System" with Didier, Dosser, Marrez and Véron : ◮ we defined a random expression in PMNS ; ◮ we defined a random multiplication in Fp based on PMNS. ◮ For the description of our work pay attention to the two following presentations by Yssouf Dosso and Jérémie Marrez ! !

Randomness and SCA Nadia El Mrabet 25 / 24