blind fault attack against spn ciphers - fdtc 2014

36
BLIND FAULT ATTACK AGAINST SPN CIPHERS FDTC 2014 Roman Korkikian, Sylvain Pelissier, David Naccache September 23, 2014

Upload: others

Post on 09-Apr-2022

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Blind Fault Attack against SPN Ciphers - FDTC 2014

BLIND FAULT ATTACK AGAINST SPNCIPHERSFDTC 2014

Roman Korkikian, Sylvain Pelissier, David NaccacheSeptember 23, 2014

Page 2: Blind Fault Attack against SPN Ciphers - FDTC 2014

IN BRIEF

Substitution Permutation Networks (SPN)Fault attacksBlind fault attack against SPN ciphersResultsQuestions

2

Page 3: Blind Fault Attack against SPN Ciphers - FDTC 2014

BLOCK CIPHER

3

Page 4: Blind Fault Attack against SPN Ciphers - FDTC 2014

FAULT ATTACKS

4

Page 5: Blind Fault Attack against SPN Ciphers - FDTC 2014

SUBSTITUTION PERMUTATION NETWORKS

Block cipher construction which uses a sequence of invertibletransformations:

Substitution stage or S-box S (Usually 4-bit or 8-bitS-boxes)Permutation stage PKey mixing operation A

Structure used by AES, LED, SAFER++, ...

5

Page 6: Blind Fault Attack against SPN Ciphers - FDTC 2014

SUBSTITUTION PERMUTATION NETWORKS

Plaintext

A[K0]: K0 mixing

S1,1 S1,j S1,m

Round 1P: diffusion

A[K1]: K1 mixing

Sr ,1 Sr ,j Sr ,m

Round rP: diffusion

A[Kr ]: Kr mixing

SR,1 SR,j SR,m

Round RA[KR]: KR mixing

Ciphertext

Figure : A typical SPN-based block cipher

6

Page 7: Blind Fault Attack against SPN Ciphers - FDTC 2014

DIFFERENTIAL FAULT ANALYSIS

1. Inject faults in the last rounds of a block cipher2. Collect pairs (C1, C̃1), (C2, C̃2), ...

3. Apply a statistical method on these pairs and retrieve thekey K .

The input messages do not need to be known:

M1 → (C1, C̃1),

M2 → (C2, C̃2),

...

7

Page 8: Blind Fault Attack against SPN Ciphers - FDTC 2014

DIFFERENTIAL FAULT ANALYSIS

8

Page 9: Blind Fault Attack against SPN Ciphers - FDTC 2014

COLLISION FAULT ANALYSIS

The same idea can be applied for inputs:1. Inject faults in the first rounds2. Find colliding input pairs (M1, M̃1), (M2, M̃2), ...

3. Apply a statistical method on these pairs and retrieve thekey K .

The output messages do not have to be known:

(M1, M̃1)→ C1

(M2, M̃2)→ C2

...

But they have to be somehow compared (equality checkO(C1 = C2)).

9

Page 10: Blind Fault Attack against SPN Ciphers - FDTC 2014

COLLISION FAULT ANALYSIS

10

Page 11: Blind Fault Attack against SPN Ciphers - FDTC 2014

CURRENT ATTACKS FOR AES

Attack Rounds Plaintexts Ciphertexts

DFA 6-10 Unknown Known

CFA 1-2 Known Unknown*

* equality test check (O(C1 = C2))

11

Page 12: Blind Fault Attack against SPN Ciphers - FDTC 2014

BLIND FAULT ATTACK

What if input and output values are not directly accessible ?

12

Page 13: Blind Fault Attack against SPN Ciphers - FDTC 2014

EXAMPLES

Input and output whiteningCascade encryptionHardware security module

13

Page 14: Blind Fault Attack against SPN Ciphers - FDTC 2014

OUR CONTRIBUTION

Attack Rounds Plaintexts Ciphertexts

DFA 6-10 Unknown Known

CFA 1-2 Known Unknown*

BFA Any Unknown Unknown*

* equality test check (O(C1 = C2))

14

Page 15: Blind Fault Attack against SPN Ciphers - FDTC 2014

ASSUMPTIONS

1. A multi-bit set or reset fault can be injected to an internalbyte/nibble X of a SPN block cipher.

2. Unknown plaintexts can be encrypted several times.3. The different faulted or correct outputs can be compared

pairwise without revealing their values (pairwise equalitycheck O(C1 = C2)).

15

Page 16: Blind Fault Attack against SPN Ciphers - FDTC 2014

BLIND FAULT ATTACK OVERVIEW

1. For each plaintext:1.1 Introduce faults during a round execution and compare the

different outputs.1.2 From the number of different faulted outputs determine the

Hamming weights of an algorithm’s internal state.2. For each possible key candidate:

2.1 Perform a key search to recover a key byte/nibble.

16

Page 17: Blind Fault Attack against SPN Ciphers - FDTC 2014

FAULT MODEL

Multi-bit reset fault

Multi-bit set fault

17

Page 18: Blind Fault Attack against SPN Ciphers - FDTC 2014

MULTI-BIT SET/RESET FAULT MODEL

These fault models have been observed in practice:Laser fault injection in SRAM:[Roscian, Sarafianos, Dutertre, Tria ] FDTC 2013Electromagnetic glitch fault injections:[Moro, Dehbaoui, Heydemann, Robisson, Encrenaz ]FDTC 2013

18

Page 19: Blind Fault Attack against SPN Ciphers - FDTC 2014

HAMMING WEIGHT GUESS

19

Page 20: Blind Fault Attack against SPN Ciphers - FDTC 2014

OCCUPANCY PROBLEM

The number of faults injections can be minimized whenconsidered as an "occupancy problem".

The probability that after ` fault injections, Y` differentpossible ciphertexts (among λ = 2HW(X)) are received canbe considered as the probability that Y` out of λ bins areoccupied after throwing randomly ` balls.

20

Page 21: Blind Fault Attack against SPN Ciphers - FDTC 2014

OCCUPANCY PROBLEM

Pr(Y` = κ) =

{λ!ακ,`

(λ−κ)!λ` κ ∈ {1, ...,min(λ, `)}0 else

λ̂ with maximum likelihood is assumed as correct:

λ̂ = arg maxλiPr(Y` = κ|λi)

21

Page 22: Blind Fault Attack against SPN Ciphers - FDTC 2014

SIMULATION

0 10 20 30 40 50 60 70 80

0

0.2

0.4

0.6

0.8

1

Number of faults

Ham

min

g w

eight

reco

ver

y r

ate

Hamming weight recovery rate for 4−bits variable

Hamming weight recovery rate for 8−bits variable

15 faults give a 99% success probability for a 4-bit variable.62 faults give a 99% success probability for a 8-bit variable.

22

Page 23: Blind Fault Attack against SPN Ciphers - FDTC 2014

TARGETED STATES

23

Page 24: Blind Fault Attack against SPN Ciphers - FDTC 2014

TARGETED STATES

24

Page 25: Blind Fault Attack against SPN Ciphers - FDTC 2014

KEY SIFTING

For each key byte/nibble candidate Ki :I if @X HW(X ) = hr and HW (Sr+1,j ◦ A |Ki (X )) = hr+1:

Ki is discarded from the candidate list.

⇒ A lot of Hamming weight pairs needed to reduce thecandidate list⇒ Can be improved with key likelihood estimation.

25

Page 26: Blind Fault Attack against SPN Ciphers - FDTC 2014

KEY LIKELIHOOD ESTIMATION

It was determined that Hamming weight distribution of keymixing and S-box is unique for the tested ciphers:

26

Page 27: Blind Fault Attack against SPN Ciphers - FDTC 2014

KEY LIKELIHOOD ESTIMATION

1. Before the attack, the Hamming weight distributions areprecomputed for each key candidate.

2. The Euclidean distance between the distribution of therecovered Hamming weight pairs and the precomputeddistributions is computed for all remaining key candidates.

3. The key candidate with the minimal distance is assumed tobe correct.

27

Page 28: Blind Fault Attack against SPN Ciphers - FDTC 2014

SIMULATIONS

Table : Specification of operation for different ciphers

Cipher Exact operation Size

LED X Sr+1,j = S

[Kr ,j ⊕ X SP

r ,j

]4-bit

AES X Sr+1,j = S

[Kr ,j ⊕ X SP

r ,j

]8-bit

SAFER++ X Sr+1,j = S

[Kr ,j + X SP

r ,j

]8-bit

28

Page 29: Blind Fault Attack against SPN Ciphers - FDTC 2014

LED SIMULATION

0 100 200 300 400 500

0

0.2

0.4

0.6

0.8

1

Number of hamming weight pairs

Key

rec

ov

ery s

ucc

ess

rate

Success rate after key sifting

Success rate after key sifting and key likelihood estimation

29

Page 30: Blind Fault Attack against SPN Ciphers - FDTC 2014

AES SIMULATION

0 200 400 600 800 1000

0

0.2

0.4

0.6

0.8

1

Number of hamming weight pairs

Key

rec

over

y s

ucc

ess

rate

Success rate after key sifting

Success rate after key sifting and key likelihood estimation

30

Page 31: Blind Fault Attack against SPN Ciphers - FDTC 2014

RESULTS

Number of faults used to recover a key byte/nibble:Cipher # plaintexts # faults per plaintext Total # faultsLED 50 40 2,000AES 250 120 30,000

SAFER++ 200 120 24,000

31

Page 32: Blind Fault Attack against SPN Ciphers - FDTC 2014

RESULTS

Fault attacks are feasible even when input and outputmessages are not known but ciphertext equality check isavailable.Fault attacks can be applied against any SPN round.Fault model is generic and has been observed in practice.The total number of faults to recover a key is the price topay for blindness (480,000 for a complete AES key).

32

Page 33: Blind Fault Attack against SPN Ciphers - FDTC 2014

FUTURE DEVELOPEMENTS

New methods to reduce the number of required faultinjections.Hamming weight distribution theory.Results and problems when applied in practice.

33

Page 34: Blind Fault Attack against SPN Ciphers - FDTC 2014

QUESTIONS

34

Page 35: Blind Fault Attack against SPN Ciphers - FDTC 2014

35

Page 36: Blind Fault Attack against SPN Ciphers - FDTC 2014

HAMMING WEIGHT PROBABILITY DISTRIBUTION

Prk[HW(x),HW

(Sr+1,j ◦ A |k (x)

)]

36