For your quiz in recitation this week, refer to these exercise generators:

Similar documents
Carmen s Core Concepts (Math 135)

Number theory (Chapter 4)

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

ICS141: Discrete Mathematics for Computer Science I

Basic elements of number theory

Basic elements of number theory

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

3 The fundamentals: Algorithms, the integers, and matrices

2x 1 7. A linear congruence in modular arithmetic is an equation of the form. Why is the solution a set of integers rather than a unique integer?

Congruence of Integers

Public Key Cryptography

Ma/CS 6a Class 2: Congruences

Number Theory Math 420 Silverman Exam #1 February 27, 2018

4 Number Theory and Cryptography

Lecture Notes. Advanced Discrete Structures COT S

Chapter 3 Basic Number Theory

Modular Arithmetic Instructor: Marizza Bailey Name:

Math 131 notes. Jason Riedy. 6 October, Linear Diophantine equations : Likely delayed 6

Ma/CS 6a Class 2: Congruences

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

CPSC 467b: Cryptography and Computer Security

Number Theory and Algebra: A Brief Introduction

Applied Cryptography and Computer Security CSE 664 Spring 2017

ECE596C: Handout #11

An integer p is prime if p > 1 and p has exactly two positive divisors, 1 and p.

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

CPSC 467: Cryptography and Computer Security

4 Powers of an Element; Cyclic Groups

MATH 361: NUMBER THEORY FOURTH LECTURE

CHAPTER 3. Congruences. Congruence: definitions and properties

Wednesday, February 21. Today we will begin Course Notes Chapter 5 (Number Theory).

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

Integers and Division

4. Congruence Classes

Theory of RSA. Hiroshi Toyoizumi 1. December 8,

Number Theory and Group Theoryfor Public-Key Cryptography

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

a the relation arb is defined if and only if = 2 k, k

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013

Mathematical Foundations of Public-Key Cryptography

Elementary Number Theory Review. Franz Luef

Review. CS311H: Discrete Mathematics. Number Theory. Computing GCDs. Insight Behind Euclid s Algorithm. Using this Theorem. Euclidian Algorithm

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

Senior Math Circles Cryptography and Number Theory Week 2

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

The RSA public encryption scheme: How I learned to stop worrying and love buying stuff online

NUMBER THEORY FOR CRYPTOGRAPHY

Beautiful Mathematics

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

Number Theory Notes Spring 2011

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

1 Overview and revision

CS March 17, 2009

Introduction to Public-Key Cryptosystems:

Cryptography. P. Danziger. Transmit...Bob...

Introduction to Cryptography CS 355 Lecture 3

Powers in Modular Arithmetic, and RSA Public Key Cryptography

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

Solutions to Practice Final 3

Topics in Cryptography. Lecture 5: Basic Number Theory

Number Theory. Modular Arithmetic

M381 Number Theory 2004 Page 1

MATH 145 Algebra, Solutions to Assignment 4

Introduction to Cryptology. Lecture 19

Number Theory A focused introduction

Discrete mathematics I - Number theory

Applied Cryptography and Computer Security CSE 664 Spring 2018

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Simple Math: Cryptography

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I

CPSC 467b: Cryptography and Computer Security

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

Encryption: The RSA Public Key Cipher

Lecture 3.1: Public Key Cryptography I

10 Modular Arithmetic and Cryptography

Number Theory Proof Portfolio

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

NOTES ON SIMPLE NUMBER THEORY

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

3.2 Solving linear congruences. v3

Discrete Mathematics with Applications MATH236

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Example 2: Student work M ATHS COURSEWORK. Mathematics SL and HL teacher support material 1. Proving Euler s Totient Theorem

Proof 1: Using only ch. 6 results. Since gcd(a, b) = 1, we have

CRYPTOGRAPHY AND NUMBER THEORY

MATH 25 CLASS 21 NOTES, NOV Contents. 2. Subgroups 2 3. Isomorphisms 4

MATH 115, SUMMER 2012 LECTURE 4 THURSDAY, JUNE 21ST

CSE 20 DISCRETE MATH. Winter

Exercises Exercises. 2. Determine whether each of these integers is prime. a) 21. b) 29. c) 71. d) 97. e) 111. f) 143. a) 19. b) 27. c) 93.

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Math 109 HW 9 Solutions

Lecture 10: HMAC and Number Theory

Elementary Number Theory. Franz Luef

Transcription:

Monday, Oct 29 Today we will talk about inverses in modular arithmetic, and the use of inverses to solve linear congruences. For your quiz in recitation this week, refer to these exercise generators: GCD as a linear combination Multiplicative inverse mod m Solve linear congruence Fermat's Little Theorem There is no online quiz this week. 1

Solving Linear Congruences (from Wednesday) EXERCISE 1. Find x such that 10x 33 (mod 7). A. 2 B. 4 C. 5 D. 6 E. None of these 2. Find x such that 10x 21 (mod 4) A. 0 B. 1 C. 2 D. 3 E. None of these On Wednesday, we used trial-and-error calculations to find that the answer for exercise 1 is B and the answer for exercise 2 is E. Note that, since 4 is a solution to the congruence in exercise 1, any other integer that is congruent to 4 (mod 7) will also be a solution, so there are infinitely many solutions. However, 4 is the unique positive solution that is less than the modulus 7. When we solve a linear congruence, we are always interested in the unique solution that is a positive integer less than the modulus m, if there is such a solution. 2

Also note that trial and error would not be practical if the modulus m were a much larger number, such as 230 or 1590090309007787699945731038830484828024036552967. On Wednesday, we mentioned that there is an algebraic method for efficiently deciding whether a linear congruence has a unique solution mod m, and for finding that solution (if it exists). The method involves using a multiplicative inverse. 3

Multiplicative inverses To solve linear congruences efficiently, first recall the idea of multiplicative inverse. For a nonzero real number a, the multiplicative inverse of a is the unique real number, denoted 1/a or a 1, having the property a a 1 = 1 We use the multiplicative inverse to solve linear equations in real numbers. For instance, to solve the linear equation 12x = 7 we multiply both sides of the equation by 1/12, the inverse of 12: 12x = 7 1 12 12x = 1 12 7 12 12 x = 7 12 1 x = 7 12 x = 7! 12 4

Multiplicative Inverses in Modular Arithmetic The multiplicative inverse (if it exists) of a mod m, denoted either a or a 1, is the unique integer having the property a 1 a 1 (mod m), 0<a 1 <m We can use the multiplicative inverse mod m to solve linear congruences in a manner similar to the use of the inverse to solve a linear equation in real numbers. The solution to ax b(mod m) is x = a 1 b(mod m) where a 1 is the multiplicative inverse of a mod m, if the inverse exists. 5

EXAMPLE Suppose we know that 2 4 1 (mod 7); that is, we know that the inverse of 4 mod 7 is 2. Then we can solve the linear congruence 4x 6 (mod 7) without having to resort to trial and error. 4x 6(mod 7) 2 4x 2 6(mod 7) 1 x (2 6)(mod 7) //because 2 4 mod 7 = 1 x = 12 mod 7 x = 5 Note that in modular arithmetic, where our domain is the set of integers, notation like 1/4 doesn t make sense, so we don t want to say that we multiplied both sides by ¼. 6

Theorem: (Existence of an inverse mod m) If a, m are integers, m>0, then there exists an integer a such that a a 1(mod m) if and only if GCD(a,m) = 1. In other words, the integer a will have an inverse mod m if and only if a, m, are relatively prime. This means that a linear congruence ax b (mod m) will have a unique solution (mod m) if and only gcd(m, a) = 1. Proof: 7

EXERCISE Which of these will have a unique solution 0<x<42 (that is, a unique solution mod 42)? A. 35x 19 (mod 42) B. 25x 19 (mod 42) C. Both A and B D. None of these 8

The proof of the previous theorem tells us not only how to tell if an integer a will have an inverse mod m, but it tells us how to find that inverse: 1. If gcd(m, a) > 1, then the inverse of a does not exist. 2. If gcd(m, a) = 1, use the extended Euclidean algorithm to write the linear combination 1 = ms + at. The coefficient t gives us a 1 : If 0<t<m, then t is the inverse of a. Otherwise, t mod m is the inverse of a. Corollary: The linear congruence ax b(mod m) will have a unique solution 0 x<m if and only if gcd(a, m) = 1. If gcd(a, m) 1, then there will be no solution, unless m is a multiple of a; in that case, there will be multiple solutions. 9

Example Find the inverse of 17(mod 31), and use it to solve the linear congruence 17x 15(mod 31) 10

MULTIPLICATIVE INVERSES in CRYPTOGRAPHY Modular arithmetic and inverses can be used to encrypt/decrypt messages, digital signatures, et c, as follows. First, our message M will be coded as an integer or block of integers. To encrypt our integer message M, pick a (large) modulus m and an encryption key e that is an integer that is relatively prime to m. (To be precise, the pair (e, m) is the encryption key). Let our encrypted message, C, be (e M) mod m. C = (e M) mod m is sent to recipients. To decrypt C, recipients multiply the encrypted message C by e 1. (e 1 C)mod m = (e 1 e M) mod m = M. 11

EXAMPLE Suppose our message is M = 58. Our intended recipients know that our encryption key is e = 418 with modulus m = 8335. Then our encrypted message is C = (418 58) mod 8335 = 24244 mod 8335 = 7574 We send our encrypted message: 7574. The recipient calculates that the multiplicative inverse of 418 mod 8335 is 6002 and uses that to decrypt our encrypted message: (6002 7574) mod 8335 = 45459148 mod 8335 =58 12