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.

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
Cryptography and Network Security
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.
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
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)
22C:19 Discrete Structures Integers and Modular Arithmetic
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.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
Number Theory and Cryptography
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
and Factoring Integers (I)
CSC2110 Discrete Mathematics Tutorial 5 GCD and Modular Arithmetic
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
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
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
Chapter 8 – Introduction to Number Theory Prime Numbers
Great Theoretical Ideas in Computer Science.
Peter Lam Discrete Math CS.  Sometimes Referred to Clock Arithmetic  Remainder is Used as Part of Value ◦ i.e Clocks  24 Hours in a Day However, Time.
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.

Great Theoretical Ideas in Computer Science.
Mathematics of Cryptography Part I: Modular Arithmetic
MATH 224 – Discrete Mathematics
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
CPSC 3730 Cryptography and Network Security
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
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
RSA Prepared by: SITI ZAINAH ADNAN
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
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Chapter 4 With Question/Answer Animations. Section 4.1.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
9.1 Primes and Related Congruence Equations 23 Sep 2013.
Discrete Mathematics
Divisibility and Modular Arithmetic
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
CS480 Cryptography and Information Security
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division Fermat's little theorem intro.
Number-Theoretic Algorithms
Discrete Math II Howon Kim
Mathematical Background for Cryptography: Modular arithmetic and gcd
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.
Number Theory and Modular Arithmetic
Numerical Algorithms x x-1
Number Theory (Chapter 7)
Computer Security Modular Arithmetic November 12, 2018
Prime and Relatively Prime Numbers
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Introduction to Cryptography
Mathematical Background for Cryptography
Presentation transcript:

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 a, b and m are integers. b divides a if there is no remainder on division. The notation b|a is commonly used to mean that b divides a. If b|a, we say that b is a divisor of a.

YSLInformation Security -- Public-Key Cryptography2 Prime and Relatively Prime Numbers (cont’d) If a|1, then a =  1. If a|b and b|a, then a =  b. Any b  0 divides 0. If b|g and b|h, then b|(mg + nh) for arbitrary integers m and n.

YSLInformation Security -- Public-Key Cryptography3 Prime and Relatively Prime Numbers (cont’d)

YSLInformation Security -- Public-Key Cryptography4 Prime and Relatively Prime Numbers (cont’d) Table 7.1 Primes under 2000

YSLInformation Security -- Public-Key Cryptography5 Prime and Relatively Prime Numbers (cont’d) The above statement is referred to as the prime number theorem, which was proven in 1896 by Hadaward and Poussin.

YSLInformation Security -- Public-Key Cryptography6 Prime and Relatively Prime Numbers (cont’d)

YSLInformation Security -- Public-Key Cryptography7 Prime and Relatively Prime Numbers (cont’d) Whether there exists a simple formula to generate prime numbers? An ancient Chinese mathematician conjectured that if n divides 2 n - 2 then n is prime. For n = 3, 3 divides 6 and n is prime. However, For n = 341 = 11  31, n dives Mersenne suggested that if p is prime then M p = 2 p - 1 is prime. This type of primes are referred to as Mersenne primes. Unfortunately, for p = 11, M 11 = = 2047 = 23  89.

YSLInformation Security -- Public-Key Cryptography8 Prime and Relatively Prime Numbers (cont’d) Fermat conjectured that if F n = 2 2 n + 1, where n is a non-negative integer, then F n is prime. When n is less than or equal to 4, F 0 = 3, F 1 = 5, F 2 = 17, F 3 = 257 and F 4 = are all primes. However, F 5 = = 641  is not a prime bumber. n n is valid only for n < 80. There are an infinite number of primes of the form 4n + 1 or 4n + 3. There is no simple way so far to gererate prime numbers.

YSLInformation Security -- Public-Key Cryptography9 Prime and Relatively Prime Numbers (cont’d) Factorization of an integer as a product of prime numbers Example: 91 = 7  13; = 7  11 2  13. Useful for checking divisibility and relative primality to be discussed later. Factorization is in gereral difficult.

YSLInformation Security -- Public-Key Cryptography10 Prime and Relatively Prime Numbers (cont’d) Define notation gcd(a,b) to mean the greatest common divisor of a and b. The positive integer c is said to be the gcd of a and b if –c|a and c|b –any divisor of a and b is a dividor of c. Equivalently, gcd(a,b) = max[k, such that k|a and k|b] gcd(a,b) = gcd(-a,b) = gcd(a,-b) = gcd(-a,-b) =gcd(|a|,|b|)

YSLInformation Security -- Public-Key Cryptography11 Prime and Relatively Prime Numbers (cont’d) gcd(a,0) = |a|. Factorization is one possible but in general inefficient way to calculate gcd. Whereas, Euclid‘s algorithm (to be discussed later) is more efficient. Relative primality –the integers a and b are relatively prime if they have no prime factors in common –or equivalently, their only common factor is 1 –or equivalently, gcd(a,b) = 1

YSLInformation Security -- Public-Key Cryptography12 Modular Arithmetic

YSLInformation Security -- Public-Key Cryptography13 Modular Arithmetic (cont’d) Examples: –a = 11; n = 7; 11 = 1  7 + 4; r = 4. –a = -11; n = 7; -11 = (-2)  7 + 3; r = 3. If a is an integer and n is a positive integer, define a mod n to be the remainder when a is divided by n. Then, a =  a/n   n + (a mod n); Example: 11 mod 7 = 4; -11 mod 7 = 3.

YSLInformation Security -- Public-Key Cryptography14 Modular Arithmetic (cont’d)

YSLInformation Security -- Public-Key Cryptography15 Modular Arithmetic (cont’d) Properties of modular arithmetic operations Proof of Property 1: Define (a mod n) = r a and (b mod n) = r b. Then a = r a + jn and b = r b + kn for some integers j and k. Then, (a+b) mod n = (r a + jn + r b + kn) mod n = (r a + r b + (j + k)n) mod n = (r a + r b ) mod n = [(a mod n) + (b mod n)] mod n

YSLInformation Security -- Public-Key Cryptography16 Modular Arithmetic (cont’d)  Examples for the above three properties

YSLInformation Security -- Public-Key Cryptography17 Modular Arithmetic (cont’d) Properties of modular arithmetic –Let Z n = {0,1,2,…,(n-1)} be the set of residues modulo n.

YSLInformation Security -- Public-Key Cryptography18 Modular Arithmetic (cont’d) Properties of modular arithmetic (cont’d) –if (a + b)  (a + c) mod n, then b  c mod n (due to the existence of an additive inverse) –if (a  b)  (a  c) mod n, then b  c mod n (only if a is relatively prime to n; due to the possible absence of a multiplicative inverse) e.g. 6  3 = 18  2 mod 8 and 6  7 = 42  2 mod 8 but 3  7 mod 8 (6 is not relatively prime to 8) –If n is prime then the property of multiplicative inverse holds (from a ring to a field).

YSLInformation Security -- Public-Key Cryptography19 Modular Arithmetic (cont’d) Properties of modular arithmetic (cont’d)

YSLInformation Security -- Public-Key Cryptography20 Fermat’s and Euler’s Theorems Fermat’s theorem

YSLInformation Security -- Public-Key Cryptography21 Fermat’s and Euler’s Theorems (cont’d) Fermat’s theorem (cont’d) –alternative form if p is prime and a is any positive integer, then a p  a mod p example: p = 5, a = 3, 3 5 = 243  3 mod 5

YSLInformation Security -- Public-Key Cryptography22 Fermat’s and Euler’s Theorems (cont’d) Euler’s totient function

YSLInformation Security -- Public-Key Cryptography23 Fermat’s and Euler’s Theorems (cont’d)

YSLInformation Security -- Public-Key Cryptography24 Fermat’s and Euler’s Theorems (cont’d) Euler’s totient function (cont’d) –if n is the product of two primes p and q φ(n) = pq – [(q – 1)+(p –1) + 1] = pq – (p + q) + 1 = (p – 1)  (q – 1) = φ (p)  φ (q)

YSLInformation Security -- Public-Key Cryptography25 Fermat’s and Euler’s Theorems (cont’d) Euler’s theorem

YSLInformation Security -- Public-Key Cryptography26 Fermat’s and Euler’s Theorems (cont’d) Euler’s totient function (cont’d)

YSLInformation Security -- Public-Key Cryptography27 Testing for Primality If p is an odd prime, then the equation x 2  1 (mod p) has only two solutions, 1 and -1.

YSLInformation Security -- Public-Key Cryptography28 Testing for Primality (cont’d)

YSLInformation Security -- Public-Key Cryptography29 Testing for Primality (cont’d) Probabilistic primality test

YSLInformation Security -- Public-Key Cryptography30 Euclid’s Algorithm

YSLInformation Security -- Public-Key Cryptography31 Euclid’s Algorithm (cont’d)

YSLInformation Security -- Public-Key Cryptography32 Euclid’s Algorithm (cont’d)

YSLInformation Security -- Public-Key Cryptography33 Euclid’s Algorithm (cont’d)

YSLInformation Security -- Public-Key Cryptography34 Extended Euclid’s Algorithm

YSLInformation Security -- Public-Key Cryptography35 Chinese Remainder Theorem

YSLInformation Security -- Public-Key Cryptography36 Chinese Remainder Theorem (cont’d)

YSLInformation Security -- Public-Key Cryptography37 Discrete Logarithms

YSLInformation Security -- Public-Key Cryptography38 Discrete Logarithms (cont’d)