Cryptanalysis of Ciphers and Protocols Elad Pinhas Barkan
Total Page:16
File Type:pdf, Size:1020Kb
Cryptanalysis of Ciphers and Protocols Elad Pinhas Barkan Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 Cryptanalysis of Ciphers and Protocols Research Thesis Submitted in partial fulfillment of the Requirements for the Degree of Doctor of Philosophy Elad Pinhas Barkan Submitted to the Senate of the Technion — Israel Institute of Technology Adar 5766 Haifa March 2006 Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 The research thesis was done under the supervision of Prof. Eli Biham in the Faculty of Computer Science. It is my privilege to thank Eli Biham for his insightful support that made this work possible, and for bringing me up as a scientist and researcher. I especially acknowledge Eli for his respect and trust, and for providing me with a very high degree of independence. Eli found the golden path among education, rigorousness, and care. His unique ability to quickly communicate anything in a personal (and sometimes playful) way always leaves me with a smile on my face. I am thankful to Adi Shamir for our fruitful collaboration, for being highly avail- able around the clock (and around the globe), and for his patience and his wisdom. I acknowledge Nathan Keller for his wonderful and helpful curiosity, and for being an amazing brainmaker. It is a pleasure to thank my colleagues at the Technion, Orr Dunkelman and Rafi Chen, for fruitful discussions and for the wonderful time we had together. I feel that no words can express my deep gratitude to my loving family, which gave me unconditional love, support, and understanding through the better and worse times of my research. Special thanks goes to my future wife Tamar Kashti for listening to all my research ideas during our many speed-walking, for her love, for her good advices and encouragement, and for being a great companion. The generous financial help of Technion is gratefully acknowledged. Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 Contents Abstract 1 1 Introduction 4 2 In How Many Ways Can You Write Rijndael? 11 2.1 Introduction . 11 2.2 Description of Rijndael . 14 2.3 Square Dual Ciphers . 16 2.4 Modifying the Polynomial . 20 2.5 Log Dual Ciphers . 22 2.6 Self-Dual Ciphers . 24 2.6.1 Higher-Order Self-Dual Cipher . 26 2.6.2 Cryptanalysis of Self-Dual Ciphers . 27 2.6.3 Application to BES . 28 2.7 Applications of Dual Ciphers . 29 2.8 Summary . 30 2.9 Appendix: The Affine Transformation of Rijndael and Rijndael2 . 31 2.10 Appendix: The Matrix Q ........................ 31 2.11 Appendix: The Matrix R ........................ 32 2.12 Appendix: Properties of the T (x) Transformation . 33 2.13 Appendix: How to Enumerate the Keys of Self-Dual Ciphers . 34 3 Instant Ciphertext-Only Cryptanalysis of GSM Encrypted Commu- nications 38 3.1 Introduction . 39 3.1.1 Executive Summary of the New Attacks . 41 3.1.2 Organization of this Chapter . 43 3.2 Description of A5/2 . 43 3.3 Known Plaintext Attacks on A5/2 . 46 i Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 3.3.1 Goldberg, Wagner, and Green’s Known Plaintext Attack on A5/2 ............................... 46 3.3.2 Our Non-Optimized Known-Plaintext Attack on A5/2 . 49 3.3.3 An Optimized Attack on A5/2 . 52 3.4 An Instant Ciphertext-Only Attack on A5/2 . 55 3.5 Withstanding Errors in the Reception . 57 3.6 A Passive Ciphertext-Only Cryptanalysis of A5/1 Encrypted Commu- nication . 60 3.7 Leveraging the Attacks to Any GSM Network by Active Attacks . 64 3.7.1 Class-Mark Attack . 66 3.7.2 Recovering Kc of Past or Future Conversations . 66 3.7.3 Man in the Middle Attack . 68 3.7.4 Attack on GPRS . 70 3.8 Possible Attack Scenarios . 71 3.8.1 Call Wire-Tapping . 71 3.8.2 Call Hijacking . 72 3.8.3 Altering of Data Messages (SMS) . 72 3.8.4 Call Theft — Dynamic Cloning . 72 3.9 How to Acquire a Specific Victim . 73 3.10 Summary . 75 3.11 Appendix: Enhancing The Attack of Goldberg, Wagner, and Green on GSM’s A5/2 to a Ciphertext-Only Attack . 76 3.12 Appendix: Technical Background on GSM . 78 3.12.1 GSM Call Establishment . 81 4 Conditional Estimators: an Effective Attack on A5/1 84 4.1 Introduction . 84 4.1.1 Previous Correlation Attacks on A5/1 . 85 4.1.2 Our Contribution . 86 4.1.3 Organization of the Chapter . 87 4.2 A Description of A5/1 . 87 4.3 Notations and Previous Works . 89 4.4 The New Observations . 92 4.4.1 The New Correlation — Conditional Estimators . 92 4.4.2 First Weakness of R2 — the Alignment Property . 93 4.4.3 Second Weakness of R2 — the Folding Property . 94 4.4.4 Third Weakness of R2 — the Symmetry Property . 95 4.5 The New Attack . 96 ii Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 4.5.1 Step 2 — Decoding of Estimators . 97 4.6 Simulations of our Attacks . 101 4.6.1 Early Filtering . 103 4.6.2 Improved Estimators . 103 4.7 A New Source for Known-Keystream . 103 4.8 Summary . 104 4.9 Appendix: Overview of Step 2 and Step 3 of Maximov, Johansson, and Babbage’s Attack . 105 4.10 Appendix: Fast Calculation of funcl2,s1 [x] . 106 4.11 Appendix: Calculating Conditional Estimators . 107 4.12 Appendix: Step 3 — Recovering the Third Register . 114 4.12.1 Alternative Step 3 Using the Ten Zero Bits of Kc . 115 5 Rigorous Bounds on Cryptanalytic Time/Memory Tradeoffs 116 5.1 Introduction . 116 5.1.1 Previous Work . 117 5.1.2 The Contribution of This Chapter . 118 5.1.3 Structure of the Chapter . 120 5.2 The Stateful Random Graph Model . 120 5.2.1 Coverage Types and Collisions of Paths in the Stateful Random Graph . 124 5.3 A Rigorous Upper Bound on the Maximum Possible Net Coverage of M Chains in a Stateful Random Graph . 125 5.3.1 Reducing the Best Choice of Start Points to the Average Case 126 5.3.2 Bounding Prob(Wi,j = 1) . 127 5.3.3 Concluding the Proof . 131 5.4 A Lower Bound for S ..........................132 5.5 A Lower Bound on the Time Complexity . 132 5.5.1 A Lower Bound on the Time Complexity of Cryptanalytic Time/Memory/Data Tradeoffs . 134 5.6 Notes on Rainbow-Like Schemes . 134 5.6.1 A Note on the Rainbow Scheme . 134 5.6.2 Notes on Rainbow Time/Memory/Data Tradeoffs . 135 5.7 Summary . 136 5.8 Appendix: A Time/Memory Tradeoff with Hidden State that Depends Only on the Previous Values in the Chain 136 iii Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 5.9 Appendix: Stretching Distinguished Points — A Time/Memory Trade- off Scheme with a Deeper Preprocessing . 137 5.10 Appendix: Time Complexity of Hellman Versus Rainbow . 140 5.11 Appendix: Analysis of the New Cryptanalytic Time/Memory/Data Tradeoffs . 141 5.11.1 Trivial Rainbow Time/Memory/Data Tradeoff: TM 2D = N 2 ...........................141 5.11.2 Thin-Rainbow Time/Memory/Data Tradeoff: TM 2D2 = N 2 ..........................141 5.11.3 Fuzzy-Rainbow Time/Memory/Data Tradeoff: 2TM 2D2 = N 2 + ND2M ....................142 5.11.4 Analysis of the Matrix Stop Rule in the Modified Rainbow Scheme . 143 5.11.5 Notes . 144 5.12 Appendix: Extended Coverage Theorem . 145 A Introduction to some of the Contemporary Methods of Cryptanal- ysis 148 A.1 Introduction to Differential Cryptanalysis . 148 A.1.1 Simple Examples . 148 A.2 Introduction to Linear Cryptanalysis . 150 A.2.1 Simple Examples . 151 A.3 Time Memory Tradeoffs . 153 A.4 Algebraic Attacks . 157 A.4.1 Linearization . 158 A.4.2 Relinearization . 159 A.4.3 The XL Method . 160 A.5 Introduction to Stream Ciphers and Their Analysis . 161 A.6 Correlation Attacks . 162 A.7 Time/Memory/Data Tradeoff for Stream Ciphers . 163 Bibliography 166 Abstract in Hebrew f iv Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 List of Tables 2.1 The Table T (x) with Generator 03x and Irreducible Polynomial 11Bx (Rijndael) . 35 2.2 The Element Cycles Under the Squaring Operation . 36 2.3 The Key Cycles Under the Squaring Operation . 37 3.1 Four Points on the Time/Memory/Data Tradeoff Curve for a Ciphertext- Only attack on A5/1 . 62 4.1 Comparison Between Our Attacks and Passive Attacks of Previous Works . 102 4.2 A Comparison of Distribution Tables for d = 4 . 108 4.3 The Pattern Table for d = 4 and the Frame Clock Symbol 00112 . 112 4.4 The United Pattern Table for d = 4 and the Frame Clock Symbol 00112 113 5.1 Experiments Results of the Stretching Algorithm . 140 v Technion - Computer Science Department - Ph.D. Thesis PHD-2006-04 - 2006 List of Figures 3.1 The Internal Structure of A5/2 . 44 3.2 The Key Setup of A5/2 . 45 3.3 The Man-in-the-Middle Attack . 68 3.4 A TDMA frame . 78 3.5 The coding of COUNT . 79 3.6 The SDCCH/8 channel — downlink. 80 3.7 The SDCCH/8 channel — uplink.