Newhope: a Mobile Implementation of a Post-Quantum Cryptographic Key Encapsulation Mechanism
Total Page:16
File Type:pdf, Size:1020Kb
Air Force Institute of Technology AFIT Scholar Theses and Dissertations Student Graduate Works 3-26-2020 NewHope: A Mobile Implementation of a Post-Quantum Cryptographic Key Encapsulation Mechanism Jessica A. Switzler Follow this and additional works at: https://scholar.afit.edu/etd Part of the Computer Sciences Commons Recommended Citation Switzler, Jessica A., "NewHope: A Mobile Implementation of a Post-Quantum Cryptographic Key Encapsulation Mechanism" (2020). Theses and Dissertations. 3190. https://scholar.afit.edu/etd/3190 This Thesis 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]. NewHope: A Mobile Implementation of a Post-Quantum Crytographic Key Encapsulation Mechanism THESIS Jessica A. Switzler AFIT-ENG-MS-20-M-063 DEPARTMENT OF THE AIR FORCE AIR UNIVERSITY AIR FORCE INSTITUTE OF TECHNOLOGY Wright-Patterson Air Force Base, Ohio DISTRIBUTION STATEMENT A APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. The views expressed in this document are those of the author and do not reflect the official policy or position of the United States Air Force, the United States Department of Defense or the United States Government. This material is declared a work of the U.S. Government and is not subject to copyright protection in the United States. AFIT-ENG-MS-20-M-063 NewHope: A Mobile Implementation of a Post-Quantum Crytographic Key Encapsulation Mechanism THESIS Presented to the Faculty Department of Electrical and Computer Engineering Graduate School of Engineering and Management Air Force Institute of Technology Air University Air Education and Training Command in Partial Fulfillment of the Requirements for the Degree of Master of Science in Cyber Operations Jessica A. Switzler, B.S. March 26, 2020 DISTRIBUTION STATEMENT A APPROVED FOR PUBLIC RELEASE; DISTRIBUTION UNLIMITED. AFIT-ENG-MS-20-M-063 NewHope: A Mobile Implementation of a Post-Quantum Crytographic Key Encapsulation Mechanism THESIS Jessica A. Switzler, B.S. Committee Membership: Laurence D. Merkle, Ph.D Chair Maj. Richard Dill, Ph.D Member Barry E. Mullins, Ph.D Member AFIT-ENG-MS-20-M-063 Abstract NIST anticipates the appearance of large-scale quantum computers by 2036 [34], which will threaten widely used asymmetric algorithms, National Institute of Stan- dards and Technology (NIST) launched a Post-Quantum Cryptography Standardiza- tion Project to find quantum-secure alternatives. NewHope post-quantum cryptog- raphy (PQC) key encapsulation mechanism (KEM) is the only Round 2 candidate to simultaneously achieve small key values through the use of a security problem with sufficient confidence its security, while mitigating any known vulnerabilities. This research contributes to NIST project’s overall goal by assessing the plat- form flexibility and resource requirements of NewHope KEMs on an Android mobile device. The resource requirements analyzed are transmission size as well as scheme runtime, central processing unit (CPU), memory, and energy usage. Results from each NewHope KEM instantiations are compared amongst each other, to a baseline appli- cation, and to results from previous work. NewHope PQC KEM was demonstrated to have sufficient flexibility for mobile implementation, competitive performance with other PQC KEMs, and to have competitive scheme runtime with current key exchange algorithms. iv Table of Contents Page Abstract . iv List of Figures . viii List of Tables . ix I. Introduction . .1 1.1 Motivation . .1 1.2 Problem Background. .2 1.3 Research Objectives . .4 1.4 Approach . .5 1.5 Assumptions and Limitations . .6 1.6 Document Overview . .7 II. Background and Literature Review . .8 2.1 Chapter Overview . .8 2.2 Quantum Computers and Quantum Computing . .9 2.3 Effect of Popular Quantum Algorithms . 13 2.4 Post-Quantum Cryptography (PQC) . 15 2.5 NIST: PQC Standardization . 16 2.6 Implementations of PQC for IoT and Mobile Devices . 19 2.7 NIST Round 2 PQC KEM’s . 23 2.8 Lattice-Based Cryptography . 26 2.8.1 Lattices . 28 2.8.2 Lattice Problems . 28 2.9 Cryptanalysis of Lattice-Based Cryptography . 35 2.9.1 Lattice-Basis Reduction . 35 2.9.2 Shortest Vector Problem . 37 2.9.3 Closest Vector Problem . 38 2.9.4 Learning with Errors Problem . 38 2.9.5 Ring Learning with Errors Problem . 39 2.9.6 Analysis of Cryptanalysis . 44 2.10 NewHope . 46 2.10.1 NewHope Cryptosystem . 47 2.10.2 NewHope KEM Types . 47 2.10.3 NewHope Cryptosystem Package . 48 2.10.4 NewHope Mitigating Attack Vectors . 49 2.10.5 NewHope Parameter Sets . 51 2.10.6 NewHope Key Encapsulation . 54 2.11 Java Native Interface (JNI) . 57 v Page 2.11.1 JNI Basics . 58 2.11.2 JNI Within Android Studio . 59 2.12 Chapter Summary . 61 III. Methodology . 63 3.1 Chapter Overview . 63 3.2 Methodology Procedure Outline . 64 3.3 Choosing a KEM Algorithm . 65 3.4 Building the Original KEM Codebase . 66 3.5 Reverse Engineering NewHope KEM . 68 3.6 Analyzing Transmission Byte Requirement . 69 3.7 Creating a Baseline Application for Comparison . 71 3.8 Preparation for Mobile Implementation . 72 3.9 Creating NewHope Mobile Implementations . 75 3.10 Testing the KEM . 80 3.10.1 Android Profiler . 81 3.10.2 Data Collection Procedure . 82 3.11 Chapter Summary . 84 IV. Results and Analysis . 86 4.1 Chapter Overview . 86 4.2 Verification of Correctness . 87 4.3 Baseline JNI Application . 88 4.4 Verbose OnClick Event Condition . 89 4.5 Succinct OnClick Event Condition . 90 4.6 No Output OnClick Event Condition . 92 4.7 Comparing NewHope Implementations with Different OnClick Event Conditions . 93 4.8 Performance Comparison of NewHope Configurations and Baseline Application . 95 4.9 Statistical Analysis of NewHope Configurations and Baseline Application . 97 4.9.1 Native Scheme Runtime T-Tests Between NewHope Configurations . 98 4.9.2 CPU Average T-Tests Between NewHope Configurations and Baseline Application . 100 4.9.3 CPU Average T-Tests Between NewHope Configurations . 103 4.10 Comparison to Previous Work. 105 4.11 Chapter Summary . 109 vi Page V. Conclusions . 111 5.1 Chapter Overview . 111 5.2 Conclusions. 111 5.3 Future Work . ..