Elliptic Curve Cryptography by Kai Laemmle (Under The
Total Page:16
File Type:pdf, Size:1020Kb
Elliptic Curve Cryptography by Kai Laemmle (Under the direction of Matthew Baker) Abstract We will introduce the reader to elliptic curves, and explain how they can be used for cryptography and why they are more difficult to attack in comparison to systems based on finite fields, such as the famous RSA algorithm. This expository paper will discuss different algorithms to attack cryptographic systems, such as the index calculus method, Shanks’ algorithm, Pollard’s rho method and the pairing attack. Finally, we will construct the Weil pairing, prove some of its important properties and present an algorithm to compute it. The study of attacks on cryptographic systems can help to reveal that a certain cryptographic protocol is weak and therefore that it should not be used. The reader should have background in algebra, basic number theory and some cryptography, such as the RSA algorithm. No background in elliptic curves or in algebraic geometry is required, but may be helpful. Index words: Elliptic curve cryptography, Discrete logarithm problem, Shanks’ Baby-Step Giant-Step algorithm, Pollard’s rho method, Index calculus method, Pairing attack, MOV/Frey-R¨uck attack, Weil pairing, Computing the Weil pairing Elliptic Curve Cryptography by Kai Laemmle Vordiplom (equiv. B.A.), University of Hannover, Germany, 2001 A Thesis Submitted to the Graduate Faculty of The University of Georgia in Partial Fulfillment of the Requirements for the Degree Master of Arts Athens, Georgia 2003 c 2003 Kai Laemmle All Rights Reserved Elliptic Curve Cryptography by Kai Laemmle Approved: Major Professor: Matthew Baker Committee: Robert Rumely Robert Varley Electronic Version Approved: Maureen Grasso Dean of the Graduate School The University of Georgia December 2003 Acknowledgments I address special thanks to Christina Geisler, Kyunglim Nam, Jeff Thompson, Markus Hunziker, Kareem Shabana, Charles James and Allison Barfield for your support and your friendship. Thank you to Michael Guy who encouraged and sup- ported me in common classes, to Janice Winner and to International Student Life of the University of Georgia who helped me very much when I arrived in the United States, and to Nicole Schulze who was right when she suggested to study abroad for a while. I also thank Matt Baker and the other committee members for your academic advice and cooperation. Thanks to all friends I did not mention above and all good things happened to me during my stay in Athens. iv Table of Contents Page Acknowledgments . iv Chapter 1 Introduction . 1 1.1 Idea of Cryptography . 1 1.2 Overview . 2 1.3 Why Elliptic Curve Cryptosystems? . 3 2 Applications of Elliptic Curves in Cryptography . 4 2.1 Elliptic Curves And Cryptography . 5 2.2 Analog of Diffie-Hellman Key-Exchange Protocol 8 2.3 Analog of Massey-Omura . 9 2.4 Analog of ElGamal . 10 3 Encoding . 12 3.1 An Encoding Algorithm . 13 3.2 Square Test . 16 3.3 Computing Square Roots In Fp ............. 21 4 The Discrete Logarithm Problem . 27 4.1 The DLP and the Security of Cryptosystems . 27 4.2 Comparing Algorithms on the DLP . 29 4.3 Shanks’ Baby-Step Giant-Step Algorithm . 30 4.4 Pollard’s Rho Method . 32 v vi 4.5 The Index Calculus Method . 33 5 The Weil Pairing . 36 5.1 The Pairing Attack In General . 36 5.2 Preparation for the Weil Pairing . 39 5.3 Definition and Properties of the Weil Pairing . 43 5.4 Computing the Weil Pairing . 48 5.5 Proving Properties of the Weil Pairing . 55 Bibliography . 62 Chapter 1 Introduction 1.1 Idea of Cryptography Alice wants to send a message to Bob using a public channel. What does Alice do, if only Bob should be able to read the message? She uses methods of cryptography, for instance a public key cryptosystem: Bob creates a so-called public key and a corresponding private key. The public key is known to every user and is used to encrypt a message. The private key is only known to Bob and is used to decrypt the message. Alice uses the public key of Bob to encrypt her message and sends the encrypted message to Bob. Bob, having his secret information (his secret or private key) can now decrypt the message. Without Bob’s secret key, it should be very hard to decrypt the message. The main idea of cryptography is that decryption is easy when one has cer- tain secret information, but without that information, it is very difficult (or even impossible in a reasonable amount of time) to decrypt the message. In general, when somebody makes up a new cryptosystem, its security will usu- ally be either disproved (for instance, by an algorithm cracking it) or else its security will be believed after a long number of unsuccessful attempts at breaking the cryp- tosystem. So, we might rephrase one of the above paragraphs: The main idea of cryptog- raphy is that decryption is easy when one has certain secret information, but without 1 2 that information, it is believed to be very hard (or even impossible in a reasonable amount of time) to decrypt the message. 1.2 Overview We will explain how to use elliptic curves for encryption and decryption in chapter 2. There, we will discuss the Diffie-Hellman Key-Exchange protocol and the Diffie- Hellman problem, and we will look at two cryptosystems adapted to elliptic curves, namely the Massey-Omura protocol and the ElGamal protocol. While chapter 2 deals with points on elliptic curves, we actually want to encrypt and decrypt messages. Filling this gap, i.e. embedding messages as points on a given elliptic curve, is called encoding. We will talk about how we can encode messages as points on an elliptic curve in chapter 3. The encoding algorithm needs a square test modulo p, and it involves computing square roots modulo p. The strength of cryptosystems based on discrete exponentiation relies on the fact that the inverse operation, the discrete logarithm problem (DLP), is considered very hard to solve. In chapter 4, we will discuss the DLP and introduce some attacks on it, such as the index calculus method, Shanks’ Baby-Step Giant-Step algorithm and Pollard’s rho method. Knowing under which conditions these attacks are efficient helps to avoid weak cryptosystems when one is choosing or designing a cryptosystem. In Chapter 5, we focus on one particular class of attacks on the DLP on an elliptic curve, namely pairing attacks, and we will discuss one particular example, the Weil pairing attack, in detail. The goal of pairing attacks is to reduce the DLP for elliptic curves to the DLP for multiplicative groups of finite fields. 3 1.3 Why Elliptic Curve Cryptosystems? The RSA cryptosystem is difficult to crack, because it is believed to be very hard to decompose large composite numbers into their prime factors in a reasonable amount of time. A cryptosystem based on discrete exponentiation, such as the Diffie-Hellman protocol, is difficult to attack because the discrete logarithm problem is believed to be hard to solve. It is a good idea to use a combination of cryptosystems, involving both the dis- crete logarithm problem and the difficulty of factoring large numbers. Besides adding versatility, cryptosystems based on discrete exponentiation need smaller parameters than comparable RSA-type cryptosystems. This explains why we would like to use discrete logarithms. But why do we not just base our algorithms on multiplicative groups of finite fields rather than elliptic curves, since arithmetic on finite fields is much easier? There is no known “efficient” algorithm to crack a general elliptic curve cryp- tosystem, if we choose our elliptic curve cryptosystem to satisfy certain conditions. Though the index calculus method, which is based on factor bases, solves the DLP for multiplicative groups of finite fields “efficiently”. This attack does not seem to work for elliptic curve cryptosystems, since there is no known analogue of factor bases on elliptic curves. An “efficient” algorithm means a so-called subexponential algorithm, which is better than exponential running time, but worse than polynomial running time. Let p be the input size. Then 5 log3 p + 3 log p is polynomial in log p (we just say “polynomial”), and p5 + log p is exponential (in log p). The expected running time √ of the index calculus method is O(e 2 log p log log p), which is subexponential. Chapter 2 Applications of Elliptic Curves in Cryptography In this chapter we will discuss some examples of how elliptic curves can be used for cryptographic purposes. We will present the Diffie-Hellman Key-Exchange protocol, the Massey-Omura protocol and the ElGamal protocol adopted to elliptic curves. These protocols can also be implemented over finite multiplicative groups (see [6]). Elliptic curve cryptosystems can be used to create a common secret with commu- nication over a public channel, which is achieved, for instance, by the Diffie-Hellman Key-Exchange protocol. This common secret can serve as a private key to encrypt and decrypt a message, as in the ElGamal protocol outlined at the end of this chapter. While the ElGamal protocol requires a base point B of the elliptic curve, where B should have a high order, preferably close to the number of points on the elliptic curve, the Massey-Omura protocol needs the number of points of an elliptic curve over a fixed field, which can be computed using Schoof’s algorithm (see [11]). Another disadvantage of Massey-Omura is that it requires more back-and-forth communication, which, in practice, is often a major disadvantage, and which also makes more information accessible to the public, and which therefore might make the protocol more vulnerable.