Number Theory for Cryptography

Size: px
Start display at page:

Download "Number Theory for Cryptography"

Transcription

1 Number Theory for Cryptography 密碼學與應用 海洋大學資訊工程系 丁培毅

2 Congruence Modulo Operation: Question: What is 12 mod 9? Answer: 12 mod 9 3 or 12 3 (mod 9) 12 is congruent to 3 modulo 9 Definition: Let a, r, m (where is the set of all integers) and m 0. We write a r (mod m) if m divides a r (i.e. m a-r) m is called the modulus r is called the remainder a = q m + r 0 r < m Example: a=42 and m=9 42 = therefore 42 6 (mod 9) 2

3 Greatest tcommon Divisor i GCD of a and b is the largest positive integer dividing both a and b gcd(a, b) or (a,b) ex. gcd(6, 4) = 2,,g gcd(5, 7) = 1 Euclidean algorithm ex. gcd( , = = = = = gcd remainder divisor dividend ignore 1180) Why does it work? Let d = gcd(482, 1180) d 482 and d 1180 d 216 because 216 = d 216 and d 482 d 50 d 50 and d 216 d 16 d 16 and d 50 d d = 2 3

4 Greatest tcommon Divisor i (cont d) Euclidean Algorithm: calculating GCD gcd(1180, 482) ( 輾轉相除法 ) 4

5 Greatest tcommon Divisor i (cont d) Def: a and b are relatively prime: gcd(a, b) = 1 Theorem: Let a and b be two integers, with at least one of a, b nonzero, and let d = gcd(a,b). Then there exist integers x, y, gcd(x, y) = 1 such that a x + b y = d Constructive proof: Using Extended Euclidean Algorithm to find x and y d = 2 = = ( ) - 3 ( ) = = 1180 (-29) a x b y 216 = = =

6 Extended d Euclidean Algorithm Let gcd(a, b) = d Looking for s and t, gcd(s, t) = 1 s.t. a s + b t = d When d = 1t 1, b -1 (mod a) a = q 1 b + r 1 b = q 2 r 1 + r 2 r 1 = q 3 r 2 + r 3 r 2 = q 4 r 3 + d r 3 = q 5 d + 0 Ex = = = ( ) = = = ( ) - 4 ( ) = = = ( ) - 3 ( ) = = 2 6

7 Greatest tcommon Divisor i (cont d) The above proves only the existence of integers x and y How about gcd(x, y)? Z d = a x+b y d = gcd(a, b) 1 = a/d x + b/d y If gcd(x, y) = r then 1=a/d(x'r) r) + b/d (y'r) Note: gcd(x, y) = 1 but (x, y) is not unique i.e. 1 = r (a/dx' + b/dy') e.g. d = a x +b y = a (x-kb) + b (y+ka) which means that r 1 i.e. r = 1 gcd(x, y) = 1 7

8 Greatest tcommon Divisor i (cont d) Lemma: gcd(a,b) = gcd(x,y) = gcd(a,y) = gcd(x,b) = 1 a, b, x, y s.t. 1 = a x + b y pf:( ) following the previous theorem ( ) Given a, b, z, if x, y, gcd(x,y)=1 s.t. z = ax + by then gcd(a, b) z (also gcd(a, y) z, gcd(x, b) z) (let d = gcd(a, b) d a and d b d a x + b y d z) especially, given a, b, xyst1=ax+by x, s.t. x y gcd(a, b) 1 gcd(a, b) = 1 8

9 Operations under mod n Proposition: Let a,b,c,d,n,,,, be integers with n 0, suppose a b (mod n) and c d (mod n) then a + c b + d (mod n), a - c b - d (mod n), Proposition: a c b d(modn) Let a,b,c,n be integers with n 0 and gcd(a,n) =1. If a b a c (mod n) then b c (mod n) 9

10 Operations under mod n What is the multiplicative inverse of a (mod n)? i.e. a a -1 1 (mod n) or a a -1 = 1 + k n gcd(a, n) = 1 s and t such that a s + n t = 1 a -1 s (mod n) a x b (mod n), gcd(a, n) = 1, x? x b a -1 b s (mod n) a x b (mod n), gcd(a, n) = d 1, x? if d b (a/d) x (b/d) (mod n/d) gcd(a/d,n/d) = 1 x 0 (b/d) (a/d) -1 (mod n/d) there are d solutions to the equation a x b(modn): x 0, x 0 +(n/d),...,x 0 +(d-1)(n/d) (mod n) This expression also implies gcd(a,n)=1. Are there any solutions? 10

11 Mti Matrix inversion i under mod n A square matrix is invertible mod n if and only if its determinant and n are relatively prime ex: in real field R -1 a b 1 d -b = c d ad - bc -c a In a finite field Z (mod n)? we need to find the inverse for ad-bc (mod n) in order to calculate the inverse of the matrix -1 a c b d d -b (ad bc) -1 (mod n) -c a 11

12 Group A group G is a finite or infinite set of elements and a binary operation which together satisfy 1Closure: 1. ab G a,b a b=c G 封閉性 2. Associativity: a,b,c G (a b) c = a (b c) 結合性 3. Identity: a GG 1 a = a 1 = a 單位元素 4. Inverse: a G a a -1 = 1 = a -1 a 反元素 Abelian group 交換群 a,b G a b = b a means g g g g Cyclic group G of order m: a group defined by an element g G such that g, g 2, g 3,. g m are all distinct elements in G (thus cover all elements of G) and g m =1 1, the element g is called a generator of G. Ex: * Z n (or Z/nZ) 12

13 Group (cont d) The order of a group: the number of elements in a group G, denoted G. If the order of a group is a finite number, the group is said to be a finite group, note g G = 1 (the identity element). The order of an element g of a finite group G is the smallest power m such that g m = 1 (the identity element), denoted by ord G G(g) ex: Z n : additive group modulo n is the set {0, 1,, n-1} binary operation: + (mod n) size of Z i n is n, identity: 0 g+g+ +g 0 (mod n) inverse: -x n-x (mod n) * ex: Z n : multiplicative group modulo n is the set {i:0 i n, gcd(i,n)=1} binary operation: (mod n) size of Z* n is (n), identity: 1 g (n) 1(modn) inverse: x -1 can be found using extended Euclidean Algorithm 13

14 Ring m Definition: The ring m consists of The set m = {0, 1, 2,, m-1} Two operations + (mod m) and (mod m) for all a, b m such that they satisfy the properties on the next slide Example: m = 9 9 = {0, 1, 2, 3, 4, 5, 6, 7, 8} = 14 5 (mod 9) 6 8 = 48 3 (mod 9) 14

15 Properties of fthe ring m Consider the ring m = {0, 1,, m-1} } The additive identity 0 : a + 0 a (mod m) The additive inverse of a: -a a = m a st s.t. a+(-a) ( a) 0(modm) m) Addition is closed i.e if a, b m then a + b m Addition is commutative a+b b+a(mod m) Addition is associative (a + b) + c a + (b + c) (mod m) Multiplicative identity 1 : a 1 a (mod m) The multiplicative inverse of a exists only when gcd(a,m) = 1 and denoted as a -1 st s.t. a -1 a 1(modm) m) might or might not exist Multiplication is closed i.e. if a, b m then a b m Multiplication is commutative a b b a (mod m) Multiplication is associative (a b) c a (b c) (mod m) 15

16 Some remarks on the ring m A ring is an Abelian group under addition and a semigroup under multiplication. A semigroup is defined for a set and a binary operator in which the multiplication operation is associative. No other restrictions are placed on a semigroup; thus a semigroup need not have an identity element and its elements need not have inverses within the semigroup. 16

17 Some remarks on the ring m (cont d) Roughly speaking a ring is a mathematical ti structure t in which we can add, subtract, multiply, and even sometimes divide. id (A ring in which h every element has multiplicative li inverse is called a field.) Example: Is the division 4/15 (mod 26) possible? In fact, 4/15 mod (mod 26) Does 15-1 (mod 26) exist? It exists only if gcd(15, 26) = (mod 26) therefore, 4/15 mod mod 26 17

18 Some remarks on the group * m and m The modulo operation can be applied whenever we want under Z m (a + b) (mod m) [(a (mod m)) + ((b mod m)) ] (mod m) under Z * m (a b) (mod m) [(a (mod m)) ((b mod m)) ] (mod m) a b (mod m) (a (mod m)) b (mod m) Question? a b? (mod m) a (b mod m) (mod m) 18

19 Exponentiation in m Example: 3 8 (mod 7)? 3 8 (mod 7) 6561 (mod 7) 2 since or 3 8 (mod 7) (mod 7) (mod 7) (3 2 (mod 7)) (3 2 (mod 7)) (3 2 (mod 7)) (3 2 (mod 7)) (mod 7) 16 (mod 7) 2 The cyclic group m* and the modulo arithmetic is of central limportance to modern public-key cryptography. In practice, the order of the integers involved in PKC are in the range of [2 160, ]. Perhaps even en larger. 19

20 Exponentiation in m (cont d) How do we do the exponentiation efficiently? (mod 789) many ways to do this a. do 1234 times multiplication li and then calculate l remainder b. repeat 1234 times (multiplication by 3 and calculate remainder) c. repeated log 1234 times (square, multiply and calculate remainder) ex. first tabulate (mod 789) = ( ) ( ) (((759 39) 324) 459) (mod 789) 20

21 Exponentiation in m (cont d) calculate x y (mod m) where y = b b b 2 Method 1: b 2 b 2 b 4 b x b 2 ( x 2 ) x 1 x 2 x 1 x 0 ( ) ( ) ( ) square Method 2: b b b square 2b b x b 0 ( ) ( x ) square x 0 ) 2 x square square and multiply log y times x b 21

22 Exponentiation in m (cont d) Mthd1 Method 1: 1234 = ( ) (1+2(0+2(0+2(1+2(0+2(1+2(1+2(0+2(0+2(1)))))))))) 9 9 2(0+2(0+2(1+2(0+2(1+2(1+2(0+2(0+2(1))))))))) (0+2(1+2(0+2(1+2(1+2(0+2(0+2(1)))))))) (1+2(0+2(1+2(1+2(0+2(0+2(1))))))) (0+2(1+2(1+2(0+2(0+2(1)))))) (1+2(1+2(0+2(0+2(1))))) (1+2(0+2(0+2(1)))) (0+2(0+2(1))) 2(1))) (0+2(1)) (1) mod

23 Exponentiation in m (cont d) Mthd2 Method 2: 1234 = ( ) (1+2(0+2(0+2(1+2(0+2(1+2(1+2(0+2(0+2(1)))))))))) (3 3 2(0+2(1+2(0+2(1+2(1+2(0+2(0+2(1)))))))) ) 2 (3 (3 2(1+2( 0+2(1+2(1+2(0+2(0+2(1))))))) ) 2 ) 2 (3 ((3 3 (( 2( 0+2(1+2(1+2(0+2(0+2(1)))))) ) 2 ) 2 ) 2 (3 ((3 (3 2(1+2(1+2(0+2(0+2(1))))) ) 2 ) 2 ) 2 ) 2 (3 ((3 ((3 3 2(1+2(0+2(0+2(1)))) ) 2 ) 2 ) 2 ) 2 ) 2 (3 ((3 ((3 (3 3 2(0+2(0+2(1))) ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 (3 ((3 ((3 (3 (3 2(0+2(1)) ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 (3 ((3 ((3 (3 ((3 2(1) ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 (3 ((3 ((3 (3 (((3 1 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 ) 2 23

24 Chinese Remainder Theorem (CRT) i j {1,2, k}, gcd(r i, r j ) = 1, 0 m i r i Is there an m that satisfies simultaneously the following set of congruence equations? m m 1 (mod r 1 ) ex: m 1 (mod 3) m 2 (mod r 2 ) 2 (mod 5) 3 (mod 7) Note: gcd(3,5) = 1 m k (mod r k ) gcd(3,7) = 1 gcd(5,7) = 1 韓信點兵 : 三個一數餘一, 五個一數餘二, 七個一數餘三, 請問隊伍中至少有幾名士兵? 24

25 Chinese Remainder Theorem (CRT) first solution: n = r 1 r 2 r k z i = n / r i s i Z* ri s.t. s i z i 1 (mod r i ) (since gcd(z i, r i ) = 1) k m z i s i m i (mod n) i=1 ex: n = m 1 =1, m 2 =2, m 3 =3 r 1 =3, r 2 =5, r 3 =7 z 1 =35, z 2 =21, z 3 =15 s 1 =2, s 2 =1, s 3=1 Unique solution in Z n? m (mod 105) 25

26 Chinese Remainder Theorem (CRT) Uniqueness: 1. If there exists m' Z n ( m) also satisfies the previous k congruence relations, then i, m'-m 0 (mod r i ). 2. This is equivalent to i, m' = m + k i r i m+r j m+2r j m m+r i m+2r i m' m' = m + k lcm(r 1, r 2 r k ) = m + k n m' Z n for all k 0 contradiction! 26

27 Chinese Remainder Theorem (CRT) second solution: R i = r 1 r 2 r i-1 * t i Z ri s.t. t i R i 1 (mod r i ) (since gcd(r i, r i ) = 1) ^ m = m satisfies the first i-1 congruence relations 1 1 m^ i = m^ i-1 + R i (m i -m^ i-1 ) t i (mod R i+1 ) i 2 ^ m = m k Note that m^ i m 1 (mod r 1 ) m 2 (mod r 2 ) m i (mod r i ) m 1 =1, m 2 =2, m 3 =3 r 1 =3, r 2 =5, r 3 =7 R 2 =3, R 3 =15, R 4 =105 t 2 =2, t 3 =1 ex: m^ 1 1 m^ 2 1+3(2-1)2=7 m ^ m (3-7) (mod 105) 27

28 1 step step 2 Chinese Remainder Theorem (CRT) special case: x m (mod r 1 ) m (mod r 2 ) m n (mod r n ) x m (mod r 1 r 2 r n ) insight i of the second solution: every step satisfies one more requirement x m 1 (mod r 1 ) lt^ let m 1 = m 1 m ^ r m ^ =r r 2r 1 1 R 2 1 m 1 is the only solution for x in Z* R2 general solution of x must be m^ 1 + kr 2 for some k x m 1 (mod r 1 ) m m2 2 (mod r ^ r 2 r 1 ^ 2r 2 r 1 R 3 = r 2 r 2 ) m 2 + r 2 r 1 1 let m^ 2 m^ 1 + k * R 2 (mod R 3 ) where k * = t 2 (m 2 -m^ 1 ) and t 2 R 2 1 (mod r 2 ) m * 2 is the only solution for x in Z R3 general solution of x must be m^ 2 + k R 3 for some k 2m2+ m r2r

29 Chinese Remainder Theorem (CRT) Applications: solve x 2 1(mod35) 35 = 5 7 x* satisfies f(x*) 0 (mod 35) x* satisfies both f(x*) 0 (mod 5) and f(x*) 0 (mod 7) Proof: ( ) ( ) f(x*) = k 1 p and f(x*) = k 2 q imply that f(x*) = k lcm(p q) = k p q i.e. f(x*) 0 (mod p q) f(x*) = k p q implies that f(x*) = (k p) q = (k q) p i.e. f(x*) 0( (mod p) 0 (mod q) 29

30 Chinese Remainder Theorem (CRT) since 5 and 7 are prime, we can solve x 2 1 (mod 5) and x 2 1 (mod 7) far more easily than x 2 1 (mod 35) Why? x 2 1 (mod 5) has exactly two solutions: x 1 (mod 5) x 2 1 (mod 7) has exactly two solutions: o s: x 1 (mod 7) put them together and use CRT, there are four solutions x 1(mod5) 1(mod7) x 1(mod35) x 1 (mod 5) 6 (mod 7) x 6 (mod 35) x 4 (mod 5) 1 (mod 7) x 29 (mod 35) x 4 (mod 5) 6 (mod 7) x 34 (mod 35) 30

31 Mtlbt Matlab tools format rat format long format long matrix inverse inv(a) matrix determinant det(a) p = q d + r r = mod(p, d) or r = rem(p, d) q = floor( p / d ) g = gcd(a, b) g = a s + b t [g, s, t] = gcd(a, b) factoring factor(n) prime numbers < N primes(n) test prime isprime(p) mod exponentiation * powermod(a,b,n) find primitive root * primitiveroot(p) crt * crt([a 1 a 2 a 3...], [m 1 m 2 m 3...]) (N) * eulerphi(n) 31

32 Field Field: a set that has the operation of addition, multiplication, subtraction, and division by nonzero elements. Also, the associative, commutative, and distributive laws hold. Ex. Real numbers, complex numbers, rational numbers, integers mod a prime are fields Ex. Integers, 2 2 matrices with real entries are not fields Ex. GF(4) = {0, 1,, 2 } 0 + x = x x + x = 0 1 x=x x + 1 = 2 Addition and multiplication are commutative and associative, and the distributive law x(y+z)=xy+xz holds for all x, y, z x 3 = 1 for all nonzero elements 32

33 Gli Galois Field Fild Galois Field: A field with finite element, finite field For every power p n of a prime, there is exactly one finite field with p n elements (called GF(p n )), and these are the only finite fields. For n > 1, {integers (mod p n )} do not form a field. Ex. p x 1 (mod p n ) does not have a solution (i.e. p does not have multiplicative inverse) 33

34 How to construct ta GF(p n )? Def: Z 2 [X]: the set of polynomials whose coefficients are integers mod 2 ex. 0, 1, 1+X 3 +X 6 add/subtract/multiply/divide/euclidean Algorithm: process all coefficients i mod 2 (1+X 2 +X 4 ) + (X+X 2 ) = 1+X+X 4 (1+X+X 3 )(1+X) = 1+X 2 +X 3 +X 4 bitwise XOR X 4 +X 3 +1 = (X 2 +1)(X 2 +X+1) + X long division can be written as X 4 +X 3 +1 X (mod X 2 +X+1) 34

35 How to construct tgf(2 n )? Define Z 2 [X] (mod X 2 +X+1) to be {0, 1, X, X+1} addition, subtraction, multiplication are done mod X 2 +X+1 f(x) g(x) (mod X 2 +X+1) if f(x) and g(x) have the same remainder when divided by X 2 +X+1 or equivalently h(x) such that f(x) - g(x) = (X 2 +X+1) h(x) ex. XX = X 2 X+1 (mod X 2 +X+1) if we replace X by, we can get the same GF(4) as before the modulus polynomial X 2 +X+1 should be irreducible Irreducible: polynomial does not factor into polynomials of lower degree with mod 2 arithmetic ex. X 2 +1 is not irreducible since X 2 +1 = (X+1)(X+1) 35

36 How to construct tgf( GF(p n )? Z p [X] is the set of polynomials with coefficients mod p Choose P(X) to be any one irreducible polynomial mod p of degree n (other irreducible P(X) s would result to isomorphisms) Let GF(p n )bez[x] p mod P(X) An element tin Z p [X] mod P(X) must be of the form a 0 + a 1 X + + a n-1 X n-1 each a i are integers mod p, and have p choices, hence there are p n possible elements in GF(p n ) multiplicative inverse of any element in GF(p n ) can be found using extended Euclidean algorithm (over polynomial) 36

37 GF(2 8 ) AES (Rijndael) uses GF(2 8 ) with irreducible polynomial X 8 + X 4 + X 3 + X + 1 each element is represented as b 7 X 7 + b 6 X 6 + b 5 X 5 + b 4 X 4 + b 3 X 3 + b 2 X 2 +b 1 X + b 0 each b i is either 0 or 1 elements of GF(2 8 ) can be represented as 8-bit bytes b 7 b 6 b 5 b 4 b 3 b 2 b 1 b 0 mod 2 operations can be implemented by XOR in H/W 37

38 GF(p n ) Definition of generating polynomial g(x) is parallel to the generator in Z p : every element in GF(p n ) (except 0) can be expressed as a power of g(x) the smallest exponent k such that g(x) k 1 is p n -1 Discrete log problem in GF(p n ): given h(x), find an integer k such that h(x) g(x) k (mod P(X)) believed to be very hard in most situations 38

Solutions for the Practice Questions

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

More information

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

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

More information

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

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

More information

Discrete Math Class 4 ( )

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

More information

Number Theory/Cryptography (part 1 of CSC 282)

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

More information

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

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

More information

SOLUTIONS TO PROBLEM SET 5. Section 9.1

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

More information

ALGEBRA: Chapter I: QUESTION BANK

ALGEBRA: Chapter I: QUESTION BANK 1 ALGEBRA: Chapter I: QUESTION BANK Elements of Number Theory Congruence One mark questions: 1 Define divisibility 2 If a b then prove that a kb k Z 3 If a b b c then PT a/c 4 If a b are two non zero integers

More information

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

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

More information

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

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

More information

Data security (Cryptography) exercise book

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

More information

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

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

More information

Modular Arithmetic. claserken. July 2016

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

More information

Math 412: Number Theory Lecture 6: congruence system and

Math 412: Number Theory Lecture 6: congruence system and Math 412: Number Theory Lecture 6: congruence system and classes Gexin Yu gyu@wm.edu College of William and Mary Chinese Remainder Theorem Chinese Remainder Theorem: let m 1, m 2,..., m k be pairwise coprimes.

More information

Primitive Roots. Chapter Orders and Primitive Roots

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

More information

Distribution of Primes

Distribution of Primes Distribution of Primes Definition. For positive real numbers x, let π(x) be the number of prime numbers less than or equal to x. For example, π(1) = 0, π(10) = 4 and π(100) = 25. To use some ciphers, we

More information

Applications of Fermat s Little Theorem and Congruences

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

More information

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

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

More information

NUMBER THEORY AMIN WITNO

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

More information

SOLUTIONS FOR PROBLEM SET 4

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

More information

Modular Arithmetic. Kieran Cooney - February 18, 2016

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

More information

Carmen s Core Concepts (Math 135)

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

More information

Introduction to Modular Arithmetic

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

More information

Math 127: Equivalence Relations

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

More information

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

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

More information

Wilson s Theorem and Fermat s Theorem

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

More information

CHAPTER 2. Modular Arithmetic

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

More information

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence.

Linear Congruences. The solutions to a linear congruence ax b (mod m) are all integers x that satisfy the congruence. Section 4.4 Linear Congruences Definition: A congruence of the form ax b (mod m), where m is a positive integer, a and b are integers, and x is a variable, is called a linear congruence. The solutions

More information

Numbers (8A) Young Won Lim 5/22/17

Numbers (8A) Young Won Lim 5/22/17 Numbers (8A Copyright (c 2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

Numbers (8A) Young Won Lim 5/24/17

Numbers (8A) Young Won Lim 5/24/17 Numbers (8A Copyright (c 2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes

Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes Chapter 4 Cyclotomic Cosets, the Mattson Solomon Polynomial, Idempotents and Cyclic Codes 4.1 Introduction Much of the pioneering research on cyclic codes was carried out by Prange [5]inthe 1950s and considerably

More information

Numbers (8A) Young Won Lim 6/21/17

Numbers (8A) Young Won Lim 6/21/17 Numbers (8A Copyright (c 2017 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version

More information

ELEMENTS OF NUMBER THEORY & CONGRUENCES. Lagrange, Legendre and Gauss. Mth Mathematicst

ELEMENTS OF NUMBER THEORY & CONGRUENCES. Lagrange, Legendre and Gauss. Mth Mathematicst ELEMENTS OF NUMBER THEORY & CONGRUENCES Lagrange, Legendre and Gauss ELEMENTS OF NUMBER THEORY & CONGRUENCES 1) If a 0, b 0 Z and a/b, b/a then 1) a=b 2) a=1 3) b=1 4) a=±b Ans : is 4 known result. If

More information

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013

CMPSCI 250: Introduction to Computation. Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013 CMPSCI 250: Introduction to Computation Lecture #14: The Chinese Remainder Theorem David Mix Barrington 4 October 2013 The Chinese Remainder Theorem Infinitely Many Primes Reviewing Inverses and the Inverse

More information

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

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

More information

Cryptography, Number Theory, and RSA

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

More information

1.6 Congruence Modulo m

1.6 Congruence Modulo m 1.6 Congruence Modulo m 47 5. Let a, b 2 N and p be a prime. Prove for all natural numbers n 1, if p n (ab) and p - a, then p n b. 6. In the proof of Theorem 1.5.6 it was stated that if n is a prime number

More information

Implementation / Programming: Random Number Generation

Implementation / Programming: Random Number Generation Introduction to Modeling and Simulation Implementation / Programming: Random Number Generation OSMAN BALCI Professor Department of Computer Science Virginia Polytechnic Institute and State University (Virginia

More information

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

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

More information

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

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

More information

Foundations of Cryptography

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

More information

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

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

More information

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

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

More information

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

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

More information

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

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

More information

Final exam. Question Points Score. Total: 150

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

More information

Practice Midterm 2 Solutions

Practice Midterm 2 Solutions Practice Midterm 2 Solutions May 30, 2013 (1) We want to show that for any odd integer a coprime to 7, a 3 is congruent to 1 or 1 mod 7. In fact, we don t need the assumption that a is odd. By Fermat s

More information

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

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

More information

Algorithmic Number Theory and Cryptography (CS 303)

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

More information

Solutions for the 2nd Practice Midterm

Solutions for the 2nd Practice Midterm Solutions for the 2nd Practice Midterm 1. (a) Use the Euclidean Algorithm to find the greatest common divisor of 44 and 17. The Euclidean Algorithm yields: 44 = 2 17 + 10 17 = 1 10 + 7 10 = 1 7 + 3 7 =

More information

Fermat s little theorem. RSA.

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

More information

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography

Overview. The Big Picture... CSC 580 Cryptography and Computer Security. January 25, Math Basics for Cryptography CSC 580 Cryptography and Computer Security Math Basics for Cryptography January 25, 2018 Overview Today: Math basics (Sections 2.1-2.3) To do before Tuesday: Complete HW1 problems Read Sections 3.1, 3.2

More information

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

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

More information

The Chinese Remainder Theorem

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

More information

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

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

More information

The Chinese Remainder Theorem

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

More information

Modular Arithmetic: refresher.

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

More information

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

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

More information

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS

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

More information

Algorithmic Number Theory and Cryptography (CS 303)

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

More information

Math 3560 HW Set 6. Kara. October 17, 2013

Math 3560 HW Set 6. Kara. October 17, 2013 Math 3560 HW Set 6 Kara October 17, 013 (91) Let I be the identity matrix 1 Diagonal matrices with nonzero entries on diagonal form a group I is in the set and a 1 0 0 b 1 0 0 a 1 b 1 0 0 0 a 0 0 b 0 0

More information

Modular arithmetic Math 2320

Modular arithmetic Math 2320 Modular arithmetic Math 220 Fix an integer m 2, called the modulus. For any other integer a, we can use the division algorithm to write a = qm + r. The reduction of a modulo m is the remainder r resulting

More information

Constructions of Coverings of the Integers: Exploring an Erdős Problem

Constructions of Coverings of the Integers: Exploring an Erdős Problem Constructions of Coverings of the Integers: Exploring an Erdős Problem Kelly Bickel, Michael Firrisa, Juan Ortiz, and Kristen Pueschel August 20, 2008 Abstract In this paper, we study necessary conditions

More information

LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI

LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI LECTURE 7: POLYNOMIAL CONGRUENCES TO PRIME POWER MODULI 1. Hensel Lemma for nonsingular solutions Although there is no analogue of Lagrange s Theorem for prime power moduli, there is an algorithm for determining

More information

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees.

17. Symmetries. Thus, the example above corresponds to the matrix: We shall now look at how permutations relate to trees. 7 Symmetries 7 Permutations A permutation of a set is a reordering of its elements Another way to look at it is as a function Φ that takes as its argument a set of natural numbers of the form {, 2,, n}

More information

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

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

More information

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

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

More information

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

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

More information

MAT Modular arithmetic and number theory. Modular arithmetic

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

More information

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

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

More information

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

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

More information

6.2 Modular Arithmetic

6.2 Modular Arithmetic 6.2 Modular Arithmetic Every reader is familiar with arithmetic from the time they are three or four years old. It is the study of numbers and various ways in which we can combine them, such as through

More information

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

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

More information

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

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

More information

Solutions for the Practice Final

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

More information

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

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

More information

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION MATH CIRCLE (BEGINNERS) 02/05/2012 Modular arithmetic. Two whole numbers a and b are said to be congruent modulo n, often written a b (mod n), if they give

More information

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

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

More information

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

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

More information

Number Theory. Konkreetne Matemaatika

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

More information

Goldbach Conjecture (7 th june 1742)

Goldbach Conjecture (7 th june 1742) Goldbach Conjecture (7 th june 1742) We note P the odd prime numbers set. P = {p 1 = 3, p 2 = 5, p 3 = 7, p 4 = 11,...} n 2N\{0, 2, 4}, p P, p n/2, q P, q n/2, n = p + q We call n s Goldbach decomposition

More information

1 Introduction to Cryptology

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

More information

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

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

More information

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

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

More information

Sheet 1: Introduction to prime numbers.

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

More information

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey

ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey ON MODULI FOR WHICH THE FIBONACCI SEQUENCE CONTAINS A COMPLETE SYSTEM OF RESIDUES S. A. BURR Belt Telephone Laboratories, Inc., Whippany, New Jersey Shah [1] and Bruckner [2] have considered the problem

More information

12. Let Rm = {0,1,2,..., m 1} be a complete residue system modulo ra. Let a be an integer. When is a Rm = {0,1 a, 2 a,...

12. Let Rm = {0,1,2,..., m 1} be a complete residue system modulo ra. Let a be an integer. When is a Rm = {0,1 a, 2 a,... 12. Let Rm = {0,1,2,..., m 1} be a complete residue system modulo ra. Let a be an integer. When is a Rm = {0,1 a, 2 a,..., a (ra - 1)} a complete residue system modulo m? Prove your conjecture. (Try m

More information

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = =

1 = 3 2 = 3 ( ) = = = 33( ) 98 = = = Math 115 Discrete Math Final Exam December 13, 2000 Your name It is important that you show your work. 1. Use the Euclidean algorithm to solve the decanting problem for decanters of sizes 199 and 98. In

More information

Two congruences involving 4-cores

Two congruences involving 4-cores Two congruences involving 4-cores ABSTRACT. The goal of this paper is to prove two new congruences involving 4- cores using elementary techniques; namely, if a 4 (n) denotes the number of 4-cores of n,

More information

DUBLIN CITY UNIVERSITY

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

More information

Permutation Groups. Every permutation can be written as a product of disjoint cycles. This factorization is unique up to the order of the factors.

Permutation Groups. Every permutation can be written as a product of disjoint cycles. This factorization is unique up to the order of the factors. Permutation Groups 5-9-2013 A permutation of a set X is a bijective function σ : X X The set of permutations S X of a set X forms a group under function composition The group of permutations of {1,2,,n}

More information

Power = 36² mod 99 Power = 9 5 a 5 = 0 x = 81 Power = 9² mod 99 Power = 81 6 a 6 = 1 x = 81 x 81 mod 99 x = 27 7 a 7 = 1 x = 27 x 27 mod 99 x = 36

Power = 36² mod 99 Power = 9 5 a 5 = 0 x = 81 Power = 9² mod 99 Power = 81 6 a 6 = 1 x = 81 x 81 mod 99 x = 27 7 a 7 = 1 x = 27 x 27 mod 99 x = 36 Question 1 Section 4.1 11. What time does a 12-hour clock read a) 80 hours after it reads 11:00? b) 40 hours before it reads 12:00? c) 100 hours after it reads 6:00? I don't really understand this question

More information

The Chinese Remainder Theorem

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

More information

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

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

More information

Solution: This is sampling without repetition and order matters. Therefore

Solution: This is sampling without repetition and order matters. Therefore June 27, 2001 Your name It is important that you show your work. The total value of this test is 220 points. 1. (10 points) Use the Euclidean algorithm to solve the decanting problem for decanters of sizes

More information

SESAME Modular Arithmetic. MurphyKate Montee. March 2018 IN,Z, We think numbers should satisfy certain rules, which we call axioms:

SESAME Modular Arithmetic. MurphyKate Montee. March 2018 IN,Z, We think numbers should satisfy certain rules, which we call axioms: SESAME Modular Arithmetic MurphyKate Montee March 08 What is a Number? Examples of Number Systems: We think numbers should satisfy certain rules which we call axioms: Commutivity Associativity 3 Existence

More information

CS70: Lecture 8. Outline.

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

More information

ON MULTIPLICATIVE SEMIGROUPS OF RESIDUE CLASSES

ON MULTIPLICATIVE SEMIGROUPS OF RESIDUE CLASSES ON MULTIPLICATIVE SEMIGROUPS OF RESIDUE CLASSES E. T. PARKER1 The set of residue classes, modulo any positive integer, is commutative and associative under the operation of multiplication. The author made

More information

L29&30 - RSA Cryptography

L29&30 - RSA Cryptography L29&30 - RSA Cryptography CSci/Math 2112 20&22 July 2015 1 / 13 Notation We write a mod n for the integer b such that 0 b < n and a b (mod n). 2 / 13 Calculating Large Powers Modulo n Example 1 What is

More information

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS

LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS LUCAS-SIERPIŃSKI AND LUCAS-RIESEL NUMBERS DANIEL BACZKOWSKI, OLAOLU FASORANTI, AND CARRIE E. FINCH Abstract. In this paper, we show that there are infinitely many Sierpiński numbers in the sequence of

More information