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.

Slides:



Advertisements
Similar presentations
Cryptography and Network Security
Advertisements

CSE115/ENGR160 Discrete Mathematics 03/15/12
Thinking Mathematically
5.1 Number Theory. The study of numbers and their properties. The numbers we use to count are called the Natural Numbers or Counting Numbers.
22C:19 Discrete Structures Integers and Modular Arithmetic
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
CSE115/ENGR160 Discrete Mathematics 03/13/12 Ming-Hsuan Yang UC Merced 1.
Number Theory and Cryptography
CSE115/ENGR160 Discrete Mathematics 03/15/11
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
CSE 311 Foundations of Computing I Lecture 12 Primes, GCD, Modular Inverse Spring
Fall 2002CMSC Discrete Structures1 Let us get into… Number Theory.
BY MISS FARAH ADIBAH ADNAN IMK
The Integers and Division
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations Copyright © The McGraw-Hill Companies, Inc. Permission required.
Chapter 2 The Fundamentals: Algorithms, the Integers, and Matrices
Section 2.2: Affine Ciphers; More Modular Arithmetic Practice HW (not to hand in) From Barr Textbook p. 80 # 2a, 3e, 3f, 4, 5a, 7, 8 9, 10 (Use affinecipherbreaker.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 3): The Fundamentals: Algorithms, the.
Mathematics of Cryptography Part I: Modular Arithmetic
3.4/3.5 The Integers and Division/ Primes and Greatest Common Divisors Let each of a and b be integers. We say that a divides b, in symbols a | b, provided.
MATH 224 – Discrete Mathematics
Mathematics of Cryptography Modular Arithmetic, Congruence,
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
Section 2.1: Shift Ciphers and Modular Arithmetic The purpose of this section is to learn about modular arithmetic, which is one of the fundamental mathematical.
Section 2.1: Shift Ciphers and Modular Arithmetic Practice HW from Barr Textbook (not to hand in) p.66 # 1, 2, 3-6, 9-12, 13, 15.
Introduction to Algorithms Second Edition by Cormen, Leiserson, Rivest & Stein Chapter 31.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
CompSci 102 Discrete Math for Computer Science
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Copyright © Zeph Grunschlag, Basic Number Theory Zeph Grunschlag.
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.
MAT 320 Spring 2008 Section 1.2.  Start with two integers for which you want to find the GCD. Apply the division algorithm, dividing the smaller number.
Section 2.2: Affine Ciphers; More Modular Arithmetic Shift ciphers use an additive key. To increase security, we can add a multiplicative parameter. –For.
CSE 311: Foundations of Computing Fall 2014 Lecture 12: Primes, GCD.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Elements of Coding and Encryption 1. Encryption In the modern word, it is crucial that the information is transmitted safely. For example, Internet purchases,
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Math 409/409G History of Mathematics Books VII – IX of the Elements Part 1: Divisibility.
Module #9 – Number Theory 1/5/ Algorithms, The Integers and Matrices.
Slide Copyright © 2009 Pearson Education, Inc. Unit 1 Number Theory MM-150 SURVEY OF MATHEMATICS – Jody Harris.
Application: Algorithms Lecture 20 Section 3.8 Wed, Feb 21, 2007.
Factor A factor of an integer is any integer that divides the given integer with no remainder.
Ref: Pfleeger96, Ch.31 Properties of Arithmetic Reference: Pfleeger, Charles P., Security in Computing, 2nd Edition, Prentice Hall, 1996.
AF2. Turn off your phones Primes, gcd, some examples, reading.
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.
CSE 311: Foundations of Computing Fall 2013 Lecture 12: Primes, GCD, modular inverse.
Discrete Mathematics
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: Algorithms,
The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
Chapter 4 With Question/Answer Animations 1. Chapter Summary Divisibility and Modular Arithmetic - Sec 4.1 – Lecture 16 Integer Representations and Algorithms.
Ch04-Number Theory and Cryptography 1. Introduction to Number Theory Number theory is about integers and their properties. We will start with the basic.
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.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Chapter 3 The Fundamentals: Algorithms, the integers, and matrices Section 3.4: The integers and division Number theory: the part of mathematics involving.
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.
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
Number-Theoretic Algorithms
Public Key Encryption Major topics The RSA scheme was devised in 1978
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Applied Discrete Mathematics Week 4: Number Theory
Number Theory (Chapter 7)
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Copyright © Zeph Grunschlag,
Divisibility and Modular Arithmetic
Applied Discrete Mathematics Week 10: Introduction to Counting
Presentation transcript:

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

The purpose of the next two sections that we cover is to provide the mathematics background needed to understand the RSA Cryptosystem, which is a modern cryptosystem in wide use today. We start out by reviewing and expanding our study of prime numbers.

Prime Numbers Recall that a prime number p is a number whose only divisors are 1 and itself (1 and p). A number that is not prime is said to be composite. The following set represents the set of primes that are less than 100: {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…} A larger list of primes can be found in the Barr text on pp

Facts About Primes 1. There are an infinite number of primes. 2.Every natural number can be factored into a product of primes (Fundamental Theorem of Arithmetic).

Determining the Primality of Larger Positive Integers Because of its use in cryptology and other applications, mathematical techniques for determining whether large numbers are prime have been targets of intense research. We study some elementary factors for determining the primality of numbers.

Fact 2 is the only even prime. Any even number larger than 2 is not prime since 2 is a divisor.

Example 1: Is prime? Solution:

How do we determine if large positive integers are prime? The next example illustrates an elementary method for doing this?

How do we determine if large positive integers are prime? The next example illustrates an elementary method for doing this?

Example 2: Is 127 prime? Solution:

Example 2 provides the justification for the following primality test for prime numbers. Square Root Test for Determining Prime Numbers Let n > 1 be a natural number. If no prime number {2, 3, 5, 7, 11, 13, …} less than is a divisor of n, than n is prime.

Example 3: Determine if 839 is prime. Solution:

Example 4: Determine if 1073 is prime. Solution:

Example 5: Determine if 1709 is prime. Solution:

As the numbers tested get larger, the square root test for primality does have limitations. The next example illustrates this fact.

Example 6: Determine if is prime. Solution:

Being able to determine whether large numbers are prime will be important later on when we study the RSA cryptosystem. To deal with larger numbers, much more sophisticated tests for primality testing have been developed and are an on going topic of research. The largest prime number discovered up to December 2005 was the number which is a digit prime number.

Factorization of Composite Numbers Recall that a number that is not prime, it is composite. If a number is composite, it can be factored into prime factors other than 1 and itself. We review some basic techniques of factoring in the following examples.

Example 7: Factor 3267 into a product of prime factors. Solution:

Example 8: Factor into a product of prime factors. Solution:

Example 9: Factor 1511 into a product of prime factors. Solution:

The Greatest Common Divisor of Two Numbers Recall that the greatest common divisor of two numbers, denoted as gcd( a, b ), is the largest number that divides a and b evenly with no remainder. For example, gcd(10, 20). = 10 and gcd(72, 108)=36.

Previously, we saw a method to find the gcd that involved multiplying the prime factors that both numbers had in common. This method is inefficient for find the greatest common divisor of larger numbers since it is harder factor numbers with larger prime factors. However, there is a well known method known as the Euclidean algorithm that will allows us to find the greatest common divisor of larger numbers which we state next.

The Euclidean Algorithm The Euclidean Algorithm makes repeated use of the division algorithm to find the greatest common divisor of two numbers. If we are given two numbers a and b where a > b, we compute

The last nonzero remainder,, is the greatest common divisor. of a and b, that is,.

Example 10: Find the greatest common divisor of a = 2299 and b = 627. Solution: (Will be displayed in class)

Example 11: Find the greatest common divisor of a = and b = Solution: (Will be displayed in class)

Theorem For any two positive integers a and b, there are integers s and t where a s + b t = gcd( a, b )

Note To find s and t, we solve for the remainders starting with the first step in the Euclidean algorithm, substituting each remainder we obtain into the remainders we obtain in successive steps until the greatest common divisor of a and b is reached.

Example 12: Find s and t where a s + b t = gcd( a, b ), where a = 2299 and b = 627. Solution: (Will be displayed in class)

Example 13: Find s and t where a s + b t = gcd( a, b ), where a = and b = Solution: (Will be displayed in class)

Using the previous results, we want to consider the problem of solving the modular equation for t. Here, t represents the multiplicative inverse of b MOD a, that is, the number you must multiply b by to get 1 in MOD a arithmetic. In mathematical notation, we say that. The next example illustrates how Example 13 a special case illustrating how this problem is solved.

Example 14: Consider a = and b = 9875 and consider the problem of solving or In Example 13, we solved a s + b t = gcd( a, b), and obtained t = Since we are working in MOD arithmetic, we can convert t to its equivalent positive representation by computing t = MOD =

We claim that t = is the multiplicative inverse of b MOD a = 9875 MOD 54321, that is. We can verify this by computing b t MOD a = (9875)(51125) MOD = MOD = 1. █ We generalize the results of Example 14 in the following corollary.

Corollary If a and b are relatively prime (gcd( a, b ) = 1), then b has an inverse modulo a. That is, exists. Then b t = 1 MOD a has a solution.

Fact is computed by solving a s + b t = 1. To ensure t > 0, compute t = t MOD a to convert t to its positive representation.

Example 14: Compute. Solution: (Will be displayed in class)

Example 15: Compute Solution: (Will be displayed in class)

Example 16: Solve 7x + 1 = 4 MOD 26 for x. Solution: (In typewritten notes)

Note If, does not exist.

Example 17: Compute. Solution: