On the Security of Pairing Implementations Ronan Lashermes
Total Page:16
File Type:pdf, Size:1020Kb
On the security of pairing implementations Ronan Lashermes To cite this version: Ronan Lashermes. On the security of pairing implementations. Cryptography and Security [cs.CR]. Université de Versailles-Saint Quentin en Yvelines, 2014. English. NNT : 2014VERS0021. tel- 01128871 HAL Id: tel-01128871 https://tel.archives-ouvertes.fr/tel-01128871 Submitted on 10 Mar 2015 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. Ecole´ doctorale Sciences et Technologies de Versailles - STV - ED 539 Etude´ de la s´ecurit´edes impl´ementations de couplage On the security of pairing implementations THESE` pr´esent´eeet soutenue publiquement le 29 Septembre 2014 pour le grade de Docteur de l'Universit´ede Versailles St-Quentin-en-Yvelines (sp´ecialit´einformatique) par Ronan Lashermes Composition du jury Rapporteurs : Antoine Joux, UPMC Jean-Pierre Seifert, TU-Berlin Examinateurs : Pierre-Alain Fouque, Universit´eRennes 1 Jacques Fournier, CEA-Tech Daniel Page, University of Bristol Directeur de th`ese: Louis Goubin, UVSQ Laboratoire Parall´elisme,R´eseaux,Syst`emeset Mod´elisationPRiSM { UMR 8144 | CEA-Tech Uses a latex class derived from thesul. Acronyms ABE Attribute-Based Encryption. 10, 41 AES Advanced Encryption Standard. 2, 3, 5, 47 BDH Bilinear Diffie-Hellman. 42, 49, 127, 128, 131 BLS Barreto-Lynn-Scott. 34, 35 BN Barreto-Naehrig. 6, 32, 34, 35, 38, 43, 44, 48, 57, 60, 61, 63, 72, 109, 122, 123, 125, 131, 133, 134, 136, 150 CDH Computational Diffie-Hellman. 42, 127 CM Complex Multiplication. 33 DDH Decisional Diffie-Hellman. 42, 127 DEM Dupont-Enge-Morain. 33 DES Data Encryption Standard. 2 DFA Differential Fault Attack. 6 DLP Discrete Logarithm Problem. 4, 5, 34, 42, 43, 123, 127, 128 ECB Electronic Code Book. 5 ECC Elliptic Curves Cryptography. 3, 4 ECDLP Elliptic Curve Discrete Logarithm Problem. 3–5, 34, 42, 43, 123, 127, 128 EM Electromagnetic. 6, 46, 48–52, 57, 68, 78, 92, 94, 101, 109, 110, 129–132, 139, 148, 150, 151 FA Fault Attack. 46, 59, 78, 79, 101, 110, 129, 151 FE Final Exponentiation. 38, 44, 79–82, 84, 87, 92, 98, 100, 101, 107, 109, 110, 141, 142, 144, 145, 148, 150, 151 FIB Focused Ion Beam. 6 GMV Galbraith-McKee-Valença. 34 HIBE Hierarchical Identity-Based Encryption. 10, 40, 41 i ii Acronyms IBE Identity-Based Encryption. 4, 6, 10, 39–41, 49, 59, 126, 131 KSS Kachisa-Schaefer-Scott. 34, 35 MA Miller Algorithm. 44, 79, 87, 101, 110, 141, 150 MNT Miyaji-Nakabayashi-Takano. 33–35 PBC Pairing-Based Cryptography. 4, 6, 10, 42, 109, 110, 127, 128, 150 PC Personal Computer. 48, 101, 102, 131 PKC Public-key cryptography. 1–4 PKG Private Key Generator. 39–41, 126, 127 PKI Public-Key Infrastructure. 39, 126 RAM Random Access Memory. 47, 49, 52, 94, 131 RNS Residue Number System. 16 ROM Read-Only Memory. 49, 131 SCA Side-Channels Analysis. 6, 46, 101, 110, 129, 140, 151 USB Universal Serial Bus. 48 XOR eXclusive OR. 13, 47 List of Figures 2.1 Algorithm for the Final Exponentiation (FE) in Fp12 . x is a public parameter of the curve. 38 3.1 Electromagnetic (EM) bench scheme for fault injection. 50 3.2 Zoom on the EM probe. 50 3.3 Scales for the chip, the probe and the vulnerable surface. 52 3.4 Coarse XY mapping with AMP = −210 V. Red (light) if the fault injection raised an interrupt, blue (dark) when an undetected fault has been created. 53 3.5 Coarse and fine-grained XY mappings scales. 54 3.6 Fine-grained XY mapping. Red (light) if the fault injection raised an interrupt, blue (dark) when an undetected fault has been created. 54 3.7 Y coordinate versus AMP at X =131 200 µm. Red (light) if the fault injection raised an interrupt, blue (dark) when an undetected fault has been created. 55 3.8 AMP versus DELAY. Red (light) if the fault injection raised an interrupt, blue (dark) when an undetected fault has been created. 55 3.9 AMP versus Y coordinate. Red (light) if the fault injection raised an interrupt, blue (dark) when an undetected fault has been created. The X scale is different since this experiment was done during a campaign different from the others. 56 5.1 First fault location in the FE. 81 5.2 Second fault location in the FE. 84 5.3 e1 fault location. 89 5.4 e2,e3 fault locations. 90 5.5 e4,e5,e6 fault locations. 91 6.1 Upgraded EM bench scheme. 102 iii iv List of Figures List of Tables 2.1 Asymptotic complexities of modular multiplication algorithms . 16 2.2 Cost for the quadratic extension. 18 2.3 Cost for the cubic extension. 20 2.4 Cost for the tower extension 2 · 2 · 3.......................... 20 2.5 Cost for the tower extension 2 · 3 · 2.......................... 20 2.6 Cost for the tower extension 3 · 2 · 2.......................... 21 2.7 Cyclotomic polynomials . 37 2.8 Computation time vs security level. 44 3.1 Number of calls to Fp primitive operations in our implementation. 49 6.1 Statistics for a fault on Miller only (total: 50 injections). AMP: −190 V, DELAY: 235.6 ns ......................................... 104 6.2 Statistics for a fault on the Final Exponetiation (fault on f1, total: 50 injections). AMP: −150 V, DELAY: 329 ns............................ 104 6.3 Statistics for a double fault injection (total: 650 injections). 104 v vi List of Tables Contents Acronyms i List of Figures iii List of Tables v 1 General introduction 1 1.1 Introduction to cryptography . .2 1.1.1 Symmetric-key cryptography . .2 1.1.2 Public-key cryptography . .2 1.2 Introduction to cryptanalysis . .4 1.2.1 Classical cryptanalysis . .4 1.2.2 Physical attacks . .5 1.3 In this thesis . .6 2 The design of a pairing based crypto-system 9 2.1 Mathematical background . 10 2.1.1 Algebra basics . 10 2.1.2 Functions . 11 2.1.3 Equivalence relations and classes . 12 2.2 Finite fields . 12 2.2.1 Definitions . 12 2.2.2 Computations over finite fields . 13 2.3 Extension fields . 16 2.3.1 Definitions . 16 2.3.2 Computations on quadratic extensions [BGDM+10] . 17 2.3.3 Computations on cubic extensions [BGDM+10] . 18 2.3.4 Example: constructing tower extensions for Fp12 .............. 19 2.4 Elliptic curves . 21 2.4.1 Definitions . 21 vii viii Contents 2.4.2 Operations on an elliptic curve . 22 2.4.3 r-torsion . 27 2.4.4 Twists of elliptic curves . 27 2.5 Pairings . 28 2.5.1 Divisors . 28 2.5.2 Definitions . 29 2.5.3 Weil pairing . 30 2.5.4 Tate pairing . 31 2.5.5 Ate pairing [HSV06] . 31 2.5.6 Optimal Ate (OATE) pairing [Ver10] . 32 2.5.7 Families of elliptic curves for pairings . 33 2.6 Miller algorithm . 35 2.7 Final exponentiation for Tate-like pairings . 36 2.7.1 Basic method . 37 2.7.2 Other methods . 38 2.8 Protocols for PBC . 39 2.8.1 One round tripartite key exchange . 39 2.8.2 Identity-Based Encryption (IBE) [BF01] . 39 2.8.3 Hierarchical Identity-Based Encryption (HIBE) . 40 2.8.4 Attribute-Based Encryption (ABE) . 41 2.9 Cryptanalysis of pairing based cryptography . 42 2.9.1 Cryptographic problems . 42 2.9.2 Cryptanalysis and Pairing-Based Cryptography (PBC) . 43 2.10 Conclusion . 44 3 Setting up fault attacks against PBC 45 3.1 Physical attacks . 46 3.1.1 Physical attack techniques . 46 3.1.2 Fault models . 46 3.1.3 Examples of fault attacks . 47 3.2 Setting-up the EM bench for injecting faults . 48 3.2.1 Device Under Test . 48 3.2.2 Targeted program . 48 3.2.3 Targeted protocol . 49 3.2.4 Apparatus . 49 3.2.5 Preliminary experiments . 51 3.3 Conclusion . 57 ix 4 Fault attacks on the Miller algorithm 59 4.1 Theoretical fault attacks on the Miller algorithm . 61 4.1.1 Data-flow attacks on the Miller algorithm . 61 4.1.2 Control-flow attacks on the Miller algorithm . 62 4.1.3 How to find the secret . 64 4.2 Practical fault attacks on the Miller algorithm . 68 4.3 Countermeasures to protect the Miller algorithm . 73 4.3.1 Countermeasures in the literature . 73 4.3.2 Evaluating the countermeasures . 74 4.4 Conclusion . 78 5 Fault attacks on the Final Exponentiation 79 5.1 A fault attack to.