CSE565: Computer Security Lecture 7 Number Theory Concepts

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.
Introduction to Modern Cryptography Lecture 6 1. Testing Primitive elements in Z p 2. Primality Testing. 3. Integer Multiplication & Factoring as a One.
Great Theoretical Ideas in Computer Science.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
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.

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
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.
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.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
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.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.
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
Mathematics of Cryptography
Probabilistic Algorithms
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Handbook of Applied Cryptography - CH4, from 4.1~4.3
Randomness and Computation: Some Prime Examples
Number-Theoretic Algorithms (UNIT-4)
Cryptography and Network Security
Introduction to Number Theory
Cryptography and Network Security Chapter 8
Public Key Cryptosystems - RSA
Number Theory (Chapter 7)
Cryptography and Network Security
Cryptography Lecture 22.
Prime and Relatively Prime Numbers
Cryptography and Network Security
Introduction to Cryptography
Analysis of the RSA Encryption Algorithm
Tuesday, 27 April Number-Theoretic Algorithms Chapter 31
Key Management Network Systems Security
Chapter -5 PUBLIC-KEY CRYPTOGRAPHY AND RSA
CSCE 715: Network Systems Security
Mathematical Background for Cryptography
Patrick Lee 12 July 2003 (updated on 13 July 2003)
Cryptography Lecture 18.
Cryptography Lecture 20.
Presentation transcript:

CSE565: Computer Security Lecture 7 Number Theory Concepts Shambhu Upadhyaya Computer Science & Eng. University at Buffalo Buffalo, New York 14260 9/19/17 UB Fall 2017

Acknowledgments Material is drawn from Lawrie Brown’s slides 9/19/17 UB Fall 2017

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: 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 Prime numbers form an important entity for studying PKI. 9/19/17 UB Fall 2017

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=24×32×52 The idea of "factoring" a number is important - finding numbers which divide into it. Taking this as far as can go, by factorising all the factors, we can eventually write the number as a product of (powers of) primes - its prime factorization. 9/19/17 UB Fall 2017

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 Traditional sieve – Make a list of all the integers less than or equal to n (greater than one) and strike out the multiples of all primes less than or equal to the square root of n, then the numbers that are left are the primes. 9/19/17 UB Fall 2017

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)=2kq 2. Select a random integer a, 1<a<n–1 3. if aq mod n = 1 then return (“maybe prime"); 4. for j = 0 to k – 1 do 5. if (a2jq mod n = n-1) then return (" maybe prime ") 6. return ("composite") Example, choose n=19 18=2x9 Q=9, choose a=4, then step 3 gives you 1, so maybe prime Another example: Choose n=13, 12 = 2^2x3; q=3 Choose a=4 Step 3 doesn’t satisfy. Step 5 gives you 12=n-1. So, maybe prime. 9/19/17 UB Fall 2017

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 > 0.99999 9/19/17 UB Fall 2017

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/19/17 UB Fall 2017

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/19/17 UB Fall 2017

Chinese Remainder Theorem Used to speed up modulo computations Working modulo a product of numbers E.g., mod M = m1m2..mk Chinese Remainder theorem lets us work in each moduli mi separately Since computational cost is proportional to size, this is faster than working in the full modulus M The CRT is so called because it is believed to have been discovered by the Chinese mathematician Sun-Tsu in around 100 AD. It is very useful in speeding up some operations in the RSA public-key scheme. 9/19/17 UB Fall 2017

Chinese Remainder Theorem Can implement CRT in several ways To compute (A mod M) we can firstly compute all (ai mod mi) separately and then combine results to get answer using: See worked examples in text. ai = A mod mi Mi = M/mi 9/19/17 UB Fall 2017

Primitive Roots From Euler’s theorem we have aø(n)mod n=1 Consider ammod 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 Euler’s theorem, a and n must be relatively prime. Note that not all integers have primitive roots. But prime numbers do have. 9/19/17 UB Fall 2017

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 ax = b mod p Written as x=loga b mod p or x=inda,p(b) If a is a primitive root then always exists, otherwise may not x = log3 4 mod 13 (x st 3x = 4 mod 13) has no answer x = log2 3 mod 13 = 4 by trying successive powers Whilst exponentiation is relatively easy, finding discrete logarithms is generally a hard problem Discrete logs (or indices) share the properties of normal logarithms, and are quite useful. However whilst exponentiation is relatively easy, finding discrete logs is not, in fact is as hard as factoring a number. It is the inverse problem to exponentiation, and is an example of a problem thats "easy" one way (raising a number to a power), but "hard" the other (finding what power a number is raised to giving the desired answer). Problems with this type of asymmetry are very rare, but are of critical usefulness in modern cryptography. 9/19/17 UB Fall 2017

Summary Have considered: Prime numbers Primality Testing Chinese Remainder Theorem Discrete Logarithms 9/19/17 UB Fall 2017