Slide 1P vs. NP, AKS, RSA: The Acronyms of Mathematics Awareness Month Emily List Wittenberg University
[email protected] Slide 2April 2006: Mathematics Awareness Month Mathematics and Internet Security Slide 3Definitions P: yes or no decision problems that can be solved by an algorithm that runs in polynomial time. Polynomial time: the number of steps needed to solve a problem can be expressed as a function. Where x is the size of the input and n is a constant. Slide 4Whats so great about polynomial time? Running time of algorithm t(n) Maximum size solvable in 1 second nN 0 =100 million 100 N 0 1000 N 0 100nN 1 =1 million100 N 1 1000 N 1 n2n2 N 2 =10,00010 N 2 31.6 N 2 n3n3 N 3 =4644.64 N 3 10 N 3 2n2n N 4 =26N 4 +6.64N 4 +9.97 Current computer 100 times faster 1000 times faster Ramachandran, Vijaya. P versus NP Slide 5NP: a problem that can be verified using an algorithm that runs in polynomial time IMPORTANT: This does not mean not polynomial time Definitions Continued Slide 6What would a solution to P = NP? look like? or P NP P Slide 7Why is P vs NP important? Clay Mathematics Institute: $1,000,000 prize Internet security implications Public Key Encryption Whitfield Diffie and Martin Hellman, 1976 RSA public-key cryptosystem Ronald Rivest, Adi Shamir, and Leonard Aldeman, 1977 Slide 8RSA Encryption Uses a function that is NP but not known to be P to encrypt information. Fermats Little Theorem: Let a and p be integers such that p is prime and gcd(a, p) =1, then Slide 9Theorem: If m is an integer, n = pq, p and q are primes, and ef 1 mod ((p-1)(q-1)), then (m e ) f (mod n) m. Proof. Slide 10Theorem: If m is an integer, n = pq, p and q are primes, and ef 1 mod ((p-1)(q-1)), then (m e ) f (mod n) m. Proof. ef = (p-1)(q-1)k + 1 By substitution, (m e ) f = m (p-1)(q-1)k+1 = m (p-1)(q-1)k m. Slide 11Theorem: If m is an integer, n = pq, p and q are primes, and ef 1 mod ((p-1)(q-1)), then (m e ) f (mod n) m. Proof. ef = (p-1)(q-1)k + 1 By substitution, (m e ) f = m (p-1)(q-1)k+1 = m (p-1)(q-1)k m. Then by Fermats little theorem: (m (p-1) ) (q-1)k 1 (m e ) f m (p-1)(q-1)k m m (mod p) Slide 12Theorem: If m is an integer, n = pq, p and q are primes, and ef 1 mod ((p-1)(q-1)), then (m e ) f (mod n) m. Proof. ef = (p-1)(q-1)k + 1 By substitution, (m e ) f = m (p-1)(q-1)k+1 = m (p-1)(q-1)k m. Then by Fermats little theorem: (m (p-1) ) (q-1)k 1 (m e ) f m (p-1)(q-1)k m m (mod p) Similarly, (m e ) f m (p-1)(q-1)k m m (mod q). Slide 13Theorem: If m is an integer, n = pq, p and q are primes, and ef 1 mod ((p-1)(q-1)), then (m e ) f (mod n) m. Proof. ef = (p-1)(q-1)k + 1 By substitution, (m e ) f = m (p-1)(q-1)k+1 = m (p-1)(q-1)k m. Then by Fermats little theorem: (m (p-1) ) (q-1)k 1 (m e ) f m (p-1)(q-1)k m m (mod p) Similarly, (m e ) f m (p-1)(q-1)k m m (mod q). Therefore, by the Chinese Remainder Theorem we have (m e ) f (mod n) m. Slide 14RSA Example Necessary InformationWhere is comes fromWhat it is for this example p,qprimep=67 q=89 npq5963 Φ(n)Number of integers less than n that are relatively prime to n. (p-1)(q-1) 5808 e,fe,f >1 such thate = 37 f = 157 We want to encrypt the number 17: x e (mod n) 17 16 (mod 5963) 5064 To decrypt: 5064 f (mod 5963) 5064 157 17 Slide 15Why is RSA secure? Its nearly impossible to find f without the factors of n. Since we do not have an algorithm that runs in polynomial time to find factorizations, finding the factors n is nearly impossible. Slide 16Is this number prime, if so what are its factors? 2039568783564019774057658669290345772 8019399331434826309477264645328306272 2701277632936616063144088173312372882 6771238795387094001583065673383282791 5449969836607190676644003707421711780 5690872792848149112022286332144876183 3763265120835748216479339929612499173 1983621930427428024380310401500056379 0123 Slide 171 2 3 4 5 6 7 8 910 11121314151617181920 21222324252627282930 31323334353637383940 41424344454647484950 51525354555657585960 61626364656667686970 71727374757677787980 81828384858687888990 919293949596979899 100 Sieve of Eratosthenes Slide 181 2 3 4 5 6 7 8 910 11121314151617181920 21222324252627282930 31323334353637383940 41424344454647484950 51525354555657585960 61626364656667686970 71727374757677787980 81828384858687888990 919293949596979899 100 Sieve of Eratosthenes Slide 191 2 3 4 5 6 7 8 910 11121314151617181920 21222324252627282930 31323334353637383940 41424344454647484950 51525354555657585960 61626364656667686970 71727374757677787980 81828384858687888990 919293949596979899 100 Sieve of Eratosthenes Slide 201 2 3 4 5 6 7 8 910 11121314151617181920 21222324252627282930 31323334353637383940 41424344454647484950 51525354555657585960 61626364656667686970 71727374757677787980 81828384858687888990 919293949596979899 100 Sieve of Eratosthenes Slide 21Does the Sieve of Eratosthenes run in polynomial time? NO. Why not? For a number with N digits, the number of steps the sieve needs is [10 N ] 1/2 which is exponential. Slide 22Primes is in P In 2002, Manindra Agrawal, Neeraj Kayal and Nitin Saxena came up with an algorithm that runs in polynomial and give the primality of a number. This algorithm is beautiful Carl Pomerance The proof is simple, elegant and beautiful R. Balasubramanian Slide 23AKS Algorithm From PRIMES is in P Slide 24Explanation of AKS Lemma 2.1 Let a be an integer, n is a natural number, n > 2 and gcd(a,n)=1. Then n is prime iff (X+ a) n X n +a(mod n). Proof. By the binomial theorem: the coefficient of x i in ((X+a) n –(X n +a) is a n-i. Slide 25Explanation of AKS Lemma 2.1 Let a be an integer, n is a natural number, n > 2 and gcd(a,n)=1. Then n is prime iff (X+ a) n X n +a(mod n). Proof. By the binomial theorem: the coefficient of x i in ((X+a) n –(X n +a) is a n-i. Suppose n is prime. Then 0 (mod n) and hence all of the coefficients are zero. Slide 26Explanation of AKS Lemma 2.1 Let a be an integer, n is a natural number, n > 2 and gcd(a,n)=1. Then n is prime iff (X+ a) n X n +a(mod n). Proof. By the binomial theorem: the coefficient of x i in ((X+a) n –(X n +a) is a n-i. Suppose n is prime. Then 0 (mod n) and hence all of the coefficients are zero. Suppose n is composite. Consider a prime q that is a factor of n and let q k divide n, but q k+1 does not. Then q k does not divide and gcd( a n-q, q k ) =1 Hence, the coefficient of X q is not zero (mod n). Therefore (X+a) n X n +a (mod n). Slide 27Does AKS ruin RSA? NO!! Why not? AKS does not factor a number, it only tells us if it is prime or not. RSA is secure as long as we dont have an algorithm that can factor in polynomial time. Slide 28Acknowledgements Manindra Agrawal, Neeraj Kayal, and Nitin Saxena. PRIMES is in P. (http://www.cse.iitk.ac.in/news/primality_v3.ps), Februaruy 2003.http://www.cse.iitk.ac.in/news/primality_v3.ps P vs NP Problem. Clay Mathematics Institute, (http://www.claymath.org/millennium/P_vs_NP/) Ramachandran, Vijaya. P versus NP. University of Texas Lectures on the Millennium Prize Problems, May 2001. (http://www.claymath.org/video/) Stewart, Ian. Ian Stewart on Minesweeper. Clay Mathematics Institute, (http://www.claymath.org/Popular_Lectures/Minesweeper) Kaliski, Burt. The Mathematics of the RSA Public-Key Cryptosystem. RSA Laboratories. Polynomial time. Wikipedia, (http://en.wikipedia.org/wiki/Polynomial _time)