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 signal that can offer us a blurry view of the algorithms internal computations” * • Attack implementation of some algorithm, not algorithm itself Message Device Signed message Leakage *Quote source: Introduction to Side-Channel Analysis: Basic Concepts and Techniques, L. Batina, March 2018, Hardware Security Lecture Notes 2
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
Part 1 Background 4
ECDSA-Sign 5
ECDSA-Verify 6
Elliptic Curve Scalar Multiplication: Double And Add 7
Elliptic Curve Scalar Multiplication: Montgomery Ladder 8
Scalar Multiplication Optimization Tricks • Projective coordinates: – Homogeneous coordinates ‣ – Jacobian coordinates ‣ Image Source: 18.783 Elliptic Curves Lecture, A Sutherland, February 2017 9
Scalar Multiplication Optimization Tricks • Projective coordinates: – Homogeneous coordinates ‣ – Jacobian coordinates ‣ • During signature verification: – Non-Adjacent Form (NAF) ‣ 7 = (1,0,0,-1) – Shamir’s trick ‣ 1 pre-computation 10
Scalar Multiplication Optimization Tricks • Projective coordinates: – Homogeneous coordinates ‣ – Jacobian coordinates ‣ • During signature verification: – Non-Adjacent Form (NAF) ‣ 7 = (1,0,0,-1) – Shamir’s trick ‣ 1 pre-computation 10
Scalar Multiplication Optimization Tricks • Projective coordinates: – Homogeneous coordinates ‣ – Jacobian coordinates ‣ • During signature verification: – Non-Adjacent Form (NAF) ‣ 7 = (1,0,0,-1) – Shamir’s trick ‣ 1 pre-computation 10
Power Consumption Analysis • Template attack - Two identical devices - Build profiles - Match with target trace - Cumbersome 11
Online Template Attack • Based on template attack • Templates on the fly • Max two templates per bit 12
Online Template Attack • Based on template attack • Templates on the fly • Max two templates per bit 13
Online Template Attack • Based on template attack • Templates on the fly • Max two templates per bit • Differentiate - (2n)P - (2n+1)P 14
Part 2 The Attack 15
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
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 • Goal: extract secret scalar via ECDSA signature verification 17
Platform ChipWhisperer-Lite Classic 18
Spotting The Attack Vector (1) 19
Spotting The Attack Vector (1) 19
Spotting The Attack Vector (1) 19
Spotting The Attack Vector (2) Sign Verify 20
Spotting The Attack Vector (2) 21
Spotting The Attack Vector (2) 22
Spotting The Attack Vector (2) 23
Spotting The Attack Vector (2) Identical key dependent operation in the Montgommery ladder can be mimicked in the publicly accessible Jacobian doubling operation! 23
Sign Verify Preparing The Input Montgomery Double and add Standard projective Jacobian • Compute possible values 24
Sign Verify Preparing The Input Montgomery Double and add Standard projective Jacobian • Compute possible values • Feed legitimate point on curve 25
Sign Verify Preparing The Input Montgomery Double and add Standard projective Jacobian • Compute possible values • Feed legitimate point on curve – Bit flipping ‣ …1010 -> …1011 ‣ …1010 -> …1000 26
Measuring 27
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
Extracting Bits (2) After the correlation calculation, the template trace with the higher value is considered to represent the correct bit value. 29
Countermeasure • Randomized projective coordinates – While signing – No longer build meaningful templates 30
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
Recommend
More recommend