L29&30 - RSA Cryptography

Size: px
Start display at page:

Download "L29&30 - RSA Cryptography"

Transcription

1 L29&30 - RSA Cryptography CSci/Math &22 July / 13

2 Notation We write a mod n for the integer b such that 0 b < n and a b (mod n). 2 / 13

3 Calculating Large Powers Modulo n Example 1 What is 8 7 mod 71? 3 / 13

4 Calculating Large Powers Modulo n Example 1 What is 8 7 mod 71? Example 2 What is 5 11 mod 600? 3 / 13

5 Integers Modulo n Let n and a be positive integers such that gcd(a, n) = 1. Theorem Let x Z n. If x[a] = [0] then x = [0]. 4 / 13

6 Integers Modulo n Let n and a be positive integers such that gcd(a, n) = 1. Theorem Let x Z n. If x[a] = [0] then x = [0]. Proof. Let x Z n and x[a] = [0]. Let x = [b] for some integer 0 b < n. Then n (ab). Since gcd(a, n) = 1, we have n b, thus x = [0]. 4 / 13

7 Integers Modulo n Let n and a be positive integers such that gcd(a, n) = 1. Theorem Let x Z n. If x[a] = [0] then x = [0]. Proof. Let x Z n and x[a] = [0]. Let x = [b] for some integer 0 b < n. Then n (ab). Since gcd(a, n) = 1, we have n b, thus x = [0]. Theorem Let x, y Z n. If x[a] = y[a], then x = y. 4 / 13

8 Integers Modulo n Let n and a be positive integers such that gcd(a, n) = 1. Theorem Let x Z n. If x[a] = [0] then x = [0]. Proof. Let x Z n and x[a] = [0]. Let x = [b] for some integer 0 b < n. Then n (ab). Since gcd(a, n) = 1, we have n b, thus x = [0]. Theorem Let x, y Z n. If x[a] = y[a], then x = y. Proof. Let x, y Z n and x[a] = y[a]. Then x[a] y[a] = (x y)[a] = [0]. Since [a] [0], we have x y = [0], showing x = y. 4 / 13

9 Inverse Modulo n If gcd(x, n) = 1 then we can find a [y] Z n such that [x][y] = [1], i.e. xy 1 (mod n). The integer y is called the inverse of x modulo n. Example 3 Find the inverse of 4 modulo 7. 5 / 13

10 Inverse Modulo n If gcd(x, n) = 1 then we can find a [y] Z n such that [x][y] = [1], i.e. xy 1 (mod n). The integer y is called the inverse of x modulo n. Example 3 Find the inverse of 4 modulo 7. Example 4 Find the inverse of 9 modulo / 13

11 Fermat s Little Theorem Lemma If p is a prime and k an integer such that 0 < k < p then p ( p k). 6 / 13

12 Fermat s Little Theorem Lemma If p is a prime and k an integer such that 0 < k < p then p ( p k). Theorem (Fermat s Little Theorem) If p is a prime and a is an integer, then a p a (mod p). 6 / 13

13 Fermat s Little Theorem Lemma If p is a prime and k an integer such that 0 < k < p then p ( p k). Theorem (Fermat s Little Theorem) If p is a prime and a is an integer, then a p a (mod p). Example 5 Find 8 6 mod 7. 6 / 13

14 Euler s Totient Function Euler s Totient Function of n, denoted by φ(n), is the number of positive integers a less than (or equal to) n such that gcd(a, n) = 1. Example 6 Find φ(1), φ(9), φ(12), φ(23) and φ(6). 7 / 13

15 Euler s Totient Function Euler s Totient Function of n, denoted by φ(n), is the number of positive integers a less than (or equal to) n such that gcd(a, n) = 1. Example 6 Find φ(1), φ(9), φ(12), φ(23) and φ(6). Proposition If gcd(m, n) = 1, then φ(mn) = φ(m)φ(n). 7 / 13

16 Euler s Totient Function Euler s Totient Function of n, denoted by φ(n), is the number of positive integers a less than (or equal to) n such that gcd(a, n) = 1. Example 6 Find φ(1), φ(9), φ(12), φ(23) and φ(6). Proposition If gcd(m, n) = 1, then φ(mn) = φ(m)φ(n). Example 7 Find φ(207). 7 / 13

17 Euler s Totient Function Proposition For a prime p we have φ(p) = p 1. 8 / 13

18 Euler s Totient Function Proposition For a prime p we have φ(p) = p 1. Proposition ) For a prime p we have φ(p k ) = p k p k 1 = p (1 k 1 p. 8 / 13

19 Euler s Totient Function Proposition For a prime p we have φ(p) = p 1. Proposition ) For a prime p we have φ(p k ) = p k p k 1 = p (1 k 1 p. Proposition For any positive integer n we have φ(n) = n ( 1 1 ). p p n 8 / 13

20 Euler s Totient Function Proposition For a prime p we have φ(p) = p 1. Proposition ) For a prime p we have φ(p k ) = p k p k 1 = p (1 k 1 p. Proposition For any positive integer n we have φ(n) = n ( 1 1 ). p p n Example 8 Find φ(345). 8 / 13

21 Euler s Theorem Theorem (Euler s Theorem) Let a, n N with gcd(a, n) = 1. Then a φ(n) 1 (mod n). 9 / 13

22 Euler s Theorem Theorem (Euler s Theorem) Let a, n N with gcd(a, n) = 1. Then a φ(n) 1 (mod n). Example 9 Find mod / 13

23 RSA Cryptography Alice wants to send Bob a secure message. 10 / 13

24 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. 10 / 13

25 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: 10 / 13

26 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. 10 / 13

27 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. Calculate n = pq and φ(n) = (p 1)(q 1). 10 / 13

28 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. Calculate n = pq and φ(n) = (p 1)(q 1). Pick an integer e such that gcd(e, φ(n)) = / 13

29 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. Calculate n = pq and φ(n) = (p 1)(q 1). Pick an integer e such that gcd(e, φ(n)) = 1. Calculate the inverse d of e modulo φ(n). 10 / 13

30 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. Calculate n = pq and φ(n) = (p 1)(q 1). Pick an integer e such that gcd(e, φ(n)) = 1. Calculate the inverse d of e modulo φ(n). Make n and e public. 10 / 13

31 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. Calculate n = pq and φ(n) = (p 1)(q 1). Pick an integer e such that gcd(e, φ(n)) = 1. Calculate the inverse d of e modulo φ(n). Make n and e public. Alice calculates r x e (mod n) where x is her message, and sends r to Bob. 10 / 13

32 RSA Cryptography Alice wants to send Bob a secure message. They decide to use an RSA code. Bob will do the following: Pick two primes p and q. Calculate n = pq and φ(n) = (p 1)(q 1). Pick an integer e such that gcd(e, φ(n)) = 1. Calculate the inverse d of e modulo φ(n). Make n and e public. Alice calculates r x e (mod n) where x is her message, and sends r to Bob. Bob calculates r d mod n. 10 / 13

33 RSA Cryptography Example 10 Bob decides to use p = 5 and q = 7. Then n = 35 and φ(n) = 24. He picks e = 5, thus d = 5. He then makes n and e public. Alice wants to send HI to Bob, which becomes the two separate messages 8 and 9. Which numbers should she send to Bob? 11 / 13

34 RSA Cryptography Example 10 Bob decides to use p = 5 and q = 7. Then n = 35 and φ(n) = 24. He picks e = 5, thus d = 5. He then makes n and e public. Alice wants to send HI to Bob, which becomes the two separate messages 8 and 9. Which numbers should she send to Bob? Example 11 Bob receives the following message: 33, 15, 9, 10. What was Alice s original message? 11 / 13

35 RSA Cryptography Example 10 Bob decides to use p = 5 and q = 7. Then n = 35 and φ(n) = 24. He picks e = 5, thus d = 5. He then makes n and e public. Alice wants to send HI to Bob, which becomes the two separate messages 8 and 9. Which numbers should she send to Bob? Example 11 Bob receives the following message: 33, 15, 9, 10. What was Alice s original message? Example 12 Thief C intercepted a message from Alice to Bob. They know that Bob has n = 391 and e = 7. They also know that they need to find d to decypher the message. What should they do? 11 / 13

36 RSA Cryptography Example / 13

37 RSA Cryptography Why is Bob able to decypher Alice s message? Since de 1 (mod φ(n)), we have de = kφ(n) + 1 for some integer k. 13 / 13

38 RSA Cryptography Why is Bob able to decypher Alice s message? Since de 1 (mod φ(n)), we have de = kφ(n) + 1 for some integer k. Using Euler s Theorem, we have x de = x (x φ(n)) k x (1) k (mod n) x (mod n). 13 / 13

Introduction to Modular Arithmetic

Introduction to Modular Arithmetic 1 Integers modulo n 1.1 Preliminaries Introduction to Modular Arithmetic Definition 1.1.1 (Equivalence relation). Let R be a relation on the set A. Recall that a relation R is a subset of the cartesian

More information

Final exam. Question Points Score. Total: 150

Final exam. Question Points Score. Total: 150 MATH 11200/20 Final exam DECEMBER 9, 2016 ALAN CHANG Please present your solutions clearly and in an organized way Answer the questions in the space provided on the question sheets If you run out of room

More information

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography Colin Stirling Informatics Some slides based on ones by Myrto Arapinis Colin Stirling (Informatics) Discrete

More information

CHAPTER 2. Modular Arithmetic

CHAPTER 2. Modular Arithmetic CHAPTER 2 Modular Arithmetic In studying the integers we have seen that is useful to write a = qb + r. Often we can solve problems by considering only the remainder, r. This throws away some of the information,

More information

Foundations of Cryptography

Foundations of Cryptography Foundations of Cryptography Ville Junnila viljun@utu.fi Department of Mathematics and Statistics University of Turku 2015 Ville Junnila viljun@utu.fi Lecture 10 1 of 17 The order of a number (mod n) Definition

More information

Data security (Cryptography) exercise book

Data security (Cryptography) exercise book University of Debrecen Faculty of Informatics Data security (Cryptography) exercise book 1 Contents 1 RSA 4 1.1 RSA in general.................................. 4 1.2 RSA background.................................

More information

Assignment 2. Due: Monday Oct. 15, :59pm

Assignment 2. Due: Monday Oct. 15, :59pm Introduction To Discrete Math Due: Monday Oct. 15, 2012. 11:59pm Assignment 2 Instructor: Mohamed Omar Math 6a For all problems on assignments, you are allowed to use the textbook, class notes, and other

More information

Public Key Encryption

Public Key Encryption Math 210 Jerry L. Kazdan Public Key Encryption The essence of this procedure is that as far as we currently know, it is difficult to factor a number that is the product of two primes each having many,

More information

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014

Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 7 Public Key Cryptography Great Ideas in Theoretical Computer Science Saarland University, Summer 2014 Cryptography studies techniques for secure communication in the presence of third parties. A typical

More information

NUMBER THEORY AMIN WITNO

NUMBER THEORY AMIN WITNO NUMBER THEORY AMIN WITNO.. w w w. w i t n o. c o m Number Theory Outlines and Problem Sets Amin Witno Preface These notes are mere outlines for the course Math 313 given at Philadelphia

More information

MAT Modular arithmetic and number theory. Modular arithmetic

MAT Modular arithmetic and number theory. Modular arithmetic Modular arithmetic 1 Modular arithmetic may seem like a new and strange concept at first The aim of these notes is to describe it in several different ways, in the hope that you will find at least one

More information

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m.

p 1 MAX(a,b) + MIN(a,b) = a+b n m means that m is a an integer multiple of n. Greatest Common Divisor: We say that n divides m. Great Theoretical Ideas In Computer Science Steven Rudich CS - Spring Lecture Feb, Carnegie Mellon University Modular Arithmetic and the RSA Cryptosystem p- p MAX(a,b) + MIN(a,b) = a+b n m means that m

More information

Number Theory/Cryptography (part 1 of CSC 282)

Number Theory/Cryptography (part 1 of CSC 282) Number Theory/Cryptography (part 1 of CSC 282) http://www.cs.rochester.edu/~stefanko/teaching/11cs282 1 Schedule The homework is due Sep 8 Graded homework will be available at noon Sep 9, noon. EXAM #1

More information

Algorithmic Number Theory and Cryptography (CS 303)

Algorithmic Number Theory and Cryptography (CS 303) Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic and the RSA Public Key Cryptosystem Jeremy R. Johnson 1 Introduction Objective: To understand what a public key cryptosystem is and

More information

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory

Number Theory - Divisibility Number Theory - Congruences. Number Theory. June 23, Number Theory - Divisibility - Congruences June 23, 2014 Primes - Divisibility - Congruences Definition A positive integer p is prime if p 2 and its only positive factors are itself and 1. Otherwise, if p 2, then p

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem Theorem. Let n 1,..., n r be r positive integers relatively prime in pairs. (That is, gcd(n i, n j ) = 1 whenever 1 i < j r.) Let a 1,..., a r be any r integers. Then the

More information

Algorithmic Number Theory and Cryptography (CS 303)

Algorithmic Number Theory and Cryptography (CS 303) Algorithmic Number Theory and Cryptography (CS 303) Modular Arithmetic Jeremy R. Johnson 1 Introduction Objective: To become familiar with modular arithmetic and some key algorithmic constructions that

More information

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties.

LECTURE 3: CONGRUENCES. 1. Basic properties of congruences We begin by introducing some definitions and elementary properties. LECTURE 3: CONGRUENCES 1. Basic properties of congruences We begin by introducing some definitions and elementary properties. Definition 1.1. Suppose that a, b Z and m N. We say that a is congruent to

More information

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator.

Lecture 32. Handout or Document Camera or Class Exercise. Which of the following is equal to [53] [5] 1 in Z 7? (Do not use a calculator. Lecture 32 Instructor s Comments: This is a make up lecture. You can choose to cover many extra problems if you wish or head towards cryptography. I will probably include the square and multiply algorithm

More information

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained.

Introduction. and Z r1 Z rn. This lecture aims to provide techniques. CRT during the decription process in RSA is explained. THE CHINESE REMAINDER THEOREM INTRODUCED IN A GENERAL KONTEXT Introduction The rst Chinese problem in indeterminate analysis is encountered in a book written by the Chinese mathematician Sun Tzi. The problem

More information

Solutions for the Practice Questions

Solutions for the Practice Questions Solutions for the Practice Questions Question 1. Find all solutions to the congruence 13x 12 (mod 35). Also, answer the following questions about the solutions to the above congruence. Are there solutions

More information

Primitive Roots. Chapter Orders and Primitive Roots

Primitive Roots. Chapter Orders and Primitive Roots Chapter 5 Primitive Roots The name primitive root applies to a number a whose powers can be used to represent a reduced residue system modulo n. Primitive roots are therefore generators in that sense,

More information

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography Mathematics Explorers Club Fall 2012 Number Theory and Cryptography Chapter 0: Introduction Number Theory enjoys a very long history in short, number theory is a study of integers. Mathematicians over

More information

DUBLIN CITY UNIVERSITY

DUBLIN CITY UNIVERSITY DUBLIN CITY UNIVERSITY SEMESTER ONE EXAMINATIONS 2013 MODULE: (Title & Code) CA642 Cryptography and Number Theory COURSE: M.Sc. in Security and Forensic Computing YEAR: 1 EXAMINERS: (Including Telephone

More information

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number.

PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number. PT. Primarity Tests Given an natural number n, we want to determine if n is a prime number. (PT.1) If a number m of the form m = 2 n 1, where n N, is a Mersenne number. If a Mersenne number m is also a

More information

Math 319 Problem Set #7 Solution 18 April 2002

Math 319 Problem Set #7 Solution 18 April 2002 Math 319 Problem Set #7 Solution 18 April 2002 1. ( 2.4, problem 9) Show that if x 2 1 (mod m) and x / ±1 (mod m) then 1 < (x 1, m) < m and 1 < (x + 1, m) < m. Proof: From x 2 1 (mod m) we get m (x 2 1).

More information

Math 127: Equivalence Relations

Math 127: Equivalence Relations Math 127: Equivalence Relations Mary Radcliffe 1 Equivalence Relations Relations can take many forms in mathematics. In these notes, we focus especially on equivalence relations, but there are many other

More information

MA/CSSE 473 Day 9. The algorithm (modified) N 1

MA/CSSE 473 Day 9. The algorithm (modified) N 1 MA/CSSE 473 Day 9 Primality Testing Encryption Intro The algorithm (modified) To test N for primality Pick positive integers a 1, a 2,, a k < N at random For each a i, check for a N 1 i 1 (mod N) Use the

More information

Cryptography. 2. decoding is extremely difficult (for protection against eavesdroppers);

Cryptography. 2. decoding is extremely difficult (for protection against eavesdroppers); 18.310 lecture notes September 2, 2013 Cryptography Lecturer: Michel Goemans 1 Public Key Cryptosystems In these notes, we will be concerned with constructing secret codes. A sender would like to encrypt

More information

Cryptography, Number Theory, and RSA

Cryptography, Number Theory, and RSA Cryptography, Number Theory, and RSA Joan Boyar, IMADA, University of Southern Denmark November 2015 Outline Symmetric key cryptography Public key cryptography Introduction to number theory RSA Modular

More information

Math 255 Spring 2017 Solving x 2 a (mod n)

Math 255 Spring 2017 Solving x 2 a (mod n) Math 255 Spring 2017 Solving x 2 a (mod n) Contents 1 Lifting 1 2 Solving x 2 a (mod p k ) for p odd 3 3 Solving x 2 a (mod 2 k ) 5 4 Solving x 2 a (mod n) for general n 9 1 Lifting Definition 1.1. Let

More information

Solutions for the Practice Final

Solutions for the Practice Final Solutions for the Practice Final 1. Ian and Nai play the game of todo, where at each stage one of them flips a coin and then rolls a die. The person who played gets as many points as the number rolled

More information

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively.

b) Find all positive integers smaller than 200 which leave remainder 1, 3, 4 upon division by 3, 5, 7 respectively. Solutions to Exam 1 Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers. Prove that m φ(n) + n φ(m) 1 (mod mn). Solution: a) Fermat s Little

More information

CS70: Lecture 8. Outline.

CS70: Lecture 8. Outline. CS70: Lecture 8. Outline. 1. Finish Up Extended Euclid. 2. Cryptography 3. Public Key Cryptography 4. RSA system 4.1 Efficiency: Repeated Squaring. 4.2 Correctness: Fermat s Theorem. 4.3 Construction.

More information

Applications of Fermat s Little Theorem and Congruences

Applications of Fermat s Little Theorem and Congruences Applications of Fermat s Little Theorem and Congruences Definition: Let m be a positive integer. Then integers a and b are congruent modulo m, denoted by a b mod m, if m (a b). Example: 3 1 mod 2, 6 4

More information

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02

Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02 Collection of rules, techniques and theorems for solving polynomial congruences 11 April 2012 at 22:02 Public Polynomial congruences come up constantly, even when one is dealing with much deeper problems

More information

Modular Arithmetic. Kieran Cooney - February 18, 2016

Modular Arithmetic. Kieran Cooney - February 18, 2016 Modular Arithmetic Kieran Cooney - kieran.cooney@hotmail.com February 18, 2016 Sums and products in modular arithmetic Almost all of elementary number theory follows from one very basic theorem: Theorem.

More information

ON THE EQUATION a x x (mod b) Jam Germain

ON THE EQUATION a x x (mod b) Jam Germain ON THE EQUATION a (mod b) Jam Germain Abstract. Recently Jimenez and Yebra [3] constructed, for any given a and b, solutions to the title equation. Moreover they showed how these can be lifted to higher

More information

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017

Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017 Name: Cryptography Math 1580 Silverman First Hour Exam Mon Oct 2, 2017 INSTRUCTIONS Read Carefully Time: 50 minutes There are 5 problems. Write your name legibly at the top of this page. No calculators

More information

UNIVERSITY OF MANITOBA DATE: December 7, FINAL EXAMINATION TITLE PAGE TIME: 3 hours EXAMINER: M. Davidson

UNIVERSITY OF MANITOBA DATE: December 7, FINAL EXAMINATION TITLE PAGE TIME: 3 hours EXAMINER: M. Davidson TITLE PAGE FAMILY NAME: (Print in ink) GIVEN NAME(S): (Print in ink) STUDENT NUMBER: SEAT NUMBER: SIGNATURE: (in ink) (I understand that cheating is a serious offense) INSTRUCTIONS TO STUDENTS: This is

More information

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method

6. Find an inverse of a modulo m for each of these pairs of relatively prime integers using the method Exercises Exercises 1. Show that 15 is an inverse of 7 modulo 26. 2. Show that 937 is an inverse of 13 modulo 2436. 3. By inspection (as discussed prior to Example 1), find an inverse of 4 modulo 9. 4.

More information

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers.

Solutions to Exam 1. Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively prime positive integers. Solutions to Exam 1 Problem 1. a) State Fermat s Little Theorem and Euler s Theorem. b) Let m, n be relatively rime ositive integers. Prove that m φ(n) + n φ(m) 1 (mod mn). c) Find the remainder of 1 008

More information

Number Theory. Konkreetne Matemaatika

Number Theory. Konkreetne Matemaatika ITT9131 Number Theory Konkreetne Matemaatika Chapter Four Divisibility Primes Prime examples Factorial Factors Relative primality `MOD': the Congruence Relation Independent Residues Additional Applications

More information

Discrete Math Class 4 ( )

Discrete Math Class 4 ( ) Discrete Math 37110 - Class 4 (2016-10-06) 41 Division vs congruences Instructor: László Babai Notes taken by Jacob Burroughs Revised by instructor DO 41 If m ab and gcd(a, m) = 1, then m b DO 42 If gcd(a,

More information

MATH 13150: Freshman Seminar Unit 15

MATH 13150: Freshman Seminar Unit 15 MATH 1310: Freshman Seminar Unit 1 1. Powers in mod m arithmetic In this chapter, we ll learn an analogous result to Fermat s theorem. Fermat s theorem told us that if p is prime and p does not divide

More information

Wilson s Theorem and Fermat s Theorem

Wilson s Theorem and Fermat s Theorem Wilson s Theorem and Fermat s Theorem 7-27-2006 Wilson s theorem says that p is prime if and only if (p 1)! = 1 (mod p). Fermat s theorem says that if p is prime and p a, then a p 1 = 1 (mod p). Wilson

More information

Application: Public Key Cryptography. Public Key Cryptography

Application: Public Key Cryptography. Public Key Cryptography Application: Public Key Cryptography Suppose I wanted people to send me secret messages by snail mail Method 0. I send a padlock, that only I have the key to, to everyone who might want to send me a message.

More information

Xor. Isomorphisms. CS70: Lecture 9. Outline. Is public key crypto possible? Cryptography... Public key crypography.

Xor. Isomorphisms. CS70: Lecture 9. Outline. Is public key crypto possible? Cryptography... Public key crypography. CS70: Lecture 9. Outline. 1. Public Key Cryptography 2. RSA system 2.1 Efficiency: Repeated Squaring. 2.2 Correctness: Fermat s Theorem. 2.3 Construction. 3. Warnings. Cryptography... m = D(E(m,s),s) Alice

More information

Diffie-Hellman key-exchange protocol

Diffie-Hellman key-exchange protocol Diffie-Hellman key-exchange protocol This protocol allows two users to choose a common secret key, for DES or AES, say, while communicating over an insecure channel (with eavesdroppers). The two users

More information

Exam 1 7 = = 49 2 ( ) = = 7 ( ) =

Exam 1 7 = = 49 2 ( ) = = 7 ( ) = Exam 1 Problem 1. a) Define gcd(a, b). Using Euclid s algorithm comute gcd(889, 168). Then find x, y Z such that gcd(889, 168) = x 889 + y 168 (check your answer!). b) Let a be an integer. Prove that gcd(3a

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem Theorem. Let m and n be two relatively prime positive integers. Let a and b be any two integers. Then the two congruences x a (mod m) x b (mod n) have common solutions. Any

More information

University of British Columbia. Math 312, Midterm, 6th of June 2017

University of British Columbia. Math 312, Midterm, 6th of June 2017 University of British Columbia Math 312, Midterm, 6th of June 2017 Name (please be legible) Signature Student number Duration: 90 minutes INSTRUCTIONS This test has 7 problems for a total of 100 points.

More information

Fermat s little theorem. RSA.

Fermat s little theorem. RSA. .. Computing large numbers modulo n (a) In modulo arithmetic, you can always reduce a large number to its remainder a a rem n (mod n). (b) Addition, subtraction, and multiplication preserve congruence:

More information

SOLUTIONS TO PROBLEM SET 5. Section 9.1

SOLUTIONS TO PROBLEM SET 5. Section 9.1 SOLUTIONS TO PROBLEM SET 5 Section 9.1 Exercise 2. Recall that for (a, m) = 1 we have ord m a divides φ(m). a) We have φ(11) = 10 thus ord 11 3 {1, 2, 5, 10}. We check 3 1 3 (mod 11), 3 2 9 (mod 11), 3

More information

SOLUTIONS FOR PROBLEM SET 4

SOLUTIONS FOR PROBLEM SET 4 SOLUTIONS FOR PROBLEM SET 4 A. A certain integer a gives a remainder of 1 when divided by 2. What can you say about the remainder that a gives when divided by 8? SOLUTION. Let r be the remainder that a

More information

Number-Theoretic Algorithms

Number-Theoretic Algorithms Number-Theoretic Algorithms Hengfeng Wei hfwei@nju.edu.cn March 31 April 6, 2017 Hengfeng Wei (hfwei@nju.edu.cn) Number-Theoretic Algorithms March 31 April 6, 2017 1 / 36 Number-Theoretic Algorithms 1

More information

Public-key Cryptography: Theory and Practice

Public-key Cryptography: Theory and Practice Public-key Cryptography Theory and Practice Department of Computer Science and Engineering Indian Institute of Technology Kharagpur Chapter 5: Cryptographic Algorithms Common Encryption Algorithms RSA

More information

Public-Key Cryptosystem Based on Composite Degree Residuosity Classes. Paillier Cryptosystem. Harmeet Singh

Public-Key Cryptosystem Based on Composite Degree Residuosity Classes. Paillier Cryptosystem. Harmeet Singh Public-Key Cryptosystem Based on Composite Degree Residuosity Classes aka Paillier Cryptosystem Harmeet Singh Harmeet Singh Winter 2018 1 / 26 Background s Background Foundation of public-key encryption

More information

Chinese Remainder. Discrete Mathematics Andrei Bulatov

Chinese Remainder. Discrete Mathematics Andrei Bulatov Chnese Remander Introducton Theorem Dscrete Mathematcs Andre Bulatov Dscrete Mathematcs Chnese Remander Theorem 34-2 Prevous Lecture Resdues and arthmetc operatons Caesar cpher Pseudorandom generators

More information

Congruence. Solving linear congruences. A linear congruence is an expression in the form. ax b (modm)

Congruence. Solving linear congruences. A linear congruence is an expression in the form. ax b (modm) Congruence Solving linear congruences A linear congruence is an expression in the form ax b (modm) a, b integers, m a positive integer, x an integer variable. x is a solution if it makes the congruence

More information

EE 418: Network Security and Cryptography

EE 418: Network Security and Cryptography EE 418: Network Security and Cryptography Homework 3 Solutions Assigned: Wednesday, November 2, 2016, Due: Thursday, November 10, 2016 Instructor: Tamara Bonaci Department of Electrical Engineering University

More information

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS Author: MD.HASIRUL ISLAM NAZIR BASHIR Supervisor: MARCUS NILSSON Date: 2012-06-15 Subject: Mathematics and Modeling Level:

More information

Related Ideas: DHM Key Mechanics

Related Ideas: DHM Key Mechanics Related Ideas: DHM Key Mechanics Example (DHM Key Mechanics) Two parties, Alice and Bob, calculate a key that a third person Carl will never know, even if Carl intercepts all communication between Alice

More information

Number Theory and Public Key Cryptography Kathryn Sommers

Number Theory and Public Key Cryptography Kathryn Sommers Page!1 Math 409H Fall 2016 Texas A&M University Professor: David Larson Introduction Number Theory and Public Key Cryptography Kathryn Sommers Number theory is a very broad and encompassing subject. At

More information

Problem Set 6 Solutions Math 158, Fall 2016

Problem Set 6 Solutions Math 158, Fall 2016 All exercise numbers from the textbook refer to the second edition. 1. (a) Textbook exercise 3.3 (this shows, as we mentioned in class, that RSA decryption always works when the modulus is a product of

More information

MA 111, Topic 2: Cryptography

MA 111, Topic 2: Cryptography MA 111, Topic 2: Cryptography Our next topic is something called Cryptography, the mathematics of making and breaking Codes! In the most general sense, Cryptography is the mathematical ideas behind changing

More information

Introduction to Number Theory 2. c Eli Biham - November 5, Introduction to Number Theory 2 (12)

Introduction to Number Theory 2. c Eli Biham - November 5, Introduction to Number Theory 2 (12) Introduction to Number Theory c Eli Biham - November 5, 006 345 Introduction to Number Theory (1) Quadratic Residues Definition: The numbers 0, 1,,...,(n 1) mod n, are called uadratic residues modulo n.

More information

1 Introduction to Cryptology

1 Introduction to Cryptology U R a Scientist (CWSF-ESPC 2017) Mathematics and Cryptology Patrick Maidorn and Michael Kozdron (Department of Mathematics & Statistics) 1 Introduction to Cryptology While the phrase making and breaking

More information

DUBLIN CITY UNIVERSITY

DUBLIN CITY UNIVERSITY DUBLIN CITY UNIVERSITY SEMESTER ONE EXAMINATIONS 2013/2014 MODULE: CA642/A Cryptography and Number Theory PROGRAMME(S): MSSF MCM ECSA ECSAO MSc in Security & Forensic Computing M.Sc. in Computing Study

More information

Discrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Midterm 2 Solutions

Discrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Midterm 2 Solutions CS 70 Discrete Mathematics and Probability Theory Spring 2018 Ayazifar and Rao Midterm 2 Solutions PRINT Your Name: Oski Bear SIGN Your Name: OS K I PRINT Your Student ID: CIRCLE your exam room: Pimentel

More information

Discrete Square Root. Çetin Kaya Koç Winter / 11

Discrete Square Root. Çetin Kaya Koç  Winter / 11 Discrete Square Root Çetin Kaya Koç koc@cs.ucsb.edu Çetin Kaya Koç http://koclab.cs.ucsb.edu Winter 2017 1 / 11 Discrete Square Root Problem The discrete square root problem is defined as the computation

More information

MAT 302: ALGEBRAIC CRYPTOGRAPHY. Department of Mathematical and Computational Sciences University of Toronto, Mississauga.

MAT 302: ALGEBRAIC CRYPTOGRAPHY. Department of Mathematical and Computational Sciences University of Toronto, Mississauga. MAT 302: ALGEBRAIC CRYPTOGRAPHY Department of Mathematical and Computational Sciences University of Toronto, Mississauga February 27, 2013 Mid-term Exam INSTRUCTIONS: The duration of the exam is 100 minutes.

More information

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand. Midterm #2: practice MATH 311 Intro to Number Theory midterm: Thursday, Oct 20 Please print your name: Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating

More information

Modular Arithmetic: refresher.

Modular Arithmetic: refresher. Lecture 7. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. Division!!! 3. Euclid s GCD Algorithm. A little tricky here! Clock Math If it is 1:00

More information

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation.

The congruence relation has many similarities to equality. The following theorem says that congruence, like equality, is an equivalence relation. Congruences A congruence is a statement about divisibility. It is a notation that simplifies reasoning about divisibility. It suggests proofs by its analogy to equations. Congruences are familiar to us

More information

Introduction. Asymmetric ciphers. Online Trusted Third Party (TTP) Online Trusted Third Party (TTP)

Introduction. Asymmetric ciphers. Online Trusted Third Party (TTP) Online Trusted Third Party (TTP) Intoduction Asymmetic ciphes Myto Aapinis School of Infomatics Univesity of Edinugh Januay 29, 2015 So fa: how two uses can potect data using a shaed secet key One shaed secet key pe pai of uses that want

More information

Sheet 1: Introduction to prime numbers.

Sheet 1: Introduction to prime numbers. Option A Hand in at least one question from at least three sheets Sheet 1: Introduction to prime numbers. [provisional date for handing in: class 2.] 1. Use Sieve of Eratosthenes to find all prime numbers

More information

To be able to determine the quadratic character of an arbitrary number mod p (p an odd prime), we. The first (and most delicate) case concerns 2

To be able to determine the quadratic character of an arbitrary number mod p (p an odd prime), we. The first (and most delicate) case concerns 2 Quadratic Reciprocity To be able to determine the quadratic character of an arbitrary number mod p (p an odd prime), we need to be able to evaluate q for any prime q. The first (and most delicate) case

More information

The Chinese Remainder Theorem

The Chinese Remainder Theorem The Chinese Remainder Theorem 8-3-2014 The Chinese Remainder Theorem gives solutions to systems of congruences with relatively prime moduli The solution to a system of congruences with relatively prime

More information

Cryptography CS 555. Topic 20: Other Public Key Encryption Schemes. CS555 Topic 20 1

Cryptography CS 555. Topic 20: Other Public Key Encryption Schemes. CS555 Topic 20 1 Cryptography CS 555 Topic 20: Other Public Key Encryption Schemes Topic 20 1 Outline and Readings Outline Quadratic Residue Rabin encryption Goldwasser-Micali Commutative encryption Homomorphic encryption

More information

Carmen s Core Concepts (Math 135)

Carmen s Core Concepts (Math 135) Carmen s Core Concepts (Math 135) Carmen Bruni University of Waterloo Week 7 1 Congruence Definition 2 Congruence is an Equivalence Relation (CER) 3 Properties of Congruence (PC) 4 Example 5 Congruences

More information

A4M33PAL, ZS , FEL ČVUT

A4M33PAL, ZS , FEL ČVUT Pseudorandom numbers John von Neumann: Any one who considers arithmetical methods of producing random digits is, of course, in a state of sin. For, as has been pointed out several times, there is no such

More information

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext

Example Enemy agents are trying to invent a new type of cipher. They decide on the following encryption scheme: Plaintext converts to Ciphertext Cryptography Codes Lecture 4: The Times Cipher, Factors, Zero Divisors, and Multiplicative Inverses Spring 2014 Morgan Schreffler Office: POT 902 http://www.ms.uky.edu/~mschreffler New Cipher Times Enemy

More information

The number theory behind cryptography

The number theory behind cryptography The University of Vermont May 16, 2017 What is cryptography? Cryptography is the practice and study of techniques for secure communication in the presence of adverse third parties. What is cryptography?

More information

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005

MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005 MATH 324 Elementary Number Theory Solutions to Practice Problems for Final Examination Monday August 8, 2005 Deartment of Mathematical and Statistical Sciences University of Alberta Question 1. Find integers

More information

THE NUMBER OF PERMUTATIONS WHICH FORM ARITHMETIC PROGRESSIONS MODULO m

THE NUMBER OF PERMUTATIONS WHICH FORM ARITHMETIC PROGRESSIONS MODULO m ANALELE ŞTIINŢIFICE ALE UNIVERSITĂŢII AL.I. CUZA DIN IAŞI (S.N.) MATEMATICĂ, Tomul LXI, 2015, f.2 THE NUMBER OF PERMUTATIONS WHICH FORM ARITHMETIC PROGRESSIONS MODULO m BY FLORIAN LUCA and AUGUSTINE O.

More information

Modular Arithmetic and Doomsday

Modular Arithmetic and Doomsday Modular Arithmetic and Doomsday Blake Thornton Much of this is due directly to Joshua Zucker and Paul Zeitz. 1. Subtraction Magic Trick. While blindfolded, a magician asks a member from the audience to

More information

x 8 (mod 15) x 8 3 (mod 5) eli 2 2y 6 (mod 10) y 3 (mod 5) 6x 9 (mod 11) y 3 (mod 11) So y = 3z + 3u + 3w (mod 990) z = (990/9) (990/9) 1

x 8 (mod 15) x 8 3 (mod 5) eli 2 2y 6 (mod 10) y 3 (mod 5) 6x 9 (mod 11) y 3 (mod 11) So y = 3z + 3u + 3w (mod 990) z = (990/9) (990/9) 1 Exercise help set 6/2011 Number Theory 1. x 2 0 (mod 2) x 2 (mod 6) x 2 (mod 3) a) x 5 (mod 7) x 5 (mod 7) x 8 (mod 15) x 8 3 (mod 5) (x 8 2 (mod 3)) So x 0y + 2z + 5w + 8u (mod 210). y is not needed.

More information

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00

Solutions to Problem Set 6 - Fall 2008 Due Tuesday, Oct. 21 at 1:00 18.781 Solutions to Problem Set 6 - Fall 008 Due Tuesday, Oct. 1 at 1:00 1. (Niven.8.7) If p 3 is prime, how many solutions are there to x p 1 1 (mod p)? How many solutions are there to x p 1 (mod p)?

More information

Classical Cryptography

Classical Cryptography Classical Cryptography CS 6750 Lecture 1 September 10, 2009 Riccardo Pucella Goals of Classical Cryptography Alice wants to send message X to Bob Oscar is on the wire, listening to all communications Alice

More information

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g.,

An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., Binary exponentiation An interesting class of problems of a computational nature ask for the standard residue of a power of a number, e.g., What are the last two digits of the number 2 284? In the absence

More information

MTH 3527 Number Theory Quiz 10 (Some problems that might be on the quiz and some solutions.) 1. Euler φ-function. Desribe all integers n such that:

MTH 3527 Number Theory Quiz 10 (Some problems that might be on the quiz and some solutions.) 1. Euler φ-function. Desribe all integers n such that: MTH 7 Number Theory Quiz 10 (Some roblems that might be on the quiz and some solutions.) 1. Euler φ-function. Desribe all integers n such that: (a) φ(n) = Solution: n = 4,, 6 since φ( ) = ( 1) =, φ() =

More information

Modular Arithmetic. claserken. July 2016

Modular Arithmetic. claserken. July 2016 Modular Arithmetic claserken July 2016 Contents 1 Introduction 2 2 Modular Arithmetic 2 2.1 Modular Arithmetic Terminology.................. 2 2.2 Properties of Modular Arithmetic.................. 2 2.3

More information

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand.

Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating by hand. Midterm #: practice MATH Intro to Number Theory midterm: Thursday, Nov 7 Please print your name: Calculators will not be permitted on the exam. The numbers on the exam will be suitable for calculating

More information

Cryptography Made Easy. Stuart Reges Principal Lecturer University of Washington

Cryptography Made Easy. Stuart Reges Principal Lecturer University of Washington Cryptography Made Easy Stuart Reges Principal Lecturer University of Washington Why Study Cryptography? Secrets are intrinsically interesting So much real-life drama: Mary Queen of Scots executed for treason

More information

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm

Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm Lecture 8. Outline. 1. Modular Arithmetic. Clock Math!!! 2. Inverses for Modular Arithmetic: Greatest Common Divisor. 3. Euclid s GCD Algorithm Clock Math If it is 1:00 now. What time is it in 5 hours?

More information

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012 CMPSCI 250: Introduction to Computation Lecture #14: The Chinese Remainder Theorem David Mix Barrington 24 February 2012 The Chinese Remainder Theorem Infinitely Many Primes Reviewing Inverses and the

More information

MA10103: Foundation Mathematics I. Lecture Notes Week 3

MA10103: Foundation Mathematics I. Lecture Notes Week 3 MA10103: Foundation Mathematics I Lecture Notes Week 3 Indices/Powers In an expression a n, a is called the base and n is called the index or power or exponent. Multiplication/Division of Powers a 3 a

More information

ORDER AND CHAOS. Carl Pomerance, Dartmouth College Hanover, New Hampshire, USA

ORDER AND CHAOS. Carl Pomerance, Dartmouth College Hanover, New Hampshire, USA ORDER AND CHAOS Carl Pomerance, Dartmouth College Hanover, New Hampshire, USA Perfect shuffles Suppose you take a deck of 52 cards, cut it in half, and perfectly shuffle it (with the bottom card staying

More information

MATH 433 Applied Algebra Lecture 12: Sign of a permutation (continued). Abstract groups.

MATH 433 Applied Algebra Lecture 12: Sign of a permutation (continued). Abstract groups. MATH 433 Applied Algebra Lecture 12: Sign of a permutation (continued). Abstract groups. Permutations Let X be a finite set. A permutation of X is a bijection from X to itself. The set of all permutations

More information