Simple Power Analysis of

Slides:



Advertisements
Similar presentations
Side-Channel Attacks on RSA with CRT Weakness of RSA Alexander Kozak Jared Vanderbeck.
Advertisements

Randomized Signed-Scalar Multiplication of ECC to Resist Power Attacks JaeCheol Ha * and SangJae Moon ** * Korea Nazarene University **
Is there Safety in Numbers against Side Channel Leakage? Colin D. Walter UMIST, Manchester, UK
C ● O ● M ● O ● D ● O RESEARCH LAB Longer Keys may Facilitate Side Channel Attacks (Bradford, UK) Colin.
C. Walter, Data Integrity for Modular Arithmetic, CHES 2000 CHES 2000 Data Integrity in Hardware for Modular Arithmetic Colin Walter Computation Department,
11 -1 Chapter 11 Randomized Algorithms Randomized algorithms In a randomized algorithm (probabilistic algorithm), we make some random choices.
Long Modular Multiplication for Cryptographic Applications Laszlo Hars Seagate Research Workshop on Cryptographic Hardware and Embedded Systems, CHES 2004.
Data Structures and Algorithm Analysis Hashing Lecturer: Jing Liu Homepage:
Issues of Security with the Oswald-Aigner Exponentiation Algorithm Colin D Walter Comodo Research Lab, Bradford, UK Colin D Walter.
9th IMA Conference on Cryptography & Coding Dec 2003 More Detail for a Combined Timing and Power Attack against Implementations of RSA Werner Schindler.
Digital Signatures A primer 1. Why public key cryptography? With secret key algorithms Number of key pairs to be generated is extremely large If there.
11 -1 Chapter 11 Randomized Algorithms Randomized Algorithms In a randomized algorithm (probabilistic algorithm), we make some random choices.
Hashing Sections 10.2 – 10.3 CS 302 Dr. George Bebis.
Some Security Aspects of the Randomized Exponentiation Algorithm (Bradford, UK) Colin D. Walter M IST.
Sliding Windows Succumbs to Big Mac Attack Colin D. Walter
Precise Bounds for Montgomery Modular Multiplication and Some Potentially Insecure RSA Moduli Colin D. Walter formerly: (Manchester,
M IST : An Efficient, Randomized Exponentiation Algorithm for Resisting Power Analysis Colin D. Walter formerly: (Manchester, UK)
IEEE ARITH 17 Cape Cod, 27th – 29th June 2005 Data Dependent Power Use in Multipliers Colin D. Walter David Samyde
M IST : An Efficient, Randomized Exponentiation Algorithm for Resisting Power Analysis Colin D. Walter (Manchester, UK)
Precise Bounds for Montgomery Modular Multiplication and Some Potentially Insecure RSA Moduli Colin D. Walter formerly: (Manchester,
CS519, © A.SelcukDifferential & Linear Cryptanalysis1 CS 519 Cryptography and Network Security Instructor: Ali Aydin Selcuk.
1/16 Seeing through M IST given a Small Fraction of an RSA Private Key Colin D. Walter Comodo Research Lab (Bradford, UK)
WISA 2007 Jeju Island, Korea, 27th – 29th Aug 2007 Longer Randomly Blinded RSA Keys may be Weaker than Shorter Ones Colin D. Walter
In The Name of Allah Fault attacks on ECC
Implementation of Public Key Encryption Algorithms
Cryptography services Lecturer: Dr. Peter Soreanu Students: Raed Awad Ahmad Abdalhalim
@Yuan Xue CS 285 Network Security Public-Key Cryptography Yuan Xue Fall 2012.
Known-Plaintext-Only Attack on RSA-CRT with Montgomerry Multiplication
Greedy Algorithms.
Public Key Encryption Major topics The RSA scheme was devised in 1978
D. Cheung – IQC/UWaterloo, Canada D. K. Pradhan – UBristol, UK
PV204 Security technologies
Advanced Information Security 6 Side Channel Attacks
On the Size of Pairing-based Non-interactive Arguments
PUBLIC-KEY ENCRYPTION Focusing on RSA
CS 332: Algorithms Hash Tables David Luebke /19/2018.
May 2008 Prepared by Dr. Abdulrahman Awadhi
Cryptography, part 2.
A way to detect a collision…
C ODEBREAKER Class discussion.
Public Key Cryptosystems - RSA
Chapter 5 Sampling Distributions
Topic 14: Random Oracle Model, Hashing Applications
Chapter 5 Sampling Distributions
Digital Signature Schemes and the Random Oracle Model
Cryptographic Hash Functions Part I
Cryptography Lecture 4.
Distinguishing Exponent Digits by Observing Modular Subtractions
Digital Signature Schemes and the Random Oracle Model
CSE 2331/5331 Topic 8: Hash Tables CSE 2331/5331.
Unit-2 Divide and Conquer
Randomized Algorithms
Reasoning in Psychology Using Statistics
Hashing Sections 10.2 – 10.3 Lecture 26 CS302 Data Structures
Cryptographic Hash Functions Part I
Psych 231: Research Methods in Psychology
One Way Functions Motivation Complexity Theory Review, Motivation
Hard Problems Some problems are hard to solve.
Breaking the Liardet-Smart Randomized Exponentiation Algorithm
CS 3343: Analysis of Algorithms
Cryptography Lecture 16.
Data Structures and Algorithm Analysis Hashing
Cryptography Lecture 18.
DATA STRUCTURES-COLLISION TECHNIQUES
Randomised Algorithms for Reducing Side Channel Leakage
Colin D. Walter Comodo CA, Bradford, UK
DATA STRUCTURES-COLLISION TECHNIQUES
Some Security Aspects of the Randomized Exponentiation Algorithm
Collision Resolution: Open Addressing Extendible Hashing
Evaluation David Kauchak CS 158 – Fall 2019.
Presentation transcript:

Simple Power Analysis of Unified Code for ECC Double and Add Colin D. Walter Colin.Walter@comodo.com

Overview Aims History A Leaky Mod Mult Algorithm Unified Code for Add/Double Choosing “good” Initial Points Simulation Results: Example Counter-Measures Conclusion

Aims I The aim is to question possible mis-conceptions about: the strength of SPA/DPA counter-measures the uniformity of leakage over the input space Investigate which combinations of the following counter- measures do not guarantee a high degree of tamper resistance? Unified code for ECC Add and Double Coron’s 3 standard Blinding Counter-measures Constant-time code Double and always add point multiplication etc

Aims II Here we assume the following counter-measures: Brier-Joye Unified code for ECC Add and Double Coron’s 3 standard Blinding Counter-measures and we assume the following set-up: Leaky Modular Multiplication with reasonable probability of detecting if two given products have identical arguments. Standard square-and-multiply exponentiation algorithm We will conclude that secret keys may sometimes be recovered. It may not be sufficient to upgrade SW on old HW Some inputs leak more than others A single use of a key (as in ECDSA) may be unsafe.

History Occasional refs in patents: Kocher et al (CRYPTO 1996, 1999): To ensure that the data carrier consumes the same amount of current whether the requested operation is authorized or unauthorized, a bit is stored in the memory in either event. [Abstract, US Patent 4211919, filed Aug 1978] Kocher et al (CRYPTO 1996, 1999): Timing and Power Attacks on smart cards – the concepts. Coron (CHES 1999): Lists three standard randomising counter-measures for ECC. Brier & Joye (PKC 2002): Unified code for Double & Add. Here: The above counter-measures are sometimes insufficient.

Leaky HW Modr Multn (here: Montgomery) Notation: r = base of representation; R = rn = Montgomery factor. { Pre-condition: 0 £ A < R = rn } P ¬ 0 ; For i ¬ 0 to n-1 do Begin q ¬ (p0+aib0)(–m0–1) mod r ; P ¬ (P + aiB + qM) div r ; End ; If P ≥ M then P ¬ P–M ; (Leaky!) { Post-condition: Prn º A×B mod M }

Main Assumptions There is a side channel “oracle” which says when the conditional subtraction occurs. Standard l-to-r “Square-and-Multiply” expn is used. The correctness of secret key d can be checked. (Knowledge of I/O to the expn routine is not assumed.) Use of the Brier-Joye Unified Code for ECC Double and Add:

Brier-Joye Formulae Suppose Pi = (xi,yi,zi) and P3 = P1 + P2 for ECC over Fp. P3 is given by (same code for Add and Double): x3 = ... y3 = ... z3 = ... where u1 = x1z2 ; u2 = x2z1 ; s1 = y1z2 ; s2 = y2z1 ; ... If P1 = P2 then the same formula applies, and: u1 = x1z2 and u2 = x2z1 are the same computation, s1 = y1z2 and s2 = y2z1 are the same computation. So Mod Mult will produce two pairs of identical leakage.

Attack Idea Choose a signing where there are fewest undetermined ops. Different behaviour in one or both pairs → Pt Add Identical behaviour in both pairs → probably Pt Double An operation next to an Add must be a Double. Choose a signing where there are fewest undetermined ops. Try all possibilities for the key, the most likely first.

Some Probabilities Montgomery Mod Mult (MMM) was picked for illustration because it is well-understood. Prob of final conditional subtraction mod P : Multiplication by const C: pC = ½ Cr–n General Multiplication: pM = ¼ Pr–n ≈ ¼ (for EC-DSA, characteristic = gend Mersenne prime P ≈ r–n) For square and multiply to compute kP1, the same pt P1 is re-used every time. So use pC = ½ Cr–n.

Optimal Initial Points For randomly blinded inputs, some P1 = (x1,y1,z1) will have small x1 & y1, and large z1. So, for random P2, u1 = x1z2 and s1 = y1z2 have condl subn with pr ≈ 0 u2 = x2z1 and s2 = y2z1 have condl subn with pr ≈ ½ This maximises the proby of distinguishing u1 from u2 or s1 from s2 This maximises the proby of deducing a Point Add (≈ ¾) This maximises the number of pt ops we can determine for a given secret key.

Optimal Keys For randomly blinded keys k, there are cases where more set bits means fewer undetermined ops. For some keys, the spacing of undetermined ops leads to a smaller search space, e.g. 3 undetermined ops might lead to 8 choices; but 3 neighbouring ops must have a pattern: DDD, ADD, DAD, DDA or ADA – only 5 choices.

Example – Simulation Results Key 1 1 1 0 0 1 0 0 1 0 0 100 1 1 100 1… Pt Opn DA DA D D DA D D DA D DDADDDADADADDDA… u1 subn 01 01 0 1 00 0 0 11 0 011000101010100… u2 subn 01 00 0 1 01 0 0 11 0 010000001000100… s1 subn 00 00 1 0 00 1 1 10 0 101000011110000… s2 subn 01 01 1 0 00 1 1 10 0 101000110100001… Diffnce Y Y Y Y Y Y Y Y… Known YY YY Y N YY Y N NN N NYYYNYYYYYYYNYY…

Computational Feasibility EC-DSA curve P-192, sample of 512 signings: Lowest #unknown adds: 19 (on average) Search Space: 217.6 keys Effort (including key test): 1 minute on Pentium IV (less if I/O data is collected during side channel attack) This, and hence the attack, is computationally feasible. With 10n times the effort, 2n keys can be extracted. (for small n at least)

Counter-Measures The attack depends on: Leaky Modular Multiplier to help distinguish Add from Double; Exponentiation algorithm that reveals key from distinguishing Add from Double; Good randomisation / blinding – as in Coron’s counter-measures! So: Choose a more robust expn algorithm. If possible, choose less leaky HW

Conclusion Many essential and first-class SW counter-measures can be inadequate on their own. In particular, improving SW is probably not enough to fix existing leaky HW. Some keys can leak more than others. Keys used just once may be attacked. Randomisation may improve the chances of a successful attack.