Chapter Applications of Number Theory Some Useful Results

Slides:



Advertisements
Similar presentations
CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (4) Information Security.
Advertisements

CSE331: Introduction to Networks and Security Lecture 19 Fall 2002.
The Integers and Division. Outline Division: Factors, multiples Exercise 2.3 Primes: The Fundamental Theorem of Arithmetic. The Division Algorithm Greatest.
CSE115/ENGR160 Discrete Mathematics 03/15/12
22C:19 Discrete Structures Integers and Modular Arithmetic
Public Key Encryption Algorithm
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Public Encryption: RSA
CSE 321 Discrete Structures Winter 2008 Lecture 8 Number Theory: Modular Arithmetic.
Codes, Ciphers, and Cryptography-RSA Encryption
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
Prime Numbers Prime numbers only have divisors of 1 and self
The Fundamentals: Algorithms, Integers, and Matrices CSC-2259 Discrete Structures Konstantin Busch - LSU1.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 3 (Part 2): The Fundamentals: Algorithms, the.
Introduction to Modular Arithmetic and Public Key Cryptography.
Network and Communications Network Security Department of Computer Science Virginia Commonwealth University.
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
Copyright © Cengage Learning. All rights reserved.
RSA and its Mathematics Behind
Discrete Mathematics CS 2610 March 17, Number Theory Elementary number theory, concerned with numbers, usually integers and their properties or.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
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.
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.
Elements of Coding and Encryption Continuation 1.
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
Number Theory 이재원 School of Information Technology Sungshin W. University.
Chapter 2 (Part 1): The Fundamentals: Algorithms, the Integers & Matrices The Integers and Division (Section 2.4)
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Chapter 4 With Question/Answer Animations. Section 4.1.
1 Section Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Primality Testing. Introduction The primality test provides the probability of whether or not a large number is prime. Several theorems including Fermat’s.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
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.
RSA Algorithm Date: 96/10/17 Wun-Long Yang. Outline Introduction to RSA algorithm RSA efficient implementation & profiling.
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.
MA/CSSE 473 Day 07 Extended Euclid's Algorithm Modular Division
Public Key Cryptography
CS 210 Discrete Mathematics The Integers and Division (Section 3.4)
Public Key Encryption Major topics The RSA scheme was devised in 1978
Public Key Encryption.
Mathematics of Cryptography
RSA Slides by Kent Seamons and Tim van der Horst
CSE15 Discrete Mathematics 03/20/17
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Introduction to Cryptography
Prelude to Public-Key Cryptography
Advanced Algorithms Analysis and Design
Numerical Algorithms x x-1 Numerical Algorithms
RSA Preliminaries.
Number-Theoretic Algorithms (UNIT-4)
RSA and El Gamal Cryptosystems
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory (Chapter 7)
Private-Key Cryptography
Number Theory and Euclidean Algorithm
Number Theory.
ICS 353: Design and Analysis of Algorithms
Introduction to Cryptography
Analysis of the RSA Encryption Algorithm
CSE 321 Discrete Structures
Introduction to Algorithms Second Edition by
The RSA Public-Key Encryption Algorithm
Presentation transcript:

Chapter 3 3.7 Applications of Number Theory Some Useful Results Linear Congruences The Chinese Remainder Theorem Computer Arithmetic with Large Integers Pseudoprimes Public Key Cryptography

Some Useful Results Theorem 1: If a and b are positive integers, then there exist integers s and t such that gcd(a ,b) = sa+tb . Example 1: express gcd(252 , 198) =18 as a linear combination of 252 and 198 .

Some Useful Results Lemma 1: If a, b, and c are positive integers such that gcd(a , b) = 1 and a|bc, then a|c . Lemma 2 : If p is a prime and p|a1a2. . .an, where each ai is an integer , then p|ai for some i. Theorem 2: Let m be a positive integer and let a, b ,and c be integers. If ac≡ bc (mod m) and gcd(c, m) = 1 , then a≡b (mod m).

Linear Congruences A congruence of the form ax≡b (mod m) where m is a positive integer , a and b are integers , and x is variable, is called a linear congruence. Such congruences arise throughout number theory and its applications. How can we solve the linear congruence ax≡b (mod m) ? That is, find the x that satisfy this congruence. One method that we will describe uses an integer ā such that aā≡1 (mod m), if such an integer exist. Such an integer ā is said to be an inverse of a modulo m. Theorem 3 guarantees that an inverse of a modulo m exists whenever a and m are relatively prime.

Linear Congruences Theorem 3: If a and m are relatively prime integers and m>1, then an inverse of a modulo m exist. Furthermore, this inverse is unique modulo m. (there is a unique positive integer ā less than m that is an inverse of a modulo m and every other inverse of a modulo m is congruent to ā modulo m.) When we have an inverse of a modulo m, that is, ax≡1 (mod m) , we can easily solve the congruence ax≡b (mod m).

The Chinese Remainder Theorem Example 3: Find an inverse of 3 modulo 7? Theorem 5, section 3.4, p204. Let m be a positive integer. If a≡b (mod m) and c≡d (mod m), then a+c≡b+d (mod m) and ac≡bd (mod m). Example 4: What are the solutions of the liner congruence 3x ≡4 ( mod 7)? Example 5: In the first century, the Chinese mathematician Sun-Tsu asked: There are certain things whose number is unknown. When divided by 3, the remainder is 2; when divided by 5, the remainder is 3; and when divided by 7 , the remainder is 2. What will be the number of things?

The Chinese Remainder Theorem Theorem 4: The Chinese Remainder Theorem Let m1, m2, . . . ,mn be pairwise relative prime positive integers and a1, a2,. . . ,an arbitrary integers. Then the system x≡a1 ( mod m1) x≡a2 ( mod m2) … x≡an ( mod mn) has a unique solution modulo m= m1, m2, . . . ,mn . (That is , there is solution x with 0 ≦x <m, and all other solutions are congruent modulo m to this solution.)

射雕英雄傳 第一千四百二十七頁 瑛姑說道: 『. . . 今有物不知其數,三三數支謄二,五五數之謄三,七七數之謄二,問物幾何?』 黃蓉笑道: 『這容易得緊,以三三數之,餘數乘以七十; 五五數之,餘數乘以二十一,七七數之,餘數乘以十五。三者相加,如不大於一百零五,即為答數; 否則須減去一百零五或其倍數。』 黃蓉道: 『也不用這般硬記,我念一首詩給你聽,那就容易記了:三人同行七十稀,五樹梅花二一枝,七子團員正半月,餘百零五便得知。』

The Chinese Remainder Theorem Assign values to ai an mi. Find value for m=m1*m2*…*mn; Mi=m/mi. Find yi, the inverse of Mi module mi. Find the value x=a1M1y1+ … + anMnyn. Find x ≡ b (mod m), where 0 <= b <m

The Chinese Remainder Theorem Example 6: Solve the system of congruences in Example 5 by using theorem 4. Example 5:there are certain things whose number is unknown. When divided by 3, the remainder is 2; when divided by 5, the remainder is 3; and when divided by 7 , the remainder is 2. What will be the number of things?

Computer Arithmetic with Large Integers Suppose that m1, m2, . . . ,mn are pairwise relatively prime integers greater than or equal to 2 and let m be their product. By the Chinese Remainder Theorem, we can show that an integer a with 0≤ a < m can be uniquely represented by the n-tuple consisting of its remainders upon division by mi , i= 1, 2,. . .,n. We can uniquely represent a by (a mod m1, a mod m2, . . ., a mod mn)

Computer Arithmetic with Large Integers Example 7: What are the pairs used to represent the nonnegative integers less than 12 when they are represented by the ordered pair where the first component is the remainder of the integer upon division by 3 and the second component is the remainder of the integer upon division by 4?

Pseudoprimes Theorem 5: Fermat’s Little Theorem If p is prime and a is an integer not divisible by p, then ap-1 ≡1 (mod p) Furthermore, for every integer a we have ap ≡a (mod p) Unfortunately, there are composite integer n, such that 2n-1≡1 (mod p). Such integers are called pseudoprimes to the base 2. Example 9: Explain why the integer 341 is a pseudoprime to the base 2.

Computer Arithmetic with Large Integers Definition 1: Let b be a positive integer. If n is a composite positive integer, and bn-1 ≡1 (mod n), then n is called a pseudoprime to the base b. Definition 2: A composite integer n that satisfies the congruence bn-1 ≡1 (mod n) for all positive integers b with gcd(b , n)=1 is called a Carmichael number. (This numbers are named after Robert Carmichael, who studied them in the early twentieth century) Example 10: The integer 561 is a Carmichael number.

Private Key Cryptography Private key cryptosystems (Section 3.4, Example 9, p207) c=(p+k) mod 26, where p, c represent a letter, k is an encryption key. Everybody knowing this (private) key can both encrypt and decrypt messages easily. Two people need to securely exchange the key in advance.

Public Key Cryptography In 1976, three researchers at M.I.T. – Ronald Rivest, Adi Shamir, and Leonard Adleman – introduced to the world a public key cryptosystem, known as the RSA system. The RSA cryptosystem is based on modular exponentiation modulo the product of two large primes, which can be done rapidly using Algorithm 5 in section 3.6. Each individual has an encryption key consisting of a modulus n=pq, where p and q are large primes, say, with 200 digits each, and an exponent e that is relatively prime to (p-1)(q-1).

Public Key Cryptography To produce a usable key, two large primes must be found. This can be done quickly on a computer using probabilistic primality test. (Example 16, Section 6.2, p 412-413 text book) However, the product of these primes n=pq, with approximately 400 digits, cannot be factored in a reasonable length of time. This is an important reason why decryption cannot be done quickly without a separate decryption key.

RSA Encryption In the RSA encryption method, messages are translated into sequences of integers. These integers are grouped together to form larger integers, each representing a block of letters. The encryption proceeds by transforming the integer M, representing the plaintext (the original message), to an integer C, representing the ciphertext (the encryption message), using the function C=Me mod n.

Gcd(e, (p-1)(q-1)) = gcd(13, 42 x 58)=1. RSA Encryption Example 11: Encrypt the message STOP using the RSA cryptosystem with p=43 and q=59, so that n=43 x 59 = 2537, and with e=13. Note that Gcd(e, (p-1)(q-1)) = gcd(13, 42 x 58)=1.

RSA Decryption The plaintext message can be quickly recovered when the decryption key d, an inverse of e modulo (p-1)(q-1), is known. Such inverse exist because gcd(e, (p-1)(q-1))=1). de≡1 (mod (p-1)(q-1)), there exist an integer k, such that de=k(p-1)(q-1)+1. It follows that Cd≡(Me)d=Mde=M1+k(p-1)(q-1) (mod n). By Fermat’s Little Theorem (theorem 5)[assuming that gcd(M,p)=gcd(M,q)=1, which holds except in rare cases], it follows that Mp-1≡1 (mod p) and Mq-1 ≡1 (mod q).

RSA Decryption Consequently, Cd ≡M(Mp-1)k(q-1) ≡M (mod p) and Cd ≡M(Mq-1)k(p-1) ≡M (mod q) Because gcd(p,q)=1, it follows by the Chinese Remainder Theorem that Cd ≡M (mod pq)

RSA Decryption Example 12: We receive the encrypted message 0981 0461. What is the decrypted message if it was encrypted using the RSA cipher form example 11.