countermeasures against em analysisdutertre/doc_recherche/c_2012_1_maistri_cry… · st 130 nm 50...

19
Countermeasures against EM Analysis Paolo Maistri 1 , Sebastien Tiran 2 , Amine Dehbaoui 3 , Philippe Maurine 2 , Jean-Max Dutertre 4 (1) (2) (3) (4)

Upload: others

Post on 24-May-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Countermeasures against

EM Analysis

Paolo Maistri1, Sebastien Tiran2, Amine Dehbaoui3,

Philippe Maurine2, Jean-Max Dutertre4

(1) (2) (3) (4)

Page 2: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Context

• Side channel analysis is a major threat against

cryptographic implementations

Several leakage channels :

TimeSeveral analysis algorithms :

Time

Power

EM

Several analysis algorithms :

Simple

Differential

Higher-order Differential

Correlation

Behavioral

Several Countermeasures :

Random Masking

Dual-rail Implementations

Fake Computations (Noise)

Register Renaming

2ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 3: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Outline

• Experimental Setup

• Encryption IPs

– @ Montpellier : DES Jamming

– @ Grenoble : AES Morph – @ Grenoble : AES Morph

– @ Gardanne : AES Dual

– Attacks and Results for each IP

• Perspectives

3ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 4: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Experimental Setup

4ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 5: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

DES algorithm

• Symmetric block cipher

– Ptx 64b, Key 56b

• Feistel network

– 16 rounds– 16 rounds

• Round operations

– Key Addition

– Sbox

– Permutation

5ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 6: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

DES Jamming (1/3)

• What the countermeasure does

– Resources randomly compute and store different

values,

– All parts are always activated– All parts are always activated

• What the countermeasure does not

– Instantiate functional units for the sole purpose of

computing random operations

6ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 7: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

DES Jamming (2/3)

7ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 8: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

DES Jamming (3/3)

8ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 9: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Attacking DES Jamming

• Implementation :

– Spartan 3 1000

– Freq: 50 MHz (vs 108)

– Slices: 1105 (vs 294, +276%)– Slices: 1105 (vs 294, +276%)

• Attack: CPA-HW, SCAN

• Data set: 500k traces

• Results: only 7 sub-keys obtained

– All sub-keys obtained after 200-600 traces w/o countermeasure

9ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 10: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

AES algorithm

• Symmetric block cipher– Ptx 128b,

– Key 128/192/256b

• SPN cipher– 10/12/14 rounds

128-bit

Round Key

128-bit

Round Key

4x4-byte

State

Encryption

Secret Key Plain Text

– 10/12/14 rounds

• Round operations– SubBytes

– ShiftRows

– MixColumns

– Key Addition

10ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Key

Schedule

Round

Key

Schedule

Round

Encryption

RoundSubBytes

ShiftRows

MixColumn

Ciphered Text

Page 11: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

AES Morph (1/3)

� Quite small

� 32-bit data-path

� 4 Substitution Boxes

� 4 GF Multipliers for

MixColumns

� 10 clock cycles per round

� On-the-fly key unrolling Input

Mix

Co

lum

ns

11ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

AddRoundKey and State

2-stage S-Box

Register layer

Combinatorial logic

8-bit signal

32-bit signal

On-the-fly key unrolling

(using shared S-Boxes)

<<<

Input

SBOX SBOX SBOX SBOX

From Key Unit

To Key Unit

Mix

Co

lum

ns

Page 12: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

AES Morph (2/3)

• Dynamic resource allocation done intra-round

• Column relocation

– Several external constraints (MixColumns, ShiftRows, …)

– Only 4 different configurations– Only 4 different configurations

12ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 13: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

AES Morph (3/3)

• For each S-Box, implement several parallel mappings– From 1 to 8 possible dynamic mappings

– Choose randomly at runtime

– At the output, choose the correct inverse mapping to get back the result

• Limited to S-Box data path

• Independence ?

13ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

• Independence ?

Invers

GF( ( 24 )² ) Reg

Reg Inv Map

Inv Map n

Inv Map 1

Inv Map iMap

Map n

Map 1

Map i

Page 14: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Attacking AES Morph

• Implementation :

– Spartan 3 1000

– Freq: 50 MHz

– Slices: 1445 (vs 1199, +20%)

• Attack: CPA-HW

• Data set: 200k traces

• Results:

14ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

No countermeasures

vs CPA

Countermeasures

vs CPA

Countermeasures

vs SCAN

~21k traces ~80k traces ~60k traces

Page 15: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

AES Dual (1/2)

Dual Path

Main Path

Dual Path

15ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 16: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

AES Dual (2/2)

SB

Error

matrix

SR

MC

Ronde

i

SBdual

Error

matrix

MCdual

Ronde

16ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 17: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Attacking AES Dual

• Implementation:

ST 130 nm

50 MHz

1.2 V 200

250

Guessing Entropy

• Attack:

CPA

• Data set:

332k traces0

50

100

150

200

0 50000 100000 150000 200000 250000 300000 350000

# taces traitées

Converging !

17ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 18: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Conclusions

• DES Jamming

– Too few configurations, too little entropy

• AES Morph

– Too few configurations, too little entropy– Too few configurations, too little entropy

– Dynamic mapping useless (due to other leakage)

• AES Dual

– Quite strong !

18ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis

Page 19: Countermeasures against EM Analysisdutertre/doc_recherche/C_2012_1_Maistri_Cry… · ST 130 nm 50 MHz 1.2 V 200 250 GuessingEntropy • Attack: CPA • Data set: 332k traces 0 50

Perspectives

• AES Morph

– Increase number of configurations (intra-round +

inter-round)

– Mapping under new analysis– Mapping under new analysis

• Next:

– EM fault attacks and countermeasures!

19ANR EMAISeCi @ CryptArchi 2012 :

Maistri, Tiran, Dehbaoui, Maurine, Dutertre – Countermeasures against EM Analysis