Introduction to Number Theory Department of Computer Engineering Sharif University of Technology 3/8/2006.

Slides:



Advertisements
Similar presentations
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Advertisements

Computer Science CSC 474Dr. Peng Ning1 CSC 474 Information Systems Security Topic 2.3 Basic Number Theory.
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.
Having Proofs for Incorrectness
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)
Week 3 - Friday.  What did we talk about last time?  AES  Public key cryptography.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
CNS2010handout 8 :: introduction to number theory1 computer and network security matt barrie.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Outline Review of RSA Discrete logarithms Testing for primality Key management in public-key cryptosystem Diffie-Hellman Key exchange.
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Complexity1 Pratt’s Theorem Proved. Complexity2 Introduction So far, we’ve reduced proving PRIMES  NP to proving a number theory claim. This is our next.
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
Cryptography & Number Theory
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.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
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.
Software Security Seminar - 1 Chapter 11. Mathematical Background 발표자 : 안병희 Applied Cryptography.

Introduction to Modular Arithmetic and Public Key Cryptography.
Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
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
J. Wang. Computer Network Security Theory and Practice. Springer 2008 Chapter 3 Public-Key Cryptography and Key Management.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
1 Lecture 9 Public Key Cryptography Public Key Algorithms CIS CIS 5357 Network Security.
Implementing RSA Encryption in Java
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
YSLInformation Security -- Public-Key Cryptography1 Prime and Relatively Prime Numbers Divisors: We say that b  0 divides a if a = mb for some m, where.
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.
CS/ECE Advanced Network Security Dr. Attila Altay Yavuz
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Network and Computer Security (CS 475) Modular Arithmetic
1 Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
Great Theoretical Ideas in Computer Science for Some.
Week 4 - Wednesday.  What did we talk about last time?  Finished DES  AES.
Introduction to Number Theory
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
1 CMSC 250 Chapter 3, Number Theory. 2 CMSC 250 Introductory number theory l A good proof should have: –a statement of what is to be proven –"Proof:"
Great Theoretical Ideas in Computer Science.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
Introduction to Number Theory
Chapter Applications of Number Theory Some Useful Results
Topic 12: Number Theory Basics (2)
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Advanced Algorithms Analysis and Design
Lecture 3.2: Public Key Cryptography II
Numerical Algorithms x x-1 Numerical Algorithms
Introduction to Number Theory
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Numerical Algorithms x x-1
Number Theory (Chapter 7)
Cryptography and Network Security
Cryptography Lecture 22.
Prime and Relatively Prime Numbers
Rayat Shikshan Sanstha’s S.M.Joshi College, Hadapsar -28
Cryptography Lecture 18.
Cryptography Lecture 20.
Presentation transcript:

Introduction to Number Theory Department of Computer Engineering Sharif University of Technology 3/8/2006

Prime Numbers Any integer a > 1 can be factored in a unique way a = p 1 p 2 … p t (p 1 > p 2 > … > p t, α i > 0) a = Π P (p a p ) (P: the set all of prime numbers) Thus k = mn  k p = m p + n p for all p a|b  a p ≤ b p for all p k = gcd(a, b)  k p = min(a p, b p ) for all p

Modular Arithmetic a = qn + r  a  r mod n a  b mod n and b  c mod n  a  c mod n [(a mod n) + (b mod n)] mod n = (a + b) mod n [(a mod n) - (b mod n)] mod n = (a - b) mod n [(a mod n) * (b mod n)] mod n = (a * b) mod n (a + b)  (a + c) mod n  b  c mod n

Modular Arithmetic (cont’d) If a is relatively prime to n (a * b)  (a * c) mod n  b  c mod n Z n = {0, 1, …, (n – 1)} For each a relatively prime to n, there is b in Z n a * b  1 mod n  b = a -1 = Multiplicative inverse of a Proof key : [(a * Z n ) mod n] = Z n permuted {0 mod n, a mod n, 2a mod n, …, (n – 1)a mod n} = Z n

Fermat’s Theorem If p is prime and a is a positive integer not divisible by p a p-1  1 mod p (a p  a mod p) Proof : a * 2a * … * (p – 1)a  (p – 1)! a p-1 mod p (a * {1, 2, …, p – 1}) mod p = {1, 2, …, (p – 1)}  a * 2a * … * (p – 1)a  (p – 1)! mod p (p – 1)! a p-1  (p – 1)! mod p  a p-1  1 mod p

Euler’s Totient Function  (n) = number of positive integers less than n and relatively prime to n For a prime number p  (p) = p – 1 For n = pq where p and q are prime  (n) = (p – 1)(q – 1)

Euler’s Theorem For every a and n that are relatively prime a  (n)  1 mod n (a  (n)+1  a mod n) Proof : The set of positive integers less than n and relatively prime to n = R = {x 1, x 2, …, x  (n) } S  (a * R) mod n = {ax i mod n | 1 <= i <=  (n) } S  R because S’s elements are relatively prime to n No duplication in S

Euler’s Theorem (cont’d) Proof (cont’d) : S = R  Π R = Π S  Π(ax i )  Π(x i ) (mod n)  a  (n) * Π(x i )  Π(x i ) (mod n)  a  (n)  1 mod n Corollary useful in RSA : For n = pq where p and q are prime and 0 < m < n :  m  (n) + 1  m mod n (also m k  (n) + 1  m )

Euler’s Theorem (cont’d) Proof of corollary : gcd(m, n) = 1  clear gcd(m, n) = p (or q)  p | m  gcd(m, q) = 1  m  (q)  1 mod q  m  (n)  1 mod q  m  (n)  1 + kq  m  (n) + 1  m + kq * k’p  m  (n) + 1  m mod n

Testing for Primality x 2  1 mod p (p is an odd prime)  only two solutions x  1 and x  -1 mod p Corollary : A solution except ±1  n is not prime WITNESS(a, n) (textbook) True  n is definitely not prime False  n may be prime returns false with a prob. < 0.5 Repeatedly invoke it (until returns true) after s times, n is prime with a prob. >= (1 – 2 -s )

Discrete Logarithms a m  1 mod n (gcd(a, n) = 1) At least one integer m (namely  (n)) Least positive m is called The order of a (mod n) The exponent to which a belongs (mod n) The length of the period generated by a m is at most  (n), if m =  (n) a is a primitive root of n a, a 2, …, a  (n) (mod n) are distinct and rel. prime to n

Discrete Logarithms (cont’d) For any integer b and a primitive root a of prime number p A unique i satisfies b  a i mod n (0 <= i <=  (n) – 1) i is the index of b for the base a (mod n) = ind a,n (b) ind a,n (1) = 0 ind a,n (a) = 1 Example: n = 9   (n) = 6 a = 2 (a primitive root) ind 2, 9 (7) = 4 index number124875

Discrete Logarithms (cont’d) Any z can be expressed as z = q + k  (n) a  (n)  1 mod n  a z  a q mod n x = a mod n, y = a mod n (a mod n) (a mod n) = xy = a mod n = a mod n ind a,n (y)ind a,n (x) ind a,n (y) ind a,n (x) + ind a,n (y)ind a,n (xy)   ind a,n (xy)  [ind a,n (x) + ind a,n (y)] mod  (n)   ind a,n (x r )  [r * ind a,n (x)] mod  (n)