Online Template Attack on ECDSA: Extracting Keys Via The Other Side - - PowerPoint PPT Presentation

online template attack on ecdsa
SMART_READER_LITE
LIVE PREVIEW

Online Template Attack on ECDSA: Extracting Keys Via The Other Side - - PowerPoint PPT Presentation

Online Template Attack on ECDSA: Extracting Keys Via The Other Side By: Niels Roelofs, Niels Samwel, Lejla Batina and Joan Daemen Africacrypt Conference 2020 July 2020 Side Channel Attack Introduction A side-channel is any unintentional


slide-1
SLIDE 1

Online Template Attack on ECDSA:

By: Niels Roelofs, Niels Samwel, Lejla Batina and Joan Daemen Africacrypt Conference 2020 July 2020

Extracting Keys Via The Other Side

slide-2
SLIDE 2

Side Channel Attack Introduction

  • “A side-channel is any unintentional signal that can offer us a blurry view of the

algorithms internal computations”*

  • Attack implementation of some algorithm, not algorithm itself

2

Message Device Signed message Leakage

*Quote source: Introduction to Side-Channel Analysis: Basic Concepts and Techniques, L. Batina, March 2018, Hardware Security Lecture Notes

slide-3
SLIDE 3

Content

  • Part 1: Background

– Cryptographic

  • ECDSA

✴ Sign ✴ Verify

  • Scalar Multiplication Algorithms

✴ Double And Add ✴ Montgomery Ladder ✴ Scalar Multiplication Optimization Tricks

  • Power Consumption Analysis
  • Online Template Attack
  • Part 2: The Attack

3

slide-4
SLIDE 4

Part 1

4

Background

slide-5
SLIDE 5

ECDSA-Sign

5

slide-6
SLIDE 6

ECDSA-Verify

6

slide-7
SLIDE 7

Elliptic Curve Scalar Multiplication: Double And Add

7

slide-8
SLIDE 8

Elliptic Curve Scalar Multiplication: Montgomery Ladder

8

slide-9
SLIDE 9

Scalar Multiplication Optimization Tricks

  • Projective coordinates:

– Homogeneous coordinates

  • – Jacobian coordinates
  • 9

Image Source: 18.783 Elliptic Curves Lecture, A Sutherland, February 2017

slide-10
SLIDE 10

Scalar Multiplication Optimization Tricks

  • Projective coordinates:

– Homogeneous coordinates

  • – Jacobian coordinates
  • 10
  • During signature verification:

– Non-Adjacent Form (NAF)

  • 7 = (1,0,0,-1)

– Shamir’s trick

  • 1 pre-computation
slide-11
SLIDE 11

Scalar Multiplication Optimization Tricks

  • Projective coordinates:

– Homogeneous coordinates

  • – Jacobian coordinates
  • 10
  • During signature verification:

– Non-Adjacent Form (NAF)

  • 7 = (1,0,0,-1)

– Shamir’s trick

  • 1 pre-computation
slide-12
SLIDE 12

Scalar Multiplication Optimization Tricks

  • Projective coordinates:

– Homogeneous coordinates

  • – Jacobian coordinates
  • 10
  • During signature verification:

– Non-Adjacent Form (NAF)

  • 7 = (1,0,0,-1)

– Shamir’s trick

  • 1 pre-computation
slide-13
SLIDE 13

Power Consumption Analysis

  • Template attack
  • Two identical devices
  • Build profiles
  • Match with target trace
  • Cumbersome

11

slide-14
SLIDE 14

Online Template Attack

  • Based on template attack
  • Templates on the fly
  • Max two templates per bit

12

slide-15
SLIDE 15

Online Template Attack

  • Based on template attack
  • Templates on the fly
  • Max two templates per bit

13

slide-16
SLIDE 16

Online Template Attack

  • Based on template attack
  • Templates on the fly
  • Max two templates per bit

14

  • Differentiate
  • (2n)P
  • (2n+1)P
slide-17
SLIDE 17

Part 2

The Attack

15

slide-18
SLIDE 18

Scenario

  • One device
  • One ECDSA signature generation
  • Standard projective coordinates
  • Montgomery ladder
  • Unlimited amount of signature verifications
  • On same device as the signature generated
  • Jacobian coordinates
  • Variant of double and add

16

slide-19
SLIDE 19

Scenario

  • One device
  • One ECDSA signature generation
  • Standard projective coordinates
  • Montgomery ladder
  • Unlimited amount of signature verifications
  • On same device as the signature generated
  • Jacobian coordinates
  • Variant of double and add

17

  • Goal: extract secret scalar via

ECDSA signature verification

slide-20
SLIDE 20

Platform

18

ChipWhisperer-Lite Classic

slide-21
SLIDE 21

Spotting The Attack Vector (1)

19

slide-22
SLIDE 22

Spotting The Attack Vector (1)

19

slide-23
SLIDE 23

Spotting The Attack Vector (1)

19

slide-24
SLIDE 24

Spotting The Attack Vector (2)

Sign Verify

20

slide-25
SLIDE 25

Spotting The Attack Vector (2)

21

slide-26
SLIDE 26

Spotting The Attack Vector (2)

22

slide-27
SLIDE 27

Spotting The Attack Vector (2)

23

slide-28
SLIDE 28

Spotting The Attack Vector (2)

23

Identical key dependent operation in the Montgommery ladder can be mimicked in the publicly accessible Jacobian doubling operation!

slide-29
SLIDE 29

Preparing The Input

  • Compute possible values

24

Montgomery Double and add Sign Verify Standard projective Jacobian

slide-30
SLIDE 30

Preparing The Input

  • Compute possible values
  • Feed legitimate point on curve

25

Montgomery Double and add Sign Verify Standard projective Jacobian

slide-31
SLIDE 31

Preparing The Input

  • Compute possible values
  • Feed legitimate point on curve

– Bit flipping

  • …1010 -> …1011
  • …1010 -> …1000

26

Montgomery Double and add Sign Verify Standard projective Jacobian

slide-32
SLIDE 32

Measuring

27

slide-33
SLIDE 33

Extracting Bits (1)

  • Window resampling (to increase correlation computations)
  • Calculate Pearson correlation between:

– Relevant square operation in target trace – Square operation in both templates

28

slide-34
SLIDE 34

Extracting Bits (2)

29

After the correlation calculation, the template trace with the higher value is considered to represent the correct bit value.

slide-35
SLIDE 35

Countermeasure

  • Randomized projective coordinates

– While signing – No longer build meaningful templates

30

slide-36
SLIDE 36

Implications

  • Attack successful on realistic implementation
  • Key extraction via ECDSA verification algorithm on the same device
  • Different scalar multiplications methods for signing and verification
  • Puts portability discussion in perspective
  • Simple countermeasure effective

– Standard implemented in big crypto libraries – However, not always supported by hardware

31