CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.

Slides:



Advertisements
Similar presentations
Discrete Mathematics Lecture 3
Advertisements

Presented by Alex Atkins.  An integer p >= 2 is a prime if its only positive integer divisors are 1 and p.  Euclid proved that there are infinitely.
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
Cryptography and Network Security
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.
Computability and Complexity
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:
Public Key Cryptosystems - RSA Receiver Sender Eavesdroppe r p q p q p q p and q prime.
CSE 311 Foundations of Computing I Lecture 13 Number Theory Autumn 2012 CSE
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.
The Fundamental Theorem of Arithmetic (2/12) Definition (which we all already know). A number greater than 1 is called prime if its only divisors are 1.
Lecture 8: Primality Testing and Factoring Piotr Faliszewski
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.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
1 Fingerprint 2 Verifying set equality Verifying set equality v String Matching – Rabin-Karp Algorithm.
Elementary Number Theory and Methods of Proof. Basic Definitions An integer n is an even number if there exists an integer k such that n = 2k. An integer.
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Announcements: 1. Congrats on reaching the halfway point once again! 2. Reminder: HW5 due tomorrow, HW6 due Tuesday after break 3. Term project groups.
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.
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.
Chapter 8 – Introduction to Number Theory Prime Numbers
Cryptography and Network Security Chapter 8. Chapter 8 – Introduction to Number Theory The Devil said to Daniel Webster: "Set me a task I can't carry.
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.
CSE 311 Foundations of Computing I Lecture 12 Primes, GCD, Modular Inverse Spring
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.
Software Security Seminar - 1 Chapter 11. Mathematical Background 발표자 : 안병희 Applied Cryptography.

Information Security and Management 4. Finite Fields 8
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.
CPSC 490 Number Theory Primes, Factoring and Euler Phi-function Mar.31 st, 2006 Sam Chan.
MA/CSSE 473 Day 08 Randomized Primality Testing Carmichael Numbers Miller-Rabin test.
Cyclic Groups (9/25) Definition. A group G is called cyclic if there exists an element a in G such that G =  a . That is, every element of G can be written.
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.
Fall 2002CS 395: Computer Security1 Chapters 4 and 8: The Mathematics Required for Public Key Cryptography In case you’re beginning to worry that this.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
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.
CSE 311 Foundations of Computing I Lecture 14 Euclid’s Algorithm Mathematical Induction Autumn 2012 CSE
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
CSE 311: Foundations of Computing Fall 2013 Lecture 12: Primes, GCD, modular inverse.
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
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.
Implementation of Public Key Encryption Algorithms
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.
CSE 311 Foundations of Computing I Lecture 12 Modular Arithmetic and Applications Autumn 2012 CSE
CSE 311 Foundations of Computing I Lecture 11 Modular Exponentiation and Primes Autumn 2011 CSE 3111.
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.
Divisibility and Primes
CSE565: Computer Security Lecture 7 Number Theory Concepts
Numerical Algorithms x x-1 Numerical Algorithms
Randomness and Computation: Some Prime Examples
Chapter 5: Number Theory
Introduction to Number Theory
CSE 311 Foundations of Computing I
Numerical Algorithms x x-1
Number Theory (Chapter 7)
Mathematical Background: Prime Numbers
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
Introduction to Cryptography
CSE 311 Foundations of Computing I
CSE 321 Discrete Structures
CSE 321 Discrete Structures
Cryptography Lecture 20.
Presentation transcript:

CSE 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality

Announcements Readings –Today: Modular Exponentiation –3.5, 3.6 (5 th Edition: 2.5) –Wednesday: Primality –3.6 (5 th Edition: 2.5) –Friday: Applications of Number Theory –3.7 (5 th Edition: 2.6)

Highlights from Lecture 9 Modular Exponentiation –a p-1  1 (mod p) for p prime –a k mod n can be computed in O(log k) time

Big number arithmetic Computer Arithmetic 32 bit (or 64 bit, or 128 bit) Arbitrary precision arithmetic –Store number in arrays or linked lists Runtimes for standard algorithms for n digit numbers –Addition: –Multiplication:

Discrete Log Problem Given integers a, b in [1,…, p-1], find k such that a k mod p = b

Primality An integer p is prime if its only divisors are 1 and p An integer that is greater than 1, and not prime is called composite Fundamental theorem of arithmetic: –Every positive integer greater than one has a unique prime factorization

Factorization If n is composite, it has a factor of size at most sqrt(n)

Euclid’s theorem There are an infinite number of primes. Proof by contradiction: Suppose there are a finite number of primes: p 1, p 2,... p n

Distribution of Primes If you pick a random number n in the range [x, 2x], what is the chance that n is prime?

Famous Algorithmic Problems Primality Testing: –Given an integer n, determine if n is prime Factoring –Given an integer n, determine the prime factorization of n

Primality Testing Is the following 200 digit number prime:

Showing a number is NOT prime Trial division by small primes Fermat’s little theorem –a p-1 mod p = 1 if p is prime Miller’s Test –if p is prime, the only square roots of one are 1 and -1 –if p is composite other numbers can be the square root of one –repeated squaring used to find a non-trivial square root of one from a starting value b

Probabilistic Primality Testing Conduct Miller’s test for a random b –If p is prime, it always passes the test –If p is not prime, it fails with probability ¾ Primality testing –Choose 100 random b’s and perform Miller’s test on each –If any say false, answer “Composite” –If all say true, answer “Prime”