Practical Evaluation of Protected RNS Scalar Multiplication CHES - - PowerPoint PPT Presentation

β–Ά
practical evaluation of protected rns scalar
SMART_READER_LITE
LIVE PREVIEW

Practical Evaluation of Protected RNS Scalar Multiplication CHES - - PowerPoint PPT Presentation

Practical Evaluation of Protected RNS Scalar Multiplication CHES 2019 By Louiza Papachristodoulou Joint work with A. Fournaris, K. Papagiannopoulos, L. Batina Out utli line Residue Number System in Elliptic Curve Cryptography


slide-1
SLIDE 1

Practical Evaluation of Protected RNS Scalar Multiplication

By Louiza Papachristodoulou Joint work with

  • A. Fournaris, K. Papagiannopoulos, L. Batina

CHES 2019

slide-2
SLIDE 2

Out utli line

  • Residue Number System in Elliptic Curve Cryptography
  • Proposed TVLA threshold calculation
  • TVLA analysis
  • Location and Data Dependent Template Attacks
  • Conclusions

2

slide-3
SLIDE 3

Residue Number System

X = 50 (m1, m2, m3) = (3, 7, 11) (x1, x2, x3) = (2, 1, 6)

3

slide-4
SLIDE 4

RN RNS in in Elli Elliptic ic Cur urve Cryptography

  • Elliptic curves defined over prime fields GF(p)
  • Modular operations turn easily to RNS modular
  • perations over GF(p)
  • RNS mod multiplication usually realized through RNS

Montgomery multiplication to avoid modular inversion, but includes base extension

  • EC scalar multiplication is the critical operation Q = kP

4

slide-5
SLIDE 5

LRA RA Mon

  • ntgomery

ry Power Lad adder

  • 𝑆0 = 𝑆, 𝑆1= 𝑆 + π‘Š, 𝑆2 = βˆ’π‘†
  • Convert 𝑆0 , 𝑆1, 𝑆2 to Montgomery format
  • For i= t-1 to 0
  • 𝑆2 = 2𝑆2
  • If 𝑙𝑗 = 1

𝑆0 = 𝑆0 + 𝑆1 and 𝑆1 = 2𝑆1 else 𝑆1 = 𝑆0 + 𝑆1 and 𝑆0 = 2𝑆0 Choose base πΆπ‘œ, πΆβ€²π‘œ. Transform V, R to RNS format using permutation π‘žπ‘’

  • Integrity check: if i,k not modified and 𝑆0+ π‘Š = 𝑆1 then ret. 𝑆0 + 𝑆2

in permutation π‘žπ‘’ in permutation π‘žπ‘’ in permutation γ𝑒 in permutation γ𝑒 else ret. random value Transform 𝑆0 + 𝑆2 to binary format

5

slide-6
SLIDE 6

Tes est Vec ector Lea eakage Asse ssessment t (TV (TVLA)

  • Statistical tests between two trace-sets of acquisition
  • Welch’s t-test to evaluate if two sets have significant statistical

differences 𝑑𝑗 =

𝑀𝑗,𝐡 βˆ’π‘€π‘—,𝐢

σ𝑗,𝐡 2 π‘œπ΅ + σ𝑗,𝐢 2 π‘œπΆ

  • Values above Β±4.5, indicates leakage, but TVLA does not exploit it

6

slide-7
SLIDE 7

t-tes est Th Threshold ld Cal alib ibratio ion for

  • r TV

TVLA

Input π‘œπ‘’π΅ , π‘œπ‘’πΆ : number of traces for groups A,B π‘œπ‘‘ : number of samples 𝜏

𝐡, πœΞ’ ∢ sampled standard deviation

Output Threshold value for Welch’s t-distribution π‘’β„Žπ‘’ 1. Choose level of significance Ξ±. Here Ξ±=0.00001 2. Family-wise error rate fwer = (1 βˆ’ 𝑏)π‘œπ‘‘ 3. Ε idak correction 𝑑𝑗𝑒𝑏𝑙𝑏= 1 - (1 βˆ’ 𝑏)(1/π‘œπ‘‘) 4. df = (

𝜏𝐡

2

π‘œπ‘’π΅ + 𝜏𝐢

2

π‘œπ‘’πΆ )2 / ( (

𝜏𝐡 2 π‘œπ‘’π΅) 2

π‘œπ‘’π΅ βˆ’1 + (

𝜏𝐢 2 π‘œπ‘’πΆ) 2

π‘œπ‘’πΆ βˆ’1)

5. Threshold π‘’β„Žπ‘’= |tinv (1- 𝑑𝑗𝑒𝑏𝑙𝑏 /2, df)| π‘œπ‘’π΅ = π‘œπ‘’πΆ= 4 βˆ— 103 – 10βˆ— 103

π‘œπ‘‘ = 4 βˆ— 105 βˆ’ 8 βˆ— 105

𝜏

𝐡 = 9.7 , πœΞ’ = 6.1

π‘’β„Žπ‘’ = Β± 6.3

7

slide-8
SLIDE 8

RNS im implementation on

  • n Be

BeagleBone

  • C Software implementation on ARM Cortex A8
  • RNS Montgomery multiplication
  • Dedicated and Unified Group Law
  • 5 different variations: unprotected, randomized

scalar, random input point, random base permutations (LRA), random

  • rder
  • f
  • perations

8

slide-9
SLIDE 9

Proc

  • cessing of
  • f Trac

aces – Low Pass ass Filt Filter

9

slide-10
SLIDE 10

t-test random vs fi fixed scala lar on

  • n tw

twisted Edwards cu curve (a

(a=1, d= d=2, p= p= 2192 βˆ’ 264 βˆ’ 1)

Unprotected scalar mul LRA_rdm_point() Randomized scalar LRA

10

slide-11
SLIDE 11

t-test random vs fi fixed poi

  • int on
  • n secu

cure Edwards cu curve (a= (a=107, d=4 =47, h=4 =4, p= = 2192 βˆ’ 264 βˆ’ 1)

Unprotected scalar mul LRA_rdm_point() Randomized scalar LRA

11

slide-12
SLIDE 12

Data a Dep ependent t Tem empla late Attack acks

  • The value of a secret variable can be monitored
  • Trigger around the key-dependent assignment (if-statement)

If 𝑙𝑗 = 1: 𝑆0 = 𝑆0 + 𝑆1 and 𝑆1 = 2𝑆1 Else: 𝑆1 = 𝑆0 + 𝑆1 and 𝑆0 = 2𝑆0

  • After alignment, 20k traces. Used half for templates, half for

classification

  • Success rate 90-91% for the unprotected case, 82-97% for LRA

countermeasure activated

  • Scalar randomization (65-72%) and LRA randomized RNS operations

(55-58%) are good countermeasures

12

slide-13
SLIDE 13

Loc

  • catio

ion Dep ependent t Tem empla late Attack acks

  • Templates created for storage structure that handles the key-

dependent instruction (doubling)

If 𝑙𝑗 = 1: 𝑆0 = 𝑆0 + 𝑆1 and 𝑆1 = 2𝑆1 Else: 𝑆1 = 𝑆0 + 𝑆1 and 𝑆0 = 2𝑆0

  • Template classification: 95-99.9%
  • LRA with randomized operations: 70-83%

13

slide-14
SLIDE 14

Loc

  • catio

ion Dep ependent t Leak eakage

  • Registers are not really single registers, RNS values are stored in 50-bit

chunks - result of doubling is stored in different memory locations

  • Location dependent leakage was not an expected result
  • The normal distributions for 𝑙𝑗 = 0 and 𝑙𝑗 = 1 for every variation of

the implementation are very different (N(βˆ’24.3, 9, 7), N(19.6, 6.1))

  • Leaky platform - capacitors next to each other
  • Scalar randomization not an efficient countermeasure
  • LRA with randomized operations makes template attacks harder

14

slide-15
SLIDE 15

Eval aluatio ion Tab able

Pass t-test/secure against templates Fail t-test/not secure against templates

15

slide-16
SLIDE 16

Con

  • nclusions
  • TVLA bounds not rigid; compute according to distribution of traces,

number of samples, number of traces

  • Randomization of scalar, input point, regularity of MPL are good

countermeasures but not enough to avoid leakage

  • Different RNS representations do not lower the template success rates
  • Randomization of RNS operations protects against templates and less

expensive compared to randomization of input point

  • Classification using ML algorithms
  • Evaluation on an FPGA would give further insights in the security of RNS

16

slide-17
SLIDE 17

THANK YOU FOR YOUR ATTENTION !

louiza@cryptologio.org