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.

Slides:



Advertisements
Similar presentations
Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Advertisements

Cryptography and Network Security Chapter 9
Chapter 3 Public Key Cryptography and RSA Lecture slides by Lawrie Brown Modifications by Nguyen Cao Dat.
Cryptography and Network Security Chapter 8 Fourth Edition by William Stallings.
Opening quote. A number of concepts from number theory are essential in the design of public-key cryptographic algorithms, which this chapter will introduce.
Cryptography and Network Security
Applied Cryptography (Public key) Part I. Let’s first finish “Symmetric Key” before talking about public key John wrote the letters of the alphabet under.
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
Chapter 8 Introduction To Number Theory. Prime Numbers Prime numbers only have divisors of 1 and Prime numbers only have divisors of 1 and self. self.
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.
Primality Testing Patrick Lee 12 July 2003 (updated on 13 July 2003)
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
Great Theoretical Ideas in Computer Science.
and Factoring Integers (I)
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
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.
and Factoring Integers
Announcements: HW3 updated. Due next Thursday HW3 updated. Due next Thursday Written quiz tomorrow on chapters 1-2 (next slide) Written quiz tomorrow on.
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.
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 321 Discrete Structures Winter 2008 Lecture 10 Number Theory: Primality.
Prime Numbers Prime numbers only have divisors of 1 and self
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.
Cryptography A little number theory Public/private key cryptography –Based on slides of William Stallings and Lawrie Brown.

Cryptography Lecture 6 Stefan Dziembowski
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
Information Security and Management 4. Finite Fields 8
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.
PRIMES is in P Manindra Agrawal NUS Singapore / IIT Kanpur.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
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.
CS/ECE Advanced Network Security Dr. Attila Altay Yavuz
Key Management Network Systems Security Mort Anvari.
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.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
CSE 311: Foundations of Computing Fall 2013 Lecture 11: Modular arithmetic and applications.
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.
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
CSEN 1001 Computer and Network Security Amr El Mougy Mouaz ElAbsawi.
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.
Public Key Encryption Major topics The RSA scheme was devised in 1978
Introduction to Number Theory
CSE565: Computer Security Lecture 7 Number Theory Concepts
Probabilistic Algorithms
Handbook of Applied Cryptography - CH4, from 4.1~4.3
Cryptography and Network Security
Introduction to Number Theory
Cryptography and Network Security Chapter 8
Number Theory (Chapter 7)
Cryptography and Network Security
Cryptography and Network Security
Introduction to Cryptography
Tuesday, 27 April Number-Theoretic Algorithms Chapter 31
Mathematical Background for Cryptography
Cryptography Lecture 20.
Presentation transcript:

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 at Buffalo Buffalo, New York 14260

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.2 Acknowledgments  Material is drawn from Lawrie Brown’s slides

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.3 Prime Numbers  Prime numbers only have divisors of 1 and self  they cannot be written as a product of other numbers  note: 1 is prime, but is generally not of interest  E.g., 2,3,5,7 are prime, 4,6,8,9,10 are not  Prime numbers are central to number theory  List of prime number less than 200 is:

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.4 Prime Factorization  To factor a number n is to write it as a product of other numbers: n=a × b × c  Note that factoring a number is relatively hard compared to multiplying the factors together to generate the number  The prime factorization of a number n is when it is written as a product of primes  E.g., 91=7×13 ; 3600=2 4 ×3 2 ×5 2

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.5 Primality Testing  Often need to find large prime numbers  Traditional sieve using trial division  i.e., divide by all numbers (primes) in turn less than the square root of the number  only works for small numbers  Alternatively can use statistical primality tests based on properties of primes  for which all primes numbers satisfy property  but some composite numbers, called pseudo- primes, also satisfy the property

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.6 Miller Rabin Algorithm  A test based on Fermat’s Theorem  Algorithm is: TEST (n) is: 1. Find integers k, q, k > 0, q odd, so that (n–1)=2 k q 2. Select a random integer a, 1<a<n–1 3. if a q mod n = 1 then return (“maybe prime"); 4. for j = 0 to k – 1 do 5. if ( a 2 j q mod n = n-1 ) then return (" maybe prime ") 6. return ("composite")

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.7 Probabilistic Considerations  If Miller-Rabin returns “composite” the number is definitely not prime  Otherwise it is a prime or a pseudo-prime  Chance it detects a pseudo-prime is < ¼  Hence if repeat test with different random a then chance of n being prime after t tests is:  Pr(n prime after t tests) = 1-4 -t  E.g., for t=10 this probability is >

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.8 Deterministic Primality Algorithm  Prior to 2002, there was no known method of proving primality of large numbers  Most algorithms produced a probabilistic result  In 2002, Agrawal, Kayal and Saxena developed a simple deterministic algorithm  Deterministic, but not very efficient  Complexity is polynomial in n  Miller-Rabin is still more popular

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.9 Prime Distribution  Prime number theorem states that primes occur roughly every ( ln n ) integers  Since we can immediately ignore evens and multiples of 5, in practice only need test 0.4 ln(n) numbers of size n before we locate a prime  note this is only the “average” sometimes primes are close together, at other times are quite far apart

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.10 Chinese Remainder Theorem  Used to speed up modulo computations  Working modulo a product of numbers  E.g., mod M = m 1 m 2..m k  Chinese Remainder theorem lets us work in each moduli m i separately  Since computational cost is proportional to size, this is faster than working in the full modulus M

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.11 Chinese Remainder Theorem  Can implement CRT in several ways  To compute (A mod M) we can firstly compute all (a i mod m i ) separately and then combine results to get answer using:

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.12 Primitive Roots  From Euler’s theorem we have a ø(n) mod n=1  Consider a m mod n=1, GCD(a,n)=1  must exist for m= ø(n) but may be smaller  once powers reach m, cycle will repeat  If smallest is m= ø(n) then a is called a primitive root  If p is prime, then successive powers of a "generate" the group mod p  These are useful but relatively hard to find

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.13 Discrete Logarithms or Indices  The inverse problem to exponentiation is to find the discrete logarithm of a number modulo p  That is to find x where a x = b mod p  Written as x=log a b mod p or x=ind a,p (b)  If a is a primitive root then always exists, otherwise may not  x = log 3 4 mod 13 (x st 3 x = 4 mod 13) has no answer  x = log 2 3 mod 13 = 4 by trying successive powers  Whilst exponentiation is relatively easy, finding discrete logarithms is generally a hard problem

9/22/15UB Fall 2015 CSE565: S. Upadhyaya Lec 7.14 Summary  Have considered:  Prime numbers  Primality Testing  Chinese Remainder Theorem  Discrete Logarithms