1 Section 10.5.1 Congruences In short, a congruence relation is an equivalence relation on the carrier of an algebra such that the operations of the algebra.

Slides:



Advertisements
Similar presentations
The Euler Phi-Function Is Multiplicative (3/3)
Advertisements

RSA COSC 201 ST. MARY’S COLLEGE OF MARYLAND FALL 2012 RSA.
COMP 170 L2 Page 1 L06: The RSA Algorithm l Objective: n Present the RSA Cryptosystem n Prove its correctness n Discuss related issues.
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.
Data encryption with big prime numbers
22C:19 Discrete Structures Integers and Modular Arithmetic
hap8.html#chap8ex5.
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
1 The RSA Algorithm Supplementary Notes Prepared by Raymond Wong Presented by Raymond Wong.
and Factoring Integers (I)
The RSA Cryptosystem and Factoring Integers (II) Rong-Jaye Chen.
Chapter II. THE INTEGERS
Congruence of Integers
CS470, A.SelcukPublic Key Cryptography1 CS 470 Introduction to Applied Cryptography Instructor: Ali Aydin Selcuk.
and Factoring Integers
Public Encryption: RSA
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
CS555Spring 2012/Topic 61 Cryptography CS 555 Topic 6: Number Theory Basics.
The Integers and Division
The RSA Algorithm Rocky K. C. Chang, March
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,

1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
9/2/2015Discrete Structures1 Let us get into… Number Theory.
Introduction to Modular Arithmetic and Public Key Cryptography.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
Section 4.3: Fermat’s Little Theorem Practice HW (not to hand in) From Barr Text p. 284 # 1, 2.
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.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Basic Number Theory Divisibility Let a,b be integers with a≠0. if there exists an integer k such that b=ka, we say a divides b which is denoted by a|b.
Elements of Coding and Encryption Continuation 1.
RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013.
Algebra of RSA codes Yinduo Ma Tong Li. Ron Rivest, Adi Shamir and Leonard Adleman.
Chinese Remainder Theorem Dec 29 Picture from ………………………
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.
1 Network and Computer Security (CS 475) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
ENCRYPTION TAKE 2: PRACTICAL DETAILS David Kauchak CS52 – Spring 2015.
Network and Computer Security (CS 475) Modular Arithmetic
David Kauchak CS52 – Spring 2015
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.
CS Modular Division and RSA1 RSA Public Key Encryption To do RSA we need fast Modular Exponentiation and Primality generation which we have shown.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
The Euclidean Algorithm That’s right, it’s real..
Introduction to Number Theory
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
Divisibility and Modular Arithmetic
Data encryption with big prime numbers DANIEL FREEMAN, SLU.
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.
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.
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.
Chapter Applications of Number Theory Some Useful Results
Introduction to Cryptography
Advanced Algorithms Analysis and Design
Number-Theoretic Algorithms (UNIT-4)
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory (Chapter 7)
Applied Symbolic Computation (CS 300) Modular Arithmetic
Systems Architecture I
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Applied Symbolic Computation (CS 300) Modular Arithmetic
Presentation transcript:

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 are preserved by the relation. Example. For the algebra  Z: +, · , let x ~ y mean x mod 4 = y mod 4. Notice that ~ is an equivalence relation on Z. The four equivalence classes are [0] = {4k | k  Z}, [1] = {4k + 1 | k  Z}, [2] = {4k + 2 | k  Z}, [3] = {4k + 3 | k  Z}. Notice also that addition and multiplication are preserved by ~. In other words, if a ~ b and c ~ d, then we also have a + c ~ b + d and a·c ~ b·d Can you verify these facts? So ~ is a congruence relation on the algebra  Z: +, · . Notation: The relation x mod n = y mod n is also written as x  y (mod n) and we say, “ x is congruent to y mod n.” Application I Let [0], [1], …, [n – 1] be the equivalence classes for the relation x  y (mod n) on Z. Then they form the elements of an algebra with operations + and · defined by by [a] + [b] = [a + b] and [a]·[b] = [a·b] For example, with x  y (mod 4), we have the following calculations: [2] + [3] = [2 + 3] = [5] = [1] and [2]·[3] = [2·3] = [6] = [2]. These facts are used to give a short proof of: Fermat’s little theorem: If p is prime and p does not divide a, then a p–1  1 (mod p).

2 Application II Fermat’s little theorem is used to prove the RSA theorem in cryptology (upcoming). Application III Solving a congruence. If gcd(a, n) = 1, then ax  b (mod n) has a solution. Algorithm: (1) Find integers s and t such that 1 = as + nt. (e.g., use Euclidean algorithm in reverse). (2) Then x = bs solves the congruence. The complete set of solutions is {bs + nk | k  Z}. Example. Solve 10x  5 (mod 27) Solution. Use the Euclidean algorithm to find the gcd(10, 27): 27 = 10· = 7· = 3·2 + 1So the gcd(10, 27) = 1. Now reverse the process to find s and t such that 1 = 10s + 27t. 1 = 7 – 3·2 = 7 – (10 – 7·1)·2 = 7·3 – 10·2 = (27 – 10·2)·3 – 10·2 = 10·(–8) + 27·3. So s = –8 and t = 3. Thus x = bs = –40 is a solution, and the set of all solutions is {– k | k  Z}.

3 Application IV Chinese Remainder Theorem. Given n congruences x  a 1 (mod m 1 ), …, x  a n (mod m n ), where gcd(m i, m j ) = 1 for each i ≠ j. The following algorithm finds a unique solution x in the range 0 ≤ x < m = m 1 …m n. (1) For each i find b i such that (m/m i )b i  1 (mod m i ). (2) Set x = (m/m 1 )b 1 a 1 + … + (m/m n )b n a n. (3) If x is not in the proper range, then add or subtract a multiple of m. Example. Solve the following three congruences for the unique x specified by the CRT. x  6 (mod 5) x  4 (mod 7) x  2 (mod 11) Solution. Since the moduli are prime, the gcd requirement is satisfied. (1) Find b 1, b 2, b 3 such that 7·11b 1  1 (mod 5) 5·11b 2  1 (mod 7) 5·7b 3  1 (mod 11) Three solutions are b 1 = 3, b 2 = 6, and b 3 = 6. (2) Set x = 7·11·3·6 + 5·11·6·4 + 5·7·6·2 = (3) Since 3126 is outside the range 0 ≤ x < 5·7·11 = 385, set x = 3126 – 8·385 = 46.

4 Section Cryptology: The RSA Algorithm The algorithm allows the public to send encrypted messages by using a publicly available key, but to decrypt a message the receiver needs to know a privately held key. The RSA Algorithm Let p and q be primes and let n = pq. Let d satisfy the equation gcd(d, (p –1)(q – 1)) = 1. Let e be a solution to the congruence de  1 (mod (p –1)(q – 1)). If a is a message in the range 0 ≤ a < n where n and e are known to the sender, then the sender can encrypt a by calculating c = a e mod n. The sender sends c. If the receiver knows d, then upon receipt of c the receiver can decrypt c by calculating a = c d mod n. Usefulness The RSA algorithm is useful because for very large primes, it is hard to factor n to find p and q. So it is very hard to find d. But there are some efficient algorithms to encrypt and decrypt a and c. Example. Given primes p = 7 and q = 13, find two keys d and e. Solution. Then n = pq = 91 and (p – 1)(q – 1) = 6·12 = 72. Choose d = 41, since it satisfies the equation gcd(d, 72) = 1. Now find a suitable value for e by solving the congruence 41e  1 (mod 72). Using the Euclidean algorithm in reverse, it follows that 1 = 41·(–7) + 72·4. So we could pick e to be –7. But positive numbers are easier to work with, so we’ll add a multiple of 72 to get e = – = 65.

5 Example. For the previous example, encrypt the message a = 2. Solution: We need to calculate c = a e mod n= 2 65 mod 91 = (2 12 ) 5 ·2 5 mod 91 = (1) 5 ·2 5 mod 91 (Since 2 12 mod 91 = 1) = 32 mod 91 = 32. Example. For the previous examples, decrypt the encrypted message c = 32. Solution: We need to calculate a = c d mod n= (32) 41 mod 91 = mod 91 = (2 12 ) 17 ·2 mod 91 = (1) 17 ·2 mod 91 (Since 2 12 mod 91 = 1) = 2 mod 91 = 2.