download instant at

Size: px
Start display at page:

Download "download instant at"

Transcription

1 2 CRYPTOGRAPHY AND NUMBER THEORY 2.1 CRYPTOGRAPHY AND MODULAR ARITHMETIC Pages 54 to 56 Problem 1 Problem 2 Problem 3 Problem 4 14 mod 9 = 5; 1 mod 9 = 8; 11 mod 9 = 7. KHUH LV D PHVVDJH. EBOB FP X JBPPXDB. Five places. Problem 5 Problem = 11; = 12. Without knowledge of a, you could say essentially nothing, though you could observe that it has six or fewer letters. If you knew a, you could write the unique number that corresponds to the message. Because different sequences of letters could conceivably S16

2 give the same number when their codes are concatenated, you wouldn t know the message for sure; however, if it were a message in English, you could figure it out by experimenting with all combinations of letters that give the number you got. Problem 7 Problem 8 Problem 9 It would mean that (x 4) mod 9 = 1. Because 7 4 = 28, we have that (1/4) mod 9 = 7. There is no integer value that makes sense for (1/3) mod 9, because no multiple of 3is1plus a multiple of 9. The number is It is difficult to do by hand because without knowing how to divide by 487 in Z 30031, the only thing you might try is to multiply every number from some point on by 487 (for example, you wouldn t need to try 2 times 487 or 3 times 487 or even 10 times 487, but you might try 62, 63, etc., times 487) and then compute the result mod It is symmetric because addition is commutative. Every number appears in every row because adding a fixed number a to each entry of arow (where we add mod 7) is a one-to-one and onto function from {0, 1, 2, 3, 4, 5, 6} to itself. Problem 10 a. Yes, a = 2 and b = 5work. In particular, 2 12 x = 5 has no solutions because 2x will be even, so 2x mod 12 will be even. Thus, there is no integer x such that 2x mod 12 = 5. b. Yes, a = 5 has this property because = 5, = 10, = 3, = 8, = 1, = 6, = 11, = 4, = 9, = 2, and = 7; so, for each b, with 1 b < 12, we have given an x so that 5 12 x = b. 2.1: Cryptography and Modular Arithmetic S17

3 Problem 11 The equation has a solution for Z 5, Z 7, and Z 11.ForZ 9,ifa is not 0, 3, or 6, the equation has a solution; otherwise, the answer depends on what b is. Problem 12 a. If 0 b 1 < b 2 p 1 such that a p b 1 = a p b 2, then a(b 2 b 1 ) = 0 mod p that is, a(b 2 b 1 ) = kp. Because a(b 2 b 1 ) 0, we have that k 0. Then p divides a(b 2 b 1 ). Thus, p divides a or b 2 b 1 ;but that is impossible because they are all greater than 0 and less than p. b. From part a, we know that the p terms a p b are different when b runs through the integers from 0 to p 1. Also, a p b must be one of the p numbers 0, 1,..., p 1. So there must be one and only one b such that a p b = 1. Thus, a has a unique multiplicative inverse in Z p. Problem 13 Let b = a mod n. Note that y i = { xi + b if x i + b < n, x i + b n if x i + b n. Thus, two y i s will be of the form x i + b or two will be of the form x i + b n. The difference of these two will be of the form x i x j. Problem 14 The universe is Z 7,sox and y can take values between 0 and 7 1 = 6 only. The table for x 7 y = (xy) mod 7 should look like the following: x y S18 Chapter 2: Cryptography and Number Theory

4 Problem 15 By Theorem 2.1, for unique integers q 1 and q 2,wehavei = (i mod n) + q 1 n and j = ( j mod n) + q 2 n. Multiplying these two equations together, we get ij = (i mod n)( j mod n) + (i mod n)q 2 n + ( j mod n)q 1 n + q 1 nq 2 n. Taking both sides mod n gives us ij mod n = (i mod n)( j mod n) mod n because the remainder of the right hand side of the previous equation for ij is a multiple of n. Problem 16 x n (y n z) = (x n y) n z. For the proof, using Lemma 2.3, x n (y n z) = ( x(yz) ) mod n = ( (xy)z ) mod n = (x n y) n z. Problem 17 x n (y + n z) = x n y + n x n z and (y + n z) n x = y n x + n z n x. (We need prove only one of these because of commutativity.) For the proof, using Lemma 2.3, x n (y + n z) = ( x ( (y + z) mod n )) mod n = ( x(y + z) ) mod n = (xy + xz) mod n = ( (xy mod n) + (xz mod n) ) mod n = x n y + n x n z. 2.2 INVERSES AND GREATEST COMMON DIVISORS Pages 70 to 71 Problem 1 Yes, it is 133 mod m. Problem 2 Yes, it is 133 mod m. 2.2: Inverses and Greatest Common Divisors S19

5 Problem 3 One way to answer this problem is to try each multiple of 2. You would discover that 2 5 = 10; so, 2 does not have a multiplicative inverse in Z 10. Then you would compute the product of each pair of nonzero elements in Z 11 (this is 50 products) to show that each has a multiplicative inverse. It is easier to do the second part by noting that 11 is a prime, which means that all nonzero elements of Z 11 are relatively prime to it and thus have inverses. You could also do the first part by observing that 10 is not a prime, so not all elements of Z 10 would be relatively prime to it. Therefore, you would conclude that not all elements of Z 10 have multiplicative inverses. Problem 4 Problem 5 Problem 6 Problem 7 Problem 8 Problem 9 1; 0. The number of such elements is either zero or one, because if an element of Z n,inthis case b, has at least one inverse, then it has only one inverse. They are either 1 or = and 126 = ; 84 = Therefore, 42 is the GCD of 210 and 126. If r = 0, then gcd(r, q) = q and gcd(q, k) = q. But if r 0, then any divisor of q and k is a divisor of r = k jq,soitisadivisor of gcd(r, q). Also, any divisor of r and q is a divisor of k = jq + r and thus of gcd(q, k). Therefore, the two GCDs are equal. For the wiretapper to compute the secret key in the first scheme, she only needs to compute q 1. (This can be done using the extended GCD algorithm, because she knows q and p.) Then she can compute the secret key by multiplying the three numbers qa, qb, and q 1, all of which she knows. So the first scheme isn t very good. The second one is harder to attack. The natural way to attack it is by exhaustive search. That is, the wiretapper, knowing q a and q but not a, tries all the powers of q i for i = 1 to i = p 1 until she finds one such that q i mod p = q a mod p. Then she computes S20 Chapter 2: Cryptography and Number Theory

6 (q b ) i. This is the secret key, because (q b ) i mod p = q bi mod p = (q i ) b mod p = (q a ) b mod p = q ab mod p. However, because p is a very large number, this method is computationally very intensive, which means the scheme is hard to crack this way. One might also think about taking the logarithm of q a in Z p with respect to the base q,but we don t know a very efficient way to compute logarithms in Z p. Problem 10 Method 1: GCD(n,k) // Returns an ordered triplet of numbers: the gcd, // and the x and y values such that x*n + y*k = gcd. // Line 6 assigns all three values to variables. // Assume k > n. (1) q = floor(k/n) (2) r = k q*n (3) if (r == 0) // This is the base case (4) return (n, 0, 1) (5) else (6) (gcd, x, y ) = GCD(r, n) (7) x = y (8) y = x q*y (9) return (gcd, x, y) Method 2: GCD(n,k) // Assume that gcd, x, and y are global variables. // Assume that k > n // Upon return gcd will hold GCD(n,k) and x*n + y*k = gcd (1) q = floor(k/n) (2) r = k q*n (3) if (r == 0) // Base case: n is the GCD (4) gcd = n (5) x = 0 (6) y = 1 (7) else (8) GDC(r,n) (9) x = y (10) y = x q*y (11) x = x 2.2: Inverses and Greatest Common Divisors S21

7 Problem 11 The first loop of the algorithm is shown in the table. i k[i] n[i] q[i] r[i] This gives gcd(576, 486) = 18. The second loop of the algorithm is shown here (i is decreasing and the q[i]values were copied from the previous table for convenience): i q[i] x[i] y[i] This gives x = 11 and y = 13. Indeed, kx + ny = ( 13) = = 18 = gcd(576, 486). Problem 12 Problem 13 Problem 14 Problem x = 1, giving gcd(16, 103) = 1. We can find x and y such that 16x +103y = 1. Then x mod 103 is the inverse. Using the extended GCD algorithm, 16 ( 45) = 1. Then the multiplicative inverse of 16 mod 103 is ( 45) mod 103 = 58. In Problem 12, you computed that the multiplicative inverse of 16 mod 103 is 58. Thus, x = mod 103 = 85. The numbers not relatively prime to 35 are 0, 5, 7, 10, 14, 15, 20, 21, 25, 28, and 30 numbers that are multiples of 5 or 7. Thus, these are the elements of Z 35 that do not have multiplicative inverses. If r = 0, then gcd(k, 0) = k,butgcd( j, k) = j.ifr 0, however, then any divisor of j and k is a divisor of r = k jq,soitisadivisor of gcd(r, k). Also, any divisor of r and k is a divisor of jq = k r.however, it is not necessarily a divisor of j. Thus, there is a relationship: The GCD of j and k is a divisor of the GCD of r and k, and if the GCD of r and k is relatively prime to q, then the two GCDs are equal. S22 Chapter 2: Cryptography and Number Theory

8 Problem 16 You may write m = qn r = qn n + n r = (q + 1)n + n r so that if you take q = (q + 1) and r = n r, then you have m = q n + r, with 0 r < n. Thus, you have proved the part of Theorem 2.1 not covered by Theorem Problem 17 There are many different ways to answer this question correctly. Here is an outline of one complete solution. Using the GCD algorithm and noting that F i = 1 F i 1 + F i 2, you get that q is always 1 and r is always F i 2. Thus, gcd(f i, F i+1 ) = gcd(f i 1, F i ) = gcd(f i F i 1, F i 1 ) = gcd(f i 2, F i 1 ) = =gcd(f 2, F 3 ) = 1. Notice that 2F i 1 > F i > F i 1 for i > 3, so the extended GCD algorithm can be used in this way. When you do this recursively to compute x and y, you get 1 = gcd(f i, F i+1 ) = ( 1) i 1 F 2 i + ( 1) i F i 1 F i+1. Thus, x = ( 1) i 1 F i and y = ( 1) i F i 1. Problem 19 Problem 21 Problem 22 Problem 23 lcm(x, y) = xy/ gcd(x, y). Because = 4, the equation 4 6 x = 4 has a solution in Z 6.Infact, it has at least two solutions, because 1 is also a solution. If you suppose that a and n are not relatively prime, then a and n have a common factor d greater than 0. Thus, a = a d and n = n d.ifa n x = b, then a n (x + n n ) = b. But you cannot have x = x + n n, because adding x mod n to both sides in Z n gives n mod n = 0. This is a contradiction, because if n = n d, you know that 0 < n < n. Thus, if a and n are not relatively prime and the equation a n x = b has a solution, it has more than one solution, so it does not have a unique solution. Therefore, a n x = b has a unique solution in Z n if and only if a and n are relatively prime. Assume j < k. Ifk = ji, then gcd( j, k) = j. Inthis case, j = j 1 + k 0, which gives x = 1 and y = 0. Otherwise, assume inductively that when k < k and j j, there are integers x and y such that gcd( j, k ) = j x + k y. Write k = qj + r with 0 r < j. ByLemma 2.13, you know that gcd(r, j) = gcd( j, k). But by the 2.2: Inverses and Greatest Common Divisors S23

9 inductive hypothesis, there are integers x and y such that gcd( j, k) = rx + jy. Substitution gives gcd( j, k) = (k qj)x + jy = j (y qx ) + kx. Thus, taking y = x and x = y qx gives gcd( j, k) = jx + ky. 2.3 THE RSA CRYPTOSYSTEM Pages 81 to 82 Problem 1 4, 2, 1, 4, 2, 1,...; 4, 6, 4, 6, 4,.... In both cases, there is a repeated pattern. The first case hasa1intherepeating pattern, and the second case does not. Problem 2 You get the numbers 5, 10, 4, 9, 3, 8, 2, 7, 1, 6, which is a permutation of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}. ByLemma 2.20, you get a permutation of {1, 2, 3, 4, 5, 6, 7, 8, 9, 10} no matter which nonzero element of Z 11 is used in place of 5. Problem = 1; 2 4 mod 5 = 16 mod 5 = 1; 3 4 mod 5 = 81 mod 5 = 1; 4 4 mod 5 = 256 mod 5 = 1. Observe that each fourth power is 1. Fermat s Little Theorem explains why. Problem 4 Problem ; 1; 23; 23; ; 1; 18; 19; 105. This shows that x ed mod p (which is y d mod p) need not determine x (and couldn t if x were greater than or equal to p). Problem 6 There is exactly one solution, and it is x = 19. Problem 7 97 and 73 are prime numbers. Use Fermat s Little Theorem to get the following: a mod 97 = 1. b mod 73 = 1. c mod 73 = = 67 1 = 67. S24 Chapter 2: Cryptography and Number Theory

10 Problem 8 You have n = ki + r, where k and r are integers. Then a n mod p = a ki+r mod p = (a ki mod p) p (a r mod p) = (a ki mod p) p (a n mod i mod p) = a n mod i mod p. Because you did not use the primality of p, the equation is true if p is not a prime. Problem 9 Problem 10 Problem 11 Because they are not relatively prime to p 2, the numbers 0, p, 2p, 3p,...,(p 1)p have no multiplicative inverses. But other elements in Z p 2 have a multiplicative inverse because they have no factor p; thus, they are relatively prime to p 2. So, there are p 2 p elements with multiplicative inverse in Z p 2. The elements x that have multiplicative inverses in Z p 2 are all relatively prime to p. By Fermat s Little Theorem, you have x p 1 ( = ) kp + 1, where k is an integer. This gives x p2 p = (x p 1 ) p = (kp + 1) p = 1 + p kp + p 2 C = D p 2 + 1, where C 1 and D are both integers. Therefore, x p2 p = 1 mod p 2. You can also use a method similar to the proof of Fermat s Little Theorem to prove that x p2 p mod p 2 = 1 when x has an inverse. For any element y with no multiplicative inverse, you can write y = cp, where c is an integer and 0 c p 1. So, y p2 p = (cp) p2 p = c p2 p p p2 p = 0 mod p 2, because p 2 p 2 for all primes p. pq (p + q 1):ByCorollary 2.16, a has an inverse if gcd(a, pq) = 1. Any a that is divisible by p has gcd(a, pq) = p. There are q such a s. Inasimilar way, any b that is divisible by q has gcd(b, pq) = q. There are p such b s. Together, there are p + q 1 elements in Z pq that do not have inverses. (We get p + q 1 because pq = 0 mod pq is counted twice: both as divisible by p and as divisible by q.) a. Euclid s algorithm gives an x and a z so that mx + nz = 1. b. Write k = kmx + knz = cnmx + bmnz and k = mn(cx + bz); so, k is a multiple of mn. Because two distinct primes are relatively prime, this justifies the assertion. Problem 12 a. Let [i] ={j Z j i (mod n)}. If[i] [ j] contains an element k, then i k (mod n) and j k (mod n) implies i j (mod n) and j i (mod n). Thus, [i] = [ j]. The sets i and j are either identical or disjoint. Further, i [i], so that the sets [i] partition the integers. Therefore, is an equivalence relation. 2.3: The RSA Cryptosystem S25

11 b. Because i mod n = i mod n, you know that is reflexive. If i mod n = j mod n, then j mod n = i mod n; so, is symmetric. If i mod n = j mod n and j mod n = k mod n, then i mod n = k mod n. Therefore, is transitive. Thus, is an equivalence relation. c. If m and n are relatively prime positive integers, then the congruences and x a (mod m) x a (mod n) have a solution. Further, if x 1 and x 2 are solutions, then x 1 x 2 (mod mn). Problem 14 Because x n 1 mod n = 1, you have x n (x n 2 mod n) = 1; so, x has a multiplicative inverse. Therefore, by Corollary 2.16, gcd(x, n) = 1. Thus, every number between 1 and n 1isrelatively prime to n, sothat n has no factors other than itself and 1. Therefore, n is prime. 2.4 DETAILS OF THE RSA CRYPTOSYSTEM Pages 89 to 90 Problem 1 Problem 2 4. Multiply a 32, a 16, a 4, and a. Problem 3 Problem 4 In 40 bits, which is the same as 5 bytes, you should be able to store any number with up to 12 digits. Now notice that in 50 bytes, you could store ten numbers, each of which has 12 digits; so, you should be able to store 120 digits. Similarly, each time you multiply the number of bytes by 10, you multiply the number of digits you can store by 10; so, in 5 billion bytes, you should be able to store a billion times as many digits, or 12 billion decimal digits. Similarly, in 5 trillion bytes, you should be able to store 12 trillion decimal digits (this is about 10 13, which is insignificant in comparison to ). There are no other such numbers. S26 Chapter 2: Cryptography and Number Theory

12 Problem 5 The only such numbers are 10 and 23. Problem 6 ( ) (10120) = ( 10 (102 ) ) (10 120) = 10 ( ) = 10 (10122) ; so, it has digits. Problem 7 Because a has the same number of digits as and fewer digits than , the number of digits of a is about the number of digits of ( ) (10120) = (10120) = Thus, the number of digits is a lot closer to than to ,regardless of the value of a. Problem 8 The binary representation of gives = n b i 2 i, i=0 where n = log and each b i is 0 or 1. Ifb i is 1, you have to include the b i th square of a in the product; otherwise, don t include it. Problem 9 Problem 10 It doesn t make sense to do this, because mod 5 = 4, while 2 (2 3) mod 5 = 2. ModExp(a,x,n) (1) k = ceiling(log 2 n) (2) get the binary representation of x, let it be x k, x k 1,...,x 1,x 0 (3) y = a mod n (4) i = 0 (5) b = 1 (6) while (i k) (7) if (x i == 1) (8) b = (y*b) mod n (9) y = (y*y) mod n (10) i = i + 1 (11) return b 2.4: Details of the RSA Cryptosystem S27

13 Problem 11 If a has a multiplicative inverse, it would make sense to do so because, as in the proof of Fermat s Little Theorem, a ϕ(n) = 1. However, if a does not have an inverse, it would not. Problem 12 If m is not prime, it must have a factor n m. Thus, 0, n, 2n,...,(m/n 1) n are not relatively prime to m. Then, there are at least m/n factors that have no multiplicative inverse. Note that m/n m/ m m. Problem 13 Applying the extended GCD algorithm, you get d = e 1 mod (p 1)(q 1) = 7 1 mod 180 = 103. Applying the RSA algorithm, you encrypt the message as follows: y = x e mod n = mod 209 = 111. You can then decrypt the message in the same way, using d instead of e: y d mod pq = mod 209 = 100. Problem 14 n = pq = 253. Applying the extended GCD algorithm, or by experimenting, you see that d = 17. Then mod 253 = mod 253 = ( 12) mod 253 = ( 100(12 4 mod 253)(12 4 mod 253) ) mod 253 = 133. To reverse the process, ( (( = 4 mod 253) 4 mod 253 ) ) 133 mod 253 = mod 253 = 100. Problem 15 We use proof by contradiction within a proof by contradiction. Consider a prime p greater than 2. The number 1 passes the test x m 1 mod m = 1. Assume we have an element x 1 such that x m 1 mod m = 1 (we will eventually show this leads to a contradiction). Then, x p mod m = 1. We now show that x i mod m 1 for 1 i < p.for the sake of contradiction, suppose there is such an i < p. Let i be the smallest element that satisfies the equation x i mod m = 1. Write p = ki + r, with r = p mod i. We have x r mod m = x r x ki mod m = x p mod m = 1. This is a contradiction, because i is the smallest positive integer that satisfies x i mod m = 1. Thus, x i mod m 1 after all. We then have x i mod m x j mod m (1 i, j p), because otherwise x i j mod m = 1, assuming i j. But x has the multiplicative inverse x p 1. Thus, x, x 2, x 3,...,x p 1, x p mod m = 1 all have multiplicative inverses. We just showed that the powers of x are all distinct. So at most (p + 1) p = 1 elements have no inverse, which is contradictory to Problem 12, because p + 1 is not prime. Therefore, there can be no x 1 with x p mod m = 1. S28 Chapter 2: Cryptography and Number Theory

14 Problem 16 Bob can first use the RSA procedure to use his private key d to encrypt the document D and get a signature S. Others may then decrypt the signature using Bob s public key e and then compare the decryption with the document to see if they match. If the document is also secret, Bob should first encrypt it with the receiver s public key and send it both with and without his signature. Actually, the encryption and decryption are the same procedure except for the key used. Bob might or might not append his name to the document before encrypting it with his private key. 2.4: Details of the RSA Cryptosystem S29

2.2 Inverses and GCDs

2.2 Inverses and GCDs 34 CHAPTER 2. CRYPTOGRAPHY AND NUMBER THEORY 2.2 Inverses and GCDs 2.2.1 Inverses mod p In the last section we explored the multiplication in Z n. We saw in the special case with n =12 and a = 4 that if

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

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II CS 5319 Advanced Discrete Structure Lecture 9: Introduction to Number Theory II Divisibility Outline Greatest Common Divisor Fundamental Theorem of Arithmetic Modular Arithmetic Euler Phi Function RSA

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a k for some integer k. Notation

More information

Basic elements of number theory

Basic elements of number theory Cryptography Basic elements of number theory Marius Zimand 1 Divisibility, prime numbers By default all the variables, such as a, b, k, etc., denote integer numbers. Divisibility a 0 divides b if b = a

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

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

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

Mathematical Foundations of Public-Key Cryptography

Mathematical Foundations of Public-Key Cryptography Mathematical Foundations of Public-Key Cryptography Adam C. Champion and Dong Xuan CSE 4471: Information Security Material based on (Stallings, 2006) and (Paar and Pelzl, 2010) Outline Review: Basic Mathematical

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

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

Encryption: The RSA Public Key Cipher

Encryption: The RSA Public Key Cipher Encryption: The RSA Public Key Cipher Michael Brockway March 5, 2018 Overview Transport-layer security employs an asymmetric public cryptosystem to allow two parties (usually a client application and a

More information

Mathematical Foundations of Cryptography

Mathematical Foundations of Cryptography Mathematical Foundations of Cryptography Cryptography is based on mathematics In this chapter we study finite fields, the basis of the Advanced Encryption Standard (AES) and elliptical curve cryptography

More information

Number Theory Notes Spring 2011

Number Theory Notes Spring 2011 PRELIMINARIES The counting numbers or natural numbers are 1, 2, 3, 4, 5, 6.... The whole numbers are the counting numbers with zero 0, 1, 2, 3, 4, 5, 6.... The integers are the counting numbers and zero

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

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

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 9 February 6, 2012 CPSC 467b, Lecture 9 1/53 Euler s Theorem Generating RSA Modulus Finding primes by guess and check Density of

More information

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers

Number Theory: Applications. Number Theory Applications. Hash Functions II. Hash Functions III. Pseudorandom Numbers Number Theory: Applications Number Theory Applications Computer Science & Engineering 235: Discrete Mathematics Christopher M. Bourke cbourke@cse.unl.edu Results from Number Theory have many applications

More information

CS483 Design and Analysis of Algorithms

CS483 Design and Analysis of Algorithms CS483 Design and Analysis of Algorithms Lectures 2-3 Algorithms with Numbers Instructor: Fei Li lifei@cs.gmu.edu with subject: CS483 Office hours: STII, Room 443, Friday 4:00pm - 6:00pm or by appointments

More information

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost?

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost? Ch - Algorithms with numbers Addition Basic arithmetic Addition ultiplication Division odular arithmetic factoring is hard Primality testing 53+35=88 Cost? (n number of bits) O(n) ultiplication al-khwārizmī

More information

Some Facts from Number Theory

Some Facts from Number Theory Computer Science 52 Some Facts from Number Theory Fall Semester, 2014 These notes are adapted from a document that was prepared for a different course several years ago. They may be helpful as a summary

More information

Rings and modular arithmetic

Rings and modular arithmetic Chapter 8 Rings and modular arithmetic So far, we have been working with just one operation at a time. But standard number systems, such as Z, have two operations + and which interact. It is useful to

More information

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers

ALGEBRA. 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers ALGEBRA CHRISTIAN REMLING 1. Some elementary number theory 1.1. Primes and divisibility. We denote the collection of integers by Z = {..., 2, 1, 0, 1,...}. Given a, b Z, we write a b if b = ac for some

More information

Number Theory. Modular Arithmetic

Number Theory. Modular Arithmetic Number Theory The branch of mathematics that is important in IT security especially in cryptography. Deals only in integer numbers and the process can be done in a very fast manner. Modular Arithmetic

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

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

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

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. 2 Arithmetic This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}. (See [Houston, Chapters 27 & 28]) 2.1 Greatest common divisors Definition 2.16. If a, b are integers, we say

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

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

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

Modular Arithmetic and Elementary Algebra

Modular Arithmetic and Elementary Algebra 18.310 lecture notes September 2, 2013 Modular Arithmetic and Elementary Algebra Lecturer: Michel Goemans These notes cover basic notions in algebra which will be needed for discussing several topics of

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

Public Key Encryption

Public Key Encryption Public Key Encryption 3/13/2012 Cryptography 1 Facts About Numbers Prime number p: p is an integer p 2 The only divisors of p are 1 and p s 2, 7, 19 are primes -3, 0, 1, 6 are not primes Prime decomposition

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

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

CS March 17, 2009

CS March 17, 2009 Discrete Mathematics CS 2610 March 17, 2009 Number Theory Elementary number theory, concerned with numbers, usually integers and their properties or rational numbers mainly divisibility among integers

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

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

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

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

Math 299 Supplement: Modular Arithmetic Nov 8, 2013 Math 299 Supplement: Modular Arithmetic Nov 8, 2013 Numbers modulo n. We have previously seen examples of clock arithmetic, an algebraic system with only finitely many numbers. In this lecture, we make

More information

ECEN 5022 Cryptography

ECEN 5022 Cryptography Elementary Algebra and Number Theory University of Colorado Spring 2008 Divisibility, Primes Definition. N denotes the set {1, 2, 3,...} of natural numbers and Z denotes the set of integers {..., 2, 1,

More information

You separate binary numbers into columns in a similar fashion. 2 5 = 32

You separate binary numbers into columns in a similar fashion. 2 5 = 32 RSA Encryption 2 At the end of Part I of this article, we stated that RSA encryption works because it s impractical to factor n, which determines P 1 and P 2, which determines our private key, d, which

More information

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

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points. Math 152, Problem Set 2 solutions (2018-01-24) All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points. 1. Let us look at the following equation: x 5 1

More information

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time. 8 Modular Arithmetic We introduce an operator mod. Let d be a positive integer. For c a nonnegative integer, the value c mod d is the remainder when c is divided by d. For example, c mod d = 0 if and only

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

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

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5

Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 CS 70 Discrete Mathematics and Probability Theory Summer 2014 James Cook Note 5 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes wish to work over a

More information

Cryptography. pieces from work by Gordon Royle

Cryptography. pieces from work by Gordon Royle Cryptography pieces from work by Gordon Royle The set-up Cryptography is the mathematics of devising secure communication systems, whereas cryptanalysis is the mathematics of breaking such systems. We

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

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test

Instructor: Bobby Kleinberg Lecture Notes, 25 April The Miller-Rabin Randomized Primality Test Introduction to Algorithms (CS 482) Cornell University Instructor: Bobby Kleinberg Lecture Notes, 25 April 2008 The Miller-Rabin Randomized Primality Test 1 Introduction Primality testing is an important

More information

8 Elliptic Curve Cryptography

8 Elliptic Curve Cryptography 8 Elliptic Curve Cryptography 8.1 Elliptic Curves over a Finite Field For the purposes of cryptography, we want to consider an elliptic curve defined over a finite field F p = Z/pZ for p a prime. Given

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

Number theory. Myrto Arapinis School of Informatics University of Edinburgh. October 9, /29

Number theory. Myrto Arapinis School of Informatics University of Edinburgh. October 9, /29 Number theory Myrto Arapinis School of Informatics University of Edinburgh October 9, 2014 1/29 Division Definition If a and b are integers with a 6= 0, then a divides b if there exists an integer c such

More information

ICS141: Discrete Mathematics for Computer Science I

ICS141: Discrete Mathematics for Computer Science I ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Jan Stelovsky based on slides by Dr. Baek and Dr. Still Originals by Dr. M. P. Frank and Dr. J.L. Gross Provided by

More information

Fall 2017 Test II review problems

Fall 2017 Test II review problems Fall 2017 Test II review problems Dr. Holmes October 18, 2017 This is a quite miscellaneous grab bag of relevant problems from old tests. Some are certainly repeated. 1. Give the complete addition and

More information

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

Notes. Number Theory: Applications. Notes. Number Theory: Applications. Notes. Hash Functions I Number Theory: Applications Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry Fall 2007 Computer Science & Engineering 235 Introduction to Discrete Mathematics Sections 3.4 3.7 of Rosen cse235@cse.unl.edu

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

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730

Greatest Common Divisor MATH Greatest Common Divisor. Benjamin V.C. Collins, James A. Swenson MATH 2730 MATH 2730 Greatest Common Divisor Benjamin V.C. Collins James A. Swenson The world s least necessary definition Definition Let a, b Z, not both zero. The largest integer d such that d a and d b is called

More information

OWO Lecture: Modular Arithmetic with Algorithmic Applications

OWO Lecture: Modular Arithmetic with Algorithmic Applications OWO Lecture: Modular Arithmetic with Algorithmic Applications Martin Otto Winter Term 2008/09 Contents 1 Basic ingredients 1 2 Modular arithmetic 2 2.1 Going in circles.......................... 2 2.2

More information

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Algorithms (II) Yu Yu. Shanghai Jiaotong University Algorithms (II) Yu Yu Shanghai Jiaotong University Chapter 1. Algorithms with Numbers Two seemingly similar problems Factoring: Given a number N, express it as a product of its prime factors. Primality:

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

Public Key Algorithms

Public Key Algorithms Public Key Algorithms Raj Jain Washington University in Saint Louis Saint Louis, MO 63130 Jain@cse.wustl.edu Audio/Video recordings of this lecture are available at: http://www.cse.wustl.edu/~jain/cse571-09/

More information

Cryptography and Number Theory

Cryptography and Number Theory Chapter 2 Cryptography and Number Theory 2.1 Cryptography and Modular Arithmetic 2.1.1 Introduction to Cryptography For thousands of years people have searched for ways to send messages in secret. For

More information

Remainders. We learned how to multiply and divide in elementary

Remainders. We learned how to multiply and divide in elementary Remainders We learned how to multiply and divide in elementary school. As adults we perform division mostly by pressing the key on a calculator. This key supplies the quotient. In numerical analysis and

More information

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6

Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6 CS 70 Discrete Mathematics and Probability Theory Fall 2018 Alistair Sinclair and Yun Song Note 6 1 Modular Arithmetic In several settings, such as error-correcting codes and cryptography, we sometimes

More information

CRYPTOGRAPHY AND NUMBER THEORY

CRYPTOGRAPHY AND NUMBER THEORY CRYPTOGRAPHY AND NUMBER THEORY XINYU SHI Abstract. In this paper, we will discuss a few examples of cryptographic systems, categorized into two different types: symmetric and asymmetric cryptography. We

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

CSE 521: Design and Analysis of Algorithms I

CSE 521: Design and Analysis of Algorithms I CSE 521: Design and Analysis of Algorithms I Randomized Algorithms: Primality Testing Paul Beame 1 Randomized Algorithms QuickSelect and Quicksort Algorithms random choices make them fast and simple but

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

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

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

CODING AND CRYPTOLOGY III CRYPTOLOGY EXERCISES. The questions with a * are extension questions, and will not be included in the assignment.

CODING AND CRYPTOLOGY III CRYPTOLOGY EXERCISES. The questions with a * are extension questions, and will not be included in the assignment. CODING AND CRYPTOLOGY III CRYPTOLOGY EXERCISES A selection of the following questions will be chosen by the lecturer to form the Cryptology Assignment. The Cryptology Assignment is due by 5pm Sunday 1

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

1 Overview and revision

1 Overview and revision MTH6128 Number Theory Notes 1 Spring 2018 1 Overview and revision In this section we will meet some of the concerns of Number Theory, and have a brief revision of some of the relevant material from Introduction

More information

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm April 11, 2010 1 Algebra We start by discussing algebraic structures and their properties. This is presented in more depth than what we

More information

4 Powers of an Element; Cyclic Groups

4 Powers of an Element; Cyclic Groups 4 Powers of an Element; Cyclic Groups Notation When considering an abstract group (G, ), we will often simplify notation as follows x y will be expressed as xy (x y) z will be expressed as xyz x (y z)

More information

CSE20: Discrete Mathematics

CSE20: Discrete Mathematics Spring 2018 Today Greatest Common Divisor (GCD) Euclid s algorithm Proof of Correctness Reading: Chapter 4.3 Primes and GCD Universe: U = N = {0, 1, 2,...} a divides b (written a b) iff k.b = ak Set of

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

9 Knapsack Cryptography

9 Knapsack Cryptography 9 Knapsack Cryptography In the past four weeks, we ve discussed public-key encryption systems that depend on various problems that we believe to be hard: prime factorization, the discrete logarithm, and

More information

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem. CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 10 The next sequence of lectures in on the topic of Arithmetic Algorithms. We shall build up to an understanding of the RSA public-key cryptosystem.

More information

Lecture 6: Introducing Complexity

Lecture 6: Introducing Complexity COMP26120: Algorithms and Imperative Programming Lecture 6: Introducing Complexity Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2015 16 You need this book: Make sure you use the up-to-date

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45 Primality Tests Strong primality tests Weak tests of compositeness Reformulation

More information

CHAPTER 6. Prime Numbers. Definition and Fundamental Results

CHAPTER 6. Prime Numbers. Definition and Fundamental Results CHAPTER 6 Prime Numbers Part VI of PJE. Definition and Fundamental Results 6.1. Definition. (PJE definition 23.1.1) An integer p is prime if p > 1 and the only positive divisors of p are 1 and p. If n

More information

Logic gates. Quantum logic gates. α β 0 1 X = 1 0. Quantum NOT gate (X gate) Classical NOT gate NOT A. Matrix form representation

Logic gates. Quantum logic gates. α β 0 1 X = 1 0. Quantum NOT gate (X gate) Classical NOT gate NOT A. Matrix form representation Quantum logic gates Logic gates Classical NOT gate Quantum NOT gate (X gate) A NOT A α 0 + β 1 X α 1 + β 0 A N O T A 0 1 1 0 Matrix form representation 0 1 X = 1 0 The only non-trivial single bit gate

More information

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively

Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively 6 Prime Numbers Part VI of PJE 6.1 Fundamental Results Definition 6.1 (p.277) A positive integer n is prime when n > 1 and the only positive divisors are 1 and n. Alternatively D (p) = { p 1 1 p}. Otherwise

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

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms CRYPTOGRAPHY 19 Cryptography 5 ElGamal cryptosystems and Discrete logarithms Definition Let G be a cyclic group of order n and let α be a generator of G For each A G there exists an uniue 0 a n 1 such

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

Introduction to Cryptography. Lecture 6

Introduction to Cryptography. Lecture 6 Introduction to Cryptography Lecture 6 Benny Pinkas page 1 Public Key Encryption page 2 Classical symmetric ciphers Alice and Bob share a private key k. System is secure as long as k is secret. Major problem:

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

8 Primes and Modular Arithmetic

8 Primes and Modular Arithmetic 8 Primes and Modular Arithmetic 8.1 Primes and Factors Over two millennia ago already, people all over the world were considering the properties of numbers. One of the simplest concepts is prime numbers.

More information

Math.3336: Discrete Mathematics. Mathematical Induction

Math.3336: Discrete Mathematics. Mathematical Induction Math.3336: Discrete Mathematics Mathematical Induction 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

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms Computer Science CSC 474 Network Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography CSC 474 Dr. Peng Ning 1 Outline GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation

More information

Lecture 4: Number theory

Lecture 4: Number theory Lecture 4: Number theory Rajat Mittal IIT Kanpur In the next few classes we will talk about the basics of number theory. Number theory studies the properties of natural numbers and is considered one of

More information

Senior Math Circles Cryptography and Number Theory Week 2

Senior Math Circles Cryptography and Number Theory Week 2 Senior Math Circles Cryptography and Number Theory Week 2 Dale Brydon Feb. 9, 2014 1 Divisibility and Inverses At the end of last time, we saw that not all numbers have inverses mod n, but some do. We

More information

Applied Cryptography and Computer Security CSE 664 Spring 2017

Applied Cryptography and Computer Security CSE 664 Spring 2017 Applied Cryptography and Computer Security Lecture 11: Introduction to Number Theory Department of Computer Science and Engineering University at Buffalo 1 Lecture Outline What we ve covered so far: symmetric

More information

Numbers, Groups and Cryptography. Gordan Savin

Numbers, Groups and Cryptography. Gordan Savin Numbers, Groups and Cryptography Gordan Savin Contents Chapter 1. Euclidean Algorithm 5 1. Euclidean Algorithm 5 2. Fundamental Theorem of Arithmetic 9 3. Uniqueness of Factorization 14 4. Efficiency

More information

Chapter 5. Number Theory. 5.1 Base b representations

Chapter 5. Number Theory. 5.1 Base b representations Chapter 5 Number Theory The material in this chapter offers a small glimpse of why a lot of facts that you ve probably nown and used for a long time are true. It also offers some exposure to generalization,

More information

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m Outline GCD and Euclid s Algorithm AIT 682: Network and Systems Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography Modulo Arithmetic Modular Exponentiation Discrete Logarithms

More information

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms AIT 682: Network and Systems Security Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography Instructor: Dr. Kun Sun Outline GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation

More information