Analysis of Cryptographic Algorithms Against Theoretical and Implementation Attacks INF/01
Total Page:16
File Type:pdf, Size:1020Kb
UNIVERSITA` DEGLI STUDI DI MILANO Department of Computer Science \Giovanni Degli Antoni" Doctoral School in Computer Science Ph.D. in Computer Science XXIX cycle Analysis of cryptographic algorithms against theoretical and implementation attacks INF/01 Ph.D Candidate: Silvia Mella Advisor: Prof. Stelvio Cimato Co-Advisor: Dr. Gilles Van Assche Coordinator: Prof. Paolo Boldi Academic year 2016/2017 Dissertation presented in partial fulfillment of the requirements for the degree of Doctor in Computer Science Ph.D. Candidate: Silvia Mella Advisor: Prof. Stelvio Cimato Co-Advisor: Dr. Gilles Van Assche Coordinator: Prof. Paolo Boldi Universit`adegli Studi di Milano Department of Computer Science \Giovanni degli Antoni" Abstract This thesis deals with theoretical and implementation analysis of cryptographic functions. Theo- retical attacks exploit weaknesses in the mathematical structure of the cryptographic primitive, while implementation attacks leverage on information obtained by its physical implementation, such as leakage through physically observable parameters (side-channel analysis) or susceptibility to errors (fault analysis). In the area of theoretical cryptanalysis, we analyze the resistance of the Keccak-f permuta- tions to differential cryptanalysis (DC). Keccak-f is used in different cryptographic primitives: Keccak (which defines the NIST standard SHA-3), Ketje and Keyak (which are currently at the third round of the CAESAR competition) and the authenticated encryption function Kravatte. In its basic version, DC makes use of differential trails, i.e. sequences of differences through the rounds of the primitive. The power of trails in attacks can be characterized by their weight. The existence of low-weight trails over all but a few rounds would imply a low resistance with respect to DC. We thus present new techniques to efficiently generate all 6-round differential trails in Keccak-f up to a given weight, in order to improve known lower bounds. The limit weight we can reach with these new techniques is very high compared to previous attempts in literature for weakly aligned primitives. This allows us to improve the lower bound on 6 rounds from 74 to 92 for the four largest variants of Keccak-f. This result has been used by the authors of Kravatte to choose the number of rounds in their function. Thanks to their abstraction level, some of our techniques are actually more widely applicable than to Keccak-f. So, we formalize them in a generic way. The presented techniques have been integrated in the KeccakTools and are publicly available [BDPV15]. In the area of fault analysis, we present several results on differential fault analysis (DFA) on the block cipher AES. Most DFA attacks exploit faults that modify the intermediate state or round key. Very few examples have been presented, that leverage changes in the sequence of operations by reducing the number of rounds. In this direction, we present four DFA attacks that exploit faults that alter the sequence of operations during the final round. In particular, we show how DFA can be conducted when the main operations that compose the AES round function are corrupted, skipped or repeated during the final round. Another aspect of DFA we analyze is the role of the fault model in attacks. We study it from an information theoretical point of view, showing that the knowledge that the attacker has on the injected fault is fundamental to mount a successful attack. In order to soften the a-priori knowledge on the injection technique needed by the attacker, we present a new approach for DFA based on clustering, called J-DFA. The experimental results show that J-DFA allows to successfully recover the key both in classical DFA scenario and when the model does not perfectly match the faults effect. A peculiar result of this method is that, besides the preferred candidate for the key, it also provides the preferred models for the fault. This is a quite remarkable ability because it furnishes precious information which can be used to analyze, compare and characterize different specific injection techniques on different devices. VI In the area of side-channel attacks, we improve and extend existing attacks against the RSA algorithm, known as partial key exposure attacks. These attacks on RSA show how it is possible to find the factorization of the modulus from the knowledge of some bits of the private key. We present new partial key exposure attacks when the countermeasure known as exponent blinding is used. We first improve known results for common RSA setting by reducing the number of bits or by simplifying the mathematical analysis. Then we present novel attacks for RSA implemented using the Chinese Remainder Theorem, a scenario that has never been analyzed before in this context. List of Publications Part of the contributions of this thesis has been published in the following papers. In Journals: Silvia Mella, Joan Daemen, Gilles Van Assche. New techniques for trail bounds and applica- • tion to differential trails in Keccak. IACR Transactions on Symmetric Cryptology, 2017(1), pages 329-357, 2017. In Proceedings of International Conferences/Workshops: Claudio Ferretti, Silvia Mella, and Filippo Melzani. The role of the fault model in DFA • against AES. In Proceedings of the Third Workshop on Hardware and Architectural Support for Security and Privacy (HASP 2014), pages 4:1-4:8. Minneapolis, MN, USA, June 15, 2014. ACM. Silvia Mella, Filippo Melzani. Differential fault attacks against AES tampering with the • instruction flow. In Proceedings of the 11th International Conference on Security and Cryp- tography (SECRYPT 2014), pages 1-6. Wien, Austria, August 28-30, 2014. Stelvio Cimato, Silvia Mella, Ruggero Susella. New results for partial key exposure on RSA • with exponent blinding. In Proceedings of the 12th International Conference on Security and Cryptography (SECRYPT 2015), pages 136-147. Colmar, Alsace, France, July 20-22, 2015. Stelvio Cimato, Silvia Mella, Ruggero Susella. Partial key exposure attacks on RSA with • exponent blinding. In 12th International Joint Conference on e-Business and Telecommu- nications (ICETE 2015) Revised and Extended Selected Papers, pages 364-385. Springer International Publishing. Luca Magri, Silvia Mella, Filippo Melzani, Beatrice Rossi, Pasqualina Fragneto. J-DFA: a • novel approach for robust differential fault analysis. In proceedings of the 12th Workshop on Fault Diagnosis and Tolerance in Cryptography (FDTC 2015), pages 35-44. Saint Malo, France, September 13, 2015. IEEE Computer Society. Stelvio Cimato, Ernesto Damiani, Silvia Mella, Ching-Nung Yang. Key Recovery in public • clouds: a survey on cross-VM side channel attacks. International Conference on Cloud Com- puting and Security (ICCCS 2016) Revised Selected Papers, pages 456-467. Nanjing, China, July 29-31, 2016. Springer International Publishing. Contents Abstract .......................................................................V List of Publications ............................................................ VII List of Figures ................................................................. XII List of Tables ..................................................................XIV 1 Introduction ............................................................... 1 1.1 Cryptanalysis . .1 1.1.1 Theoretical attacks . .2 1.1.2 Implementation attacks . .3 1.2 Thesis contributions . .6 1.3 Thesis structure . .7 Part I Trail search in Keccak-f 2 Introduction ............................................................... 11 3 Preliminaries on differential cryptanalysis ................................. 13 3.1 Differentials . 13 3.2 Differential trails . 15 3.3 Trail extension . 16 3.4 Trail cores . 16 4 A generic approach for trail generation .................................... 19 4.1 Generating trails . 19 4.1.1 The first-order approach: trails from extending round differentials . 19 4.1.2 The second-order method: trails from extending two-round trails . 21 4.1.3 Lower bounding the weight starting from two-round trail cores . 22 4.2 Tree traversal approach . 22 4.2.1 Units and unit-lists . 23 4.2.2 Lower bound on the cost . 25 4.2.3 Traversing the unit-tree . 25 4.3 Searching by canonicity . 26 5 Keccak-f .................................................................. 27 5.1 The Keccak-f state .................................................... 27 5.2 The Keccak-f round function . 28 5.3 Difference propagation properties of the step mappings . 28 X Contents 5.3.1 Properties of χ .................................................... 30 5.3.2 Properties of θ .................................................... 30 5.3.3 Properties of π .................................................... 33 5.3.4 Properties of ρ .................................................... 33 5.3.5 Properties of ι .................................................... 35 5.3.6 Translation invariance along the z-axis . 35 5.4 Differential trails in Keccak-f ............................................ 36 5.4.1 Extension of trails and trail cores in Keccak-f ....................... 37 5.4.2 Extension of trail cores in Keccak-f ................................ 38 5.4.3 The Matryoshka structure . 38 6 Lower bounding the weight of trails in Keccak-f ........................... 39 6.1 Scanning the space of trails in Keccak . 39 6.1.1 Scanning the space of 6-round trail cores . 39 6.1.2 Scanning the space of 3-round trail cores . 40 6.1.3 Covering the space of 4 and 5 rounds . 42 6.2 Generating two-round trail cores in Keccak-f as a tree traversal