K. -C. Yang and J. -L. Lin National Tsing Hua University

Slides:



Advertisements
Similar presentations
With examples from Number Theory
Advertisements

Mathematics of Cryptography Part II: Algebraic Structures
Cryptography and Network Security
Chapter 4 – Finite Fields. Introduction will now introduce finite fields of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key.
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Prime Numbers: A Recent Discovery, Secure Communications, and Million Dollar Prizes George T. Gilbert TCU January 29, 2003.
1 Deciding Primality is in P M. Agrawal, N. Kayal, N. Saxena Presentation by Adi Akavia.
Computability and Complexity
Having Proofs for Incorrectness
Agrawal-Kayal-Saxena Presented by: Xiaosi Zhou
Primality Testing Patrick Lee 12 July 2003 (updated on 13 July 2003)
Introduction to Modern Cryptography Lecture 6 1. Testing Primitive elements in Z p 2. Primality Testing. 3. Integer Multiplication & Factoring as a One.
COM 5336 Cryptography Lecture 7a Primality Testing
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Basic properties of the integers
Math 3121 Abstract Algebra I
Algebraic Structures DEFINITIONS: PROPERTIES OF BINARY OPERATIONS Let S be a set and let  denote a binary operation on S. (Here  does not necessarily.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Deciding Primality is in P M. Agrawal, N. Kayal, N. Saxena Slides by Adi Akavia.
Inverses and GCDs Supplementary Notes Prepared by Raymond Wong
Complexity1 Pratt’s Theorem Proved. Complexity2 Introduction So far, we’ve reduced proving PRIMES  NP to proving a number theory claim. This is our next.
Introduction Polynomials
Finite fields.
Manindra Agrawal NUS / IITK
The Integers and Division
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.

Cryptography Lecture 6 Stefan Dziembowski
Mathematics of Cryptography Part I: Modular Arithmetic
CPSC 3730 Cryptography and Network Security
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
Information Security and Management 4. Finite Fields 8
Cryptography and Network Security Introduction to Finite Fields.
The Polynomial Time Algorithm for Testing Primality George T. Gilbert.
By: Hector L Contreras SSGT / USMC
Mathematics Review Exponents Logarithms Series Modular arithmetic Proofs.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
PRIMES is in P Manindra Agrawal NUS Singapore / IIT Kanpur.
CompSci 102 Discrete Math for Computer Science
Analyzing and Testing justified Prime Numbers
Chapter 4 – Finite Fields
Primes in P Deterministic polynomial-time algorithm of Agrawal, Kayal and Saxena Presented by Vladimir Braverman.
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Math 3121 Abstract Algebra I Lecture 5 Finish Sections 6 + Review: Cyclic Groups, Review.
9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.1 CSE565: Computer Security Lecture 7 Number Theory Concepts Shambhu Upadhyaya Computer Science & Eng. University.
Primes in P Manindra Agrawal Neeraj Kayal Nitin Saxena CS300: Technical Paper review by Arpan Agrawal.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
Great Theoretical Ideas in Computer Science.
Section 1.7. Definitions A theorem is a statement that can be shown to be true using: definitions other theorems axioms (statements which are given as.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
May 9, 2001Applied Symbolic Computation1 Applied Symbolic Computation (CS 680/480) Lecture 6: Multiplication, Interpolation, and the Chinese Remainder.
Multiplicative Group The multiplicative group of Z n includes every a, 0
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Discrete Mathematics Chapter 2 The Fundamentals : Algorithms, the Integers, and Matrices. 大葉大學 資訊工程系 黃鈴玲.
Fuw-Yi Yang1 Textbook: Introduction to Cryptography 2nd ed. By J.A. Buchmann Chap 1 Integers Department of Computer Science and Information Engineering,
PRIMES is in P Manindra Agrawal Neeraj Kayal Nitin Saxena Dept of CSE, IIT Kanpur.
CSE565: Computer Security Lecture 7 Number Theory Concepts
Probabilistic Algorithms
Sullivan Algebra and Trigonometry: Section 5
Deciding Primality is in P
Patrick Lee 12 July 2003 (updated on 13 July 2003)
From the last time: gcd(a, b) can be characterized in two different ways: It is the least positive value of ax + by where x and y range over integers.
Presentation transcript:

K. -C. Yang and J. -L. Lin National Tsing Hua University PRIMES K. -C. Yang and J. -L. Lin National Tsing Hua University

OUTLINE Definition And History of Prime PRIMES is in P Previous Researches Basic Idea and Approach Preliminary Notation The Algorithm And Verification Time Complexity Analysis Future Works

History History Definition Let p N and p > 1, p is prime if it has no positive divisor other than 1 and p. History Pythagoras (580 BC ~ 300 BC) Integer (odd, even, prime, …), Rational and Irrational number, Pythagorean Theorem… Euclid (300 BC) There are an infinite number of primes.

History (2) pf. Assume there are finite number of primes. Let p1, …, pn be all primes, and let N = p1p2…pn + 1  N is a composite number and  N has a prime factor p  p1, …, pn  Contradiction

History (3) PRIMES is in P - O(logk n) for k≧1. How to determine if a number is prime? Sieve of Eratosthenes (240 BC) If n is composite, then n has a positive divisor less than or equal to n1/2. So to determinate whether n is prime, you can try dividing n to every m < n1/2. This is an exponential-time algorithm O(n1/2 log n). PRIMES is in P - O(logk n) for k≧1.

Fermat (1) Fermat’s Last Theorem (AD 1637) xn + yn = zn has no integer solution for n > 2 Proven by Wiles (AD 1995) Fermat’s Little Theorem (AD 1640) a  N and p is prime, then ap-1 ≡1 (mod p) e.g. p = 2, a = 3, then 32 ≡ 1 (mod 2) p = 3, a = 4, then 43 ≡ 1 (mod 3) p | ap-1 - 1

Fermat (2) pf. of Fermat’s little theorem (by induction) ap-1 ≡1 (mod p)  ap - a ≡ 0 (mod p)  p | ap - a Assume p | ap - a, then examine (a + 1)p - (a + 1) (binomial theorem)   p divides the right side, so it also divides the left side.  p | (a + 1)p - (ap + 1) + (ap - a) = (a + 1)p - (a + 1)  The hypothesis is true for any a.

Fermat (3) Time complexity – O(lg n) If ap-1 ≡1 (mod p) for a  N , p is prime? It fails! 341 341 = 11 × 31 2340 ≡1 (mod 341) Pseudo primes: 341, 561 , 645, 1105…

Previous Researches 1975, Miller designed a test based on Fermat Little Theorem deterministic polynomial-time algorithm – O(log4 n) Assuming Extended Riemann Hypothesis 1980, Miller’s algorithm was modified by Rabin Unconditional but randomized polynomial-time 1983, Adleman, Pomerance and Rumely deterministic in (log n)O(logloglog n) 1986, Goldwasser and Kilian randomized polynomial-time algorithm (on almost all input) 1992, G-K algorithm was modified by Adleman and Huang randomized polynomial-time algorithm on all inputs 2002, Manindra Agrawal, Neeraj Kayal, and Nitin Saxena deterministic polynomial-time O(log7.5+εn) by using algebra

Riemann Hypothesis (1) In 1859, proposed by Riemann Hilbert’s problems 23 problems. The Second International Congress of Mathematicians, 1900. Three of Hilbert’s problems remain unconquered. 6. Can physics be axiomized? 8. Riemann hypothesis. 16. Develop a topology of real algebraic curves and surfaces. Partial answer by Oxenhielm, Stockholm University, 2003

Riemann Hypothesis (2) Riemann zeta function Trivial zero point -2, -4, -6, -8, … Riemann Hypothesis  non trivial zero point in Reimann zeta function, σ= ½. Clay Mathematics Institute $1000000 for the solution to this problem. (2000. 5)

Manindra Agrawal, Neeraj Kayal, and Nitin Saxena August 6, 2002 PRIMES is in P Manindra Agrawal, Neeraj Kayal, and Nitin Saxena August 6, 2002

Basic Idea and Approach (1) Let aZ, nN, and (a, n) = 1. Then n is prime iff (X + a)n≡(Xn + a) (mod n) pf. If n is prime  n | (X + a)n – (Xn + a)  (X - a)n≡(Xn - a) (mod n) If n is composite, let q be prime, qk | n, but qk+1 | n   n | (X + a)n – (Xn + a) an – a = a(an-1 – 1) ∵n | an-1 -1 (Fermat’s little thm)  n | an - a (n, a) = 1  (qk, an-q) = 1

Basic Idea and Approach (2) To evaluate n coefficients, it costs time Ω(n). To shorten the number of coefficients, we use (x + a)n ≡ (xn + a) (mod xr – 1, n) If p is prime, the above congruence holds. However, some composite numbers still satisfy this congruence. For appropriate r, n must be a prime power. e.g. 33, 75, 2×3×5

Basic Algorithm Input n > 1 1. If ( n = ab for some a  N and b > 1), output COMPOSITE. 2. Find the smallest r such that or(n) > 4log2n. 3. If (gcd(n, a) > 1 for some a ≦ r) , output COMPOSITE. 4. If (n ≦ r), output PRIME. 5. For a = 1 to do if , output COMPOSITE. 6. Output PRIME. Notation: or(n) = d denotes the smallest positive integer d s.t. nd ≡ 1 (mod r) Notation2: ψ(r) = |k|, where k < r and (k, r) = 1

Preliminary Notation (1) Fn denotes the finite field, where n is a prime. Let n and r be prime numbers, n ≠ r. 1. The multiplicative group of any field Fn, denoted by Fn* is cyclic. 2. Let f(x) be a polynomial with integral coefficients. Then f(x)n≡ f(xn) (mod n) 3. Let h(x) be any factor of xr - 1. Let m≡mr (mod r). Then xm ≡ xmr (mod h(x)) 4. In Fn, factorizes into irreducible polynomial each of degree or(n).

Preliminary Notation (2) Let f(x) be a polynomial with integral coefficients. Then f(x)n≡ f(xn) (mod n) pf. Let f(x) = a0 + … + adxd. The coefficient ci of xi in f(x)n is n | ci unless some ij is n. In this exception case, im = 0 for all m ≠ j. i = j × ij = nj. And cnj = ajn (mod n). Therefore, cnj ≡ aj (mod n) (Fermat’s Little Theorem) f(x)n ≡ c0 + cnxn + c2nx2n + … + cndxnd (mod n) ≡ a0 + a1xn + a2x2n + … + adxnd (mod n) ≡ f(xn) (mod n) xi1 × x2i2 × … × xdid = xi1+2i2…+did cnj = ajn + n ×Δ

Preliminary Notation (3) Let h(x) be any factor of xr – 1. Let m≡mr (mod r). Then xm ≡ xmr (mod h(x)) pf. Let m = kr + mr. Now xr ≡ 1 (mod xr - 1)  xkr ≡ 1 (mod xr - 1)  xkr+mr ≡ xmr (mod xr - 1)  xm ≡ xmr (mod xr - 1)  xm ≡ xmr (mod h(x)) xr-1 | xm-xmr  h(x) ×Δ | xm-xmr  h(x) | xm-xmr

Preliminary Notation (4) In Fn, factorizes into irreducible polynomial each of degree or(n). Let d = or(n) and h(x) be a irreducible factor of with degree k. Fn[x]/h(x) forms a field of size nk and the multiplicative subgroup of Fn[x]/h(x) is cyclic with a generator g(x) (by fact 1). We have g(x)n ≡ g(xn) (fact 2)  g(x)nd ≡ g(xnd)  g(x)nd ≡ g(x)  g(x)nd-1 ≡ 1 ∵ Order of g(x) = (nk - 1), ∴(nk - 1)|(nd - 1)  k | d. ∵ h(x) | (xr – 1), we also have xr ≡ 1 in Fn[x]/h(x)  order of x in this field must be r (∵ r is prime). Therefore, r | (nk - 1), i.e. nk ≡ 1 (mod r) Hence, d | k. Therefore, k = d. g(xn) ≡ g(xn) g(xn)n ≡ g(xn2) g(xn2)n ≡ g(xn3) … g(x)nd ≡ g(xnd) pn ≡ 1 (mod r) xnd ≡ x1 (mod h(x)) (by fact 3) g(xnd) ≡ g(x)

Algorithm Input n > 1 1. If (  a  N and b > 1 s.t. n = ab ), output COMPOSITE. 2. Find the smallest r such that or(n) > 4log2n. 3. If (  a ≦ r s.t. 1 < gcd(n, a) < n ) , output COMPOSITE. 4. If (n ≦ r), output PRIME. 5. For a = 1 to do if , output COMPOSITE. 6. Output PRIME. Notation: (n, r) = 1, or(n) = d denotes the smallest positive integer d s.t. nd ≡ 1 (mod r) Notation2: ψ(r) = |k|, where k < r and (k, r) = 1

Correctness (1) Lemma. If n is prime, the algorithm returns PRIME. pf. 1. Step 1 and Step 3 can never return COMPOSITE. n≠ab (a, n) = 1 or n  a ≦ r 2. Step 5 also can not return COMPOSITE. If p is prime, (x + a)n ≡ (xn + a) (mod xr – 1, n) holds  It returns PRIME either in Step 4 or Step 6.

Correctness (1) Lemma. If the algorithm returns PRIME, n is prime. If it returns PRIME in Step 4 then n must be prime. ∵n ≦ r , and (n, a) = 1 or n  a ≦ r The remaining case: It returns PRIME in Step 6. (n, 1) = 1 (n, 2) = 1 … (n, n -1) = 1 (n, n) = n

Correctness (2) Find an appropriate r in Step 2. rt Find an appropriate r in Step 2. Lemma. There exist an r ≦ 16lg5n s.t. or(n) > 4lg2n pf. Let r1, r2, …, rt be all numbers s.t. ori(n) ≦ 4lg2n, note that t ≦ 16lg5n 1 2 3 16lg5n  ∵n ≦ 2lgn Let ori(n) = k  nk≡1 (mod ri)  ri | nk - 1 < n1n2…n4lg2n = n8lg4n+2lg2n < n16lg4n

Correctness (3)  lcm (r1, …, rt) |Π (ni - 1) < 216lg5n However, lcm (1, …, 16lg5n) > 216lg5n Therefore, t < 216lg5n  r {ri | 0 ≦ i ≦ t}, but r < 16lg5n, and or(n) > 4lg2n Lemma. lcm (1, 2, …, m) ≧ 2m for m>6

Correctness (4) Assume n is composite. Let p be prime and p | n We fix p and r in the remainder sections. Set l = (X + a)n ≡ Xn + a (mod Xr - 1, n) for 1≦ a ≦ l (X + a)n ≡ Xn + a (mod Xr - 1, p) for 1≦ a ≦ l (X + a)p ≡ Xp + a (mod Xr - 1, p) for 1≦ a ≦ l ∵p is prime and (a, p) = 1

Correctness (5) Definition. For polynomial f(X) and number m N, we say that m is introspective for f(X) if [f(X)]m ≡ f(Xm) (mod Xr – 1, p) n, p are introspective for f(X) = X + a Lemma. If m and m’ are introspective numbers for f(X) then so is m × m’ pf. [f(X)]mm’ ≡ [f(Xm)]m’ (mod Xr - 1, p) Let Y = Xm, [f(Y)]m’, [f(Y)]m’ ≡ f(Ym’) (mod Yr - 1, p)  [f(Xm)]m’ ≡ f(Xmm’) (mod Xr - 1, p)  [f(X)]mm’ ≡ f(Xmm’) (mod Xr - 1, p) Yr - 1 = Xmr - 1 Xr - 1 | Xmr – 1

Correctness (6) Lemma. If m is introspective for f(X) and g(X) then so is f(X)g(X) pf. claim: [f(X)g(X)]m ≡ f(Xm)g(Xm) (mod Xr – 1, p) [f(X)]m ≡ f(Xm) (mod Xr – 1, p) [g(X)]m ≡ g(Xm) (mod Xr – 1, p)  [f(X)]m[g(X)]m ≡ f(Xm)g(Xm) (mod Xr – 1, p)

Lemma 4.5. If m and m are introspective numbers for f(x) then so is m m. Lemma 4.6. If m is introspective for f(x) and g(x) then it is also introspective for f(x)  g(x).

Set Lemma 4.5 and 4.6 implies that every number in the set I is instropective for every polynomials in the set P. i,e,

Define G be the set of all residues of numbers in I modulo r , then G is a subgroup of Let |G| = t , and since or(n) > 4log2n, t > 4log2n.

Lemma 4.7.

Lemma 4.8. If n is not a power of p, then

Lemma 4.9. If the algorithm returns PRIME then n is prime.

O(log3n) O(log7n) (log5n r’s) O(rlogn)= O(log6n) Each equation : O(rlog2n) Total : O(log10.5n)