DTTF/NB479: Dszquphsbqiz Day 22

Slides:



Advertisements
Similar presentations
Chris MacLellan, and Daniel W. Peterson. Statistical Primality Testing Miller-Rabin and pseudoprimes Frobenius test and pseudoprimes Composites which.
Advertisements

Digital Signatures Good properties of hand-written signatures: 1. Signature is authentic. 2. Signature is unforgeable. 3. Signature is not reusable (it.
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
Computability and Complexity
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:
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q 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
Great Theoretical Ideas in Computer Science.
Announcements: 1. Term project groups and topics due tomorrow midnight Waiting for posts from most of you. Questions? This week: Primality testing, factoring.
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.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Announcements: 1. Presentations start Friday 2. Cem Kaner presenting O th block today. Questions? This week: DSA, Digital Cash DSA, Digital Cash.
Announcements: 1. Short “pop” quiz on Ch 3 (today?) 2. Term project groups and topics due midnight 3. HW6 due Tuesday. Questions? This week: Primality.
Factoring 1 Factoring Factoring 2 Factoring  Security of RSA algorithm depends on (presumed) difficulty of factoring o Given N = pq, find p or q and.
Announcements:Questions? This week: Birthday attacks, Digital signatures, DSA Birthday attacks, Digital signatures, DSA DTTF/NB479: DszquphsbqizDay 30.
Announcements: 1. Short “pop” quiz on Ch 3 (not today) 2. Term project groups and topics due tomorrow midnight Waiting for posts from 22 of you. 3. HW6:
Announcements: 1. Congrats on reaching the halfway point once again! 2. Reminder: HW5 due tomorrow, HW6 due Tuesday after break 3. Term project groups.
Administrative HW1 due Th, Sep. 20, before class HW2 due Today, before class QUIZ1 Tu, Sep. 18 number theory/cryptography, pages 1-44 of DPV problem session:
Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on.
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.
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 numbers.
CSC2110 Discrete Mathematics Tutorial 6 Chinese Remainder Theorem, RSA and Primality Test Hackson Leung.
Chapter 8 – Introduction to Number Theory Prime Numbers
DTTF/NB479: Dszquphsbqiz Day 9 Announcements: Homework 2 due now Homework 2 due now Computer quiz Thursday on chapter 2 Computer quiz Thursday on chapter.
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 numbers.
Announcements: Homework 2 due now Homework 2 due now Quiz this Friday on concepts from chapter 2 Quiz this Friday on concepts from chapter 2 Practical.
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.
CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.

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.
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.
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.
MA/CSSE 473 Day 08 Randomized Primality Testing Carmichael Numbers Miller-Rabin test.
MA/CSSE 473 Day 11 Primality testing summary Data Encryption RSA.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
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.
6.4 Factoring.
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.
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.
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.
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.
MA/CSSE 473 Day 9 Primality Testing Encryption Intro.
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division
MA/CSSE 473 Day 08 Randomized Primality Testing Carmichael Numbers
Randomness and Computation: Some Prime Examples
Encryption Take 2: Practical details
Divisibility and Primes
Public Key Encryption Major topics The RSA scheme was devised in 1978
Topic 26: Discrete LOG Applications
DTTF/NB479: Dszquphsbqiz Day 26
Handbook of Applied Cryptography - CH4, from 4.1~4.3
Randomness and Computation: Some Prime Examples
MA/CSSE 473 Day 08 Randomized Primality Testing Carmichael Numbers
Topic 24: Finding Prime Numbers, RSA
Public Key Cryptosystems - RSA
Number Theory (Chapter 7)
Mathematical Background: Prime Numbers
Introduction to Cryptography
DTTF/NB479: Dszquphsbqiz Day 27
DTTF/NB479: Dszquphsbqiz Day 25
DTTF/NB479: Dszquphsbqiz Day 25
Mathematical Background for Cryptography
Patrick Lee 12 July 2003 (updated on 13 July 2003)
Cryptography Lecture 20.
Presentation transcript:

DTTF/NB479: Dszquphsbqiz Day 22 Announcements: Pass in Homework 5 now. Term project groups and topics due by Friday Can use discussion forum to find teammates HW6 posted Questions? This week: Primality testing, factoring Discrete Logs

Given integers n, x, and y: The Square Root Compositeness Theorem gives a way to factor certain composite numbers 1 Given integers n, x, and y: Then n is composite, and gcd(x-y, n) is a non-trivial factor

The Miller-Rabin Compositeness Test just reorders the Fermat test’s powermod to catch pseudoprimes ? Observe: n is odd and n>1 Trick: write n-1=2km, where k >=1 ? b0 We’ll compute powers from inside out, checking if the result is +1 or -1 at each step

It uses the Square Root Compositeness Theorem to catch most pseudoprimes 2 Given odd n>1, write n-1=2km, where k >=1. Choose a base a randomly (or just pick a=2) Let b0=am(mod n) If b0=+/-1, stop. n is probably prime by Fermat For i = 1..k-1 Compute bi=bi-12. If bi=1(mod n), stop. n is composite by SRCT, and gcd(bi-1-1,n) is a factor. If bi=-1(mod n), stop. n is probably prime by Fermat. If bk=1 (mod n), stop. n is composite by SRCT Else n is composite by Fermat. k b0 b0 b1 bk

Examples of Miller-Rabin 3-4 Given odd n>1, write n-1=2km, where k >=1. Choose a base a randomly (or just pick a=2) Let b0=am(mod n) If b0=+/-1, stop. n is probably prime by Fermat For i = 1..k-1 Compute bi=bi-12. If bi=1(mod n), stop. n is composite by SRCT, and gcd(bi-1-1,n) is a factor. If bi=-1(mod n), stop. n is probably prime by Fermat. If bk=1 (mod n), stop. n is composite by SRCT Else n is composite by Fermat. n=189 n=561 (recall Fermat says prob prime) Complete the table on your quiz

Fermat’s contrapositive is OK, but Miller-Rabin is better! Even? no div by other small primes? no yes Prime by Factoring/ advanced techn.? yes prime

Fermat’s contrapositive is OK, but Miller-Rabin is better! Finding large probable primes #primes < x = Density of primes: ~1/ln(x) For 100-digit numbers, ~1/230. So ~1/115 of odd 100-digit numbers are prime Can start with a random large odd number and iterate, applying M-R to remove composites. We’ll soon find one that is a likely prime. Can repeat with different bases to improve probability that it’s prime. Maple’s nextprime() appears to do this, but also runs the Lucas test: http://www.mathpages.com/home/kmath473.htm Even? no div by other small primes? no Pass M-R? yes Big picture: Fermat on steroids. Note: I usually only have time to present up to here. The rest is repeated in tomorrow’s slides. By doing a little extra work (finding k to change the order of the powermod), we can call some pseudoprimes composite and find some of their factors Those composites that even M-R with base a fails to recognize are called strong pseudoprimes for base a (~20% of those pseudoprimes < 10B). Prime by Factoring/ advanced techn.? yes prime

Factoring If you are trying to factor n=pq and know that p and q are close, use Fermat factoring: Compute n + 12, n + 22, n + 32, until you reach a perfect square, say r2 = n + k2 Then n = r2 - k2 = (r+k)(r-k) Example: factor 2405597 The moral of the story? Choose p and q such that _____ 1549 and 1553

(p-1) Algorithm Useful if p|n and (p-1) has only small factors Choose any a>1 (like a=2) and bound B Compute b=aB!(mod n) (How?) Then compute d=gcd(b-1, n) If 1<d<n, then d is a non-trivial factor Matlab example: n=5183. We’ll use a=2, B=6. Why does it work?

Moral of this story? To get a 100-digit number n=pq resistant to this attack: Make sure (p-1) has at least 1 large prime factor: Pick p0 = nextprime(1040) Choose k~1060 such that p=(kp0+1)is prime How to test? Repeat for q.

Example Factor n = 3837523 Concepts we will learn also apply to factoring really big numbers. They are the basis of the best current methods All you had to do to win $30,000 was factor a 212 digit number. This is the RSA Challenge: http://www.rsa.com/rsalabs/node.asp?id=2093#RSA704