Leakage Assessment Methodology - a clear roadmap for side-channel - - PowerPoint PPT Presentation

leakage assessment methodology
SMART_READER_LITE
LIVE PREVIEW

Leakage Assessment Methodology - a clear roadmap for side-channel - - PowerPoint PPT Presentation

Leakage Assessment Methodology - a clear roadmap for side-channel evaluations - 29. August 2015 Tobias Schneider & Amir Moradi Ruhr-Universitt Bochum Embedded Security Group Outline Motivation Statistical Background Testing


slide-1
SLIDE 1

Leakage Assessment Methodology

  • a clear roadmap for side-channel evaluations -
  • 29. August 2015

Tobias Schneider & Amir Moradi

Ruhr-Universität Bochum

slide-2
SLIDE 2

2

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Outline

  • Motivation
  • Statistical Background
  • Testing Methodology
  • Higher‐Order Testing
  • Efficient Computation
  • Case Studies
  • Conclusion
slide-3
SLIDE 3

3

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Motivation

  • Security Evaluation
  • Attack‐based Testing
  • Information‐theoretic Testing
  • Testing based on t‐Test
slide-4
SLIDE 4

4

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Motivation ‐ Security Evaluation

Problem: Evaluation is not trivial. Non‐Invasive Attack Testing Workshop, 2011 Establish testing methodology capable of robustly assessing the physical vulnerability of cryptographic devices. Goal: How secure is this chip?

slide-5
SLIDE 5

5

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Motivation ‐ Attack‐based Testing

Perform state‐of‐the‐art attacks on the device under test (DUT)

Attacks Types:

  • DPA
  • CPA
  • MIA

Intermediate Values:

  • Sbox In
  • Sbox Out
  • Sbox In/Out

Leakage Models:

  • HW
  • HD
  • Bit

Problems:

  • High computational complexity
  • Requires lot of expertise
  • Does not cover all possible attack vectors
slide-6
SLIDE 6

6

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Motivation ‐ Information‐theoretic Testing

Computation of Mutual/Perceived Information Problems:

  • High computational complexity
  • Cannot focus on one statistical moment
  • Dependent on PDF‐Estimation
  • Does not cover all possible attack vectors
slide-7
SLIDE 7

7

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Motivation ‐ Testing based on ‐Test

Tries to detect any type of leakage at a certain order

  • Proposed by CRI at NIST workshop

Advantages:

  • Independent of architecture
  • Independent of attack model
  • Fast & simple
  • Versatile

Problems:

  • No information about hardness of

attack

  • Possible false positives if no care

about evaluation setup

slide-8
SLIDE 8

8

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Motivation

  • In this talk:

– (Hopefully) understandable explanation of the tests – Detailed explanation of how to conduct tests in higher‐orders – Discuss efficiency and accuracy problems and provide efficient and robust formulas – How to design an appropriate framework to host the DUT for such tests, including both software and hardware platforms (e.g., FPGA, µController) – Two case studies

slide-9
SLIDE 9

9

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Statistical Background

  • t‐Test
slide-10
SLIDE 10

10

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Statistical Background ‐ ‐Test

Sample Sample

Null Hypothesis: Two population means are equal.

slide-11
SLIDE 11

11

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Statistical Background ‐ ‐Test

Sample Sample

Sample mean: Sample variance: Sample size:

  • t
  • v
  • 1
  • 1

Degree of freedom ‐test statistic

slide-12
SLIDE 12

12

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Statistical Background ‐ ‐Test

Estimate the probability to accept null hypothesis with Student’s distribution:

, Γ 1 2 Γ 2 1

  • 2 t, v
  • ||

With probability density function: With cumulative density function:

2 t , v

slide-13
SLIDE 13

13

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Statistical Background ‐ ‐Test

  • Small values give evidence to reject the null hypothesis
  • For testing usually only the ‐value is estimated
  • Compared to a threshold of t 4.5
  • 2 4.5, 1000 0.00001
  • Confidence of > 0.99999 to reject null hypothesis
slide-14
SLIDE 14

14

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology

  • Specific ‐Test
  • Non‐Specific t‐Test
slide-15
SLIDE 15

15

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology ‐ Specific ‐Test

Measurements With Associated Data

  • 1
  • Test is conducted at each sample point separately (univariate)
  • Key is known to enable correct partitioning
  • If corresponding ‐test exceeds threshold ⇒ DPA probable
slide-16
SLIDE 16

16

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology ‐ Specific ‐Test

Measurements With Associated Data

  • Test is conducted at each sample point separately (univariate)
  • Key is known to enable correct partitioning
  • If corresponding ‐test exceeds threshold ⇒ DPA probable
  • Other classifications possible (e.g. Sbox output byte)
slide-17
SLIDE 17

17

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology ‐ Specific ‐Test

Example: PRESENT (first round)

  • addRoundKey, sBoxLayer, pLayer
  • Bitwise: 3 64 tests
  • Nibblewise: 3 16 16 tests
  • Other tests possible

Sbox out bits (64 models) Sbox in ⊕ out bits (64 models) Sbox 0 nibble (16 models)

Problems:

  • Same as attack‐based approach
  • Many different intermediate values
  • Many different models
  • Prevents comprehensive evaluation
slide-18
SLIDE 18

18

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology ‐ Non‐Specific ‐Test

  • fixed vs. random t‐test
  • Avoids being dependent on any intermediate value/model
  • Needs special measurement phase:

Measurements With Random Associated Data D Measurements

  • With Fixed

Associated Data D

slide-19
SLIDE 19

19

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology ‐ Non‐Specific ‐Test

Relation with specific t‐test:

  • Single‐bit intermediate value
  • Overall mean:
  • if || ||

Specific t‐test

  • Non‐specific t‐test

with fixed D Non‐specific t‐test with fixed D

  • close to
  • close to
  • close to
  • close to
slide-20
SLIDE 20

20

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Testing Methodology ‐ Non‐Specific ‐Test

  • Non‐specific t‐test reports a detectable leakage

⇒ Specific t‐test reports leakage with higher confidence

  • Other direction (⇐) cannot be concluded from a single

non‐specific t‐test

  • Recommended to perform a number of non‐specific tests

with different fixed data D Semi‐fixed vs. random test:

  • Use a set of particular associated data instead of D
  • All lead to certain intermediate value
slide-21
SLIDE 21

21

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Higher Order Testing

  • Univariate
  • Multivariate
slide-22
SLIDE 22

22

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Higher Order Testing ‐ Univariate

  • Sensitive variable is masked: ∘
  • First‐order t‐test should not detect any leakage
  • Shares are often processed in parallel in

hardware circuits

  • Traces need to be preprocessed
  • Univariate higher‐order testing:
  • 2nd‐order : (centralized)
  • d‐order:
  • (standardized)
slide-23
SLIDE 23

23

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Higher Order Testing ‐ Multivariate

  • Shares are often processed at different

time instances in software implementations

  • Test need to consider a combination of

multiple different points in time

  • Finding these Points‐of‐Interest (POI) is

computationally complex

  • Different combination functions:
  • Centered product
  • 2nd‐order: ⋅
slide-24
SLIDE 24

24

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation

  • Naïve
  • Incremental
  • Raw Moments
  • Central Moments
  • Multivariate
  • Parallelization
slide-25
SLIDE 25

25

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Naïve

t

  • ,
  • ,
  • Requires estimation of:

Naïve computation of ,

:

  • :

First pass: Second pass:

  • Problem: Not efficient, especially for higher orders (preprocessing)

Reminder:

slide-26
SLIDE 26

26

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Incremental

  • :

Idea: Update intermediate values for each new trace

,

  • ,

,

  • ,
  • Advantages:
  • Requires only one pass to compute all required parameters
  • Can be run in parallel to measurement phase
slide-27
SLIDE 27

27

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Raw Moments

Incremental computation of ,

using raw moments:

  • :

First pass: ,

(raw moments) Idea: ,

  • Problem: Numerical unstable
  • Example: Univariate 5th –order test requires …
  • (central moments)

Incremental for raw moments trivial

slide-28
SLIDE 28

28

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Central Moments

Incremental computation of ,

using central moments:

First order: Second order (univariate): Advantages:

  • Efficient as other incremental algorithms
  • Intermediate values are centralized ⇒ avoid numerical issues

First Parameter Second Parameter

  • rder

(univariate):

slide-29
SLIDE 29

29

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Central Moments

Problem: Finding incremental formulas not as trivial as for raw moments Idea: Incrementally compute central sums

  • where
  • Central sum:

For set ′ ∪ with Δ ,:

, , , Δ

  • 1
  • Δ
  • 1

1 1

  • Note: Computation of , requires , for 1 and ,
slide-30
SLIDE 30

30

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Central Moments

A t‐test of order d requires to estimate the central moments up to order 2d.

Accuracy comparison:

  • Simulated traces with 100,25
  • 100 million traces
slide-31
SLIDE 31

31

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Multivariate

  • If combination function does not use the mean, computation of

the parameters is trivial (e.g., sum or product)

  • Problematic for optimum combination function (centered product)
  • Incremental formulas for both test parameters are described in the

paper  Efficient incremental formulas for any variate and order of the test

,

with point indices

slide-32
SLIDE 32

32

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Parallelization

, , , , ,

Trace n

Thread Thread 1 Thread 2 Thread 3 Thread 4

  • Computations on separate points completely independent (univariate)
  • No communication between threads

Example:

  • 1st‐5th order t‐test
  • 100,000,000 traces (each with 3,000 sample points)
  • 9h on 2xIntel Xeon X5670 CPUs @ 2.93 GHz (24 hyper‐threading cores)
slide-33
SLIDE 33

33

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Parallelization

, , , , ,

Trace n

, , , , ,

Trace n+1

, , , , ,

Trace n+2

, , , , ,

Trace n+3

Thread Thread 1

  • Useful if measurement phase already completed
  • Need adjusted formulas for the central sums
slide-34
SLIDE 34

34

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Efficient Computation ‐ Parallelization

, , , , ,

Trace n

, , , , ,

Trace n+1

, , , , ,

Trace n+2

, , , , ,

Trace n+3

  • Possible to combine both approaches for maximum performance

Thread 0 Thread 1 Thread 2 Thread 3

slide-35
SLIDE 35

35

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Case Studies

  • Framework
  • Case Study: Microcontroller
  • Case Study: FPGA
slide-36
SLIDE 36

36

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Case Studies ‐ Framework

  • Malpractice in

Measurement Phase can lead to faulty results

  • Use sequence/rapid

block mode to speed up Measurement Phase

  • Random order for

non‐specific tests

slide-37
SLIDE 37

37

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Case Studies ‐ Framework

Example Function Non‐Specific: Example Function Non‐Specific (Shared): Recommendations:

  • Fixed vs. random: with shared communication if DUT involves masking countermeasures
  • Semi‐fixed vs. random: without shared communication if DUT has hiding
  • Specific t‐test:

 Identify suitable intermediate values for key‐recovery  DUT has no countermeasure  Failed in former non‐specific tests

slide-38
SLIDE 38

38

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Case Studies ‐ Microcontroller

  • DPA contest v4.2 for an Atmel microcontroller
  • AES‐128 with low‐entropy masking & shuffling
  • PicoScope @ Sampling rate: 250 MS/s 100,000 traces
slide-39
SLIDE 39

39

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Case Studies ‐ FPGA

  • TI‐NLFSR on Spartan‐6 FPGA
  • 5 shares
  • 2,000,000 power traces with 500 MS/s
  • AND/XOR = 3 ⊕ 2 ⋅ 1
slide-40
SLIDE 40

40

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Case Studies ‐ FPGA

slide-41
SLIDE 41

41

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Conclusion

slide-42
SLIDE 42

42

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Conclusion

  • t‐test for security evaluation has become popular
  • Extended the theoretical foundation guidelines
  • Detailed instructions how to perform the test correctly

and efficient in practice at any order or variate

  • Optimized and correct measurement setup

“Future Work”:

  • Extension of the incremental approach to correlation‐

based evaluation schemes

Robust and One‐Pass Parallel Computation of Correlation‐Based Attacks at Arbitrary Order Tobias Schneider, Amir Moradi, Tim Güneysu, ePrint Report 2015/571

slide-43
SLIDE 43

43

Embedded Security Group

Sharif Uni. | Tehran | 29. August 2015 Amir Moradi

Thanks! any questions?

Embedded Security Group, Ruhr-Universität Bochum, Germany

amir.moradi@rub.de