# Computer and Network Security

Save this PDF as:

Size: px
Start display at page:

## Transcription

1 MIT Computer and Networ Security Class Notes 1 File: rivest/notes/notes.pdf Revision: December 2, 2002 Computer and Networ Security MIT Class Notes by Ronald L. Rivest December 2, 2002

2 MIT Computer and Networ Security Class Notes 2 File: rivest/notes/ntintro.pdf Revision: December 2, 2002 Introduction to Number Theory Elementary number theory provides a rich set of tools for the implementation of cryptographic schemes. Most public-ey cryptosystems are based in one way or another on number-theoretic ideas. The next pages provide a brief introduction to some basic principles of elementary number theory.

3 MIT Computer and Networ Security Class Notes 3 File: rivest/notes/bignum.pdf Revision: December 2, 2002 Bignum computations Many cryptographic schemes, such as RSA, wor with large integers, also nown as bignums or multiprecision integers. Here large may mean bits ( decimal digits), with 1024-bit integers (308 decimal digits) typical. We briefly overview of some implementation issues and possibilities. When RSA was invented, efficiently implementing it was a problem. Today, standard destop CPU s perform bignum computations quicly. Still, for servers doing hundreds of SSL connections per second, a hardware assist may be needed, such as the SSL accelerators produced by ncipher A popular C/C++ software subroutine library supporting multi-precision operations is GMP (GNU Multiprecision pacage) A more elaborate pacage (based on GMP) is Shoup s NTL (Number Theory Library) For a survey, see Java has excellent support for multiprecision operations in its BigInteger class java.sun.com/j2se/1.4.1/docs/api/java/math/biginteger.html; this includes a primalitytesting routine. Python is a personal favorite; it includes direct support for large integers. Scheme also provides direct bignum support. Some other pointers to software and hardware implementations can be found in the Practical Aspects section of Helger Lipmaa s Cryptology pointers helger/crypto/=. When woring on -bit integers, most implementations implement addition and subtraction in time O(), multiplication, division, and gcd in time O( 2 ) (although faster implementations exist for very large ), and modular exponentation in time O( 3 ). To get you roughly calibrated, here are some timings, obtained from a simple Python program on my IBM Thinpad laptop (1.2 GHz PIII processor) on 1024-bit inputs. SHA-1 is included just for comparison. The last column gives the approximate ratio of running time to addition. 2.2 microseconds addition 455,000 per second microseconds SHA1 hash (on 20-byte input) 227,000 per second microseconds modular addition 93,000 per second 5 41 microseconds multiplication 24,000 per second microseconds modular multiplication 7,400 per second milliseconds modular exponentiation (exponent is 2**16+1) 440 per second milliseconds gcd 180 per second milliseconds modular exponentiation (1024-bit exponent) 5 per second 93000

4 MIT Computer and Networ Security Class Notes 4 File: rivest/notes/divisors.pdf Revision: December 2, 2002 Divisors and Divisibility Definition 1 (Divides relation, divisor, common divisor) We say that d divides a, written d a, if there exists an integer such that a = d. If d does not divide a, we write d a. If d a and d 0, we say that d is a divisor of a. If d a and d b, then d is a common divisor of a and b. Example 1 Every integer d 0 (including d = 0) is a divisor of 0. While 0 divides no integer except itself, 1 is a divisor of every integer. The divisors of 12 are {1, 2, 3, 4, 6, 12}. A common divisor of 14 and 77 is 7. If d a then d ( a). Definition 2 (prime) An integer p > 1 is prime if its only divisors are 1 and p. Definition 3 (Greatest common divisor, relatively prime) The greatest common divisor, gcd(a, b), of two integers a and b is the largest of their common divisors, except that gcd(0, 0) = 0 by definition. Integers a and b are relatively prime if gcd(a, b) = 1. Example 2 gcd(24, 30) = 6 gcd(4, 7) = 1 gcd(0, 5) = 5 gcd( 6, 10) = 2 Example 3 For all a 0, a and a + 1 are relatively prime. The integer 1 is relatively prime to all other integers. Example 4 If p is prime and 1 a < p, then gcd(a, p) = 1. That is, a and p are relatively prime. Definition 4 For any positive integer n, we define Euler s phi function of n, denoted φ(n), as the number of integers d, 1 d n, that are relatively prime to n. (Note that φ(1) = 1.) Example 5 If p is prime, then φ(p) = p 1. For any integer > 0, φ(2 ) = 2 1. Definition 5 The least common multiple lcm(a, b) of two integers a 0, b 0, is the least m such that a m and b m. Exercise 1 Show that the number of divisors of n = p e 1 1 pe 2 2 pe (where the p i s are distinct primes) is 1 i (1 + e i ). Exercise 2 Show that lcm(a, b) = ab/ gcd(a, b).

5 MIT Computer and Networ Security Class Notes 5 File: rivest/notes/flt.pdf Revision: December 2, 2002 Fermat s Little Theorem Theorem 1 (Fermat s Little Theorem) If p is prime and a Z p, then a p 1 = 1 (mod p). Theorem 2 (Lagrange s Theorem) The order of a subgroup must divide the order of a group. Fermat s Little Theorem follows from Lagrange s Theorem, since the order of the subgroup a generated by a in Z p is the least t > 0 such that a t = 1 (mod p), and Z p = p 1. Euler s Theorem generalizes Fermat s Little Theorem, since Z n = φ(n) for all n > 0. Theorem 3 (Euler s Theorem) For any n > 1 and any a Z n, a φ(n) = 1 (mod n). A somewhat tighter result actually holds. Define for n > 0 Carmichael s lambda function λ(n) to be the least positive t such that a t = 1 (mod n) for all a Z n. Then λ(1) = λ(2) = 1, λ(4) = 2, λ(2 e ) = 2 e 2 for e > 2, λ(p e ) = p e 1 (p 1) if p is an odd prime, and if n = p e 1 1 pe, then λ(n) = lcm(λ(p e 1 1 ),..., λ(pe )). Computing modular inverses. Fermat s Little Theorem provides a convenient way to compute the modular inverse a 1 (mod p) for any a Z p, where p is prime: a 1 = a p 2 (mod p). (Euclid s extended algorithm for computing gcd(a, p) is more efficient.) Primality testing. The converse of Fermat s Little Theorem is almost true. The converse would say that if 1 a < p and a p 1 = 1 (mod p), then p is prime. Suppose that p is a large randomly chosen integer, and that a is a randomly chosen integer such that 1 a < p. Then if a p 1 1 (mod p), then p is certainly not prime (by FLT), and otherwise p is liely to be prime. FLT thus provides a heuristic test for primality for randomly chosen p; refinements of this approach yield tests effective for all p. Exercise 1 Prove that λ(n) is always a divisor of φ(n), and characterize exactly when it is a proper divisor. Exercise 2 Suppose a > 1 is not even or divisible by 5; show that a 100 (in decimal) ends in 001. Exercise 3 Let p be prime. (a) Show that a p = a (mod p) for any a Z p. (b) Argue that (a + b) p = a p + b p (mod p) for any a,b in Z p. (c) Show that (m e ) d = m (mod p) for all m Z p if ed = 1 (mod p 1).

6 MIT Computer and Networ Security Class Notes 6 File: rivest/notes/generators.pdf Revision: December 2, 2002 Generators Definition 1 A finite group G = (S, ) may be cyclic, which means that it contains a generator g such that every group element h S is a power h = g of g for some 0. If the group operation is addition, we write this condition as h = g + g + + g = g. } {{ } Example 1 For example, 3 generates Z 10 under addition, since the multiples of 3, modulo 10, are: 3, 6, 9, 2, 5, 8, 1, 4, 7, 0. Fact 1 The generators of (Z m, +) are exactly those φ(m) integers a Z m relatively prime to m. Example 2 The generators of (Z 10, +) are {1, 3, 7, 9}. Example 3 The group (Z 11, ) is generated by g = 2, since the powers of 2 (modulo 11) are: 2, 4, 8, 5, 10, 9, 7, 3, 6, 1. Fact 2 Any cyclic group of size m is isomorphic to (Z m, +). For example, (Z 11, ) (Z 10, +) via: 2 x (mod 11) x (mod 10). Theorem 1 If p is prime, then (Z p, ) is cyclic, and contains φ(p 1) generators. More generally, the group (Z n, ) is cyclic if and only if n = 2, n = 4, n = p e, or n = 2p e, where p is an odd prime and e 1; in these cases the group contains φ(φ(n)) generators. Finding a generator of Z p. If the factorization of p 1 is unnown, no efficient algorithm is nown, but if p 1 has nown factorization, it is easy to find a generator. Generators of Z p are relatively common (φ(n) n/(6 ln ln n) for n 5), so one can be found by searching at random for an element g whose order is p 1. (Note g has order p 1 if g p 1 = 1 (mod p) but g (p 1)/q 1 (mod p) for all prime divisors q of p 1). Group generated by an element. In any group G, the set g of elements generated by g is always a cyclic subgroup of G; if g = G then g is a generator of G. Groups of prime order. If a group H has prime order, then every element except the identity is a generator. For example, the subgroup QR 11 = {1, 4, 9, 5, 3} of squares (quadratic residues) in Z 11 has order 5, so 4, 9, 5, and 3 all generate QR 11. For this reason, it is sometimes of interest to wor with the group QR p of squares modulo p, where p = 2q + 1 and q is prime. Exercise 1 (a) Find all of the generators of (Z 11, ) and of (Z 2, +). (b) Let g be a generator of (Z p, ); prove that g x generates Z p if and only if x generates (Z p 1, +).

7 MIT Computer and Networ Security Class Notes 7 File: rivest/notes/orders.pdf Revision: December 2, 2002 Orders of Elements Definition 1 The order of an element a of a finite group G is the least positive t such that a t = 1. (If the group is written additively, it is the least positive t such that a + a + + a (t times) = 0.) Order Row a column contains a mod p for p = 7; boldface entries illustrate the fundamental period of a (mod p) as increases. The length of this period is the order of a, modulo p. By Fermat s Little Theorem the order always divides p 1; thus a p 1 is always 1 (see the column mared with an uparrow). Elements 3 and 5 have order p 1, and so are generators of Z 7. Element 6 is 1, modulo 7, and thus has order 2. Fact 1 The order of an element a G is a divisor of the order of G. (The order G of a group G is the number of elements it contains.) Therefore a G = 1 in G. Thus when p is prime, the order of an element a Z p is a divisor of Z p = p 1, and in general the order of an element a Z n is a divisor of Z n = φ(n). Computing the order t of an element a G. If the factorization of G is unnown, no efficient algorithm is nown, but if G has nown factorization G = p e 1 1 pe 2 2 pe, it is easy. Basically, compute the order t as t = p f 1 1 pf 2 2 pf where each f i is initially e i, then each f i is decreased in turn as much as possible (but not below zero) while eeping a t = 1 in G. Fact 2 When p is prime, the number of elements in Z p of order d, where d (p 1), is φ(d). For example, since φ(2) = 1, there is a unique square root of 1 modulo p, other than 1 itself (it is 1 = p 1 (mod p)). Exercise 1 Let ord(a) denote the order of a G. (a) Prove that ord(a) = ord(a 1 ) and ord(a ) ord(a). (b) Prove that ord(ab) is a divisor of lcm(ord(a), ord(b)), and show that it may be a proper divisor. (c) Show that ord(ab) = ord(a) ord(b) if gcd(ord(a), ord(b)) = 1. Exercise 2 Show that there are at least as many elements of order p 1 (i.e. generators) of Z p as there are elements of any other order. Exercise 3 Show that the order of a in (Z n, +) is n/ gcd(a, n).

8 MIT Computer and Networ Security Class Notes 8 File: rivest/notes/gcd.pdf Revision: December 2, 2002 Euclid s Algorithm for Computing GCD It is easy to compute gcd(a, b). This is surprising because you might thin that in order to compute gcd(a, b) you would need to figure out their divisors, i.e. solve the factoring problem. But, as you will see, we don t need to figure out the divisors of a and b to find their gcd. Euclid (circa 300 B.C.) showed how to compute gcd(a, b) for a 0 and b 0: { a if b = 0 gcd(a, b) = gcd(b, a mod b) otherwise The recursion terminates since (a mod b) < b; the second argument strictly decreases with each call. An equivalent non-recursive version sets a 0 = a, a 1 = b, and then computes a i+1 for i = 2, 3,... as a i+1 = a i 1 mod a i until a i+1 = 0, then returns a i. Example 1 Euclid s Algorithm finds the greatest common divisor of 12 and 33 as: gcd(12, 33) = gcd(33, 12) = gcd(12, 9) = gcd(9, 3) = gcd(3, 0) = 3. The equivalent non-recursive version has a 0 = 12, a 1 = 33, and So gcd(12, 33) = 3. a 2 = a 0 mod a 1 = 12 mod 33 = 12 a 3 = a 1 mod a 2 = 33 mod 12 = 9 a 4 = a 2 mod a 3 = 12 mod 9 = 3 a 5 = a 3 mod a 4 = 9 mod 3 = 0 It can be shown that the number of recursive calls is O(log b); the worst-case input is a pair of consecutive Fibonacci numbers. Euclid s algorithm (even if extended) taes O( 2 ) bit operations when inputs a and b have at most bits; see Bach and Shallit.

9 MIT Computer and Networ Security Class Notes 9 File: rivest/notes/xgcd.pdf Revision: December 2, 2002 Euclid s Extended Algorithm Theorem 1 For all integers a, b, one can efficiently compute integers x and y such that gcd(a, b) = ax + by. We give a proof by example, using Euclid s Extended Algorithm on inputs a = 9, b = 31, which for each a i of the nonrecursive version of Euclid s algorithm finds an x i and y i such that a i = ax i + by i : a 0 = a = 9 = a 1 + b 0 a 1 = b = 31 = a 0 + b 1 a 2 = a 0 mod a 1 = 9 = (a 1 + b 0) 0 (a 0 + b 1) = a 1 + b 0 a 3 = a 1 mod a 2 = 4 = (a 0 + b 1) 3 (a 1 + b 0) = a ( 3) + b 1 a 4 = a 2 mod a 3 = 1 = (a 1 + b 0) 2 (a ( 3) + b 1) = a 7 + b ( 2) a 5 = a 3 mod a 4 = 0 Thus Euclid s Extended Algorithm computes x = 7 and y = 2 for a = 9 and b = 31. Corollary 1 (Multiplicative inverse computation) Given integers n and a where gcd(a, n) = 1, using Euclid s Extended Algorithm to find x and y such that ax + ny = 1 finds an x such that ax 1 (mod n); such an x is the multiplicative inverse of a modulo n: x = a 1 (mod n). Example 1 The multiplicative inverse of 9, modulo 31, is 7. Chec: 9 7 = 63 = 1 (mod 31). Exercise 1 Find the multiplicative inverse of 11 modulo 41. Exercise 2 Prove that if gcd(a, n) > 1, then the multiplicative inverse a 1 (mod n) does not exist. Exercise 3 Show that Euclid s algorithm is correct by arguing that d is a common divisor of a and b if and only if d is a common divisor of b and (a mod b).

10 MIT Computer and Networ Security Class Notes 10 File: rivest/notes/crt.pdf Revision: December 2, 2002 Chinese Remainder Theorem When woring modulo a composite modulus n, the Chinese Remainder Theorem (CRT) can both speed computation modulo n and facilitate reasoning about the properties of arithmetic modulo n. Theorem 1 (Chinese Remainder Theorem (CRT)) Let n = n 1 n 2 n be the product of integers n i that are pairwise relatively prime. The mapping f(a) = (a 1,..., a ) = (a mod n 1,..., a mod n ) is an isomorphism from Z n to Z n1 Z n : if f(a) = (a 1,..., a ) and f(b) = (b 1,..., b ), then f((a ± b) mod n) = ((a 1 ± b 1 ) mod n 1,..., (a ± b ) mod n ) f((ab) mod n) = ((a 1b 1) mod n 1,..., (a b ) mod n ) f(a 1 mod n) = (a 1 1 mod n 1,..., a 1 mod n ) if a 1 (mod n) exists f 1 ((a 1,..., a )) = a = a i c i (mod n) where m i = n/n i and c i = m i (m 1 i mod n i ). i When n = pq is the product of two primes, woring modulo n is equivalent to woring independently on each component of its CRT (i.e. (mod p, mod q)) representation. It can be worthwhile to convert an input to its CRT representation, compute in that representation, and then convert bac. Example: For n = 35 = 5 7 put (a mod 35) in row a 1 = (a mod 5) and column a 2 = (a mod 7): f(8) = (3, 1) f( 8) = f(27) = ( 3, 1) = (2, 6) f(12) = (2, 5) f(12 1 ) = (2 1, 5 1 ) = (3, 3) = f(3) f(8 + 12) = f(20) = (3 + 2, 1 + 5) = (0, 6) f(8 12) = f(96) = f(26) = (3 2, 1 5) = (1, 5) Here m 1 = 7, m 2 = 5, c 1 = 7 (7 1 mod 5) = 7 3 = 21, c 2 = 5 (5 1 mod 7) = 5 3 = 15, so f 1 ((a 1, a 2)) = 21a a 2 (mod 35). (Note: f(21) = (1, 0), f(15) = (0, 1).) Thus, f 1 ((1, 5)) = = 96 = 26 (mod 35). Speeding up Modular Exponentation. A significant application is speeding up exponentiation modulo n = pq when p and q are nown. To compute y = x d mod n, where f(x) = (x 1, x 2 ): f(y) = f(x d ) = (x d 1 mod p, x d d mod (p 1) d mod (q 1) 2 mod q) = (x1 mod p, x2 mod q). Note x p 1 1 = 1 mod p for x 1 0 by Fermat s Little Theorem. Then convert bac from (y mod p, y mod q) to y mod n. Since exponentiation taes time cubic in the input size, two half-size exponentiations are about four times faster than one full-size exponentiation (including conversion). Exercise 1 Prove that x is a square mod n = pq if and only if it is a square mod p and mod q.

### U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009. Notes on Algebra

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, 2009 Notes on Algebra These notes contain as little theory as possible, and most results are stated without proof. Any introductory

### CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

CHAPTER 5 Number Theory 1. Integers and Division 1.1. Divisibility. Definition 1.1.1. Given two integers a and b we say a divides b if there is an integer c such that b = ac. If a divides b, we write a

### Factoring Algorithms

Factoring Algorithms The p 1 Method and Quadratic Sieve November 17, 2008 () Factoring Algorithms November 17, 2008 1 / 12 Fermat s factoring method Fermat made the observation that if n has two factors

### Today s Topics. Primes & Greatest Common Divisors

Today s Topics Primes & Greatest Common Divisors Prime representations Important theorems about primality Greatest Common Divisors Least Common Multiples Euclid s algorithm Once and for all, what are prime

### Primality - Factorization

Primality - Factorization Christophe Ritzenthaler November 9, 2009 1 Prime and factorization Definition 1.1. An integer p > 1 is called a prime number (nombre premier) if it has only 1 and p as divisors.

### Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Discrete Mathematics, Chapter 4: Number Theory and Cryptography Richard Mayr University of Edinburgh, UK Richard Mayr (University of Edinburgh, UK) Discrete Mathematics. Chapter 4 1 / 35 Outline 1 Divisibility

### Lecture 13 - Basic Number Theory.

Lecture 13 - Basic Number Theory. Boaz Barak March 22, 2010 Divisibility and primes Unless mentioned otherwise throughout this lecture all numbers are non-negative integers. We say that A divides B, denoted

### Elementary Number Theory We begin with a bit of elementary number theory, which is concerned

CONSTRUCTION OF THE FINITE FIELDS Z p S. R. DOTY Elementary Number Theory We begin with a bit of elementary number theory, which is concerned solely with questions about the set of integers Z = {0, ±1,

### Factoring & Primality

Factoring & Primality Lecturer: Dimitris Papadopoulos In this lecture we will discuss the problem of integer factorization and primality testing, two problems that have been the focus of a great amount

### 3. Applications of Number Theory

3. APPLICATIONS OF NUMBER THEORY 163 3. Applications of Number Theory 3.1. Representation of Integers. Theorem 3.1.1. Given an integer b > 1, every positive integer n can be expresses uniquely as n = a

### Cryptography and Network Security Number Theory

Cryptography and Network Security Number Theory Xiang-Yang Li Introduction to Number Theory Divisors b a if a=mb for an integer m b a and c b then c a b g and b h then b (mg+nh) for any int. m,n Prime

### 8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

### Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof. Harper Langston New York University

Discrete Mathematics Lecture 3 Elementary Number Theory and Methods of Proof Harper Langston New York University Proof and Counterexample Discovery and proof Even and odd numbers number n from Z is called

### FACTORING. n = 2 25 + 1. fall in the arithmetic sequence

FACTORING The claim that factorization is harder than primality testing (or primality certification) is not currently substantiated rigorously. As some sort of backward evidence that factoring is hard,

### Fractions and Decimals

Fractions and Decimals Tom Davis tomrdavis@earthlink.net http://www.geometer.org/mathcircles December 1, 2005 1 Introduction If you divide 1 by 81, you will find that 1/81 =.012345679012345679... The first

### = 2 + 1 2 2 = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

Instructions. Answer each of the questions on your own paper, and be sure to show your work so that partial credit can be adequately assessed. Credit will not be given for answers (even correct ones) without

### Homework 5 Solutions

Homework 5 Solutions 4.2: 2: a. 321 = 256 + 64 + 1 = (01000001) 2 b. 1023 = 512 + 256 + 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = (1111111111) 2. Note that this is 1 less than the next power of 2, 1024, which

### ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS

ABSTRACT ALGEBRA: A STUDY GUIDE FOR BEGINNERS John A. Beachy Northern Illinois University 2014 ii J.A.Beachy This is a supplement to Abstract Algebra, Third Edition by John A. Beachy and William D. Blair

### Public Key Cryptography: RSA and Lots of Number Theory

Public Key Cryptography: RSA and Lots of Number Theory Public vs. Private-Key Cryptography We have just discussed traditional symmetric cryptography: Uses a single key shared between sender and receiver

### Overview of Number Theory Basics. Divisibility

Overview of Number Theory Basics Murat Kantarcioglu Based on Prof. Ninghui Li s Slides Divisibility Definition Given integers a and b, b 0, b divides a (denoted b a) if integer c, s.t. a = cb. b is called

### Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00

18.781 Problem Set 7 - Fall 2008 Due Tuesday, Oct. 28 at 1:00 Throughout this assignment, f(x) always denotes a polynomial with integer coefficients. 1. (a) Show that e 32 (3) = 8, and write down a list

### Breaking The Code. Ryan Lowe. Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and

Breaking The Code Ryan Lowe Ryan Lowe is currently a Ball State senior with a double major in Computer Science and Mathematics and a minor in Applied Physics. As a sophomore, he took an independent study

### RSA and Primality Testing

and Primality Testing Joan Boyar, IMADA, University of Southern Denmark Studieretningsprojekter 2010 1 / 81 Correctness of cryptography cryptography Introduction to number theory Correctness of with 2

### Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

Number Theory Divisibility and Primes Definition. If a and b are integers and there is some integer c such that a = b c, then we say that b divides a or is a factor or divisor of a and write b a. Definition

### CS 103X: Discrete Structures Homework Assignment 3 Solutions

CS 103X: Discrete Structures Homework Assignment 3 s Exercise 1 (20 points). On well-ordering and induction: (a) Prove the induction principle from the well-ordering principle. (b) Prove the well-ordering

### RSA Attacks. By Abdulaziz Alrasheed and Fatima

RSA Attacks By Abdulaziz Alrasheed and Fatima 1 Introduction Invented by Ron Rivest, Adi Shamir, and Len Adleman [1], the RSA cryptosystem was first revealed in the August 1977 issue of Scientific American.

### The Mathematics of the RSA Public-Key Cryptosystem

The Mathematics of the RSA Public-Key Cryptosystem Burt Kaliski RSA Laboratories ABOUT THE AUTHOR: Dr Burt Kaliski is a computer scientist whose involvement with the security industry has been through

### On Generalized Fermat Numbers 3 2n +1

Applied Mathematics & Information Sciences 4(3) (010), 307 313 An International Journal c 010 Dixie W Publishing Corporation, U. S. A. On Generalized Fermat Numbers 3 n +1 Amin Witno Department of Basic

### Primality Testing and Factorization Methods

Primality Testing and Factorization Methods Eli Howey May 27, 2014 Abstract Since the days of Euclid and Eratosthenes, mathematicians have taken a keen interest in finding the nontrivial factors of integers,

### Cryptography and Network Security Chapter 8

Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown (with edits by RHB) Chapter 8 Introduction to Number Theory The Devil said to Daniel Webster:

### Elements of Applied Cryptography Public key encryption

Network Security Elements of Applied Cryptography Public key encryption Public key cryptosystem RSA and the factorization problem RSA in practice Other asymmetric ciphers Asymmetric Encryption Scheme Let

### Integer Factorization using the Quadratic Sieve

Integer Factorization using the Quadratic Sieve Chad Seibert* Division of Science and Mathematics University of Minnesota, Morris Morris, MN 56567 seib0060@morris.umn.edu March 16, 2011 Abstract We give

### MATH 168: FINAL PROJECT Troels Eriksen. 1 Introduction

MATH 168: FINAL PROJECT Troels Eriksen 1 Introduction In the later years cryptosystems using elliptic curves have shown up and are claimed to be just as secure as a system like RSA with much smaller key

### The RSA Algorithm. Evgeny Milanov. 3 June 2009

The RSA Algorithm Evgeny Milanov 3 June 2009 In 1978, Ron Rivest, Adi Shamir, and Leonard Adleman introduced a cryptographic algorithm, which was essentially to replace the less secure National Bureau

### Public Key Cryptography and RSA. Review: Number Theory Basics

Public Key Cryptography and RSA Murat Kantarcioglu Based on Prof. Ninghui Li s Slides Review: Number Theory Basics Definition An integer n > 1 is called a prime number if its positive divisors are 1 and

### Cryptography: RSA and the discrete logarithm problem

Cryptography: and the discrete logarithm problem R. Hayden Advanced Maths Lectures Department of Computing Imperial College London February 2010 Public key cryptography Assymmetric cryptography two keys:

### Factoring Algorithms

Institutionen för Informationsteknologi Lunds Tekniska Högskola Department of Information Technology Lund University Cryptology - Project 1 Factoring Algorithms The purpose of this project is to understand

### 9 Modular Exponentiation and Cryptography

9 Modular Exponentiation and Cryptography 9.1 Modular Exponentiation Modular arithmetic is used in cryptography. In particular, modular exponentiation is the cornerstone of what is called the RSA system.

### Math 453: Elementary Number Theory Definitions and Theorems

Math 453: Elementary Number Theory Definitions and Theorems (Class Notes, Spring 2011 A.J. Hildebrand) Version 5-4-2011 Contents About these notes 3 1 Divisibility and Factorization 4 1.1 Divisibility.......................................

### Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

Principles of Public Key Cryptography Chapter : Security Techniques Background Secret Key Cryptography Public Key Cryptography Hash Functions Authentication Chapter : Security on Network and Transport

### Basic Algorithms In Computer Algebra

Basic Algorithms In Computer Algebra Kaiserslautern SS 2011 Prof. Dr. Wolfram Decker 2. Mai 2011 References Cohen, H.: A Course in Computational Algebraic Number Theory. Springer, 1993. Cox, D.; Little,

### ECE 842 Report Implementation of Elliptic Curve Cryptography

ECE 842 Report Implementation of Elliptic Curve Cryptography Wei-Yang Lin December 15, 2004 Abstract The aim of this report is to illustrate the issues in implementing a practical elliptic curve cryptographic

### Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 5

CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 5 Modular Arithmetic One way to think of modular arithmetic is that it limits numbers to a predefined range {0,1,...,N

### Study of algorithms for factoring integers and computing discrete logarithms

Study of algorithms for factoring integers and computing discrete logarithms First Indo-French Workshop on Cryptography and Related Topics (IFW 2007) June 11 13, 2007 Paris, France Dr. Abhijit Das Department

### Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY. Sourav Mukhopadhyay

Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY Sourav Mukhopadhyay Cryptography and Network Security - MA61027 Modern/Public-key cryptography started in 1976 with the publication of the following paper. W. Diffie

Family Name:... First Name:... Section:... Advanced Cryptography Final Exam July 18 th, 2006 Start at 9:15, End at 12:00 This document consists of 12 pages. Instructions Electronic devices are not allowed.

### 1 Digital Signatures. 1.1 The RSA Function: The eth Power Map on Z n. Crypto: Primitives and Protocols Lecture 6.

1 Digital Signatures A digital signature is a fundamental cryptographic primitive, technologically equivalent to a handwritten signature. In many applications, digital signatures are used as building blocks

### Mathematics of Cryptography Part I

CHAPTER 2 Mathematics of Cryptography Part I (Solution to Odd-Numbered Problems) Review Questions 1. The set of integers is Z. It contains all integral numbers from negative infinity to positive infinity.

Chapter 2 Remodulization of Congruences Proceedings NCUR VI. è1992è, Vol. II, pp. 1036í1041. Jeærey F. Gold Department of Mathematics, Department of Physics University of Utah Don H. Tucker Department

### Integers, Division, and Divisibility

Number Theory Notes (v. 4.23 October 31, 2002) 1 Number Theory is the branch of mathematics that deals with integers and their properties, especially properties relating to arithmetic operations like addition,

### Algorithms with numbers

Chapter 1 Algorithms with numbers One of the main themes of this chapter is the dramatic contrast between two ancient problems that at first seem very similar: Factoring: Given a number N, express it as

### CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY

January 10, 2010 CHAPTER SIX IRREDUCIBILITY AND FACTORIZATION 1. BASIC DIVISIBILITY THEORY The set of polynomials over a field F is a ring, whose structure shares with the ring of integers many characteristics.

### Number Theory and Cryptography using PARI/GP

Number Theory and Cryptography using Minh Van Nguyen nguyenminh2@gmail.com 25 November 2008 This article uses to study elementary number theory and the RSA public key cryptosystem. Various commands will

### Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

Outline Computer Science 418 Digital Signatures Mike Jacobson Department of Computer Science University of Calgary Week 12 1 Digital Signatures 2 Signatures via Public Key Cryptosystems 3 Provable 4 Mike

### SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

SUBGROUPS OF CYCLIC GROUPS KEITH CONRAD 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by g = {g k : k Z}. If G = g, then G itself is cyclic, with g as a generator. Examples

### Mathematics of Cryptography

CHAPTER 2 Mathematics of Cryptography Part I: Modular Arithmetic, Congruence, and Matrices Objectives This chapter is intended to prepare the reader for the next few chapters in cryptography. The chapter

1 Introduction to Cryptography and Data Security 1 1.1 Overview of Cryptology (and This Book) 2 1.2 Symmetric Cryptography 4 1.2.1 Basics 4 1.2.2 Simple Symmetric Encryption: The Substitution Cipher...

### Runtime and Implementation of Factoring Algorithms: A Comparison

Runtime and Implementation of Factoring Algorithms: A Comparison Justin Moore CSC290 Cryptology December 20, 2003 Abstract Factoring composite numbers is not an easy task. It is classified as a hard algorithm,

### APPLICATIONS OF THE ORDER FUNCTION

APPLICATIONS OF THE ORDER FUNCTION LECTURE NOTES: MATH 432, CSUSM, SPRING 2009. PROF. WAYNE AITKEN In this lecture we will explore several applications of order functions including formulas for GCDs and

### (x + a) n = x n + a Z n [x]. Proof. If n is prime then the map

22. A quick primality test Prime numbers are one of the most basic objects in mathematics and one of the most basic questions is to decide which numbers are prime (a clearly related problem is to find

### I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

I GROUPS: BASIC DEFINITIONS AND EXAMPLES Definition 1: An operation on a set G is a function : G G G Definition 2: A group is a set G which is equipped with an operation and a special element e G, called

### Homework until Test #2

MATH31: Number Theory Homework until Test # Philipp BRAUN Section 3.1 page 43, 1. It has been conjectured that there are infinitely many primes of the form n. Exhibit five such primes. Solution. Five such

### Chapter. Number Theory and Cryptography. Contents

Chapter 10 Number Theory and Cryptography Contents 10.1 Fundamental Algorithms Involving Numbers..... 453 10.1.1 Some Facts from Elementary Number Theory.... 453 10.1.2 Euclid s GCD Algorithm................

### MATH 289 PROBLEM SET 4: NUMBER THEORY

MATH 289 PROBLEM SET 4: NUMBER THEORY 1. The greatest common divisor If d and n are integers, then we say that d divides n if and only if there exists an integer q such that n = qd. Notice that if d divides

### CIS 5371 Cryptography. 8. Encryption --

CIS 5371 Cryptography p y 8. Encryption -- Asymmetric Techniques Textbook encryption algorithms In this chapter, security (confidentiality) is considered in the following sense: All-or-nothing secrecy.

### FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY

FACTORING LARGE NUMBERS, A GREAT WAY TO SPEND A BIRTHDAY LINDSEY R. BOSKO I would like to acknowledge the assistance of Dr. Michael Singer. His guidance and feedback were instrumental in completing this

### Determining the Optimal Combination of Trial Division and Fermat s Factorization Method

Determining the Optimal Combination of Trial Division and Fermat s Factorization Method Joseph C. Woodson Home School P. O. Box 55005 Tulsa, OK 74155 Abstract The process of finding the prime factorization

### Public-key cryptography RSA

Public-key cryptography RSA NGUYEN Tuong Lan LIU Yi Master Informatique University Lyon 1 Objective: Our goal in the study is to understand the algorithm RSA, some existence attacks and implement in Java.

### SUM OF TWO SQUARES JAHNAVI BHASKAR

SUM OF TWO SQUARES JAHNAVI BHASKAR Abstract. I will investigate which numbers can be written as the sum of two squares and in how many ways, providing enough basic number theory so even the unacquainted

### Number Theory Hungarian Style. Cameron Byerley s interpretation of Csaba Szabó s lectures

Number Theory Hungarian Style Cameron Byerley s interpretation of Csaba Szabó s lectures August 20, 2005 2 0.1 introduction Number theory is a beautiful subject and even cooler when you learn about it

### Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4

### THE MATHEMATICS OF PUBLIC KEY CRYPTOGRAPHY.

THE MATHEMATICS OF PUBLIC KEY CRYPTOGRAPHY. IAN KIMING 1. Forbemærkning. Det kan forekomme idiotisk, at jeg som dansktalende og skrivende i et danskbaseret tidsskrift med en (formentlig) primært dansktalende

### MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES

MA257: INTRODUCTION TO NUMBER THEORY LECTURE NOTES 2016 47 4. Diophantine Equations A Diophantine Equation is simply an equation in one or more variables for which integer (or sometimes rational) solutions

### The RSA Algorithm: A Mathematical History of the Ubiquitous Cryptological Algorithm

The RSA Algorithm: A Mathematical History of the Ubiquitous Cryptological Algorithm Maria D. Kelly December 7, 2009 Abstract The RSA algorithm, developed in 1977 by Rivest, Shamir, and Adlemen, is an algorithm

### An Overview of Integer Factoring Algorithms. The Problem

An Overview of Integer Factoring Algorithms Manindra Agrawal IITK / NUS The Problem Given an integer n, find all its prime divisors as efficiently as possible. 1 A Difficult Problem No efficient algorithm

### Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

MTHSC 412 Section 2.4 Prime Factors and Greatest Common Divisor Greatest Common Divisor Definition Suppose that a, b Z. Then we say that d Z is a greatest common divisor (gcd) of a and b if the following

### Announcements. CS243: Discrete Structures. More on Cryptography and Mathematical Induction. Agenda for Today. Cryptography

Announcements CS43: Discrete Structures More on Cryptography and Mathematical Induction Işıl Dillig Class canceled next Thursday I am out of town Homework 4 due Oct instead of next Thursday (Oct 18) Işıl

### Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices. A Biswas, IT, BESU SHIBPUR

Mathematics of Cryptography Modular Arithmetic, Congruence, and Matrices A Biswas, IT, BESU SHIBPUR McGraw-Hill The McGraw-Hill Companies, Inc., 2000 Set of Integers The set of integers, denoted by Z,

### 8 Divisibility and prime numbers

8 Divisibility and prime numbers 8.1 Divisibility In this short section we extend the concept of a multiple from the natural numbers to the integers. We also summarize several other terms that express

Chapter 4 Complementary Sets Of Systems Of Congruences Proceedings NCUR VII. è1993è, Vol. II, pp. 793í796. Jeærey F. Gold Department of Mathematics, Department of Physics University of Utah Don H. Tucker

### Continued Fractions and the Euclidean Algorithm

Continued Fractions and the Euclidean Algorithm Lecture notes prepared for MATH 326, Spring 997 Department of Mathematics and Statistics University at Albany William F Hammond Table of Contents Introduction

### Revised Version of Chapter 23. We learned long ago how to solve linear congruences. ax c (mod m)

Chapter 23 Squares Modulo p Revised Version of Chapter 23 We learned long ago how to solve linear congruences ax c (mod m) (see Chapter 8). It s now time to take the plunge and move on to quadratic equations.

### Faster deterministic integer factorisation

David Harvey (joint work with Edgar Costa, NYU) University of New South Wales 25th October 2011 The obvious mathematical breakthrough would be the development of an easy way to factor large prime numbers

### 2 Primality and Compositeness Tests

Int. J. Contemp. Math. Sciences, Vol. 3, 2008, no. 33, 1635-1642 On Factoring R. A. Mollin Department of Mathematics and Statistics University of Calgary, Calgary, Alberta, Canada, T2N 1N4 http://www.math.ucalgary.ca/

### The cyclotomic polynomials

The cyclotomic polynomials Notes by G.J.O. Jameson 1. The definition and general results We use the notation e(t) = e 2πit. Note that e(n) = 1 for integers n, e(s + t) = e(s)e(t) for all s, t. e( 1 ) =

### Cryptography. Helmer Aslaksen Department of Mathematics National University of Singapore

Cryptography Helmer Aslaksen Department of Mathematics National University of Singapore aslaksen@math.nus.edu.sg www.math.nus.edu.sg/aslaksen/sfm/ 1 Basic Concepts There are many situations in life where

### CONTINUED FRACTIONS AND FACTORING. Niels Lauritzen

CONTINUED FRACTIONS AND FACTORING Niels Lauritzen ii NIELS LAURITZEN DEPARTMENT OF MATHEMATICAL SCIENCES UNIVERSITY OF AARHUS, DENMARK EMAIL: niels@imf.au.dk URL: http://home.imf.au.dk/niels/ Contents

### MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS

MATH 537 (Number Theory) FALL 2016 TENTATIVE SYLLABUS Class Meetings: MW 2:00-3:15 pm in Physics 144, September 7 to December 14 [Thanksgiving break November 23 27; final exam December 21] Instructor:

### Factoring Polynomials

Factoring Polynomials Sue Geller June 19, 2006 Factoring polynomials over the rational numbers, real numbers, and complex numbers has long been a standard topic of high school algebra. With the advent

### Arithmetic algorithms for cryptology 5 October 2015, Paris. Sieves. Razvan Barbulescu CNRS and IMJ-PRG. R. Barbulescu Sieves 0 / 28

Arithmetic algorithms for cryptology 5 October 2015, Paris Sieves Razvan Barbulescu CNRS and IMJ-PRG R. Barbulescu Sieves 0 / 28 Starting point Notations q prime g a generator of (F q ) X a (secret) integer

### PROBLEM SET 6: POLYNOMIALS

PROBLEM SET 6: POLYNOMIALS 1. introduction In this problem set we will consider polynomials with coefficients in K, where K is the real numbers R, the complex numbers C, the rational numbers Q or any other

### Number Theory and the RSA Public Key Cryptosystem

Number Theory and the RSA Public Key Cryptosystem Minh Van Nguyen nguyenminh2@gmail.com 05 November 2008 This tutorial uses to study elementary number theory and the RSA public key cryptosystem. A number

### The Mathematics of RSA

The Mathematics of RSA Dimitri Papaioannou May 24, 2007 1 Introduction Cryptographic systems come in two flavors. Symmetric or Private key encryption and Asymmetric or Public key encryption. Strictly speaking,

### Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any.

Algebra 2 - Chapter Prerequisites Vocabulary Copy in your notebook: Add an example of each term with the symbols used in algebra 2 if there are any. P1 p. 1 1. counting(natural) numbers - {1,2,3,4,...}

### On Factoring Integers and Evaluating Discrete Logarithms

On Factoring Integers and Evaluating Discrete Logarithms A thesis presented by JOHN AARON GREGG to the departments of Mathematics and Computer Science in partial fulfillment of the honors requirements

### Integers and division

CS 441 Discrete Mathematics for CS Lecture 12 Integers and division Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Symmetric matrix Definition: A square matrix A is called symmetric if A = A T.

### Is n a Prime Number? Manindra Agrawal. March 27, 2006, Delft. IIT Kanpur

Is n a Prime Number? Manindra Agrawal IIT Kanpur March 27, 2006, Delft Manindra Agrawal (IIT Kanpur) Is n a Prime Number? March 27, 2006, Delft 1 / 47 Overview 1 The Problem 2 Two Simple, and Slow, Methods

### Elementary factoring algorithms

Math 5330 Spring 013 Elementary factoring algorithms The RSA cryptosystem is founded on the idea that, in general, factoring is hard. Where as with Fermat s Little Theorem and some related ideas, one can