28
How (not) to Use Welch’s T-test in Side-Channel Security Evaluations F.-X. Standaert UCL Crypto Group, Belgium CARDIS 2018, Montpellier, France

How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

How (not) to Use Welch’s T-testin Side-Channel Security Evaluations

F.-X. StandaertUCL Crypto Group, Belgium

CARDIS 2018, Montpellier, France

Page 2: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Motivation for leakage detection 1

• Real World Crypto 2017 (Helena Handschuh)• DPA resistance for real people• https://www.youtube.com/watch?v=qvwwz8V9XRo

• Provide test methods that are

• Repeatable• Precise• Automated• Less subjective• Low cost

conformance-style testing

Page 3: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Big picture (side-channel evaluations) 2

modeling exploitation

detection

SRMI

yes/no

,

[Duc et al. 14/15]

POIs

sou

nd

bu

t expen

sive

Leakage detection: is theredata-dependent leakage?

POI detecion: where is the exploitable leakage?

measurement& filtering

cheap

heu

ristic

Page 4: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Bigger picture (this talk) 2

modeling exploitation

detection

SRMI

yes/no

,

[Duc et al. 14/15]

POIs

sou

nd

bu

t expen

sive

Leakage detection: is theredata-dependent leakage?

POI detecion: where is the exploitable leakage?

measurement& filtering

What if we stop here?

cheap

heu

ristic

Page 5: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Example: detection with Welch’s t-test 3

• AES Rijndael example• 128-bit key fixed• Nf traces with a fixed plaintext• Nr traces with random plaintexts• Apply Welch’s t-test to the f&r classes:

∆ 𝑡 = 𝜇𝑓 𝑡 − 𝜇𝑟 𝑡 / 𝜎𝑓2 𝑡 /𝑁𝑓 + 𝜎𝑟

2 𝑡 /𝑁𝑟

Page 6: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Example: detection with Welch’s t-test 3

• AES Rijndael example• 128-bit key fixed• Nf1 traces with a fixed plaintext• Nf2 traces with another fixed plaintext• Apply Welch’s t-test to the f&f classes:

∆ 𝑡 = 𝜇𝑓1 𝑡 − 𝜇𝑓2 𝑡 / 𝜎𝑓12 𝑡 /𝑁𝑓1 + 𝜎𝑓2

2 𝑡 /𝑁𝑓2

Page 7: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Tempting shortcoming 4

• No detection ⇒ there is anyway no attack• Are there false negatives that contradict this?

Page 8: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Tempting shortcoming 4

• No detection ⇒ there is anyway no attack• Are there false negatives that contradict this?

• Exemple of false negative #1

• 𝑦 = 𝑥 ⊕ 𝑘, 𝑧 = S(𝑥 ⊕ 𝑘), 𝑙 = HW 𝑧 + 𝑛• 𝜇𝑟 = 4 anyway • Say 𝜇𝑓 = 4 (𝑧 = 15)

• Not all leaking samples can be detected

no detection possible

Page 9: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Tempting shortcoming 4

• No detection ⇒ there is anyway no attack• Are there false negatives that contradict this?

• Exemple of false negative #1

• 𝑦 = 𝑥 ⊕ 𝑘, 𝑧 = S(𝑥 ⊕ 𝑘), 𝑙 = HW 𝑧 + 𝑛• 𝜇𝑟 = 4 anyway • Say 𝜇𝑓 = 4 (𝑧 = 15)

• Not all leaking samples can be detected

• But not a problem if applied to long traces

no detection possible

Page 10: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Tempting shortcoming 4

• No detection ⇒ there is anyway no attack• Are there false negatives that contradict this?

• Exemple of false negative #2

• Highly multivariate attacks• Static leakages (slow clock) [M14,M+15] • Horizontal attacks, SASCA [B+16,GS18]

[M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579. [M+15] Santos Merino Del Pozo, François-Xavier Standaert, Dina Kamel, Amir Moradi: Side-channel attacks from static power: when should we care? DATE 2015: 145-150 [B+16] Alberto Battistello, Jean-Sébastien Coron, Emmanuel Prouff, Rina Zeitoun: Horizontal Side-Channel Attacks and Countermeasures on the ISW Masking Scheme. CHES 2016: 23-39 [GS18] Vincent Grosso, François-Xavier Standaert: Masking Proofs Are Tight and How to Exploit it in Security Evaluations. EUROCRYPT (2) 2018: 385-412

Page 11: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Tempting shortcoming 4

• No detection ⇒ there is anyway no attack• Are there false negatives that contradict this?

• Exemple of false negative #2

• Highly multivariate attacks• Static leakages (slow clock) [M14,M+15] • Horizontal attacks, SASCA [B+16,GS18]

• But these are highly sophisticated attacks

[M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579. [M+15] Santos Merino Del Pozo, François-Xavier Standaert, Dina Kamel, Amir Moradi: Side-channel attacks from static power: when should we care? DATE 2015: 145-150 [B+16] Alberto Battistello, Jean-Sébastien Coron, Emmanuel Prouff, Rina Zeitoun: Horizontal Side-Channel Attacks and Countermeasures on the ISW Masking Scheme. CHES 2016: 23-39 [GS18] Vincent Grosso, François-Xavier Standaert: Masking Proofs Are Tight and How to Exploit it in Security Evaluations. EUROCRYPT (2) 2018: 385-412

Page 12: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Research problem 5

• Can we design an implementation• For which detection is hard / impossible• That is trivial to break (e.g., with 1 trace)

• Exploiting a simple (univariate) attack

?

Page 13: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Experimental setting 6

• Masked encoding (parallel implementation)• 𝑥 = 𝑥1 ⊕ 𝑥2 ⊕ ⋯⊕ 𝑥𝑚

• Vector of shares 𝑥 = (𝑥1, 𝑥2, … , 𝑥𝑚)

• Linear (or quadratic) leakage function

• Compute t-test statistic and MI (worst-case) metric

L 𝑥 =

𝑖=1

𝑚

𝛼𝑖 . 𝑥𝑖 + 𝑛 , L 𝑥 =

𝑖=1

𝑚

𝛼𝑖 . 𝑥𝑖 +

𝑖,𝑗=1

𝑚

𝛽𝑖,𝑗 . (𝑥𝑖⋀𝑥𝑗) + 𝑛

MI 𝑋; 𝑳 = H 𝑋 +

𝑥

Pr 𝑥 +

𝒍

f 𝒍 𝑥 . log2(Pr[𝑥|𝒍])

Page 14: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Parameters 7

• The number of shares = bus size m

• The degree of the leakage function (d=1,2)

• The order of the leakage detection (o ≤ m)

• Pre-processed samples

• The amount of noise in the leakages

𝐿′ 𝑖 = 𝐿 𝑖 − 𝜇 𝐿 𝑖𝑜

SNR =𝑚/4

𝜎𝑛2

Page 15: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Information theoretic analysis 8

• Very weak security for high SNRs• Trivial attack: check whether HW is even or odd

Page 16: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Leakage detection #1 9

• Detection starts at order 4 (as expected)• But it is already not trivial with 4 shares!

Page 17: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Leakage detection #2 10

• Things get worse as the # of shares increase• Why: detection assumes an Adv. strategy

• Estimating moments is suboptimal with high SNR

Page 18: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Interpretation (security models)

Noisy leakages security:

Goal (ideally):

𝑁 ∝ 𝑐

MI(𝑋;𝑳)

MI 𝑋; 𝑳 < MI 𝑋𝑖; 𝐿𝑖𝑚

11

Page 19: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Interpretation (security models)

Noisy leakages security:

Goal (ideally):

𝑁 ∝ 𝑐

MI(𝑋;𝑳)

MI 𝑋; 𝑳 < MI 𝑋𝑖; 𝐿𝑖𝑚

Bounded moment security:

𝑖1,𝑖2,…,𝑖𝑚−1

𝐿𝑖 𝑋

(𝑚-1)th order statistical moment (ideally)

11

Page 20: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Bounded moment security:

𝑖1,𝑖2,…,𝑖𝑚−1

𝐿𝑖 𝑋

(𝑚-1)th order statistical moment (ideally)

Interpretation (security models)

Noisy leakages security:

Goal (ideally):

𝑁 ∝ 𝑐

MI(𝑋;𝑳)

MI 𝑋; 𝑳 < MI 𝑋𝑖; 𝐿𝑖𝑚

Probing security:

Sets of (m-1) probes are of 𝑋 (ideally)

𝑥 = 𝑥1 + 𝑥2 + ⋯+ 𝑥𝑚

11

Page 21: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Interpretation (security reductions)

no

isy

leak

ages

bo

un

ded

mo

men

tp

rob

ing

ab

stra

ct-q

ua

lita

tive

phy

sica

l-q

ua

lita

tive

phy

sica

l-q

ua

nti

tati

ve

[Barthe et al.,Eurocrypt 2017]

[Duc et al.,Eurocrypt 2014]

𝑥 = 𝑥1 + 𝑥2 + ⋯+ 𝑥𝑑

12

Page 22: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Take home message: separation of duties

no

isy

leak

ages

bo

un

ded

mo

men

tp

rob

ing

𝑥 = 𝑥1 + 𝑥2 + ⋯+ 𝑥𝑑

13

Can be evaluated with Welch’s t-test(or any moment-based tool)

Cannot be evaluated with Welch’s t-test(needs SNR or distribution-based tool)

Page 23: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Last remark 14

• Say you want to evaluate the security order• Smallest leaking moment of f 𝑥 𝑙

• But noise is large (SNR is low)• Hence detection complexity grows exp. in m

• If masks are under control, an improveddetection is obtained by averaging 𝑙| 𝑥• Intuition: prevents noise amplification

Page 24: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Illustration 15

• The improved detection level is even less correlated with the security level (but it wasn’t anyway…)

Page 25: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Conclusions 16

• “Detection-only” evaluations are risky• Have a limited quantitative meaning

• Especially in the case of masking• This paper discusses the noise issue• But the multivariate issue is as important

Page 26: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Conclusions 16

• “Detection-only” evaluations are risky• Have a limited quantitative meaning

• Especially in the case of masking• This paper discusses the noise issue• But the multivariate issue is as important

• Limitations are less critical if detection occurs• But interpreting “no detection” is very hard

• It certainly does not mean the device is secure

Page 27: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

Conclusions 16

• “Detection-only” evaluations are risky• Have a limited quantitative meaning

• Especially in the case of masking• This paper discusses the noise issue• But the multivariate issue is as important

• Limitations are less critical if detection occurs• But interpreting “no detection” is very hard

• It certainly does not mean the device is secure

• (Improved) detection is a useful ingredient though• To assess an implementation’s “security order”• As a first step before other analyzes

Page 28: How (not) to Use Welch’s T-test in Side-Channel Security ... · [M14] Amir Moradi: Side-Channel Leakage through Static Power - Should We Care about in Practice? CHES 2014: 562-579

THANKShttp://perso.uclouvain.be/fstandae/