Characterisation and Estimation of the Key Rank Distribution in the - - PowerPoint PPT Presentation

characterisation and estimation of the key rank
SMART_READER_LITE
LIVE PREVIEW

Characterisation and Estimation of the Key Rank Distribution in the - - PowerPoint PPT Presentation

Characterisation and Estimation of the Key Rank Distribution in the Context of Side Channel Evaluations https://github.com/bristol-sca/labynkyr December 7, 2016 Daniel P. Martin, Luke Mather, Elisabeth Oswald, Martijn Stam Cryptography Group,


slide-1
SLIDE 1

Characterisation and Estimation of the Key Rank Distribution in the Context of Side Channel Evaluations

https://github.com/bristol-sca/labynkyr

December 7, 2016

Daniel P. Martin, Luke Mather, Elisabeth Oswald, Martijn Stam

Cryptography Group, University of Bristol

1

slide-2
SLIDE 2

OUTLINE

◮ Claim: we’re not evaluating the resistance of a device to

non-invasive side-channel attacks as well as we could be.

◮ This work: outline the reasons why, and describe an

improved evaluation methodology.

2

slide-3
SLIDE 3

WHY IS THIS IMPORTANT?

Being able to accurately evaluate the resistance of a device to SCA is important:

◮ Resistance to SCA encoded in several evaluation processes

(Common Criteria; FIPS 140-3);

◮ Billions of devices implementing cryptography; ◮ SCA is almost always probabilistic in nature; ◮ Have to make a value judgement on the strength of an

attacker that captures this probabilistic nature.

3

slide-4
SLIDE 4

PLAN

Motivation: we need to change how we view the outcome of a (non-invasive) side-channel attack

  • 1. How we view side-channel attacks at the moment;
  • 2. The current evaluation strategy;
  • 3. Changing our view to include the rank of a side-channel

attack;

  • 4. This work: how do we appropriately modify our evaluation

methodology.

4

slide-5
SLIDE 5

CURRENT MODEL FOR A SIDE-CHANNEL ATTACK

c == Enc (p)?

k

Configure attack

  • Pick model for leakage
  • Choose distinguisher

Gather n measurements (traces) Run attack Candidate key k Check using a known plaintext/ciphertext pair

5

slide-6
SLIDE 6

FACTORS AFFECTING SUCCESS

The quality of an attack is affected by:

  • 1. The nature of the ‘true’ underlying leakage signal;
  • 2. The quality of the adversary’s model for that leakage;
  • 3. The statistical technique used to assign scores to key

candidates;

  • 4. Noise: environmental, countermeasures, measurement

quality;

  • 5. The number of measurements available.

6

slide-7
SLIDE 7

CURRENT EVALUATION APPROACH

Attack-based evaluation approach:

◮ Run a battery of attacks, and see what happens.

Judge impact of attack outcomes:

  • 1. Does the adversary recover the secret key?
  • 2. If yes, how many measurements were needed?
  • 3. (other properties assessed: time, expense, ...)

7

slide-8
SLIDE 8

SIDE-CHANNEL ATTACKS: WITH KEY RANK

Configure attack

  • Pick model for leakage
  • Choose distinguisher

Gather n measurements (traces) Run attack Veyrat-Charvillion (SAC 2012) noticed that the adversary doesn't need the attack to be "perfect": Auxiliary information assigning 'scores' to all key candidates Enumerate and check the key candidates in order of their score

8

slide-9
SLIDE 9

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

9

slide-10
SLIDE 10

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) INCORRECT Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

10

slide-11
SLIDE 11

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) INCORRECT Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

11

slide-12
SLIDE 12

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) INCORRECT Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

12

slide-13
SLIDE 13

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) INCORRECT Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

13

slide-14
SLIDE 14

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) INCORRECT Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

14

slide-15
SLIDE 15

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) INCORRECT Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

15

slide-16
SLIDE 16

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) CORRECT (R = 2 )

57

Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key.

16

slide-17
SLIDE 17

KEY RANK: A DEFINITION

Most likely Least likely

1 2128 2 3 4 5 2128-1 257 257-1 257+1

Key candidate Rank R: the number R of candidate keys an adversary must enumerate and check before generating the correct key. Check each candidate key k by encrypting a known plaintext ciphertext pair (p,c) Note: enumeration of candidate keys is expensive! (see ePrint 2016/609) CORRECT (R = 2 )

57 17

slide-18
SLIDE 18

EVALUATION: WITH KEY RANK

Which is more powerful: An attack requiring 10,000 measurements with a rank of 255?

  • r

An attack requiring 50,000 measurements with a rank of 253?

18

slide-19
SLIDE 19

KEY RANK AS A RANDOM VARIABLE

Key rank R is a random variable defined over the randomness in (a fixed number of) measurements Can we analytically compute the distribution of R? Answer: no, in practice we don’t know all the distributions involved. Later: is looking at the expectation E(R) a good idea?

19

slide-20
SLIDE 20

ESTIMATING THE RANK DISTRIBUTION

The only usable approach is to estimate the rank distribution using repeated sampling.

  • 1. Fix an attack strategy, and a number of measurements n.
  • 2. Capture a fresh set of n measurements, and run the attack.
  • 3. Compute or estimate the rank for that attack.
  • 4. Repeat.

Questions we wanted to answer:

  • 1. What is the shape of the distribution?
  • 2. Is there consistency across the spectrum of SCA scenarios?

20

slide-21
SLIDE 21

COMPUTING RANK

Need a non-naive method for approximating rank when key is known. Care about speed and minimising the error in bits b: if the true rank is 2x, then the estimate is within 2x±b. Majority of existing attempts provide an estimate for an interval:

◮ Veyrat-Charvillon et al. (Eurocrypt 2013) ◮ Glowacz et al. (FSE 2015) (*) ◮ Duc et al. (Eurocrypt 2015) ◮ Bernstein et al. (ePrint 2015/221)

We chose to look at optimising:

◮ Martin et al. (Asiacrypt 2015)

21

slide-22
SLIDE 22

IMPROVING RANK ESTIMATION

Made several observations to reduce the run-time of Martin et

  • al. rank estimation algorithm.

◮ Able to achieve ∼ 8 − 10 orders of magnitude more

precision at no additional cost

◮ ⇒ can get a very accurate point estimate in a few seconds

  • n a workstation CPU.

22

slide-23
SLIDE 23

RESULTS: DISTRIBUTION CONSISTENCY

In general, distribution and shape of R is very consistent.

◮ Performed hundreds of thousands of repeat experiments

across a variety of:

◮ Noise levels; ◮ Distinguisher types; ◮ Leakage distributions; ◮ Quantities of measurements.

◮ ... estimating and recording the rank after each attack.

23

slide-24
SLIDE 24

RESULTS: DISTRIBUTION SHAPE -- REAL WORLD EXPERIMENT

20000 40000 60000 80000 100000 20 40 60 80 100 120

Number of measurements (EM traces) Estimated rank (log2) Median rank Min / max observed rank 10th / 90th percentile of rank Repeated DPA attacks on a BeagleBone Black implementing AES-128 in hardware (Longo et al. CHES 2015)

24

slide-25
SLIDE 25

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 216 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

25

slide-26
SLIDE 26

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 232 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

26

slide-27
SLIDE 27

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 248 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

27

slide-28
SLIDE 28

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 264 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

28

slide-29
SLIDE 29

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 280 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

29

slide-30
SLIDE 30

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 296 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

30

slide-31
SLIDE 31

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 2112 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

31

slide-32
SLIDE 32

RESULTS: DISTRIBUTION SHAPE -- IN DETAIL

Estimated rank (log2) Repeated attacks with an average rank of 2120 Count Histograms of repeated attacks grouped by mean rank:

60 100 120 80 40 20

32

slide-33
SLIDE 33

EVALUATION PROPOSAL

◮ Repeated sampling from the rank distribution of an attack is

the only approach. Statistic choice:

◮ Large variance in distribution means averages are not

particularly useful statistics;

◮ Non-parametric order statistics such as percentiles are

ideal: e.g estimated 10% chance my devices are vulnerable to an attack of rank ≤ 280. Estimation stability (discussed in paper):

◮ Need to run at least 30 repeat experiments.

This put stress on the measurement gathering phase:

◮ If you’re careful, you can be clever with measurement

collection.

33

slide-34
SLIDE 34

CONCLUSION

Thanks for listening! Rank estimation and enumeration code (C++11): https://github.com/bristol-sca/labynkyr MIT-style licence An analysis of enumeration capabilities: http://eprint.iacr.org/2016/609

34