Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
COMP 170 L2 Page 1 L06: The RSA Algorithm l Objective: n Present the RSA Cryptosystem n Prove its correctness n Discuss related issues.
CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
Data encryption with big prime numbers
22C:19 Discrete Structures Integers and Modular Arithmetic
BY : Darshana Chaturvedi.  INTRODUCTION  RSA ALGORITHM  EXAMPLES  RSA IS EFFECTIVE  FERMAT’S LITTLE THEOREM  EUCLID’S ALGORITHM  REFERENCES.
Primality Testing By Ho, Ching Hei Cheung, Wai Kwok.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
7. Asymmetric encryption-
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
Great Theoretical Ideas in Computer Science.
Attacks on Digital Signature Algorithm: RSA
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
1 Lecture #10 Public Key Algorithms HAIT Summer 2005 Shimrit Tzur-David.
Public Encryption: RSA
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
CSE331: Introduction to Networks and Security Lecture 20 Fall 2002.
Cryptography & Number Theory
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
RSA Encryption William Lu. RSA Background  Basic technique first discovered in 1973 by Clifford Cocks of CESG (part of British GCHQ)  Invented in 1977.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Lecture 6: Public Key Cryptography
The RSA Algorithm Based on the idea that factorization of integers into their prime factors is hard. ★ n=p . q, where p and q are distinct primes Proposed.
1 CIS 5371 Cryptography 8. Asymmetric encryption-.
Andreas Steffen, , 4-PublicKey.pptx 1 Internet Security 1 (IntSi1) Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications.
Page 1 Secure Communication Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
The RSA Algorithm Rocky K. C. Chang, March
Prime Numbers Prime numbers only have divisors of 1 and self
Introduction to Modular Arithmetic and Public Key Cryptography.
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
RSA Public Key Algorithm. RSA Algorithm history  Invented in 1977 at MIT  Named for Ron Rivest, Adi Shamir, and Len Adleman  Based on 2 keys, 1 public.
Great Theoretical Ideas in Computer Science.
RSA Ramki Thurimella.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Darci Miyashiro Math 480 April 29, 2013
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
1 Public-Key Cryptography and Message Authentication.
1 Number Theory and Advanced Cryptography 5. Cryptanalysis of RSA Chih-Hung Wang Sept Part I: Introduction to Number Theory Part II: Advanced Cryptography.
RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013.
MA/CSSE 473 Day 10 Primality testing summary Data Encryption RSA.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Scott CH Huang COM 5336 Cryptography Lecture 6 Public Key Cryptography & RSA Scott CH Huang COM 5336 Cryptography Lecture 6.
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
What use are prime numbers? ?. o All the primes, apart from 2, are odd numbers. o 1 is not a prime number. Why? o There are infinitely many prime numbers!
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Introduction to Cryptography Lecture 9. Public – Key Cryptosystems Each participant has a public key and a private key. It should be infeasible to determine.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
Great Theoretical Ideas in Computer Science.
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
Lecture 6. RSA Use in Encryption to encrypt a message M the sender: – obtains public key of recipient PU={e,n} – computes: C = M e mod n, where 0≤M
Cryptography RSA Algorithm BY : Wesam Fadheel Computer science department - WMU CS-6800 Advanced Theory of Computation Instructor: Dr. Elise De Doncker.
Copyright © Zeph Grunschlag, RSA Encryption Zeph Grunschlag.
1 The RSA Algorithm Rocky K. C. Chang February 23, 2007.
Intro to Cryptography ICS 6D Sandy Irani. Cryptography Intro Alice wants to send a message to Bob so that even if Eve can see the transmitted information,
Fermat’s Little Theorem
Chapter Applications of Number Theory Some Useful Results
Presentation transcript:

Cryptography Dec 29

This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer science – the design of cryptosystem. Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem

Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal: Even though an adversary can listen to your conversation, the adversary can not learn what the message was. message

Cryptography AliceBob adversary Goal: Even though an adversary can listen to your conversation, the adversary can not learn what the message was. message -> f(message) f(message) encrypt the messagedecrypt the message f(message) -> message But the adversary has no clue how to obtain message from f(message) A difficult goal!

Key AliceBob adversary Goal: Even though an adversary can listen to your conversation, the adversary can not learn what the message was. message -> f(message,key) f(message, key) encrypt the message using the keydecrypt the message using the key f(message,key) -> message But the adversary can not decrypt f(message,key) without the key Use number theory!

This Lecture Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem

Turing’s Code (Version 1.0) The first step is to translate a message into a number “v i c t o r y” -> Beforehand The sender and receiver agree on a secret key, which is a large number k. Encryption The sender encrypts the message m by computing: m* = m · k Decryption The receiver decrypts m by computing: m*/k = m · k/k = m

Turing’s Code (Version 1.0) AliceBob adversary mk m = message k = key encrypted message = mk Why the adversary cannot figure out m? mk = received message k = key decrypted message = mk/k=m The adversary doesn’t have the key k, and so can only factor mk to figure out m, but factoring is a difficult task to do.

Turing’s Code (Version 1.0) AliceBob adversary mk m = message k = key encrypted message = mk mk = received message k = key decrypted message = mk/k=m So why don’t we use this Turing’s code today? Major flaw: if you use the same key to send two messages m and m’, then from mk and m’k, we can use gcd(mk,m’k) to figure out k, and then decrypt every message.

Turing’s Code (Version 2.0) Beforehand The sender and receiver agree on a large prime p, which may be made public. (This will be the modulus for all our arithmetic.) They also agree on a secret key k in {1, 2,..., p − 1}. Encryption The message m can be any integer in the set {0, 1, 2,..., p − 1}. The sender encrypts the message m to produce m* by computing: m* = mk mod p Decryption Let k’ be the multiplicative inverse of k under modulo p. m*  mk (mod p) m*k’  m (mod p) m*k’ = m

Turing’s Code (Version 2.0) AliceBob adversary m* = mk mod p m = message k = key encrypted message = mk mod p Why the adversary cannot figure out m? m* = received message k = key decrypted message = m*k’ =m Many m and k can produce m* as output, just impossible to determine m without k. Public information p

Turing’s Code (Version 2.0) AliceBob adversary m* = mk mod p m = message k = key encrypted message = mk mod p m* = received message k = key decrypted message = m*k’ =m If the adversary somehow knows m, then first compute m’ := multiplicative inverse of m m*  mk (mod p) m*m’  k (mod p) So the adversary can figure out k. Public information p So why don’t we use this Turing’s code today? plain-text attack

This Lecture Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem

Private Key Cryptosystem AliceBob adversary message -> f(message,key) f(message, key) encrypt the message using the keydecrypt the message using the key f(message,key) -> message But the adversary can not decrypt f(message,key) without the key Two parties have to agree on a secret key, which may be difficult in practice. If we buy books from Amazon, we don’t need to exchange a secret code. Why is it secure?

Public Key Cryptosystem AliceBob adversary message -> f(message,Bob’s key) f(message, Bob’s key) encrypt the message using Bob’s keydecrypt the message f(message,Bob’s key) -> message But the adversary can not decrypt f(message, Bob’s key)! Public information: Key for AlicePublic information: Key for Bob Only Bob can decrypt the message sent to him! How is it possible??? There is no need to have a secret key between Alice and Bob.

RSA Cryptosystem RSA are the initials of three Computer Scientists, Ron Rivest, Adi Shamir and Len Adleman, who discovered their algorithm when they were working together at MIT in 1977.

This Lecture Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem Key generation, encryption, decryption Correctness Secure? Computational issues

Generating Public Key AliceBob How Bob creates his public keys? Choose 2 large prime numbers p and q. Set n = pq and T = (p-1)(q-1) Choose e ≠1 so that gcd(e,T)=1 Calculate d so that de = 1 (mod T) Publish e and n as public keys Keep d as secret key > 150 digits Secret key only known to Bob. public key: e and n secret key: d

Encrypting Message AliceBob Look at Bob’s homepage for e and n. Send y = x e mod n How Alice sends a message to Bob? message x Send y = x e mod n Alice does not need to know Bob’s secret key to send the message. public key: e and n secret key: d

AliceBob Receive y = x e mod n Compute z = y d mod n How Bob recover Alice’s message? public key: e and n secret key: d message x Send y = x e mod n Bob uses z is the original message that Alice sent. Decrypting Message

RSA Cryptosystem AliceBob public key: e and n secret key: d message x Send y = x e mod n Choose 2 large prime numbers p and q. Set n = pq and T = (p-1)(q-1) Choose e ≠1 so that gcd(e,T)=1 Calculate d so that de = 1 (mod T) Publish e and n as public keys Keep d as secret key Compute z = y d mod n Key generation Encrypting message Decrypting message

This Lecture Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem Key generation, encryption, decryption Correctness Secure? Computational issues

RSA Cryptosystem AliceBob For the RSA cryptosytem to work, we need to show: 1) z = x 2) Without the secret key d, we can not compute the original message before the sun burns out. public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n with additional assumptions…

Correctness AliceBob Note that z = y d mod n = x ed mod n. Therefore we need to prove x = x ed mod n. p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) (a) x mod p = x ed mod p (b) x mod q = x ed mod q (c) x mod n = x ed mod n public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n 1) z = x Therefore, if Alice sends x < n, then Bob can recover correctly.

Correctness AliceBob Hence, x ed mod p = x 1+k(p-1)(q-1) mod p = x·x k(p-1)(q-1) mod p = x·(x k(q-1) ) (p-1) mod p Note that de = 1 + kT public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) (a) x mod p = x ed mod p 1) z = x = 1 + k(p-1)(q-1)

Correctness AliceBob Fermat’s little theorem: If p | a, then a p-1  1 mod p public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) Hence, x ed mod p = x 1+k(p-1)(q-1) mod p = x·x k(p-1)(q-1) mod p = x·(x k(q-1) ) (p-1) mod p = x mod p (a) x mod p = x ed mod p 1) z = x a

Correctness AliceBob Hence, x ed mod p = x 1+k(p-1)(q-1) mod p = x·x k(p-1)(q-1) mod p = x·(x k(q-1) ) (p-1) mod p public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) (a) x mod p = x ed mod p 1) z = x What if p | a? a This means p | x k(q-1), implying p | x, since p is prime Since p | x, we have x ed mod p = x mod p = 0.

Correctness AliceBob Note that z = y d mod n = x ed mod n. Therefore we need to prove x = x ed mod n. p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) (a) x mod p = x ed mod p (b) x mod q = x ed mod q (c) x mod n = x ed mod n public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n 1) z = x (c) can be proved directly, also follows from Chinese Remainder theorem. The same proof.

This Lecture Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem Key generation, encryption, decryption Correctness Secure? Computational issues

Why is this Secure? AliceBob Method 1: From y= x e mod n, don’t know how to compute x. Thus not possible to work backward. It is an example of an “one-way” function. public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) 2) Without the secret key d, we can not compute the original message before the sun burns out. adversary

Why is this Secure? AliceBob public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) Method 2: Factor n = pq. Compute secrete key d. Then decrypt everything! No one knows an efficient way to do factoring. 2) Without the secret key d, we can not compute the original message before the sun burns out. adversary The security is based on assumptions that some computational problems are hard.

This Lecture Introduction to cryptograph “Turing code” Public key cryptography RSA cryptosystem Key generation, encryption, decryption Correctness Secure? Computational issues

RSA Example AliceBob p=5 q=11 n = 55 T = 40 e = 7 d = 23 x=33 How to compute it efficiently? public key: e and n secret key: d message x Send y = x e mod n Compute z = y d mod n p, q prime n = pq T = (p-1)(q-1) e s.t. gcd(e,T)=1 de = 1 (mod T) First Bob generated his keys. Then Alice sends the encrypted message. y = mod 55 y = mod 55

Exponentiation mod 713 = 144 * 144 * 144 * 144 mod 713 = * 144 * 144 mod 713 = 59 * 144 * 144 mod 713 = 8496 * 144 mod 713 = 653 * 144 mod 713 = mod 713 = 629 mod * mod 713 = 59 * 59 mod 713 = 3481 mod 713 = 629 mod 713 To compute exponentiation mod n This still takes too long when the exponent is large. This is much more efficient.

Repeated Squaring mod 713 = mod 713 = 648·485·59 mod 713 = mod 713 = mod 713 = · mod 713 = 59·59 mod 713 = mod 713 = ·144 4 mod 713 = 629·629 mod 713 = mod 713 = ·144 8 mod 713 = 639·639 mod 713 = mod 713 = · mod 713 = 485·485 mod 713 = 648 Note that 50 =

Generating Public Key Choose 2 large prime numbers p and q. Set n = pq and T = (p-1)(q-1) Choose e ≠1 so that gcd(e,T)=1 Calculate d so that de = 1 (mod T) Publish e and n as public keys Keep d as secret key How to choose large prime numbers efficiently? Given a large number, how to check whether it is prime efficiently?

Primality Testing Given a large integer n, determine quickly whether n is prime First test: for i = 1,…,√n, check if i divides n. Need some number theory! We are talking about n with 150 digits. This simply takes too long (2 150 steps, sun will burn out). We are looking for an exponential improvement (instead of n, we can only afford roughly log(n) steps), like we did in the extended GCD algorithm.

Primality Testing It doesn’t seem to help, since we don’t know how to compute (n-1)! mod n quickly (in roughly log(n) steps). Theorem: n is a prime if and only if (n-1)!  -1 (mod n)

Primality Testing 1  a n-1 (mod n) Theorem: If n is prime & a not a multiple of n Contrapositive. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Example. Show that 1763 is composite (not a prime number). Let a=2, n= (mod 1763) = 142 ≠ 1 Therefore, it is composite by (the contrapositive of) Fermat’s little theorem.

Primality Testing Contrapositive. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Example. Show that 1387 is composite (not a prime number). Let a=2, n= (mod 1387) = 1 can not tell whether n is prime or not. Try a= (mod 1387) = 1238 ≠ 1this shows n is composite.

Primality Testing Contrapositive. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. “Fermat” testGiven n, choose a < n Compute a n-1 (mod n) If a n-1 (mod n) ≠ 1 conclude that n is a composite number If a n-1 (mod n) = 1 try another a Each test takes about log(n) steps. It depends on how many a that we need to try…

Primality Testing Contrapositive. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. “Fermat” testGiven n, choose a < n Compute a n-1 (mod n) If a n-1 (mod n) ≠ 1 conclude that n is a composite number If a n-1 (mod n) = 1 try another a Unfortunately, there exists n which is composite, but a n-1 (mod n) = 1 for every a! These are called Carmichael numbers (e.g. 561, 1105, 1729, etc…)

Primality Testing Contrapositive 1. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Lemma. If n is a prime number, x 2  1 (mod n) if and only if x  1 (mod n) or x  -1 (mod n) Contrapositive 2. If x 2  1 (mod n) but x  1 (mod n) and x  -1 (mod n) then n is a composite number. For n=1387 and a=2, Fermat’s test fails because  1 (mod 1387). Example Note that it is (2 693 ) 2 However  512 (mod 1387)  1 (mod 1387) By contrapositive 2, we can conclude that 1387 is a composite number.

Primality Testing Contrapositive 1. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Contrapositive 2. If x 2  1 (mod n) but x  1 (mod n) and x  -1 (mod n) then n is a composite number. Strong primality test Let n-1 = 2 k dPick an a. Compute a 2 k d (mod n), a 2 k-1 d (mod n), a 2 k-2 d (mod n),…, a d (mod n) ≠1 Composite by contrapositive 1.

Primality Testing Contrapositive 1. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Contrapositive 2. If x 2  1 (mod n) but x  1 (mod n) and x  -1 (mod n) then n is a composite number. Let n-1 = 2 k dPick an a. Compute a 2 k d (mod n), a 2 k-1 d (mod n), a 2 k-2 d (mod n),…, a d (mod n) =1 Composite by contrapositive 2. ≠1 & ≠-1 Strong primality test

Primality Testing Contrapositive 1. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Contrapositive 2. If x 2  1 (mod n) but x  1 (mod n) and x  -1 (mod n) then n is a composite number. Let n-1 = 2 k dPick an a. Compute a 2 k d (mod n), a 2 k-1 d (mod n), a 2 k-2 d (mod n),…, a d (mod n) =1 Continue to go backward and check =1 Strong primality test

Primality Testing Contrapositive 1. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Contrapositive 2. If x 2  1 (mod n) but x  1 (mod n) and x  -1 (mod n) then n is a composite number. Let n-1 = 2 k dPick an a. Compute a 2 k d (mod n), a 2 k-1 d (mod n), a 2 k-2 d (mod n),…, a d (mod n) =1 End the test and say it is a “probable” prime. =1=-1 Strong primality test

Primality Testing Contrapositive 1. If 1  a n-1 (mod n) and a is not a multiple of n, then n is not a prime number. Contrapositive 2. If x 2  1 (mod n) but x  1 (mod n) and x  -1 (mod n) then n is a composite number. Let n-1 = 2 k dPick an a. Compute a 2 k d (mod n), a 2 k-1 d (mod n), a 2 k-2 d (mod n),…, a d (mod n) =1 End the test and say it is a “probable” prime. =1 Strong primality test

Primality Testing Given n, pick an a Let n’ = n-1 (so n’ is an even number) If a n’ (mod n) ≠ 1, then stop and say “n is composite”. n’ := n’/2; While n’ is an integer do If a n’ (mod n) = -1, then stop and say “n is a probable prime”. If a n’ (mod n) ≠ 1, then stop and say “n is composite”. n’ := n’/2; Stop and say “n is a probable prime”. Strong primality test

Primality Testing Theorem: if n is composite, for more than half of a < n, the strong primality test will say n is composite! So, given a composite n, if we pick a random a, the strong primality test will be incorrect with probability <= 1/2. Thus, if we repeat the procedure for times, then the probability that the strong primality test is still incorrect is very small (e.g. much smaller than our computer will suddenly crash). For a particular a, the strong primality test takes “about” log(n) steps. But again, there exists n which is composite but pass the test… This is the most efficient method used in practice!

Generating Public Key Choose 2 large prime numbers p and q. Set n = pq and T = (p-1)(q-1) Choose e ≠1 so that gcd(e,T)=1 Calculate d so that de = 1 (mod T) Publish e and n as public keys Keep d as secret key How to choose large prime numbers efficiently? Prime number theorem: From 1 to n, there are roughly n/log(n) prime numbers. Pick a random large number, do the (randomized) strong primality tests, until we find a prime! Similar idea

Remarks We have derived everything from basic principle. RSA cryptosystem is one of the most important achievements in compute science. (The researchers won the Turing award for their contribution.) Number theory is also very useful in coding theory (e.g. compression). Mathematics is very important in computer science.

More Remarks Theorem: if n is composite, for more than half of a < n, the strong primality test will say n is composite! The proof uses Chinese Remainder theorem and some elementary number theory. (Introduction to Algorithms, MIT press) Theroem (Primes is in P, 2004) There is an efficient and deterministic primality test. Conjecture: It is enough to try a to up to roughly log(n). Major Open Problem: Is there an efficient algorithm to compute the prime factorization?