Design and Analysis of Lightweight Block Ciphers : a Focus on the Linear
Total Page:16
File Type:pdf, Size:1020Kb
Design and Analysis of Lightweight Block Ciphers: A Focus on the Linear Layer Christof Beierle Doctoral Dissertation Faculty of Mathematics Ruhr-Universit¨atBochum December 2017 Design and Analysis of Lightweight Block Ciphers: A Focus on the Linear Layer vorgelegt von Christof Beierle Dissertation zur Erlangung des Doktorgrades der Naturwissenschaften an der Fakult¨atf¨urMathematik der Ruhr-Universit¨atBochum Dezember 2017 First reviewer: Prof. Dr. Gregor Leander Second reviewer: Prof. Dr. Alexander May Date of oral examination: February 9, 2018 Abstract Lots of cryptographic schemes are based on block ciphers. Formally, a block cipher can be defined as a family of permutations on a finite binary vector space. A majority of modern constructions is based on the alternation of a nonlinear and a linear operation. The scope of this work is to study the linear operation with regard to optimized efficiency and necessary security requirements. Our main topics are • the problem of efficiently implementing multiplication with fixed elements in finite fields of characteristic two. • a method for finding optimal alternatives for the ShiftRows operation in AES-like ciphers. • the tweakable block ciphers Skinny and Mantis. • the effect of the choice of the linear operation and the round constants with regard to the resistance against invariant attacks. • the derivation of a security argument for the block cipher Simon that does not rely on computer-aided methods. Zusammenfassung Viele kryptographische Verfahren basieren auf Blockchiffren. Formal kann eine Blockchiffre als eine Familie von Permutationen auf einem endlichen bin¨arenVek- torraum definiert werden. Eine Vielzahl moderner Konstruktionen basiert auf der wechselseitigen Anwendung von nicht-linearen und linearen Abbildungen. Im Rah- men dieser Arbeit wird die lineare Abbildung im Hinblick auf Effizienzoptimierung und notwendige Sicherheitseigenschaften studiert. Unsere Hauptthemen sind • das Problem der effizienten Implementierung der Multiplikation mit festen Elementen in endlichen K¨orpern der Charakteristik zwei. • eine Methode f¨urdas Finden optimaler Alternativen f¨urdie ShiftRows Op- eration in AES-¨ahnlichen Chiffren. • die ver¨anderbaren Blockchiffren Skinny und Mantis. • die Auswirkung der Wahl der linearen Abbildung und der Rundenkonstanten auf die Resistenz gegen Invariantangriffe. • das Herleiten eines nicht auf Computerberechnungen beruhenden Sicher- heitsargumentes f¨urdie Blockchiffre Simon. Acknowledgements First and foremost I would like to thank my advisor Gregor Leander for accepting me as his student and for giving me the opportunity to work in his group during the last three years. He offered plenty of time for discussions and pointing to inter- esting research questions. I would also like to thank Alexander May for agreeing to be the second reviewer of this thesis. My work was funded by DFG Research Training Group GRK 1817. Special thanks also to them. Further, I am very grateful to all of my co-authors with whom I collaborated during the three years of my Ph.D. studies and to all other people I worked with. I would especially like to thank Roberto Avanzi, Anne Canteaut, Gottfried Herold, Takanori Isobe and Thomas Peyrin for some valuable discussions and comments on particular topics discussed in this thesis. I would like to thank Anne Canteaut for welcoming me for seven weeks in her group at INRIA, Paris and Christian Rechberger for inviting me to visit his group at DTU, Copenhagen for one week. I would also like to express my gratitude to the Embedded Security Group of the Faculty of Electrical Engineering and Information Technology for hosting me for the first months as a Ph.D. student and for several weeks during my interdis- ciplinary project. Further thanks go to my colleagues Thorsten Kranz and Friedrich Wiemer with whom I shared an office. Especially thanks to Friedrich for helping me several times with Linux issues and using the C3 cluster, and for proofreading parts of this thesis. Special thanks also to Irmgard and Marion for helping with lots of administra- tive tasks. I would like to express my deepest gratitude to all of my family for their support and guidance. Especially, I thank my parents Marion and Klaus and my grandparents Helga and Hermann, from whom I have learned so much. Finally, I thank Anja for all her love and support. Bochum, February 2018 Contents List of Figures xi List of Tables xv Notations xvii 1 Introduction 1 2 State of the Art in Block Cipher Design 5 2.1 Security Notions . .6 2.2 Block Cipher Constructions . 11 2.2.1 Key-Alternating Ciphers . 13 2.2.2 Substitution-Permutation Ciphers . 14 2.2.3 Feistel and ARX . 15 2.3 Cryptanalytic Attacks . 18 2.3.1 Differential Cryptanalysis . 18 2.3.2 Linear Cryptanalysis . 24 2.4 The Wide-Trail Strategy and AES-like Ciphers . 30 2.4.1 The Branch Number and a Link to Coding Theory . 32 2.4.2 AES-like Ciphers . 34 2.4.3 Computing Active S-boxes with Automatic Tools . 39 2.5 Lightweight Cryptography . 41 2.5.1 Lightweight Metrics . 42 2.5.2 Characteristics of Lightweight Block Ciphers . 43 2.5.3 Midori .............................. 45 I Design of Lightweight Linear Layers 49 3 Lightweight Linear Layers based on Finite Field Multiplications 51 3.1 Introduction . 51 3.2 Preliminaries . 56 3.2.1 The XOR-Count and the Cycle Normal Form . 57 ix 3.3 Efficient Multiplication in Finite Fields . 60 3.3.1 Characterizing Elements with Optimal XOR-Count . 61 3.3.2 Experimental Search for Optimal XOR-Counts . 64 3.4 Constructing Lightweight MDS Matrices . 67 3.4.1 Generic Lightweight MDS Matrices . 68 3.4.2 Instantiating Lightweight MDS Matrices . 71 3.5 Generalizing the MDS Property . 72 3.6 Conclusion and Open Problems . 73 4 On the Best Word Permutations for Lightweight AES-like Ciphers 79 4.1 Introduction . 79 4.2 Classifying Word Permutations . 82 4.2.1 Structure Matrix of a Word Permutation . 84 4.2.2 Search Algorithm . 85 4.2.3 The Difference between the Equivalence Notions . 86 4.3 Case Study { The Best Word Permutations for Midori ....... 88 4.3.1 Computing the Minimum Number of Active S-boxes . 89 4.4 Conclusion and Open Problems . 91 5 The Tweakable Block Ciphers Skinny and Mantis 93 5.1 Introduction . 93 5.2 Tweakable Block Ciphers . 95 5.2.1 Related-Key Attacks . 96 5.2.2 The TWEAKEY Framework . 100 5.3 The Skinny Family of Lightweight (Tweakable) Block Ciphers . 101 5.3.1 Specification . 101 5.3.2 Design Rationale . 109 5.3.3 The MILP Model for Computing Active S-Boxes . 113 5.3.4 Diffusion Test . 116 5.3.5 Security Claim and Best Cryptanalysis so far . 117 5.4 The Mantis Family of Low-Latency Tweakable Block Ciphers . 118 5.4.1 Specification . 119 5.4.2 Design Rationale . 122 5.4.3 Security Claim and Best Cryptanalysis so far . 124 5.4.4 Unrolled Implementations . 125 5.4.5 The MILP Constraints for the MixColumns Operation . 125 5.5 Conclusion and Future Work . 127 II Analysis of Lightweight Block Ciphers 129 6 Invariant Attacks 131 6.1 Introduction . 131 6.2 Preliminaries and Explanation of the Attack . 134 6.3 A Link to Linear Cryptanalysis . 136 6.4 Proving the Absence of Invariants in Lightweight SPNs . 139 6.4.1 The Simple Case . 143 6.4.2 When the Dimension is Smaller . 143 6.4.3 Results for some Lightweight Ciphers . 146 6.5 Design Criteria on the Linear Layer and on the Round Constants . 147 6.5.1 The Possible Dimensions of the L-Invariant Subspaces . 147 6.5.2 Considering More Round Constants . 151 6.5.3 Choosing Random Round Constants . 154 6.6 Conclusion and Open Problems . 158 7 Differential Trails in Simon-like Ciphers 161 7.1 Introduction . 161 7.2 Preliminaries . 164 7.3 Analysis of Differential Trails . 167 7.3.1 Restriction to Rotations as Rotational Invariant Functions . 168 7.3.2 Obtaining the Upper Bound for Simon and Simeck ..... 171 7.4 Conclusion and Open Problems . 175 Bibliography 177 List of Figures 2.1 A product cipher . 11 2.2 A key-alternating cipher . 13 2.3 A substitution-permutation (SP) cipher . 14 2.4 One round Ff of a Feistel cipher . 15 2.5 One round Ff of a key-alternating Feistel cipher . 15 2.6 The structure of a key-alternating cipher with an AES-like round . 35 4.1 An AES-like cipher for equivalent permutations . 83 4.2 The possible transition patterns of the MixColumn matrix in Midori 90 5.1 Illustration of Mantis6 ......................... 119 6.1 The highest possible dimensions of WL(c1; : : : ; ct) for Skinny-64, Prince and Mantis ............................ 134 n 6.2 The probability that WL(c1; : : : ; ct) = F2 for uniformly random constants ci for several lightweight ciphers . 134 7.1 Comparison of the experimental bounds for Simon-32 and Simon-48 from the literature and our provable bounds . 164 7.2 Illustration of the Simon round function and the generalized Simon- like round function . 167 7.3 Propagation of the Hamming weight for differences (α; 0) with w1(α) 2 f1; 2; 3g ................................. 171 xiii List of Tables 2.1 The S-box SbAES used in the AES ................... 36 2.2 The 4-bit S-box SbMid64 used in Midori-64 .............. 46 3.1 Optimal instantiations of the generic MDS matrices for 2 ≤ n ≤ 8 . 71 3.2 Comparison of our results with F2s -linear MDS matrices from the literature by average overhead per row . 72 3.3 Minimal XOR-counts for all elements in F2∗4 ............. 74 3.4 Minimal XOR-counts for all elements in F2∗5 ............. 75 3.5 Minimal XOR-counts for all elements in F2∗6 ............. 75 3.6 Minimal XOR-counts for all elements in F2∗7 ............