Enhancing Electromagnetic Side-Channel Analysis in an Operational Environment David P
Total Page:16
File Type:pdf, Size:1020Kb
Air Force Institute of Technology AFIT Scholar Theses and Dissertations Student Graduate Works 9-1-2013 Enhancing Electromagnetic Side-Channel Analysis in an Operational Environment David P. Montminy Follow this and additional works at: https://scholar.afit.edu/etd Part of the Other Computer Engineering Commons, and the Other Electrical and Computer Engineering Commons Recommended Citation Montminy, David P., "Enhancing Electromagnetic Side-Channel Analysis in an Operational Environment" (2013). Theses and Dissertations. 888. https://scholar.afit.edu/etd/888 This Dissertation is brought to you for free and open access by the Student Graduate Works at AFIT Scholar. It has been accepted for inclusion in Theses and Dissertations by an authorized administrator of AFIT Scholar. For more information, please contact [email protected]. Enhancing Electromagnetic Side-Channel Analysis in an Operational Environment DISSERTATION David P. Montminy, Major, USAF AFIT{ENG{DS{13{S{01 DEPARTMENT OF THE AIR FORCE AIR UNIVERSITY AIR FORCE INSTITUTE OF TECHNOLOGY Wright Patterson Air Force Base, Ohio APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. The views expressed in this dissertation are those of the author and do not reflect the official policy or position of the United States Air Force, Department of Defense, or the United States Government. AFIT{ENG{DS{13{S{01 ENHANCING ELECTROMAGNETIC SIDE-CHANNEL ANALYSIS IN AN OPERATIONAL ENVIRONMENT DISSERTATION Presented to the Faculty of the Graduate School of Engineering and Management of the Air Force Institute of Technology Air University In Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy David P. Montminy, B.S.E.E., M.S.C.E. Major, USAF September 2013 APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. To my parents and grandparents, The values you instilled in me as a child continue to served me well. To my wife and children, The love and support you have given me over the last three years has kept me strong and focused. This dissertation would not have been possible without your support. iii Acknowledgements Special thanks to my advisor Dr. Rusty Baldwin, whom I was lucky enough to first choose as my advisor for my master's degree. His continued support and encour- agement over the years led me back to AFIT for a PhD. With gentle guidance he allowed me to explore my interests while keeping my research focused. I would also like to thank my research committee, Dr. Temple and Dr. Oxley for the numerous document reviews and feedback sessions. David P. Montminy iv Table of Contents Page Acknowledgements . iv List of Figures . xii List of Tables . xv Abstract . xvi 1. Introduction . .1 1.1 Motivation . .2 1.2 Research Contributions . .3 1.3 Organization . .4 2. Background . .6 2.1 Introduction . .6 2.2 Cryptography Preliminaries . .7 2.2.1 Block Ciphers . .7 2.2.2 Advanced Encryption Standard . .8 2.2.3 Cryptanalysis of Block Ciphers . 12 2.3 Side-Channel Leakage . 14 2.3.1 Power Consumption . 14 2.3.2 Electromagnetic Emissions . 16 2.3.3 Other Side-Channels . 19 2.3.4 Leakage Models . 19 2.4 Side-Channel Attacks . 22 2.4.1 Types of Implementation Attacks . 23 v Page 2.4.2 Adversary Models . 23 2.4.3 Power and EM Analysis . 24 2.4.4 Simple Side-Channel Analysis . 25 2.4.5 Differential Side-Channel Analysis . 26 2.4.6 Profiling Attacks . 29 2.5 Countermeasures . 33 2.5.1 Masking . 33 2.5.2 Hiding . 34 2.6 Collecting Electromagnetic Emissions . 35 2.6.1 Electronic Noise . 36 2.6.2 Improving Collections . 36 2.7 Pre-Processing Processing Techniques . 38 2.7.1 Detecting Compromising Frequency Components 39 2.7.2 Trace Alignment . 42 2.7.3 Frequency-Based Analysis . 44 2.8 Algebraic Cryptanalysis . 45 2.8.1 Describing a Cipher . 45 2.8.2 Solving a System of Equations . 48 2.8.3 Using SAT Solvers . 48 2.8.4 Algebraic Side-Channel Analysis . 50 2.8.5 Related Key Recovery Techniques . 53 2.9 Summary . 55 3. Methodology . 57 3.1 Data Collection . 57 3.2 Targeted Devices . 60 3.2.1 PIC Microcontrollers . 60 3.2.2 ARM Cortex-M4F . 62 vi Page 3.3 Signal Processing Techniques . 65 3.3.1 Filtering . 65 3.3.2 Decimation . 67 3.3.3 Alignment . 67 3.4 Correlation-Based Electromagnetic Analysis . 68 3.4.1 CEMA Attack Methodology . 68 3.4.2 Example CEMA Attack . 71 3.4.3 Known-Key Correlation Analysis . 72 3.4.4 Comparing Effectiveness of CEMA Attacks . 73 3.5 Identifying Information Leaking Frequencies . 74 3.5.1 Frequency Interval Break Down Approach . 75 3.5.2 Overlapping Frequency Interval Approach . 76 3.6 Template Attacks . 79 3.6.1 Class Identification . 81 3.6.2 Classifier Training . 81 3.6.3 Classifying Observed Traces . 82 3.6.4 Class Selection . 83 3.6.5 Distinguishing Feature Selection . 83 3.6.6 Comparing Effectiveness of Template Attacks 85 3.7 Algebraic Cryptanalysis . 86 3.7.1 Generating a System of Equations for AES-128 86 3.7.2 Converting to a SAT Problem . 87 3.7.3 Solving the System of Equations . 89 3.7.4 Unique Contributions of this SAT Solver Tool 89 3.8 Summary . 90 vii Page 4. Key Schedule Redundancy Attack . 91 4.1 Introduction . 91 4.2 Background . 93 4.2.1 Key Schedule Background . 93 4.3 Related Work . 94 4.4 The Attack . 97 4.4.1 Data Collection . 97 4.4.2 Targeted Intermediate Values . 98 4.4.3 Template Attack . 100 4.4.4 Reconciling Round Key-Byte Guesses . 101 4.5 Results and Comparison . 102 4.5.1 Evaluating Performance . 102 4.5.2 Comparison of Distinguishing Features . 103 4.5.3 Experimental Results . 104 4.5.4 Comparison . 108 4.6 Conclusion . 110 5. Improving Cross-Device Template Attacks . 112 5.1 Introduction . 112 5.2 Cross-Device EM leakage . 114 5.2.1 Compensating for Device Differences . 116 5.3 Experimental Methodology . 117 5.3.1 Targeted Devices . 117 5.3.2 Template Attack Methodology . 117 5.3.3 Distinguishing Feature Data Normalization . 119 5.4 Results . 120 5.4.1 Selected Features . 120 5.4.2 Baseline Standard Template Attack . 122 viii Page 5.4.3 MVN Technique Results . 125 5.4.4 PCA-based Attack . 127 5.4.5 Comparison of Attacks . 128 5.5 Conclusion . 131 5.6 Constructing a Master Template . 132 6. Cross-Device Attacks on Complex Microprocessors . 134 6.1 Introduction . 134 6.2 Related Work . 135 6.3 Methodology . 136 6.3.1 Device Leakage Cartography . 136 6.3.2 Identifying Unrelated Signals . 137 6.3.3 Combining Techniques . 140 6.4 Results . 141 6.4.1 Effectiveness of Cross-Device Methods . 141 6.4.2 Probe Position Tolerance . 144 6.4.3 Comparison of Successful CEMA and Template Attacks Locations . 147 6.4.4 Notch-Filtering for CEMA Attacks . 149 6.5 Conclusion . 150 7. Differential Electromagnetic Attacks on a 32-bit Microprocessor Using Software Defined Radios . 152 7.1 Introduction . 152 7.2 Background . 154 7.2.1 Triggering and Alignment . 154 7.2.2 Software Defined Radios . 155 7.3 Related Work . 156 7.4 Baseline Attack Performance . 157 ix Page 7.4.1 Electromagnetic Cartography Scan . 158 7.4.2 Correlation-Based Frequency-Dependent Leak- age Analysis . 159 7.4.3 Baseline Results . 161 7.5 Software Defined Radio Methodology . 163 7.5.1 Sub-Nyquist Sampling . 165 7.5.2 Software Defined Radios . 165 7.5.3 Identifying and Aligning Encryption Operations 167 7.5.4 Additional Processing for the RTL-SDR . 171 7.6 Software-Defined Radio Results . 171 7.6.1 USRP . 171 7.6.2 RTL-SDR . 177 7.6.3 Additional Observations . 180 7.6.4 Comparison of the Baseline and SDR Results 182 7.7 Conclusion and Future Work . 184 8. Conclusion . 186 8.1 Research Summary . 186 8.1.1 Algebraic Cryptanalysis . 186 8.1.2 Cross-Device Template Attacks . 188 8.1.3 Software Defined Radios (SDR) . 190 8.2 Recommendations for Future Research . 191 8.2.1 Algebraic Cryptanalysis . 191 8.2.2 Cross-Device Template Attacks . 192 8.2.3 Software Defined Radios . 193 Appendix A. Constructing and Solving Systems of Equations . 195 A.1 Conjunctive Normal Form . 195 x Page A.2 SAT Solvers . 196 A.3 Converting MQ to SAT . 196 A.3.1 Step 1: Convert the Polynomial System to a Lin- ear System . 197 A.3.2 Step 2: Linear System to CNF Expression . 197 A.3.3 Step 3: DIMACS CNF Form . 199 A.4 Methods for Solving Non-linear Multivariate Systems of Equations . 200 Appendix B. Writing AES-128 for a SAT Solver . 202 B.1 SR Polynomial Generator . 202 B.1.1 Variable Names . 204 B.2 ANF to CNF Converter . 205 B.2.1 Specifying Known Values . 205 B.2.2 SAT Solver . 207 B.3 Example Code . 207 B.3.1 Full System of Equations . 207 B.3.2 Key.