Cryptography and Network Security

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

Cryptography and Network Security Chapter 8 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Cryptography and Network Security Chapter 8 Fourth Edition by William Stallings Lecture slides by Lawrie Brown Modified – Tom Noack.
Cryptography and Network Security Chapter 8 Fourth Edition by William Stallings.
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.
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.
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.
Agrawal-Kayal-Saxena Presented by: Xiaosi Zhou
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.
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.
Chap. 8,9: Introduction to number theory and RSA algorithm
Cryptography Lecture 11: Oct 12. Cryptography AliceBob Cryptography is the study of methods for sending and receiving secret messages. adversary Goal:
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.
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.
BY MISS FARAH ADIBAH ADNAN IMK
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.

Module :MA3036NI Cryptography and Number Theory Lecture Week 7
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.
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.
The Complexity of Primality Testing. What is Primality Testing? Testing whether an integer is prime or not. – An integer p is prime if the only integers.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
Cryptography Lecture 7: RSA Primality Testing Piotr Faliszewski.
Politiche delle Reti e Sicurezza 2008 UNICAM. M.L.Maggiulli © Maria Laura Maggiulli Dipartimento di Informatica.
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.
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 2-3 Basic Number Theory and Algebra. In modern cryptographic systems, the messages are represented by numerical values prior to being encrypted.
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.
1 Discrete Structures – CNS2300 Text Discrete Mathematics and Its Applications Kenneth H. Rosen (5 th Edition) Chapter 2 The Fundamentals: 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.
Number-Theoretic Algorithms
Public Key Encryption Major topics The RSA scheme was devised in 1978
Introduction to Number Theory
Mathematics of Cryptography
Chapter Applications of Number Theory Some Useful Results
CSE565: Computer Security Lecture 7 Number Theory Concepts
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Handbook of Applied Cryptography - CH4, from 4.1~4.3
Cryptography and Network Security
Introduction to Number Theory
6*. An Introduction to Number Theory
Cryptography and Network Security Chapter 8
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Cryptography and Network Security
Computer Security Modular Arithmetic November 12, 2018
Prime and Relatively Prime Numbers
Cryptography and Network Security
Introduction to Cryptography
Tuesday, 27 April Number-Theoretic Algorithms Chapter 31
Lecture 2-3 Basic Number Theory and Algebra
Presentation transcript:

Cryptography and Network Security Lecture slides prepared for “Cryptography and Network Security”, 6/e, by William Stallings, Chapter 8 – “More Number Theory”. Sixth Edition by William Stallings

Chapter 8 More Number Theory A number of concepts from number theory are essential in the design of public-key cryptographic algorithms. This chapter provides an overview of the concepts referred to in other chapters. The reader familiar with these topics can safely skip this chapter. The reader should also review Sections 4.1 through 4.3 before proceeding with this chapter. As with Chapter 4, this chapter includes a number of examples, each of which is highlighted in a shaded box. More Number Theory

—The Mathematical Magpie, Clifton Fadiman The Devil said to Daniel Webster: “Set me a task I can’t carry out, and I’ll give you anything in the world you ask for.” Daniel Webster: “Fair enough. Prove that for n greater than 2, the equation an + bn = cn has no non-trivial solution in the integers.” They agreed on a three-day period for the labor, and the Devil disappeared. At the end of three days, the Devil presented himself, haggard, jumpy, biting his lip. Daniel Webster said to him, “Well, how did you do at my task? Did you prove the theorem?” “Eh? No … no, I haven’t proved it.” “Then I can have whatever I ask for? Money? The Presidency?” “What? Oh, that—of course. But listen! If we could just prove the following two lemmas—” Opening quote. A number of concepts from number theory are essential in the design of public-key cryptographic algorithms, which this chapter will introduce. —The Mathematical Magpie, Clifton Fadiman

Prime Numbers Any integer a > 1 can be factored in a unique way as Prime numbers only have divisors of 1 and itself They cannot be written as a product of other numbers Prime numbers are central to number theory Any integer a > 1 can be factored in a unique way as a = p1 a1 * p2 a2 * . . . * pp1 a1 where p1 < p2 < . . . < pt are prime numbers and where each ai is a positive integer This is known as the fundamental theorem of arithmetic An integer p > 1 is a prime number if and only if its only divisors are ±1 and ± p . Prime numbers play a critical role in number theory and in the techniques discussed in this chapter. Any integer a > 1 can be factored in a unique way as a = p1 a1 * p2 a2 * . . . * pp1 a1 where p1 < p2 < . . . < pt are prime numbers and where each ai is a positive integer This is known as the fundamental theorem of arithmetic

Table 8.1 Primes Under 2000 Table 8.1 shows the primes less than 2000. Note the way the primes are distributed. In particular, note the number of primes in each range of 100 numbers.

Fermat's Theorem States the following: ap-1 = 1 (mod p) If p is prime and a is a positive integer not divisible by p then ap-1 = 1 (mod p) Sometimes referred to as Fermat’s Little Theorem An alternate form is: If p is prime and a is a positive integer then ap = a (mod p) Plays an important role in public-key cryptography Two theorems that play important roles in public-key cryptography are Fermat’s theorem and Euler’s theorem. Fermat’s theorem states the following: If p is prime and a is a positive integer not divisible by p, then ap-1 = 1 (mod p) An alternative form of Fermat’s theorem is also useful: If p is prime and a is a positive integer, then ap = a (mod)

Table 8.2 Some Values of Euler’s Totient Function ø(n) Before presenting Euler’s theorem, we need to introduce an important quantity in number theory, referred to as Euler’s totient function, written ø (n ), and defined as the number of positive integers less than n and relatively prime to n . By convention, ø(1) = 1. Table 8.2 lists the first 30 values of ø (n ). The value ø(1) is without meaning but is defined to have the value 1. It should be clear that, for a prime number p , ø (p ) = p - 1

Euler's Theorem States that for every a and n that are relatively prime: aø(n) = 1(mod n) An alternative form is: aø(n)+1 = a(mod n) Euler’s theorem states that for every a and n that are relatively prime: aø(n) = 1(mod n) As is the case for Fermat’s theorem, an alternative form of the theorem is also Useful: aø(n)+1 = a(mod n) Plays an important role in public-key cryptography

Miller-Rabin Algorithm Typically used to test a large number for primality Algorithm is: TEST (n) 1. Find integers k, q, with 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 (“inconclusive") ; 4. for j = 0 to k – 1 do 5. if (a2jq mod n = n – 1) then return (“inconclusive") ; 6. return (“composite") ; For many cryptographic algorithms, it is necessary to select one or more very large prime numbers at random. Thus, we are faced with the task of determining whether a given large number is prime. There is no simple yet efficient means of accomplishing this task. In this section, we present one attractive and popular algorithm. You may be surprised to learn that this algorithm yields a number that is not necessarily a prime. However, the algorithm can yield a number that is almost certainly a prime. This will be explained presently. We also make reference to a deterministic algorithm for finding primes. The section closes with a discussion concerning the distribution of primes. The algorithm due to Miller and Rabin [MILL75, RABI80] is typically used to test a large number for primality. The procedure TEST takes a candidate integer n as input and returns the result composite if n is definitely not a prime, and the result inconclusive if n may or may not be a prime. How can we use the Miller-Rabin algorithm to determine with a high degree of confidence whether or not an integer is prime? It can be shown [KNUT98] that given an odd number n that is not prime and a randomly chosen integer, a with 1 < a < n - 1, the probability that TEST will return inconclusive (i.e., fail to detect that n is not prime) is less than 1/4. Thus, if t different values of a are chosen, the probability that all of them will pass TEST (return inconclusive) for n is less than (1/4)t . For example, for t = 10, the probability that a nonprime number will pass all ten tests is less than 10-6 . Thus, for a sufficiently large value of t, we can be confident that n is prime if Miller’s test always returns inconclusive . This gives us a basis for determining whether an odd integer n is prime with a reasonable degree of confidence. The procedure is as follows: Repeatedly invoke TEST (n) using randomly chosen values for a . If, at any point, TEST returns composite , then n is determined to be nonprime. If TEST continues to return inconclusive for t tests, then for a sufficiently large value of t , assume that n is prime.

Deterministic Primality Algorithm Prior to 2002 there was no known method of efficiently proving the primality of very large numbers All of the algorithms in use produced a probabilistic result In 2002 Agrawal, Kayal, and Saxena developed an algorithm that efficiently determines whether a given large number is prime Known as the AKS algorithm Does not appear to be as efficient as the Miller-Rabin algorithm Prior to 2002, there was no known method of efficiently proving the primality of very large numbers. All of the algorithms in use, including the most popular (Miller-Rabin), produced a probabilistic result. In 2002 (announced in 2002, published in 2004), Agrawal, Kayal, and Saxena [AGRA04] developed a relatively simple deterministic algorithm that efficiently determines whether a given large number is a prime. The algorithm, known as the AKS algorithm, does not appear to be as efficient as the Miller- Rabin algorithm. Thus far, it has not supplanted this older, probabilistic technique.

Chinese Remainder Theorem (CRT) Believed to have been discovered by the Chinese mathematician Sun-Tsu in around 100 A.D. One of the most useful results of number theory Says it is possible to reconstruct integers in a certain range from their residues modulo a set of pairwise relatively prime moduli Can be stated in several ways One of the most useful results of number theory is the Chinese remainder theorem (CRT). In essence, the CRT says it is possible to reconstruct integers in a certain range from their residues modulo a set of pairwise relatively prime moduli. The CRT can be stated in several ways. We present here a formulation that is most useful from the point of view of this text. An alternative formulation is explored in Problem 8.17. One of the useful features of the Chinese remainder theorem is that it provides a way to manipulate (potentially very large) numbers mod M in terms of tuples of smaller numbers. This can be useful when M is 150 digits or more. However, note that it is necessary to know beforehand the factorization of M . Provides a way to manipulate (potentially very large) numbers mod M in terms of tuples of smaller numbers This can be useful when M is 150 digits or more However, it is necessary to know beforehand the factorization of M

Powers of Integers, Modulo 19 Table 8.3 Powers of Integers, Modulo 19 Table 8.3 shows all the powers of a , modulo 19 for all positive ø <19. The length of the sequence for each base value is indicated by shading. Note the following: 1. All sequences end in 1. This is consistent with the reasoning of the preceding few paragraphs. 2. The length of a sequence divides ø (19) = 18. That is, an integral number of sequences occur in each row of the table. 3. Some of the sequences are of length 18. In this case, it is said that the base integer a generates (via powers) the set of nonzero integers modulo 19. Each such integer is called a primitive root of the modulus 19. More generally, we can say that the highest possible exponent to which a number can belong (mod n ) is ø (n ). If a number is of this order, it is referred to as a primitive root of n . The importance of this notion is that if a is a primitive root of n , then its powers a , a2 ,. . . , aø(n) are distinct (mod n ) and are all relatively prime to n . In particular, for a prime number p , if a is a primitive root of p , then a , a2 ,. . . , ap-1 are distinct (mod p ). For the prime number 19, its primitive roots are 2, 3, 10, 13, 14, and 15. Not all integers have primitive roots. In fact, the only integers with primitive roots are those of the form 2, 4, pa , and 2pa , where p is any odd prime and a is a positive integer. The proof is not simple but can be found in many number theory books, including [ORE76].

Table 8. 4, which is directly derived from Table 8 Table 8.4, which is directly derived from Table 8.3, shows the sets of discrete logarithms that can be defined for modulus 19.

Summary Prime numbers Fermat’s Theorem Euler’s totient function Euler’s Theorem Testing for primality Miller-Rabin algorithm A deterministic primality algorithm Distribution of primes The Chinese Remainder Theorem Discrete logarithms Powers of an integer, modulo n Logarithms for modular arithmetic Calculation of discrete logarithms Chapter 8 summary.