Math.3336: Discrete Mathematics. Mathematical Induction

Size: px
Start display at page:

Download "Math.3336: Discrete Mathematics. Mathematical Induction"

Transcription

1 Math.3336: Discrete Mathematics Mathematical Induction Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston blerina Fall 2018 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 1/37

2 Assignments to work on Homework #6 due Monday, 10/15, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 2/37

3 Fermat s Little Theorem Fermat s Little Theorem: If p is prime and gcd(a, p) = 1, then a p 1 1 (mod p). Furthermore, for every a Z, a p a (mod p). Fermat s little theorem is useful in computing the remainders modulo p of large powers of integers. Find (mod 11). By Fermat s little theorem, (mod 11). Therefore, (7 10 ) k 1 (mod 11), k Z. It follows that = = (7 1 0) (1) (mod 11). As a result, (mod 11) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 3/37

4 Proof of Fermat s Little Theorem Proof: It is clear that for any relatively prime integers a, p, if a p 1 1 (mod p), then a p = a a p 1 a 1 = a (mod p), i.e. a p a (mod p). Note all integers 1, 2, 3,..., p 1 are relatively prime to p. Furthermore, since gcd(a, p) = 1, then all integers a, 2a, 3a,..., (p 1)a are relatively prime to p. Let i, j {1, 2, 3,..., p 1}, then one can show that ia ja (mod p) iff i = j. This shows that each of a, 2a, 3a,..., (p 1)a is distinctly equivalent to one of 1, 2, 3,..., p 1. As a result, by properties of congruence we get: a 2a 3a (p 1)a (p 1) (mod p) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 4/37

5 Proof of Fermat s Little Theorem As a result, by properties of congruence we get: a 2a 3a (p 1)a (p 1) (mod p) It follows that (p 1)!a p 1 (p 1)! (mod p) Since gcd(p, (p 1)!) = 1, then we deduce that a p 1 1 (mod p). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 5/37

6 Euler s Totient Function The Euler s Totient Function at a given positive integer n, denoted by φ(n), gives the number of all positive integers smaller than n relatively prime to n. If p is prime, then φ(p) = p 1. Because p is relatively prime to any of 1, 2, 3,..., p 1. If n = pq, then φ(n) = (p 1)(q 1). Because all positive integers less equal than n that have a factor of p or q are p, 2p, 3p,..., qp and q, 2q, 3q,..., pq. The rest of them are relatively prime to n = pq, i.e. φ(n) = pq p q + 1 = (p 1)(q 1) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 6/37

7 Euler s Totient Function in Fermat s Little Theorem By Fermat s Little Theorem, if gcd(a, p) = gcd(a, q) = 1, then a p 1 1 (mod p) a q 1 1 (mod q) Furthermore, we have a (p 1)(q 1) 1 = (a p 1 1)(a q 1 + a q a 2 + a + 1) = (a q 1 1)(a p 1 + a p a 2 + a + 1) Since p (a p 1 1) and q (a q 1 1), it follows that p (a (p 1)(q 1) 1) and q (a (p 1)(q 1) 1), i.e. a (p 1)(q 1) 1 (mod p) a (p 1)(q 1) 1 (mod q) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 7/37

8 Euler s Totient Function in Fermat s Little Theorem Thus, we have a (p 1)(q 1) 1 (mod p) a (p 1)(q 1) 1 (mod q) A quick application of Chinese Remainder Theorem implies that a (p 1)(q 1) 1 (mod pq). To generalize, given that gcd(a, n) = 1 we have a φ(n) 1 (mod n). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 8/37

9 High Level Math Behind RSA In the RSA system, private key consists of two very large prime numbers p, q Public key consists of a number n, which is the product of p, q and another number e e is a number relatively prime with (p 1)(q 1) = φ(n) Encrypt messages using n, e, but to decrypt, must know p, q In theory, can extract p, q from n using prime factorization, but this is intractable for very large numbers Security of RSA relies on inherent computational difficulty of prime factorization Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 9/37

10 Encryption in RSA To send message to Bob, Alice first represents message as a sequence of numbers Call this number representing message M Alice then uses Bob s public key n, e to perform encryption as: C is called the ciphertext C = M e (mod n) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 10/37

11 Encryption Example Encrypt message STOP using RSA with n = 2537, e = 13 First convert each letter to a number in [0, 25]: S = 18, T = 19, O = 14, P = 15 Group sequence into blocks of 4 digits: M = Now encrypt each block as C = M 13 (mod 2537) For first block, (mod 2537) = 2081; for second block (mod 2537) = 2182 Ciphertext: Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 11/37

12 RSA Decryption How do we decrypt cipher text using private keys p, q? We know that e is relatively prime to (p 1)(q 1). Decryption key d is the inverse of e modulo (p 1)(q 1): d e 1 (mod φ(n) = (p 1)(q 1)) As we saw earlier, d can be computed reasonably efficiently if we know (p 1)(q 1) However, since adversaries do not know p, q, they cannot compute d with reasonable computational effort! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 12/37

13 RSA Decryption, cont. We know that where p, q are primes. a (p 1)(q 1) 1 (mod pq), Our goal is to find the decryption key d, which is the inverse of e modulo (p 1)(q 1), i.e. need d such that Then we have: d e + t (p 1)(q 1) = 1. (M e ) d = M ed = M 1+(p 1)(q 1) ( t) M (mod n = pq) Since the ciphertext C is just M e, C d (mod n) allows decrypting the message Since Bob can compute d using p, q, Bob can easily decrypt message, but no one else can! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 13/37

14 Decryption Example A message M is encrypted through RSA cipher with p = 41, q = 61 and e = 17, and the following cipher text is obtained: C = To decrypt this cipher text, we need to compute d, the inverse of e modulo (p 1)(q 1). Here, (p 1)(q 1) = 2400, thus solve: 17x 1 (mod 2400) Apply extended Euclidean algorithm to compute s, t such that: We get s = 847, t = 6 17s t = 1 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 14/37

15 Example, cont. Decrypt C = using p = 41, q = 61, n = 2501, and e = 17. The inverse of e = 17 modulo (p 1)(q 1) = 2400 is d = (mod 2400) (mod 2501) = 1108; (mod 2501) = (mod 2501) = 0818; (mod 2501) = (mod 2501) = 1403 Thus, decrypted message is M = , or in English, Life is Good. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 15/37

16 Chapter 5 Induction and Recursion Chapter 5 Overview Mathematical Induction Section 5.1 Strong Induction Section 5.2 Well-Ordering Section 5.2 Recursive Definitions Section 5.3 Structural Induction Section 5.3 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 16/37

17 Section 5.1 Introduction to Mathematical Induction Many mathematical theorems assert that a property holds for all natural numbers, odd positive integers, etc. Mathematical induction: very important proof technique for proving such universally quantified statements Induction will come up over and over again in other classes: algorithms, programming languages, automata theory,... Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 17/37

18 Analogy Suppose we have an infinite ladder, and we know two things: 1 We can reach the first rung of the ladder 2 If we reach a particular rung, then we can also reach the next rung From these two facts, can we conclude we can reach every step of the infinite ladder? Answer is yes, and mathematical induction allows us to make arguments like this Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 18/37

19 Mathematical Induction Used to prove statements of the form x Z + P(x) An inductive proof has two steps: 1 Base case: Prove that P(1) is true 2 Inductive step: Prove n Z + P(n) P(n + 1) Induction says if you can prove (1) and (2), you can conclude: x Z + P(x) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 19/37

20 Inductive Hypothesis In the inductive step, need to show: n Z + P(n) P(n + 1) To prove this, we assume P(n) holds, and based on this assumption, prove P(n + 1). The assumption that P(n) holds is called the inductive hypothesis Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 20/37

21 Example 1 Prove the following statement by induction: n n Z + (n)(n + 1), i = 2 i=1 Base case: n = 1. In this case, 1 the base case holds. i=1 i = 1 and (1)(1+1) 2 = 1; thus, Inductive step: By the inductive hypothesis, we assume P(k): k i = i=1 Now, we want to show P(k + 1): k+1 i = i=1 (k)(k + 1) 2 (k + 1)(k + 2) 2 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 21/37

22 Example 1, cont. First, observe: k+1 i = i=1 k i + (k + 1) i=1 By the inductive hypothesis, k i=1 i = (k)(k+1) 2 ; thus: k+1 i = i=1 (k)(k + 1) 2 + (k + 1) Rewrite left hand side as: k+1 i = k 2 + 3k i=1 = (k + 1)(k + 2) 2 Since we proved both base case and inductive step, property holds. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 22/37

23 Example 2 Prove the following statement for all non-negative integers n: n 2 i = 2 n+1 1 i=0 Since need to show for all n 0, base case is P(0), not P(1)! Base case (n = 0): 2 0 = 1 = Inductive step: By the inductive hypothesis, we assume P(k): k 2 i = 2 k+1 1 i=0 Now, we want to show P(k + 1): k+1 2 i = 2 (k+1)+1 1 = 2 k+2 1 i=0 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 23/37

24 Example 2, cont. Thus, we have: k+1 k 2 i = 2 i + 2 k+1 i=0 i=0 By the inductive hypothesis, we have: k+1 2 i = 2 k k+1 i=0 Rewrite as: k+1 2 i = 2 2 k+1 1+ = 2 k+2 1 i=0 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 24/37

25 Example 3 Prove that n < 2 n for all nonnegative integers n Base case (n=0): 0 < 2 0 Inductive step: Need to show k + 1 < 2 k+1 assuming k < 2 k From the inductive hypothesis, we know k + 1 < 2 k + 1 Since 1 2 k for k Z +, this implies k + 1 < 2 k + 2 k Thus, k + 1 < 2 2 k = 2 k+1 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 25/37

26 Example 4 Prove that 2 n < n! for all integers n 4 Base case (n=4): 2 4 = 16 < 24 = 4! Inductive step: By the inductive hypothesis, we know 2 k < k!, and we need to show that 2 k+1 < (k + 1)! By induction hypothesis, we have 2 k+1 = 2 2 k < 2 k! Since k 4, 2 < k + 1, therefore: 2 k+1 < 2 k! < (k + 1)k! = (k + 1)! By induction, we conclude that 2 n < n!, n 4. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 26/37

27 Example 5 Prove that 3 (n 3 n) for all positive integers n. Base case (n=1): 3 (0 = 1 3 1) Inductive step: Show 3 (k + 1) 3 (k + 1) assuming 3 k 3 k First, rewrite (k + 1) 3 (k + 1) as k 3 + 3k 2 + 3k + 1 k 1 = (k 3 k) + 3(k 2 + k) By the inductive hypothesis, 3 (k 3 k); and also 3 3(k 2 + k) By Thm from earlier, it follows that 3 (k 3 k + 3(k 2 + k)) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 27/37

28 Example 6 We can also use induction to prove results about sets. Use induction to prove generalized DeMorgan s law for sets: n n A j = A j for n 2 j =1 j =1 We ll prove this by induction on the number of sets Base case (n=2): A 1 A 2 = A 1 A 2 We already proved this earlier! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 28/37

29 Example 6, cont. Inductive step: P(k) P(k + 1) k+1 j =1 ( k ) A j = A j A k+1 j =1 Now, using De Morgan s law, rewrite left hand side: k+1 j =1 ( k ) A j = A j A k+1 j =1 From inductive hypothesis, we have ( k j =1 A j ) = k j =1 A j, thus: k+1 j =1 A j = k A j A k+1 = j =1 k+1 j =1 A j Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 29/37

30 Correctness of Induction Why is induction a valid proof technique? Suppose we can prove the base case and inductive step, but n P(n) does not hold for positive integers. There must be a least element k for which P(k) doesn t hold. Two possibilities: Either (i) k = 1 or (ii) k 2 (i) k cannot be 1 because we proved P(1) in base case (ii) Since k is the least element, we know P(k 1) holds But, in the inductive step we proved P(k 1) P(k); thus, P(k) must also hold! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 30/37

31 Section 5.2 Strong Induction Slight variation on the inductive proof technique is strong induction Regular and strong induction only differ in the inductive step Regular induction: assume P(k) holds and prove P(k + 1) Strong induction: assume P(1), P(2),.., P(k); prove P(k + 1) Regular induction and strong induction are equivalent, but strong induction can sometimes make proofs easier Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 31/37

32 Motivation for Strong Induction Prove that if n is an integer greater than 1, then it is either a prime or can be written as the product of primes. Let s first try to prove the property using regular induction. Base case (n=2): Since 2 is a prime number, P(2) holds. Inductive step: Assume k is either a prime or the product of primes. But this doesn t really help us prove the property about k + 1! Claim is proven much easier using strong induction! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 32/37

33 Proof Using Strong Induction Prove that if n is an integer greater than 1, then it is either a prime or can be written as the product of primes. Base case: same as before. Inductive step: Assume each of 2, 3,..., k is either prime or product of primes. Now, we want to prove the same thing about k + 1 Two cases: k is either (i) prime or (ii) composite If it is prime, property holds. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 33/37

34 Proof, cont. If composite, k + 1 can be written as pq where 2 p, q k By the IH, p, q are either primes or product of primes. Thus, k + 1 can also be written as product of primes Observe: Much easier to prove this property using strong induction! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 34/37

35 A Word about Base Cases In all examples so far, we had only one base case i.e., only proved the base case for one integer In some inductive proofs, there may be multiple base cases i.e., prove base case for the first k numbers In the latter case, inductive step only needs to consider numbers greater than k Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 35/37

36 Example Prove that every integer n 12 can be written as n = 4a + 5b for some non-negative integers a, b. Proof by strong induction on n and consider 4 base cases Base case 1 (n=12): 12 = Base case 2 (n=13): 13 = Base case 3 (n=14): 14 = Base case 4 (n=15): 15 = Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 36/37

37 Example, cont. Prove that every integer n 12 can be written as n = 4a + 5b for some non-negative integers a, b. Inductive hypothesis: Suppose every 12 i k can be written as i = 4a + 5b. Inductive step: We want to show k + 1 can also be written this way for k Observe: k + 1 = (k 3) + 4 By the inductive hypothesis, k 3 = 4a + 5b for some a, b because k 3 12 But then, k + 1 can be written as 4(a + 1) + 5b Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Mathematical Induction 37/37

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

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors Math.3336: Discrete Mathematics Primes and Greatest Common Divisors Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

Math.3336: Discrete Mathematics. Cardinality of Sets

Math.3336: Discrete Mathematics. Cardinality of Sets Math.3336: Discrete Mathematics Cardinality of Sets Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018

More information

Math.3336: Discrete Mathematics. Propositional Equivalences

Math.3336: Discrete Mathematics. Propositional Equivalences Math.3336: Discrete Mathematics Propositional Equivalences Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall

More information

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

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors Math.3336: Discrete Mathematics Primes and Greatest Common Divisors Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

Math.3336: Discrete Mathematics. Chapter 9 Relations

Math.3336: Discrete Mathematics. Chapter 9 Relations Math.3336: Discrete Mathematics Chapter 9 Relations Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018

More information

Math.3336: Discrete Mathematics. Advanced Counting Techniques

Math.3336: Discrete Mathematics. Advanced Counting Techniques Math.3336: Discrete Mathematics Advanced Counting Techniques Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

Math.3336: Discrete Mathematics. Nested Quantifiers

Math.3336: Discrete Mathematics. Nested Quantifiers Math.3336: Discrete Mathematics Nested Quantifiers Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018

More information

Math.3336: Discrete Mathematics. Combinatorics: Basics of Counting

Math.3336: Discrete Mathematics. Combinatorics: Basics of Counting Math.3336: Discrete Mathematics Combinatorics: Basics of Counting Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

Math.3336: Discrete Mathematics. Proof Methods and Strategy

Math.3336: Discrete Mathematics. Proof Methods and Strategy Math.3336: Discrete Mathematics Proof Methods and Strategy Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall

More information

Introduction to Public-Key Cryptosystems:

Introduction to Public-Key Cryptosystems: Introduction to Public-Key Cryptosystems: Technical Underpinnings: RSA and Primality Testing Modes of Encryption for RSA Digital Signatures for RSA 1 RSA Block Encryption / Decryption and Signing Each

More information

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference Math.3336: Discrete Mathematics Nested Quantifiers/Rules of Inference Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Math.3336: Discrete Mathematics. Applications of Propositional Logic Math.3336: Discrete Mathematics Applications of Propositional Logic Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu

More information

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

Review. CS311H: Discrete Mathematics. Number Theory. Computing GCDs. Insight Behind Euclid s Algorithm. Using this Theorem. Euclidian Algorithm Review CS311H: Discrete Mathematics Number Theory Instructor: Işıl Dillig What does it mean for two ints a, b to be congruent mod m? What is the Division theorem? If a b and a c, does it mean b c? What

More information

Public Key Cryptography

Public Key Cryptography Public Key Cryptography Spotlight on Science J. Robert Buchanan Department of Mathematics 2011 What is Cryptography? cryptography: study of methods for sending messages in a form that only be understood

More information

Ma/CS 6a Class 4: Primality Testing

Ma/CS 6a Class 4: Primality Testing Ma/CS 6a Class 4: Primality Testing By Adam Sheffer Reminder: Euler s Totient Function Euler s totient φ(n) is defined as follows: Given n N, then φ n = x 1 x < n and GCD x, n = 1. In more words: φ n is

More information

The security of RSA (part 1) The security of RSA (part 1)

The security of RSA (part 1) The security of RSA (part 1) The modulus n and its totient value φ(n) are known φ(n) = p q (p + q) + 1 = n (p + q) + 1 The modulus n and its totient value φ(n) are known φ(n) = p q (p + q) + 1 = n (p + q) + 1 i.e. q = (n φ(n) + 1)

More information

Ma/CS 6a Class 4: Primality Testing

Ma/CS 6a Class 4: Primality Testing Ma/CS 6a Class 4: Primality Testing By Adam Sheffer Send anonymous suggestions and complaints from here. Email: adamcandobetter@gmail.com Password: anonymous2 There aren t enough crocodiles in the presentations

More information

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

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya BBM 205 Discrete Mathematics Hacettepe University http://web.cs.hacettepe.edu.tr/ bbm205 Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya Resources: Kenneth Rosen,

More information

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

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013 RSA Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013 Recap Recap Number theory o What is a prime number? o What is prime factorization? o What is a GCD? o What does relatively prime

More information

10 Modular Arithmetic and Cryptography

10 Modular Arithmetic and Cryptography 10 Modular Arithmetic and Cryptography 10.1 Encryption and Decryption Encryption is used to send messages secretly. The sender has a message or plaintext. Encryption by the sender takes the plaintext and

More information

Ma/CS 6a Class 3: The RSA Algorithm

Ma/CS 6a Class 3: The RSA Algorithm Ma/CS 6a Class 3: The RSA Algorithm By Adam Sheffer Reminder: Putnam Competition Signup ends Wednesday 10/08. Signup sheets available in all Sloan classrooms, Math office, or contact Kathy Carreon, kcarreon@caltech.edu.

More information

Number theory (Chapter 4)

Number theory (Chapter 4) EECS 203 Spring 2016 Lecture 12 Page 1 of 8 Number theory (Chapter 4) Review Compute 6 11 mod 13 in an efficient way What is the prime factorization of 100? 138? What is gcd(100, 138)? What is lcm(100,138)?

More information

Fall 2017 September 20, Written Homework 02

Fall 2017 September 20, Written Homework 02 CS1800 Discrete Structures Profs. Aslam, Gold, & Pavlu Fall 2017 September 20, 2017 Assigned: Wed 20 Sep 2017 Due: Fri 06 Oct 2017 Instructions: Written Homework 02 The assignment has to be uploaded to

More information

ECE596C: Handout #11

ECE596C: Handout #11 ECE596C: Handout #11 Public Key Cryptosystems Electrical and Computer Engineering, University of Arizona, Loukas Lazos Abstract In this lecture we introduce necessary mathematical background for studying

More information

Implementation Tutorial on RSA

Implementation Tutorial on RSA Implementation Tutorial on Maciek Adamczyk; m adamczyk@umail.ucsb.edu Marianne Magnussen; mariannemagnussen@umail.ucsb.edu Adamczyk and Magnussen Spring 2018 1 / 13 Overview Implementation Tutorial Introduction

More information

Cryptosystem. Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage

Cryptosystem. Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage Cryptosystem Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage f(m). The receiver computes f 1 (f(m)). Advantage: Cannot

More information

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

Cryptography. P. Danziger. Transmit...Bob... 10.4 Cryptography P. Danziger 1 Cipher Schemes A cryptographic scheme is an example of a code. The special requirement is that the encoded message be difficult to retrieve without some special piece of

More information

Chapter 8 Public-key Cryptography and Digital Signatures

Chapter 8 Public-key Cryptography and Digital Signatures Chapter 8 Public-key Cryptography and Digital Signatures v 1. Introduction to Public-key Cryptography 2. Example of Public-key Algorithm: Diffie- Hellman Key Exchange Scheme 3. RSA Encryption and Digital

More information

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

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2 Contents 1 Recommended Reading 1 2 Public Key/Private Key Cryptography 1 2.1 Overview............................................. 1 2.2 RSA Algorithm.......................................... 2 3 A Number

More information

Math 223, Spring 2009 Final Exam Solutions

Math 223, Spring 2009 Final Exam Solutions Math 223, Spring 2009 Final Exam Solutions Name: Student ID: Directions: Check that your test has 16 pages, including this one and the blank one on the bottom (which you can use as scratch paper or to

More information

MATH3302 Cryptography Problem Set 2

MATH3302 Cryptography Problem Set 2 MATH3302 Cryptography Problem Set 2 These questions are based on the material in Section 4: Shannon s Theory, Section 5: Modern Cryptography, Section 6: The Data Encryption Standard, Section 7: International

More information

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

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017 CSC 580 Cryptography and Computer Security Math for Public Key Crypto, RSA, and Diffie-Hellman (Sections 2.4-2.6, 2.8, 9.2, 10.1-10.2) March 21, 2017 Overview Today: Math needed for basic public-key crypto

More information

Lecture Notes, Week 6

Lecture Notes, Week 6 YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467b: Cryptography and Computer Security Week 6 (rev. 3) Professor M. J. Fischer February 15 & 17, 2005 1 RSA Security Lecture Notes, Week 6 Several

More information

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

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2006 Contents 9 Introduction to Number Theory and Cryptography 1 9.1 Subgroups

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 8 1 The following are equivalent (TFAE) 2 Inverses 3 More on Multiplicative Inverses 4 Linear Congruence Theorem 2 [LCT2] 5 Fermat

More information

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).

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). 1 Background 1.1 The group of units MAT 3343, APPLIED ALGEBRA, FALL 2003 Handout 3: The RSA Cryptosystem Peter Selinger Let (R, +, ) be a ring. Then R forms an abelian group under addition. R does not

More information

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE CPSC 467a: Cryptography and Computer Security Notes 13 (rev. 2) Professor M. J. Fischer October 22, 2008 53 Chinese Remainder Theorem Lecture Notes 13 We

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 11 February 21, 2013 CPSC 467b, Lecture 11 1/27 Discrete Logarithm Diffie-Hellman Key Exchange ElGamal Key Agreement Primitive Roots

More information

Cryptography IV: Asymmetric Ciphers

Cryptography IV: Asymmetric Ciphers Cryptography IV: Asymmetric Ciphers Computer Security Lecture 7 David Aspinall School of Informatics University of Edinburgh 31st January 2011 Outline Background RSA Diffie-Hellman ElGamal Summary Outline

More information

Solutions to the Midterm Test (March 5, 2011)

Solutions to the Midterm Test (March 5, 2011) MATC16 Cryptography and Coding Theory Gábor Pete University of Toronto Scarborough Solutions to the Midterm Test (March 5, 2011) YOUR NAME: DO NOT OPEN THIS BOOKLET UNTIL INSTRUCTED TO DO SO. INSTRUCTIONS:

More information

An Introduction to Cryptography

An Introduction to Cryptography An Introduction to Cryptography Spotlight on Science J. Robert Buchanan Department of Mathematics Spring 2008 What is Cryptography? cryptography: study of methods for sending messages in a form that only

More information

Discrete mathematics I - Number theory

Discrete mathematics I - Number theory Discrete mathematics I - Number theory Emil Vatai (based on hungarian slides by László Mérai) 1 January 31, 2018 1 Financed from the financial support ELTE won from the Higher Education

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security Outline Quadratic residues Useful tests Digital Signatures CPSC 467b: Cryptography and Computer Security Lecture 14 Michael J. Fischer Department of Computer Science Yale University March 1, 2010 Michael

More information

M381 Number Theory 2004 Page 1

M381 Number Theory 2004 Page 1 M81 Number Theory 2004 Page 1 [[ Comments are written like this. Please send me (dave@wildd.freeserve.co.uk) details of any errors you find or suggestions for improvements. ]] Question 1 20 = 2 * 10 +

More information

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a "

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a Math 4161 Dr. Franz Rothe December 9, 2013 13FALL\4161_fall13f.tex Name: Use the back pages for extra space Final 70 70 Problem 1. The following assertions may be true or false, depending on the choice

More information

Private Key Cryptography. Fermat s Little Theorem. One Time Pads. Public Key Cryptography

Private Key Cryptography. Fermat s Little Theorem. One Time Pads. Public Key Cryptography Fermat s Little Theorem Private Key Cryptography Theorem 11 (Fermat s Little Theorem): (a) If p prime and gcd(p, a) = 1, then a p 1 1 (mod p). (b) For all a Z, a p a (mod p). Proof. Let A = {1, 2,...,

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 8 February 1, 2012 CPSC 467b, Lecture 8 1/42 Number Theory Needed for RSA Z n : The integers mod n Modular arithmetic GCD Relatively

More information

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

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography David R. Wilkins Copyright c David R. Wilkins 2000 2013 Contents 9 Introduction to Number Theory 63 9.1 Subgroups

More information

Number Theory and Algebra: A Brief Introduction

Number Theory and Algebra: A Brief Introduction Number Theory and Algebra: A Brief Introduction Indian Statistical Institute Kolkata May 15, 2017 Elementary Number Theory: Modular Arithmetic Definition Let n be a positive integer and a and b two integers.

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 9 February 14, 2013 CPSC 467b, Lecture 9 1/42 Integer Division (cont.) Relatively prime numbers, Z n, and φ(n) Computing in Z n

More information

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

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory. CSS322: Security and Cryptography Sirindhorn International Institute of Technology Thammasat University Prepared by Steven Gordon on 29 December 2011 CSS322Y11S2L06, Steve/Courses/2011/S2/CSS322/Lectures/number.tex,

More information

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

The RSA public encryption scheme: How I learned to stop worrying and love buying stuff online The RSA public encryption scheme: How I learned to stop worrying and love buying stuff online Anthony Várilly-Alvarado Rice University Mathematics Leadership Institute, June 2010 Our Goal Today I will

More information

Name: Mathematics 1C03

Name: Mathematics 1C03 Name: Student ID Number: Mathematics 1C03 Day Class Instructor: M. Harada Duration: 2.5 hours April 2018 McMaster University PRACTICE Final Examination This is a PRACTICE final exam. The actual final exam

More information

Ma/CS 6a Class 1. Course Details

Ma/CS 6a Class 1. Course Details Ma/CS 6a Class 1 By Adam Sheffer Course Details Adam Sheffer. adamsh@caltech.edu 1:00 Monday, Wednesday, and Friday. http://www.math.caltech.edu/~2014-15/1term/ma006a/ 1 Course Structure No exam! Grade

More information

The RSA cryptosystem and primality tests

The RSA cryptosystem and primality tests Mathematics, KTH Bengt Ek November 2015 Supplementary material for SF2736, Discrete mathematics: The RSA cryptosystem and primality tests Secret codes (i.e. codes used to make messages unreadable to outsiders

More information

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION Recall that RSA works as follows. A wants B to communicate with A, but without E understanding the transmitted message. To do so: A broadcasts RSA method,

More information

Discrete Mathematics GCD, LCM, RSA Algorithm

Discrete Mathematics GCD, LCM, RSA Algorithm Discrete Mathematics GCD, LCM, RSA Algorithm Abdul Hameed http://informationtechnology.pk/pucit abdul.hameed@pucit.edu.pk Lecture 16 Greatest Common Divisor 2 Greatest common divisor The greatest common

More information

MATH 145 Algebra, Solutions to Assignment 4

MATH 145 Algebra, Solutions to Assignment 4 MATH 145 Algebra, Solutions to Assignment 4 1: a) Find the inverse of 178 in Z 365. Solution: We find s and t so that 178s + 365t = 1, and then 178 1 = s. The Euclidean Algorithm gives 365 = 178 + 9 178

More information

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems CPE 776:DATA SECURITY & CRYPTOGRAPHY Some Number Theory and Classical Crypto Systems Dr. Lo ai Tawalbeh Computer Engineering Department Jordan University of Science and Technology Jordan Some Number Theory

More information

Ma/CS 6a Class 2: Congruences

Ma/CS 6a Class 2: Congruences Ma/CS 6a Class 2: Congruences 1 + 1 5 (mod 3) By Adam Sheffer Reminder: Public Key Cryptography Idea. Use a public key which is used for encryption and a private key used for decryption. Alice encrypts

More information

Lecture 1: Introduction to Public key cryptography

Lecture 1: Introduction to Public key cryptography Lecture 1: Introduction to Public key cryptography Thomas Johansson T. Johansson (Lund University) 1 / 44 Key distribution Symmetric key cryptography: Alice and Bob share a common secret key. Some means

More information

MATHEMATICS EXTENDED ESSAY

MATHEMATICS EXTENDED ESSAY MATHEMATICS EXTENDED ESSAY How does the RSA algorithm function and why is it used in modern communication? Candidate Name: Murtuza Kainan Candidate Session Number: 003077006 Word Count: 3908 1 P a g e

More information

Simple Math: Cryptography

Simple Math: Cryptography 1 Introduction Simple Math: Cryptography This section develops some mathematics before getting to the application. The mathematics that I use involves simple facts from number theory. Number theory is

More information

Discrete Mathematics. Spring 2017

Discrete Mathematics. Spring 2017 Discrete Mathematics Spring 2017 Previous Lecture Principle of Mathematical Induction Mathematical Induction: rule of inference Mathematical Induction: Conjecturing and Proving Climbing an Infinite Ladder

More information

Elementary Number Theory MARUCO. Summer, 2018

Elementary Number Theory MARUCO. Summer, 2018 Elementary Number Theory MARUCO Summer, 2018 Problem Set #0 axiom, theorem, proof, Z, N. Axioms Make a list of axioms for the integers. Does your list adequately describe them? Can you make this list as

More information

10 Public Key Cryptography : RSA

10 Public Key Cryptography : RSA 10 Public Key Cryptography : RSA 10.1 Introduction The idea behind a public-key system is that it might be possible to find a cryptosystem where it is computationally infeasible to determine d K even if

More information

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University Number Theory, Public Key Cryptography, RSA Ahmet Burak Can Hacettepe University abc@hacettepe.edu.tr The Euler Phi Function For a positive integer n, if 0

More information

CIS 551 / TCOM 401 Computer and Network Security

CIS 551 / TCOM 401 Computer and Network Security CIS 551 / TCOM 401 Computer and Network Security Spring 2008 Lecture 15 3/20/08 CIS/TCOM 551 1 Announcements Project 3 available on the web. Get the handout in class today. Project 3 is due April 4th It

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 9 September 30, 2015 CPSC 467, Lecture 9 1/47 Fast Exponentiation Algorithms Number Theory Needed for RSA Elementary Number Theory

More information

Number Theory and Group Theoryfor Public-Key Cryptography

Number Theory and Group Theoryfor Public-Key Cryptography Number Theory and Group Theory for Public-Key Cryptography TDA352, DIT250 Wissam Aoudi Chalmers University of Technology November 21, 2017 Wissam Aoudi Number Theory and Group Theoryfor Public-Key Cryptography

More information

Network Security Technology Spring, 2018 Tutorial 3, Week 4 (March 23) Due Date: March 30

Network Security Technology Spring, 2018 Tutorial 3, Week 4 (March 23) Due Date: March 30 Network Security Technology Spring, 2018 Tutorial 3, Week 4 (March 23) LIU Zhen Due Date: March 30 Questions: 1. RSA (20 Points) Assume that we use RSA with the prime numbers p = 17 and q = 23. (a) Calculate

More information

MATH 361: NUMBER THEORY FOURTH LECTURE

MATH 361: NUMBER THEORY FOURTH LECTURE MATH 361: NUMBER THEORY FOURTH LECTURE 1. Introduction Everybody knows that three hours after 10:00, the time is 1:00. That is, everybody is familiar with modular arithmetic, the usual arithmetic of the

More information

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30 CHALMERS GÖTEBORGS UNIVERSITET CRYPTOGRAPHY TDA35 (Chalmers) - DIT50 (GU) 11 April 017, 8:30-1:30 No extra material is allowed during the exam except for pens and a simple calculator (not smartphones).

More information

Mathematical Induction

Mathematical Induction Mathematical Induction Representation of integers Mathematical Induction Reading (Epp s textbook) 5.1 5.3 1 Representations of Integers Let b be a positive integer greater than 1. Then if n is a positive

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 14 October 23, 2017 CPSC 467, Lecture 14 1/42 Computing in Z n Modular multiplication Modular inverses Extended Euclidean algorithm

More information

Applied Cryptography and Computer Security CSE 664 Spring 2018

Applied Cryptography and Computer Security CSE 664 Spring 2018 Applied Cryptography and Computer Security Lecture 12: Introduction to Number Theory II Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline This time we ll finish the

More information

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

Example 2: Student work M ATHS COURSEWORK. Mathematics SL and HL teacher support material 1. Proving Euler s Totient Theorem M ATHS COURSEWORK Mathematics SL and HL teacher support material 1 TA B L E O F C O N T E N T S Maths Coursework 3 Introduction 3 The Theorem 3 Euler s Totient Function 3 Fermat s Little Theorem 4 Proving

More information

Number Theory A focused introduction

Number Theory A focused introduction Number Theory A focused introduction This is an explanation of RSA public key cryptography. We will start from first principles, but only the results that are needed to understand RSA are given. We begin

More information

Public-Key Cryptosystems CHAPTER 4

Public-Key Cryptosystems CHAPTER 4 Public-Key Cryptosystems CHAPTER 4 Introduction How to distribute the cryptographic keys? Naïve Solution Naïve Solution Give every user P i a separate random key K ij to communicate with every P j. Disadvantage:

More information

Ma/CS 6a Class 2: Congruences

Ma/CS 6a Class 2: Congruences Ma/CS 6a Class 2: Congruences 1 + 1 5 (mod 3) By Adam Sheffer Reminder: Public Key Cryptography Idea. Use a public key which is used for encryption and a private key used for decryption. Alice encrypts

More information

Elementary Number Theory Review. Franz Luef

Elementary Number Theory Review. Franz Luef Elementary Number Theory Review Principle of Induction Principle of Induction Suppose we have a sequence of mathematical statements P(1), P(2),... such that (a) P(1) is true. (b) If P(k) is true, then

More information

Topics in Cryptography. Lecture 5: Basic Number Theory

Topics in Cryptography. Lecture 5: Basic Number Theory Topics in Cryptography Lecture 5: Basic Number Theory Benny Pinkas page 1 1 Classical symmetric ciphers Alice and Bob share a private key k. System is secure as long as k is secret. Major problem: generating

More information

basics of security/cryptography

basics of security/cryptography RSA Cryptography basics of security/cryptography Bob encrypts message M into ciphertext C=P(M) using a public key; Bob sends C to Alice Alice decrypts ciphertext back into M using a private key (secret)

More information

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems Cryptography Introduction to Number Theory 1 Preview Integers Prime Numbers Modular Arithmetic Totient Function Euler's Theorem Fermat's Little Theorem Euclid's Algorithm 2 Introduction to Number Theory

More information

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence:

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence: Linear Congruences The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence: ax b (mod m), a, b Z, m N +. (1) If x 0 is a solution then so is x k :=

More information

THE RSA ENCRYPTION SCHEME

THE RSA ENCRYPTION SCHEME THE RSA ENCRYPTION SCHEME Contents 1. The RSA Encryption Scheme 2 1.1. Advantages over traditional coding methods 3 1.2. Proof of the decoding procedure 4 1.3. Security of the RSA Scheme 4 1.4. Finding

More information

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS Modular arithmetics that we have discussed in the previous lectures is very useful in Cryptography and Computer Science. Here we discuss several

More information

Homework 4 for Modular Arithmetic: The RSA Cipher

Homework 4 for Modular Arithmetic: The RSA Cipher Homework 4 for Modular Arithmetic: The RSA Cipher Gregory V. Bard April 25, 2018 This is a practice workbook for the RSA cipher. It is not suitable for learning the RSA cipher from scratch. However, there

More information

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used.

Candidates must show on each answer book the type of calculator used. Only calculators permitted under UEA Regulations may be used. UNIVERSITY OF EAST ANGLIA School of Mathematics May/June UG Examination 2010 2011 CRYPTOGRAPHY Time allowed: 2 hours Attempt THREE questions. Candidates must show on each answer book the type of calculator

More information

Homework Problems, Math 134, Spring 2007 (Robert Boltje)

Homework Problems, Math 134, Spring 2007 (Robert Boltje) Homework Problems, Math 134, Spring 2007 (Robert Boltje) 1. Write a computer program that uses the Euclidean Algorithm to compute the greatest common divisor d of two natural numbers a and b and also integers

More information

MATH 2200 Final Review

MATH 2200 Final Review MATH 00 Final Review Thomas Goller December 7, 01 1 Exam Format The final exam will consist of 8-10 proofs It will take place on Tuesday, December 11, from 10:30 AM - 1:30 PM, in the usual room Topics

More information

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

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer. CHAPTER 2 INTRODUCTION TO NUMBER THEORY ANSWERS TO QUESTIONS 2.1 A nonzero b is a divisor of a if a = mb for some m, where a, b, and m are integers. That is, b is a divisor of a if there is no remainder

More information

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2

= 1 2x. x 2 a ) 0 (mod p n ), (x 2 + 2a + a2. x a ) 2 8. p-adic numbers 8.1. Motivation: Solving x 2 a (mod p n ). Take an odd prime p, and ( an) integer a coprime to p. Then, as we know, x 2 a (mod p) has a solution x Z iff = 1. In this case we can suppose

More information

RSA Algorithm. Factoring, EulerPhi, Breaking RSA. Çetin Kaya Koç Spring / 14

RSA Algorithm. Factoring, EulerPhi, Breaking RSA.   Çetin Kaya Koç Spring / 14 RSA Algorithm http://koclab.org Çetin Kaya Koç Spring 2018 1 / 14 Well-Known One-Way Functions Discrete Logarithm: Given p, g, and x, computing y in y = g x (mod p) is EASY Given p, g, y, computing x in

More information

Math 430 Midterm II Review Packet Spring 2018 SOLUTIONS TO PRACTICE PROBLEMS

Math 430 Midterm II Review Packet Spring 2018 SOLUTIONS TO PRACTICE PROBLEMS Math 40 Midterm II Review Packet Spring 2018 SOLUTIONS TO PRACTICE PROBLEMS WARNING: Remember, it s best to rely as little as possible on my solutions. Therefore, I urge you to try the problems on your

More information

CS2800 Questions selected for fall 2017

CS2800 Questions selected for fall 2017 Discrete Structures Final exam sample questions Solutions CS2800 Questions selected for fall 2017 1. Determine the prime factorizations, greatest common divisor, and least common multiple of the following

More information

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

For your quiz in recitation this week, refer to these exercise generators: 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

More information

Cryptography. Course 1: Remainder: RSA. Jean-Sébastien Coron. September 21, Université du Luxembourg

Cryptography. Course 1: Remainder: RSA. Jean-Sébastien Coron. September 21, Université du Luxembourg Course 1: Remainder: RSA Université du Luxembourg September 21, 2010 Public-key encryption Public-key encryption: two keys. One key is made public and used to encrypt. The other key is kept private and

More information

Mathematics of Cryptography

Mathematics of Cryptography UNIT - III Mathematics of Cryptography Part III: Primes and Related Congruence Equations 1 Objectives To introduce prime numbers and their applications in cryptography. To discuss some primality test algorithms

More information

Practice Assignment 2 Discussion 24/02/ /02/2018

Practice Assignment 2 Discussion 24/02/ /02/2018 German University in Cairo Faculty of MET (CSEN 1001 Computer and Network Security Course) Dr. Amr El Mougy 1 RSA 1.1 RSA Encryption Practice Assignment 2 Discussion 24/02/2018-29/02/2018 Perform encryption

More information