Number Theory and Public Key Cryptography Kathryn Sommers

Similar documents
Public Key Encryption

Data security (Cryptography) exercise book

Cryptography Lecture 1: Remainders and Modular Arithmetic Spring 2014 Morgan Schreffler Office: POT 902

EE 418: Network Security and Cryptography

Mathematics Explorers Club Fall 2012 Number Theory and Cryptography

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

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

Diffie-Hellman key-exchange protocol

The number theory behind cryptography

Discrete Mathematics & Mathematical Reasoning Multiplicative Inverses and Some Cryptography

Primitive Roots. Chapter Orders and Primitive Roots

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

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

Math 319 Problem Set #7 Solution 18 April 2002

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

Application: Public Key Cryptography. Public Key Cryptography

CHAPTER 2. Modular Arithmetic

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

Solutions for the Practice Final

Fermat s little theorem. RSA.

1 Introduction to Cryptology

MA 111, Topic 2: Cryptography

SOLUTIONS TO PROBLEM SET 5. Section 9.1

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

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

Public Key Cryptography

DUBLIN CITY UNIVERSITY

Degree project NUMBER OF PERIODIC POINTS OF CONGRUENTIAL MONOMIAL DYNAMICAL SYSTEMS

Number Theory and Security in the Digital Age

Grade 7 & 8 Math Circles October 12, 2011 Modular Arithmetic

Multiples and Divisibility

Applications of Fermat s Little Theorem and Congruences

The Chinese Remainder Theorem

Cryptography, Number Theory, and RSA

Algorithmic Number Theory and Cryptography (CS 303)

Sheet 1: Introduction to prime numbers.

Distribution of Primes

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

NUMBER THEORY AMIN WITNO

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

Implementation / Programming: Random Number Generation

DUBLIN CITY UNIVERSITY

Multiple : The product of a given whole number and another whole number. For example, some multiples of 3 are 3, 6, 9, and 12.

Solution: Alice tosses a coin and conveys the result to Bob. Problem: Alice can choose any result.

Section 1.6 Factors. To successfully complete this section,

Final exam. Question Points Score. Total: 150

Solutions for the Practice Questions

Wilson s Theorem and Fermat s Theorem

L29&30 - RSA Cryptography

Introduction to Modular Arithmetic

EE 418 Network Security and Cryptography Lecture #3

Foundations of Cryptography

MAT199: Math Alive Cryptography Part 2

Public-key Cryptography: Theory and Practice

Modular Arithmetic. Kieran Cooney - February 18, 2016

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

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.

Quantitative Aptitude Preparation Numbers. Prepared by: MS. RUPAL PATEL Assistant Professor CMPICA, CHARUSAT

Math 1111 Math Exam Study Guide

MATH 135 Algebra, Solutions to Assignment 7

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

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

Math 1111 Math Exam Study Guide

ElGamal Public-Key Encryption and Signature

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

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

Introduction to Cryptography CS 355

Class 8: Factors and Multiples (Lecture Notes)

Modular arithmetic Math 2320

CMath 55 PROFESSOR KENNETH A. RIBET. Final Examination May 11, :30AM 2:30PM, 100 Lewis Hall

1.6 Congruence Modulo m

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

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

Number Theory/Cryptography (part 1 of CSC 282)

MATH LEVEL 2 LESSON PLAN 3 FACTORING Copyright Vinay Agarwala, Checked: 1/19/18

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

The Chinese Remainder Theorem

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

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

In this paper, we discuss strings of 3 s and 7 s, hereby dubbed dreibens. As a first step

The Chinese Remainder Theorem

Fall. Spring. Possible Summer Topics

Teacher s Notes. Problem of the Month: Courtney s Collection

Number Theory. Konkreetne Matemaatika

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

MODULAR ARITHMETIC II: CONGRUENCES AND DIVISION

Drill Time: Remainders from Long Division

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

Successful Implementation of the Hill and Magic Square Ciphers: A New Direction

Related Ideas: DHM Key Mechanics

Chapter 3 LEAST SIGNIFICANT BIT STEGANOGRAPHY TECHNIQUE FOR HIDING COMPRESSED ENCRYPTED DATA USING VARIOUS FILE FORMATS

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

TMA4155 Cryptography, Intro

Journal of Discrete Mathematical Sciences & Cryptography Vol. ( ), No., pp. 1 10

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

#27: Number Theory, Part II: Modular Arithmetic and Cryptography May 1, 2009

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

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

Math 412: Number Theory Lecture 6: congruence system and

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

Transcription:

Page!1 Math 409H Fall 2016 Texas A&M University Professor: David Larson Introduction Number Theory and Public Key Cryptography Kathryn Sommers Number theory is a very broad and encompassing subject. At its base, number theory is the study of integers, focusing mainly on the positive integers, also referred to as natural numbers, and the mathematical relationships between these numbers ( What ). Number theory includes many subjects, such as prime numbers and congruences. Many of the concepts and mathematical relationships of number theory are crucial elements to many methods of cryptography. Cryptography is the process of using ciphers or codes, often composed of algorithms, for encryption and decryption. Encryption is using ciphers to make information unreadable while decryption is using ciphers to make information readable again. One method of cryptography that is deeply rooted in number theory is Public Key Cryptography. Public Key Cryptography is a special type of cryptography where the encryption cipher is known to the public, but the cipher needed to decrypt the information is either impossible or nearly impossible to find (Manfredi). There are many types of Public Key Cryptography such as the RSA Public Key Cryptographic System and the Diffie-Hellman Public Key Cryptographic System both methods heavily rely on multiple areas of number theory.

Page!2 Number Theory As explained in the introduction, number theory is the study of integers and the relationships between these integers. Specifically, number theory deals with the set of natural numbers 1, 2, 3, 4, 5, 6, 7, 8, which are the positive integers. Since number theory focuses on the relationships between these numbers, this set of numbers is often broken down into smaller sets of numbers based on a common mathematical relationship between the numbers of the new set. We will take a look at types of numbers, congruences, and then primitive roots. Types of Numbers Each natural number can be categorized into one of three types: prime numbers, composite numbers, and unity. A prime number is a positive integer that has only two distinct divisors, namely 1 and the integer itself. Using this definition, one can find the set of prime numbers: 2, 3, 5, 7, 11, 13, 17,. Prime numbers play a key role in multiple areas of study within number theory. A composite number is a positive integer that has more than two distinct divisors. Using this definition, one can find the set of composite numbers: 4, 6, 8, 9, 10, 12, 14,. The last category of number is unity. 1 is the only number that can be categorized as unity since it is neither a prime number nor a composite number. Congruences Congruences refer to the congruential relationship between integers. Specifically, congruences refer to the remainders that result from dividing a number by an integer referred to as a modulus (Hershey). We will take a look at the basic written notation for congruences,

Page!3 a b (mod m) (Notation 1) where a is an integer, m is the modulus used to divide the integer, and b is the remainder. Here is an example of how congruences work and how to correctly write the notation. Let a = 11 and m = 2. Next, divide 11 by 2. This results in the remainder, b, equal to 1. Therefore the notation for this example is 11 1 (mod 2). With similar notation, further integers and mathematical processes can be implemented. It is important to note that there can be a different notation for instances when the number being divided is raised to a power. In these cases the rule might be written as an equation so the notation might look like this, b = (a)^d (mod m) (Equation 2) where d is the power to which the integer a has been raised, m is the modulus that will divide (a)^d with b as the remainder. For further examples and explanations of congruences, see the Exercises section. Primitive Roots Primitive roots can be used to greatly increase the ease of solving congruences where a is raised to a large integer d (See Equation 2). In this type of congruence, the primitive root of d would be the smallest factor of d, we will call it r, that if a was raised to the r power, the remainder b would stay the same. This means that b = (a)^d (mod m) and b = (a)^r (mod m) (Equation 3) are equal to each other with the exact same remainder.

Page!4 Public Key Cryptography Public key cryptography derives its name from the fact that part of the cipher used to encrypt information is known to the public. As previously stated, even though the encryption key is known to the public, the information is still very hard to decrypt, unless the decryption key is already known, since the decryption key is nearly or completely impossible to find when one only knows the encryption key (Gunnells). Within public key cryptography, there are many methods of encryption, each relying heavily on number theory. The Diffie-Hellman Public Key Cryptographic System This type of public key cryptography relies on the use of multiple parts of number theory including prime numbers, primitive roots, and congruences. This method is designed for two groups to contribute numbers to the public key. Publicly, both groups decide on a prime number, m, and a primitive root, a, of that prime number to use in their key. Privately, each of the groups choose an integer between 1 and m to use as an exponent for a. For Group 1, we will call their chosen integer A and we will call Group 2 s integer B. To encrypt information, Group 1 computes the remainder, x, using x = (a)^a (mod m) (Equation 4) and sends the resulting integer for x to Group 2. Similarly, Group 2 computers their remainder, y, using y = (a)^b (mod m) (Equation 5)

Page!5 and sends their result for y to Group 1. In order to decrypt the received integer, each group then takes the new integer that they have received and raises it to their original chosen integer and the reduces the result using (mod m). Hence, Group 1 would want to compute X, their decrypted integer, using X = (y)^a (mod m) (Equation 6) and Group 2 would want to compute Y, their decrypted integer, using Y = (x)^b (mod m). (Equation 7) This completes the encryption and decryption process for the Diffie-Hellman Public Key Cryptographic System. For further explanation and an example, see the Exercises section. The RSA Public Key Cryptographic System RSA Public Key Cryptographic System relies heavily on prime numbers and their unique characteristics. Specifically, RSA Public Key Cryptography utilizes the fact that multiplying together two large prime numbers results in an integer that is often extremely hard to factor (Welsh). For RSA Public Key Encryption, we utilize a version of Equation 2, C = (M)^e (mod n) (Equation 8) where M represents the information to be encrypted, e represents an integer chosen by the sender as part of the public key, n represents the other part of the public key, which is made up of two large prime numbers multiplied together, called p and q, and C represents the encrypted information. A similar equation is used to decrypt, D = (C)^d (mod n) (Equation 9)

Page!6 where C is the encrypted information, n is the same public key used to encrypt, d is the private key, and D is the decrypted message. Similarly, another equation can be used to decrypt a message. This alternate equation is as follows, ed 1 (mod (p-1)(q-1)) (Equation 10) where e is again part of the public key, d is the private key, 1 is the remainder, and p and q are the large prime numbers used to find n when encrypting the message. For further explanation and examples, see the Exercises section. Conclusion It is now clear to see that Public Key Cryptography relies heavily on many aspects of number theory. Since number theory is such an expansive subject, the cryptographic systems that can be derived from the concepts and relationships of number theory are great in number. In a world that is constantly looking for new ways to protect information for unwanted readers, public key cryptography and its underlying number theory are an important and growing field.

Page!7 Exercises 1. Does 3X 7 (mod 12) have a solution? (Hershey) Proof: By definition of notation for congruences, the modulus is 12, the integer that will be divided is 3X, and 7 is the remainder. Therefore, in order for 7 to be the remainder, X must be an integer that when multiplied by 3 and divided by 12 would leave a remainder of 7. However, since 12 is a composite number and can be factored into (3 x 4), (3X)/12 is equal to (3X)/(3 x 4). Cancelling out the 3 s, we get X/4, rendering it impossible to find an integer X such that the remainder is 7. Therefore, 3X 7 (mod 12) does not have a solution. 2. Does 6X 3 (mod 15) have a solution? (Hershey) Proof: By definition of notation for congruences, the modulus is 15, the integer that will be divided is 6X, and the remainder is 3. Therefore, for 3 to be the remainder, X must be an integer that when multiplied by 6 and then divided by 15 would leave a remainder of 7. Therefore, X=8 would be a solution since (6 x 8)/15 leaves a remainder of 3. Therefore 6X 3 (mod 15) has a solution. 3. What is (47)^1395 (mod 48)? (Hershey) Solution: Using known laws of exponents and primitive roots, (47)^1395 = (47)^1392 x (47)^3. Therefore, (47)^1395 (mod 48) = ((47)^1392 x (47)^3) (mod 48). Solving for the remainder, we find it to be 47. Hence, (47)^1395 47 (mod 48).

Page!8 4. What is (4)^3207 (mod 1024)? (Hershey) Solution: Using known laws of exponents and primitive roots, (4)^3207 = (4)^3202 x (4)^5. Therefore, (4)^3207 (mod 1024) = ((4)^3202 x (4)^5) (mod 1024). However, it is clear that (4)^5 0 (mod 1024). Therefore, the remainder will be 0 since multiplying anything by 0 is 0. Hence, (4)^3207 0 (mod 1024). 5. What is (2)^57 (mod 123)? (Hershey) Solution: Using known laws of exponents and primitive roots, (2)^57 = (2)^14 x (2)^42 x (2)^1. Therefore, (2)^57 (mod 123) = ((2)^14 x (2)^42 x (2)^1) (mod 123). Using the fact that both (2)^14 and (2)^42 are (2)^7 raised to a power, we will first find (2)^7 (mod 123). It is clear that (2)^7 = 5 (mod 123). Hence, (2)^57 (mod 123) = ((((2)^7)^2) x (((2)^7)^6) x ((2)^1)) (mod 123) = (((5)^2) x ((5)^6) x (2)) (mod 123) = 781250 (mod 123) = 77 Therefore, the remainder is 77 and (2)^57 77 (mod 123).

Page!9 6. Parties A and B decide upon the prime p = 101 and the primitive root a = 3. Suppose that Party A picks A = 70 and Party B picks B = 87. What quantity is developed in common by Parties A and B? (Hershey) Solution: Using the Diffie-Hellman Public Key Cryptographic System, we will first compute what Party A sends using Equation 4. Using the given values, x = (3)^70 (mod 101). Solving, we find x = 17. Next, we will compute what Party B sends using Equation 5. Again using given values, y = (3)^87 (mod 101). Solving, we find y = 8. It is clear that x does not equal y so we will now decrypt the messages. Now, using Equation 6 and the given values to find Party A s decrypted message, we get X = (8)^70 (mod 101) and we find X = 14. Next, using Equation 7 and the given values we find Party B s decrypted message. We find Y = (17)^87 (mod 101). Solving, we find that Y = 14. Clearly, X = Y so the quantity developed in common by Parties A and B is the decrypted messages by both parties, which shows that the use of the Diffie-Hellman Public Key Cryptographic System was successful.

Page!10 7. In a public-key cryptosystem using the RSA method, you intercept the cryptogram C = 10 sent to a receiver whose public key is e = 5 and n = 35. Find the integer M which was sent. (Welsh) Solution: Using the RSA Public Key Cryptographic System, we will start by applying the given values to Equation 8. Then, 10 = (M)^5 (mod 35). Therefore, 10 is the remainder when (M)^5 is divided by 35. Solving for M, we find M = 5. Hence, the initial integer that was sent was 5. 8. In an RSA system the public key of a given user is e = 31 and n = 3599. What is the private key of the user? (Welsh) Solution: Using the RSA Public Key Cryptographic System, we will want to use Equation 10. However, all the parts needed for equation 10 have not been given to us; specifically, we are missing p and q. Since we were given n = 3599 and we know that p and q are prime numbers due to the fact that RSA Encryption was used we must find a p and q such that pq = 3599. Solving, p and q are found to equal 59 and 61. Now we have all the parts needed to use Equation 10. Using Equation 10 we get, 31d 1 (mod (59-1)(61-1)) 31d 1 (mod 3480) Solving for d, we find d = 3031. Therefore the private key of the user is 3031. This example shows us why the RSA method is usually done with extremely large prime

Page!11 numbers, because in this example, I could easily find the primes used through a few attempts of multiplying prime numbers since the n was relatively small. For n much larger than this one, attempting to find n by multiplying prime numbers would take an extremely long time and could even be impossible.

Page!12 References [1] Gunnells, Paul E.. The mathematics of cryptology. Department of Mathematics and Statistics, University of Massachusetts, Amherst, 2004. Web. 12 October 2015. http:// people.math.umass.edu/~gunnells/talks/crypt.pdf [2] Hershey, John E.. Cryptography Demystified. The McGraw-Hill Companies, Inc., 2003. Print. [3] Manfredi, Michael. Modern Cryptography and Mathematics. The University of Warwick. Web. 11 October 2015. <http://www.furthermaths.org.uk/files/encryption.pdf> [4] Sommers, Kathryn. The Mathematics of Cryptography. 2015. Print. [5] Welsh, Dominic. Codes and Cryptography. Oxford University Press, New York, 1988. Print. [6] What is Number Theory? Brown University. Web. 08 December 2016. <https:// www.math.brown.edu/~jhs/frintch1ch6.pdf>