Power Analysis on NTRU Prime Wei-Lun Huang, Jiun-Peng Chen, Bo-Yin - - PowerPoint PPT Presentation

power analysis on ntru prime
SMART_READER_LITE
LIVE PREVIEW

Power Analysis on NTRU Prime Wei-Lun Huang, Jiun-Peng Chen, Bo-Yin - - PowerPoint PPT Presentation

Power Analysis on NTRU Prime Wei-Lun Huang, Jiun-Peng Chen, Bo-Yin Yang Academia Sinica, Taiwan CHES 2020 1 Topics NTRU Prime A Brief Preview Correlation Power Analysis: vertical vs. horizontal in-depth Online Template


slide-1
SLIDE 1

Power Analysis on NTRU Prime

Wei-Lun Huang, Jiun-Peng Chen, Bo-Yin Yang Academia Sinica, Taiwan CHES 2020

1

slide-2
SLIDE 2

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

2

slide-3
SLIDE 3

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

3

slide-4
SLIDE 4

❖ Shor’s Algorithm

➢ solving integer factorization and discrete logarithms efficiently ➢ Quantum Computers: estimated as arriving in 10~20 years

Post-Quantum Cryptography (PQC)

4

  • Peter W. Shor. Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer.
slide-5
SLIDE 5

❖ Shor’s Algorithm

➢ solving integer factorization and discrete logarithms efficiently ➢ Quantum Computers: estimated as arriving in 10~20 years

❖ The NIST PQC Standardization Project

➢ key encapsulation mechanisms (KEM) + digital signatures ➢ lattices / error correction codes / multivariate quadratic equations / ...

Post-Quantum Cryptography (PQC)

5

  • Post-Quantum Cryptography | CSRC. https://csrc.nist.gov/Projects/Post-Quantum-Cryptography
slide-6
SLIDE 6

❖ Streamlined NTRU Prime / NTRU LPRime: 653 / 761 / 857

NTRU Prime: lattice-based KEM

6

  • Daniel J. Bernstein, Chitchanok Chuengsatiansup, Tanja Lange, and Christine van Vredendaal. NTRU Prime: round 2.
slide-7
SLIDE 7

❖ The Product Scanning Method

➢ Inputs: known c in R/q and secret short f ➢ Ouput: e = (c x f) mod q ➢ Decap / Encap / KeyGen (only ntrulpr*)

Interesting Multiplication in NTRU Prime

7

  • Michael Hutter and Erich Wenger. Fast Multi-Precision Multiplication for Public-Key Cryptography on Embedded Microprocessors.
slide-8
SLIDE 8

❖ The Product Scanning Method

➢ Inputs: known c in R/q and secret short f ➢ Ouput: e = (c x f) mod q ➢ Decap / Encap / KeyGen (only ntrulpr*)

Interesting Multiplication in NTRU Prime

8

slide-9
SLIDE 9

❖ The Product Scanning Method

➢ Inputs: known c in R/q and secret short f ➢ Ouput: e = (c x f) mod q ➢ Decap / Encap / KeyGen (only ntrulpr*)

Interesting Multiplication in NTRU Prime

9

slide-10
SLIDE 10

❖ The Product Scanning Method

➢ Inputs: known c in R/q and secret short f ➢ Ouput: e = (c x f) mod q ➢ Decap / Encap / KeyGen (only ntrulpr*)

Interesting Multiplication in NTRU Prime

10

slide-11
SLIDE 11

❖ The Product Scanning Method

➢ Inputs: known c in R/q and secret short f ➢ Ouput: e = (c x f) mod q ➢ Decap / Encap / KeyGen (only ntrulpr*)

Interesting Multiplication in NTRU Prime

11

slide-12
SLIDE 12

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

12

slide-13
SLIDE 13

❖ sntrup761 Decap on ARM Cortex-M4

➢ p = 761, q = 4591, and w = 286 ➢

  • n STM32F303RCT7 and STM32F415RGT6

Experiment Settings

13

  • STMicroelectronics. Datasheet - STM32F303xB STM32F303xC.
  • STMicroelectronics. Datasheet - STM32F415xx STM32F417xx.
slide-14
SLIDE 14

❖ sntrup761 Decap on ARM Cortex-M4

➢ p = 761, q = 4591, and w = 286 ➢

  • n STM32F303RCT7 and STM32F415RGT6

❖ ChipWhisperer-Lite Two-Part Version

➢ random input generation + measurement + data collection

❖ Statistical Analysis: in Python 3.6.1 or C++ on a MacBook Air

Experiment Settings

14

  • ChipWhisperer-Lite (CW1173) Two-Part Version - NewAE Technology Inc. https://store.newae.com/chipwhisperer-lite-cw1173-two-part-version/
slide-15
SLIDE 15

STM32F415RGT6 + ChipWhisperer-Lite

15

Target Board at 7.38MHz Mini-Circuits SLP-10.7+ Coaxial Cable USB to PC Control Board MacBook Air

  • Low Pass Filter - Mini Circuits. https://www.minicircuits.com/pdfs/SLP-10.7+.pdf
slide-16
SLIDE 16

❖ Vertical CPA: robust and fast ❖ Horizontal In-Depth CPA: using one single short trace ❖ Online Template Attacks: fast profiling with few template traces ❖ Chosen-Input SPA: with the naked eye

Power Analysis Methods

16

CPA: Correlation Power Analysis SPA: Simple Power Analysis

slide-17
SLIDE 17

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

17

  • Mun-Kyu Lee et al. Countermeasures against Power Analysis Attacks for the NTRU Public Key Cryptosystem.
  • Aydin Aysu et al. Horizontal Side-Channel Vulnerabilities of Post-Quantum Key Exchange Protocols.
slide-18
SLIDE 18

Vertical CPA

18

slide-19
SLIDE 19

Vertical CPA

likely to confuse with

19

Reveal and at a time.

slide-20
SLIDE 20

Reveal

  • ne by one.

Vertical CPA

likely to confuse with

20

Reveal and at a time.

slide-21
SLIDE 21

❖ Vertical CPA: one coefficient at a time with multiple short traces

➢ How to squeeze more information from each short trace?

In-Depth CPA

21

slide-22
SLIDE 22

❖ Vertical CPA: one coefficient at a time with multiple short traces

➢ How to squeeze more information from each short trace?

❖ In-Depth CPA: multiple coefficients at a time with one short trace

➢ The intermediate state of depends on the current ➢ and all the previous . ➝ Extend-and-Prune

In-Depth CPA

22

slide-23
SLIDE 23

❖ Block Size m = 67 + Pruning Period n = 6

Candidate Pruning

23

slide-24
SLIDE 24

❖ Tail Errors: at the end of the block

➢ In the current block recovery, the correlation still looks great. ➢ In the next block recovery, no hypotheses survive.

Tail-Error Removal

24

slide-25
SLIDE 25

❖ Tail Errors: at the end of the block

➢ In the current block recovery, the correlation still looks great. ➢ In the next block recovery, no hypotheses survive.

❖ Roll Back: by half a block

  • nce no hypotheses survive in the current block recovery.

➢ tail errors in the final block ➝ exhaustive search

Tail-Error Removal

25

slide-26
SLIDE 26

A Toy Example: m = 5, n = 2, l = 5

26

slide-27
SLIDE 27

A Toy Example: m = 5, n = 2, l = 5

27

slide-28
SLIDE 28

❖ In-Depth CPA: inefficient and inaccurate

➢ every m coefficients mapped to only m samples ➢ the lack of data ➝ ineffective candidate pruning

Horizontal In-Depth CPA (HIDCPA)

28

slide-29
SLIDE 29

❖ In-Depth CPA: inefficient and inaccurate

➢ every m coefficients mapped to only m samples ➢ the lack of data ➝ ineffective candidate pruning

❖ Learn from horizontal attacks!

➢ Observe the calculation of . ➢ For l ≪ p, we have nearly l times as many data.

Horizontal In-Depth CPA (HIDCPA)

29

slide-30
SLIDE 30

A Real-World Example: m = 67, n = 6, l = 5

30

Tail Error The Top

slide-31
SLIDE 31

A Real-World Example: m = 67, n = 6, l = 5

31

The Middle

slide-32
SLIDE 32

A Real-World Example: m = 67, n = 6, l = 5

32

The Bottom Corrected

slide-33
SLIDE 33

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

33

  • Lejla Batina, Lukasz Chmielewski, Louiza Papachristodoulou, Peter Schwabe, and Michael Tunstall. Online Template Attacks.
slide-34
SLIDE 34

❖ What if the assumption of simple power models fails?

➢ Classical Correlation Attacks: the Hamming weight/distance models ➢ Classical Template Attacks: multivariate normal distribution

Template Attacks

34

slide-35
SLIDE 35

❖ What if the assumption of simple power models fails?

➢ Classical Correlation Attacks: the Hamming weight/distance models ➢ Classical Template Attacks: multivariate normal distribution

❖ The Profiling Stage

➢ numerous template traces + heavy computational power

Template Attacks

35

Can we mount template attacks with few template traces?

slide-36
SLIDE 36

Online Template Attacks (OTA)

36

Can we mount template attacks with fewer executions? Step: 1 2, 4, 6, ... 3, 5, 7, ...

slide-37
SLIDE 37

❖ Chosen-Input:

➢ enhancing the reusability of template traces

The Chosen-Input Offline Variant

37

slide-38
SLIDE 38

❖ Illegitimate Private Key: f* on the template generator

➢ generating all the required template traces within four executions ➢ and expressed as

The Chosen-Input Offline Variant

38

slide-39
SLIDE 39

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

39

  • Paul C. Kocher, Joshua Jaffe, and Benjamin Jun. Differential Power Analysis.
slide-40
SLIDE 40

Not Countermeasures

❖ Apply a random mask to each output coefficient.

➢ integer offsets added at the beginning and removed at the end

❖ Shuffle multiply-and-accumulates for each output coefficient.

➢ input-coefficient pairs accessed in a random order

40

  • Mun-Kyu Lee et al. Countermeasures against Power Analysis Attacks for the NTRU Public Key Cryptosystem.
slide-41
SLIDE 41

Not Countermeasures

❖ Apply a random mask to each output coefficient.

➢ integer offsets added at the beginning and removed at the end

❖ Shuffle multiply-and-accumulates for each output coefficient.

➢ input-coefficient pairs accessed in a random order

41

subject to chosen-input SPA (CISPA) subject to chosen-input SPA (CISPA)

slide-42
SLIDE 42

CISPA on Countermeasure 2

42

slide-43
SLIDE 43

❖ Two Stages: nonzero identification + clustering ❖ The First Stage: continuous? discontinuous?

➢ similar to CISPA on Countermeasure 2 ➢ Zero or Nonzero: output coefficient ➝ private-key coefficient

CISPA on Countermeasure 1

43

slide-44
SLIDE 44

❖ The Second Stage:

➢ knowing + observing the calculation

CISPA on Countermeasure 1

44

slide-45
SLIDE 45

❖ NTRU Prime ❖ A Brief Preview ❖ Correlation Power Analysis: vertical vs. horizontal in-depth ❖ Online Template Attacks ❖ Chosen-Input Simple Power Analysis ❖ Finale

Topics

45

slide-46
SLIDE 46

❖ Optimized Product Scanning

➢ Modular Reduction: per multiply-and-accumulate ➝ per calculation ➢ SMLABB ➝ SMLADX: two multiply-and-accumulates per instruction ➢ 4.4x faster / immune to OTA / still subject to HIDCPA and CISPA

Two Optimizations and One Countermeasure

46

  • Cortex-M4 Devices Generic User Guide. http://infocenter.arm.com/help/topic/com.arm.doc.dui0553b/DUI0553.pdf
slide-47
SLIDE 47

❖ Optimized Product Scanning

➢ Modular Reduction: per multiply-and-accumulate ➝ per calculation ➢ SMLABB ➝ SMLADX: two multiply-and-accumulates per instruction ➢ 4.4x faster / immune to OTA / still subject to HIDCPA and CISPA

❖ First-Order Masking: both inputs masked

➢ If the ciphertext not masked: horizontal CPA ➢ If the private key not masked: SPA or profiling attacks (potentially)

Two Optimizations and One Countermeasure

47

  • Stefan Mangard, Elisabeth Oswald, and Thomas Popp. Power Analysis Attacks - Revealing the Secrets of Smart Cards.
slide-48
SLIDE 48

❖ Single-Trace Power Analysis on the Product Scanning Method

➢ applicable to NTRU Prime Decap/Encap/KeyGen ➢ targeting the reference/protected/optimized implementations ➢ with short observation span, few template traces, or the naked eye

Conclusion

48

slide-49
SLIDE 49

❖ Single-Trace Power Analysis on the Product Scanning Method

➢ applicable to NTRU Prime Decap/Encap/KeyGen ➢ targeting the reference/protected/optimized implementations ➢ with short observation span, few template traces, or the naked eye

❖ Potential Applications

  • ther ideal-lattice-based cryptosystems with

➢ private/session-key coefficients from a small set of possibilities ➢ multi-level Karatsuba ending with the product scanning method

Conclusion

49

  • Anatolii Karatsuba. Multiplication of Multidigit Numbers on Automata.
slide-50
SLIDE 50

Q & A

50