RSA Parameter Generation Bob needs to: - find 2 large primes p,q - find e s.t. gcd(e, Á (pq))=1 Good news: - primes are fairly common: there are about.

Slides:



Advertisements
Similar presentations
RSA.
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
PRIMALITY TESTING – its importance for cryptography
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.
MS 101: Algorithms Instructor Neelima Gupta
Agrawal-Kayal-Saxena Presented by: Xiaosi Zhou
Primality Testing Patrick Lee 12 July 2003 (updated on 13 July 2003)
Announcements: 1. Congrats on reaching the halfway point once again! 2. DES graded soon 3. Short “pop” quiz on Ch 3. (Thursday at earliest) 4. Reminder:
Chapter 8 More Number Theory. Prime Numbers Prime numbers only have divisors of 1 and itself They cannot be written as a product of other numbers Prime.
Lecture 8: Primality Testing and Factoring Piotr Faliszewski
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
מבוא מורחב 1 Lecture 4 Material in the textbook on Pages 44-46, of 2nd Edition Sections and Hanoy towers.
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
Great Theoretical Ideas in Computer Science.
and Factoring Integers (I)
Announcements: 1. Pass in Homework 5 now. 2. Term project groups and topics due by Friday 1.Can use discussion forum to find teammates 3. HW6 posted, due.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Tuesday, 28 April Number-Theoretic Algorithms Chapter 31.
1 Fingerprint 2 Verifying set equality Verifying set equality v String Matching – Rabin-Karp Algorithm.
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.
מבוא מורחב - שיעור 6 1 Lecture 6 High order procedures Primality testing The RSA cryptosystem.
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
Announcements: 1. Congrats on reaching the halfway point once again! 2. Reminder: HW5 due tomorrow, HW6 due Tuesday after break 3. Term project groups.
Prof. Bart Selman Module Probability --- Part e)
Announcements: 1. Pass in worksheet on using RSA now. 2. DES graded soon 3. Short “pop” quiz on Ch 3 (Thursday at earliest) 4. Term project groups and.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Chapter 8 – Introduction to Number Theory Prime Numbers
RSA Question 2 Bob thinks that p and q are primes but p isn’t. Then, Bob thinks ©Bob:=(p-1)(q-1) = Á(n). Is this true ? Bob chooses a random e (1 < e
Public key ciphers 1 Session 5.
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.

CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
Prabhas Chongstitvatana 1 Primality Testing Is a given odd integer prime or composite ? No known algorithm can solve this problem with certainty in a reasonable.
Chapter 14 Randomized algorithms Introduction Las Vegas and Monte Carlo algorithms Randomized Quicksort Randomized selection Testing String Equality Pattern.
MA/CSSE 473 Day 08 Randomized Primality Testing Carmichael Numbers Miller-Rabin test.
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.
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.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
PRIMES is in P Manindra Agrawal NUS Singapore / IIT Kanpur.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
ENCRYPTION TAKE 2: PRACTICAL DETAILS David Kauchak CS52 – Spring 2015.
מבוא מורחב - שיעור 6 1 Lecture 6 High order procedures Primality testing The RSA cryptosystem.
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.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
RSA cryptosystem--preview Suppose n=p  q and  (n)=(p-1)(q-1), where p and q are big primes. Select (find) a and b, such that a  b=1 mod  (n). K=(n,p,q,a,b),
6.3 Primality Testing. p2. (1) Prime numbers 1. How to generate large prime numbers? (1) Generate as candidate a random odd number n of appropriate size.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
מבוא מורחב 1 Lecture 4 Material in the textbook on Pages 44-46, of 2nd Edition Sections and Hanoy towers.
CS 312: Algorithm Analysis Lecture #4: Primality Testing, GCD This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License.Creative.
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.
MA/CSSE 473 Day 10 Primality Testing. MA/CSSE 473 Day 10 In-class exam: Friday, Sept 28 –You may bring a two-sided 8.5x11 inch piece of paper containing.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
MA/CSSE 473 Day 9 Primality Testing Encryption Intro.
PRIMES is in P Manindra Agrawal Neeraj Kayal Nitin Saxena Dept of CSE, IIT Kanpur.
A Prime Example CS Lecture 20 A positive integer p  2 is prime if the only positive integers that divide p are 1 and p itself. Positive integers.
RSA Encryption Greg Gronn Laura Trimmer. RSA Encryption  Requires two 30 digit prime numbers to create an encoding/decryption key.  Goal: analyze different.
CSE565: Computer Security Lecture 7 Number Theory Concepts
Probabilistic Algorithms
Handbook of Applied Cryptography - CH4, from 4.1~4.3
Randomness and Computation: Some Prime Examples
Introduction to Cryptography
Material in the textbook on
Cryptography Lecture 18.
Cryptography Lecture 20.
Presentation transcript:

RSA Parameter Generation Bob needs to: - find 2 large primes p,q - find e s.t. gcd(e, Á (pq))=1 Good news: - primes are fairly common: there are about N/ln N primes · N Exercise: If looking for a 512-bit prime, how many randomly generated numbers need to try ?

RSA Parameter Generation We need to decide: Given a number x, how to determine if x is a prime ? What is the running time ?

Primality Testing Until recently, no (deterministic) poly-time algorithm for primality testing. In 2002, Agrawal, Kayal, and Saxena: Primality testing is in P !!!

Primality Testing Good news: there is a faster approach using randomization First, some terminology: A yes-biased Monte Carlo algorithm is a randomized algorithm that: - if the algo says YES, then the answer is correct - if the algo says NO, then the answer might be incorrect, but this happens with a small probability More precisely, there is a (small) error probability ² >0 s.t. for any “yes” instance, the algo says NO with probability · ² (considering all possible random choices of the algo).

Primality Testing Good news: there is a faster approach using randomization (yes-biased Monte Carlo algorithm to determine if an input number is composite) First, some terminology: A yes-biased Monte Carlo algorithm is a randomized algorithm that: - if the algo says YES, then the answer is correct - if the algo says NO, then the answer might be incorrect, but this happens with a small probability More precisely, there is a (small) error probability ² >0 s.t. for any “yes” instance, the algo says NO with probability · ² (considering all possible random choices of the algo).

Primality Testing – randomized attempt 1 Fermat’s Little Theorem (pg 79): If p is a prime, then a p-1 ´ 1 (mod p) for all a 2 Z p -{0} PseudoPrime(x): 1. Choose random a, 1 ≤ a ≤ x − if a x−1 ≡ 1 (mod x): 3. return prime 4. else 5. return composite Is this a yes-biased Monte Carlo algorithm ? For primes ? For composites ? Polynomial-time ?

Primality Testing – randomized attempt 1 Problem: There are composite numbers for which the Fermat’s Little Theorem holds. (A composite number x is a Carmichael number if a x-1 ´ 1 (mod x), for every a 2 Z x -{0}) Good news: Carmichael numbers are very rare: only 255 Carmichael numbers smaller than 10 9 (the first three are 561, 1105, and 1729). Bad news: What is ² for our algo from the previous slide ?

Miller-Rabin Miller-Rabin(x): 1. Find k,m such that x−1 = 2 k m, where m is odd 2. Choose random a, 1 ≤ a ≤ x−1 3. Let b = a m mod x 4. if b ≡ 1 (mod x): return prime 5. for i=0 to k−1: 6. if b ≡ −1 (mod x): return prime 7. else: b = b 2 mod x 8. return composite This is a polynomial-time yes-biased Monte Carlo algorithm that tests whether x is composite. Why ? Note: ² ≤ ¼ (we will not prove this)

RSA Questions - Eve can compute the e-th root modulo n to decrypt… The catch: computing roots mod n as hard as factoring ! - If Bob chooses p,q but one of them will not be a prime, will RSA still work ? - Can Eve precompute all products of 512-bit primes, to have a table (and factorization) of all possible n ?