MATHEMATICS EXTENDED ESSAY

Similar documents
Public Key Cryptography

CIS 551 / TCOM 401 Computer and Network Security

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

Encryption: The RSA Public Key Cipher

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

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

CS March 17, 2009

Integers and Division

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

10 Modular Arithmetic and Cryptography

Number Theory. Modular Arithmetic

CRYPTOGRAPHY AND NUMBER THEORY

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

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

Mathematics of Cryptography

Public Key Algorithms

Math.3336: Discrete Mathematics. Mathematical Induction

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

An Introduction to Cryptography

NUMBER THEORY FOR CRYPTOGRAPHY

ICS141: Discrete Mathematics for Computer Science I

Discrete mathematics I - Number theory

RSA. Ramki Thurimella

Number Theory A focused introduction

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

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

Number Theory & Modern Cryptography

Powers in Modular Arithmetic, and RSA Public Key Cryptography

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

The RSA cryptosystem and primality tests

Discrete Mathematics GCD, LCM, RSA Algorithm

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

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

Basic elements of number theory

Basic elements of number theory

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

Lecture Notes, Week 6

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

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics

Mathematics of Public Key Cryptography

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

Week 7 An Application to Cryptography

OWO Lecture: Modular Arithmetic with Algorithmic Applications

Simple Math: Cryptography

CPSC 467b: Cryptography and Computer Security

Number Theory and Group Theoryfor Public-Key Cryptography

CRYPTOGRAPHY AND LARGE PRIMES *

Topics in Cryptography. Lecture 5: Basic Number Theory

THE RSA CRYPTOSYSTEM

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

CPSC 467b: Cryptography and Computer Security

Ti Secured communications

10 Public Key Cryptography : RSA

Chapter 4 Asymmetric Cryptography

Asymmetric Cryptography

Number theory (Chapter 4)

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

A Few Facts from Number Theory and the RSA Cryptosystem OVERVIEW. RSA Producing Big Primes. Table of Contents. Overview Basic Facts of Number Theory

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

Congruence of Integers

Lecture 1: Introduction to Public key cryptography

Cryptography. pieces from work by Gordon Royle

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Ma/CS 6a Class 3: The RSA Algorithm

RSA ENCRYPTION USING THREE MERSENNE PRIMES

Implementation of the RSA algorithm and its cryptanalysis. Abstract. Introduction

Mathematical Foundations of Public-Key Cryptography

Public Key 9/17/2018. Symmetric Cryptography Review. Symmetric Cryptography: Shortcomings (1) Symmetric Cryptography: Analogy

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

Chapter 8 Public-key Cryptography and Digital Signatures

RSA RSA public key cryptosystem

Public-Key Cryptosystems CHAPTER 4

The RSA Cipher and its Algorithmic Foundations

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

Homework 4 for Modular Arithmetic: The RSA Cipher

8.1 Principles of Public-Key Cryptosystems

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography

Introduction to Modern Cryptography. Benny Chor

Public-key Cryptography and elliptic curves

CPSC 467: Cryptography and Computer Security

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

THE CUBIC PUBLIC-KEY TRANSFORMATION*

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

Asymmetric Encryption

NET 311D INFORMATION SECURITY

Jong C. Park Computer Science Division, KAIST

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

Public Key Cryptography. All secret key algorithms & hash algorithms do the same thing but public key algorithms look very different from each other.

MODULAR ARITHMETIC KEITH CONRAD

Innovation and Cryptoventures. Cryptography 101. Campbell R. Harvey. Duke University, NBER and Investment Strategy Advisor, Man Group, plc

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

Great Theoretical Ideas in Computer Science

Applied Cryptography and Computer Security CSE 664 Spring 2018

Attacks on RSA & Using Asymmetric Crypto

19. Coding for Secrecy

Cryptography IV: Asymmetric Ciphers

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

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

Introduction to Public-Key Cryptosystems:

Transcription:

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

ABSTRACT The research question that this extended essay in mathematics address is How does the RSA algorithm function and why is it used in modern communication? I have first started the essay with an introduction to RSA, public and private key cryptography, number theory, and Modular mathematics. I have investigated the RSA algorithm by taking 3 examples with increasingly large values of prime numbers. Using these numbers, I have demonstrated how the algorithm works. Then using modular mathematics and results from number theory, I have formulated a proof that demonstrates that the RSA algorithm works because of a significant relationship d ( m m ( mod n) = e ) between the public ( e ) and private keys ( d ) and the modulus number ( n ). Furthermore, I have investigated the reasons for the use and effectiveness of this algorithm which I have explained by making use of the concepts of computational hardness and non polynomial time. It was concluded that the RSA algorithm functions effectively due to the relationship between the public key, private key, and modulus number and the fact that decryption requires the private key that can be obtained by factorizing the modulus which is a non polynomial time computation. The relationship between RSA and number theory concepts was also emphasized and it also concluded that the effectiveness of the algorithm would continue to increase with an increase in the value of massive primes and semi prime numbers used to generate the modulus number. Its inherent security and availability of a public key it was concluded were vital reasons because of which RSA is used in modern communication. Word count: 263 2 P a g e

TABLE OF CONTENTS INTRODUCTION... 5 SYMMETRIC KEY ENCRYPTION:... 6 ASYMMETRIC KEY ENCRYPTION:... 6 NOTATIONS... 7 MATHEMATICAL CONCEPTS AND PRINCIPALS ESSENTIAL TO RSA:... 8 PRIME NUMBER... 8 SEMI PRIME NUMBER... 9 ALGORITHM... 9 COMPUTATION... Error! Bookmark not defined. MODULAR MATHEMATICS... 10 MODULAR CONGRUENCE... 11 MODULAR MULTIPLICATIVE INVERSE... 11 FERMAT S LITTLE THEOREM... 12 TOTIENT FUNCTION... 13 CHINESE REMAINDER THEOREM... 13 EULER S TOTIENT THEOREM... 14 BIG O NOTATION... 14 POLYNOMIAL TIME... 15 NON POLYNOMIAL TIME... 15 INVESTIGATIONS... 16 EXAMPLE 1... 16 MATHEMATICAL EXPLANATION OF THE FIRST EXAMPLE... 19 3 P a g e

EXAMPLE 2:... 24 EXAMPLE 3... 30 FINAL NUMBER THEORY PROOF FOR THE FUNCTIONING OF RSA... 36 INITIATING THE PROOF... 38 CASE 1... 40 CASE 2:... 41 EFFECTIVENESS OF THE RSA ALGORITHM... 43 INFORMATION THEORETIC SECURITY... 43 COMPUTATIONAL SECURITY... 43 THE RSA PROBLEM... 43 USE OF RSA IN MODERN COMMUNICATION... 44 CONCLUSION... 45 FURTHER INVESTIGATION:... 46 BIBLIOGRAPHY... 47 4 P a g e

INTRODUCTION Neglect of mathematics works injury to all knowledge, since he who is ignorant of it cannot know the other sciences or the things of the world. ~Quoted by Roger Bacon in C B Boyer, A History of Mathematics (New York 1968) Mathematics is required in every subject and field. In the world of cryptography and computer security, number theory has been instrumental in providing solutions. The entirety of the encryption systems used for transactions and security over the internet is based on the mathematics of prime numbers and factorization. This extended essay explores the working of the first public key algorithm, the RSA algorithm, and further explores the cause of effectiveness of the RSA algorithm. As such the research question that this extended essay addresses is: How does the RSA algorithm function and why is it used in modern communication? In doing so, many mathematical concepts and theorem are explored and their relationship to the functioning of RSA is investigated. I chose to investigate the RSA algorithm because of my interests in the fields of number theory, complexity theory, and computer security. In writing this extended essay, I have had an opportunity to explore number theory and modular arithmetic outside of the prescribed I.B syllabus and apply this new found knowledge to explain RSA. 5 P a g e

The type of encryption that preceded the RSA algorithm was symmetric key encryption. SYMMETRIC KEY ENCRYPTION: Symmetric key encryption refers to encryption that is achieved using only one key that is used to encrypt and decrypt information. This type of encryption was difficult and impractical to use due to the difficulty involved in the transferring of keys. Since only one key is required for both encryption and decryption, the transfer of the key if intercepted by an adversary could compromise the security of the information. The conception of the RSA algorithm gave rise to asymmetric key encryption. ASYMMETRIC KEY ENCRYPTION: Asymmetric key encryption or public key encryption is encryption achieved using two different keys for the processes of encryption and decryption. The first algorithm to introduce this type of encryption is the RSA algorithm. The use of asymmetric key encryption is favoured over that of symmetric key encryption because of the transfer of the public key eliminates any risk involving the security of data. The RSA algorithm, named after its inventors Ron Rivest, Adi Shamir, and Leonard Adleman, is a public key cryptography algorithm. It is known to be very secure because of the presumed difficulty of factoring very large semi prime numbers. It was the first asymmetric key encryption algorithm of its kind. The functioning of the RSA algorithm is based on results from a branch of pure mathematics known as number theory. 6 P a g e

NOTATIONS a b : a divides b a b : a does not divide b a b(mod c) : a is congruent to b modulo c ( ) ab c a b 1 1 mod, = : a is the modular multiplicative inverse of b modulo c gcd( a, b ) : the greatest common divisor of a and b 7 P a g e

MATHEMATICAL CONCEPTS AND PRINCIPALS ESSENTIAL TO RSA: PRIME NUMBER: A prime number is a number that has no factors than the number 1 and itself. Prime numbers are unique and any pattern confirming their emergence is not known. Prime numbers are known to be infinite. This can be demonstrated using a simple Euclidean proof 1 : If a list of prime numbers p, p1, p2, p3, p4, p5,... p n is taken, it is possible to show that no matter how large the list, an additional prime number p k which does not appear on the list is has to exist. Let a number P be the product of all the prime numbers in the list: P = p p p... 2 p3 p4 p5 pn Let some number q = P + 1. Then, q is either prime or not: Now, if q is a prime number, it follows that there is one extra prime number apart from those listed as p, p1, p2, p3, p4, p5,... p n 1 S. P. Glasby Central Washington University http://www.cwu.edu/_glasbys/ February 2002 8 P a g e

On the other hand, it is possible that q is not a prime number. If that is the case then no prime number on the list p, p1, p2, p3, p4, p5,... pn will be able to divide q. This is because q = P + 1 and the division of q by any of the prime numbers will result in a remainder of 1 since no number divides 1. A prime number that is not on the list will therefore divide q. It thus follows that for any given list of primes, there is always a prime that is not present on the list. The logical conclusion is that the number of prime numbers are infinite. SEMI PRIME NUMBER: A semi prime number is a number that has two prime numbers as its factors other than 1 and the number itself. For example, 6 is a semi prime number since it is the product of the two prime numbers 2 and 3. Semi prime numbers are essential to cryptosystems such as RSA. The modulus n used in RSA is always a semi prime number. ALGORITHM 2 : An algorithm is a specific set of instructions for carrying out a procedure or solving a problem, usually with the requirement that the procedure terminate at some point. Specific algorithms sometimes also go by the name method, procedure, or technique. The word "algorithm" is a distortion of al-khwārizmī, a Persian mathematician who wrote an influential treatise about algebraic methods. 2 Weisstein, Eric W. "Algorithm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/algorithm.html 9 P a g e

MODULAR MATHEMATICS 3 : Modular mathematics or arithmetic focuses upon modular congruence. Numbers tend to wrap around the modulus number and start over when modular arithmetic is considered. For example, consider the equation 15 0 (mod 3). This means that 15 will continure to wrap around 3. For instance 4 will become 1, 5 will become 2, 6 will become 0, and so on until 15. A consequence is also that the remainder obtained when 15 is divided by 3 is equal to 0. Modular arithmetic is used to tell time by converting from the 24 hour format to the twelve hour format. 3 Insall, Matt and Weisstein, Eric W. "Modular Arithmetic." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/modulararithmetic.html 10 P a g e

MODULAR CONGRUENCE: If two numbers a and b have a difference a-b that is divisible by an integer m such that a b m is a whole number, then the two numbers are said to be congruent to modulo m. This written mathematically as: a b ( mod m) MODULAR MULTIPLICATIVE INVERSE 4 : The modular multiplicative inverse of a number a( mod ) m is an integer x such that ax ( m) 1 mod The modular multiplicative inverse can only exist if the numbers a and m are co-prime. This is simply because if a was divisible by m, then, ax m would leave a remainder of zero. This would contradict the relation ax 1 ( mod m) since ax m needs to leave a remainder of 1. 4 Hobson, Nick; Nichol, Reid; and Weisstein, Eric W. "Modular Inverse." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/modularinverse.html 11 P a g e

FERMAT S LITTLE THEOREM 5 : If p is a prime number and a a natural number, then p a a(mod p) (1) Furthermore, if p does not divide a, then there exists some smallest exponent d such that d a ( p) 1 0 mod (2) and d divides p 1. Hence, ( p) p 1 a 1 0 mod (3) The theorem is sometimes also simply known as "Fermat's theorem" 5 Weisstein, Eric W. "Fermat's Little Theorem." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/fermatslittletheorem.html 12 P a g e

TOTIENT FUNCTION 6 : The totient function θ ( n), also called Euler's totient function, is defined as the number of positive integers n that are relatively prime to (i.e., do not contain any factor in common with) n, where 1 is counted as being relatively prime to all numbers. Since a number less than or equal to and relatively prime to a given number is called a totative, the totient function θ ( n) can be simply defined as the number of totatives of n. Example: the number 15 has the following totatives, 1, 2, 4, 6, 7, 8, 9, 10, 11, 12, 13, 14. These are 12 numbers in total. Therefore, θ (15) = 12 In case of a prime number p, the totient function θ ( p) = p 1. This is because all numbers less than a prime number p are relatively co-prime to p. CHINESE REMAINDER THEOREM 7 : A simplification of the Chinese remainder theorem states that for any two relatively prime numbers p and q and any two integers a and b, There exists a number x such that, x a(mod p) x b(mod q) 6 Weisstein, Eric W. "Totient Function." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/totientfunction.html 7 Weisstein, Eric W. "Chinese Remainder Theorem." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/chineseremaindertheorem.html 13 P a g e

EULER S TOTIENT THEOREM 8 : Euler s totient theorem is a result that was asserted by Leonard Euler as a generalization of Fermat s little theorem using the totient function. It states: a θ ( n) 1(mod n) Where, θ ( n) is the totient function of n and a is any number that is relatively prime to n. This generalization can be made by manipulating the result of Fermat s little theorem: a p 1 ( p) 1 0 mod Let p be a prime number. Then, its totient function, θ ( p), is p 1since all numbers less than a prime number are co-prime to it. Now, a θ ( p) a 1 0(mod p) θ ( p) 1(mod p) BIG O NOTATION 9 : (with a capital letter O, not a zero), also called Landau's symbol, is a symbolism used in complexity theory, computer science, and mathematics to describe the asymptotic behaviour of functions. Basically, it tells you how fast a function grows or declines. 8 Weisstein, Eric W. "Euler's Totient Theorem." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/eulerstotienttheorem.html 9 http://web.mit.edu/16.070/www/lecture/big_o.pdf 14 P a g e

Landau's symbol comes from the name of the German number theoretician Edmund Landau who invented the notation. The letter O is used because the rate of growth of a function is also called its order. POLYNOMIAL TIME 10 : An algorithm is said to be solvable in polynomial time if the number of steps required to k complete the algorithm for a given input is O( n ) for some nonnegative integer k, where n is the complexity of the input. Polynomial-time algorithms are said to be "fast."(fast in what sense?) Most familiar mathematical operations such as addition, subtraction, multiplication, and division, as well as computing square roots, powers, and logarithms, can be performed in polynomial time. Computing the digits of most interesting mathematical constants, including π and e can also be done in polynomial time. NON POLYNOMIAL TIME: An infinitely complex process of computation is said to take place in non polynomial time. k The number of steps required to complete the operation cannot be expressed as O( n ) when non polynomial time is required for computation. 10 Terr, David. "Polynomial Time." From MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein. http://mathworld.wolfram.com/polynomialtime.html 15 P a g e

INVESTIGATIONS EXAMPLE 1: Consider a letter K. Let K be denoted by an integer 65. This letter shall be encrypted and be sent. Step 1: Two prime numbers are chosen, p = 7 q = 11 Step 2: pq is computed to obtain the semi prime number n. n = pq = 7 11 = 77 Step 3: The third step is the computation of the totient function of the semi prime number n. θ ( n) = ( p 1)( q 1) = 6 10 = 60 Step 4: A number e is selected such that 1< e < θ, where e and θ are co prime. Let e = 23 16 P a g e

Step 5: A number d is to be calculated such that de 1(mod θ ) This means that d is the modular multiplicative inverse of e(mod θ ) In this case, d is such that d 23 1(mod 60) This means that d is a number such that 23 d 60 has a remainder of 1. Using a Texas instruments TI-84 calculator a table was generated. The function used to generate the table was a remainder function of the form: Remainder (Dividend, Divisor) = Remainder (23 x, 60) The table generated was: X value Function value (Remainder when divided by 120) 1 23.. 44 52 45 15 46 38 17 P a g e

47 1 48 24 49 47 50 10...... The value of d determined using the table was thus 47. Step 6: The cipher text for a padded integer needs to be generated. For a padded integer P, the cipher text C is such that, m e c ( mod n) 23 The letter K which is denoted by the integer 65 is to be encrypted. 65 c( mod 77) thus calculated to be 32., c is Step 7: Decryption is achieved by computing using the Cipher text and the hidden key d. ( mod ) d c p n, 47 In this case, 32 p( mod 77) Upon computation, it is found that K = 65. Thus the integer that was used to pad the letter K is obtained. 18 P a g e

MATHEMATICAL EXPLANATION OF THE FIRST EXAMPLE Consider example 1 for the explanation. ( ). 32 is therefore, the remainder when 65 23 is divided by 77. 23 65 32 mod 77 According to the division algorithm, Dividend = Divisor x quotient + remainder. Thus for some integer k, = +. 23 65 77k 32 This can be further rewritten as 23 65 (7 11 k) 32 = +. It can also be determined that 23 65 = (7 11 k) + 32 0 + 32mod11 This is because both 65 23 and 32 when divided by 11 will leave the same remainder. Now, by raising both sides the private exponent 47 the following result is obtained: 23 ( ) ( ) 47 47 65 32 mod11 It should be noted that (23 x 47) = 1 + (60 x 18). Using this observation, one can see that: (65 23 ) 47 = 65 (23 x 47) = 65 1 + (60 x 18) = 65 x 65 (60 x 18) = 65 x (65 108 ) 10 Fermat s little theorem states that a P-1 0 (mod P), where, a is a natural number and P is a prime number. Taking 65 108 as the natural number and 11 as the prime number, it can be stated: 19 P a g e

(65 108 ) 11 1 1 0 (mod 11) = (65 108 ) 10 1 0 (mod 11) However, by adding 1 to both sides it can be seen that: (65 108 ) 10 1 (mod 11) Using all observations together, it can now be seen that: 32 47 (65 23 ) 47 = 65 x (65 108 ) 10 65 x 1 = 65 mod 11 By subtracting 65 from both sides, it can be further seen that: 32 47 65 0 (mod 11) Therefore, 11 divides evenly into 32 47 65. This also implies that 32 47 when divided by 11 yields a remainder of 65. Repeating the same exact steps with the other prime 7 would yield the same result. Since both 7 and 11 leave a remainder of 65, it follows that their multiple 77 will also leave a remainder of 65. This is because of the following result of the following independent lemma: x a(mod p) x a(mod q) x a(mod pq) pq ( x a), where p and q are prime numbers. It therefore needs to be proved that pq ( x a) Now, p multiplied by some integer and added to a gives x. So, for some integer k : x = pk + a 20 P a g e

Similarly, for some integer k 1 : x = qk1 + a Therefore, x = pk + a = qk + a ( x a) = pk = qk p qk, q pk 1 1 1 1 Now, since p qk1, and since q is a prime number, p q. Therefore, only k1 is divisible by p p k 1. Therefore, p multiplied by some integer k 2 would be equal to k 1. Since ( x a) qk = 1and k1 pk2 =, ( x a) = pqk2 Similarly, since q pk, and since p is a prime number, p q. Therefore, only k is divisible by p q k. Therefore, q multiplied by some integer k 3 would be equal to k. Since ( x a) = pk and k = qk3, ( x a) = pqk3 Now, ( x a) = pqk = pqk k = k = k 2 3 2 3 ( x a) ( x a) = pqk = k pq pq ( x a) Therefore, x pq will leave a remainder of a. The multiple of the prime numbers 7 and 11, will therefore leave the same remainder of 65. 21 P a g e

This example demonstrates the relationship between the padded integer 65, the cipher text 32, the public key 23, the private key 47, and the semi prime number 77. Any padded integer can thus be converted into cipher text and then be retrieved using the private key and the semi prime 77. 22 P a g e

The RSA algorithm can thus be generalized: 23 P a g e

EXAMPLE 2: Consider a simple random pad: A message Deploy is to be sent using this pad. D has a padded value of 1. E has a padded value of 6. P has a padded value of 5. L has a padded value of 73. O has a padded value of 00. Y has a padded value of 9. The padded integer is thus: 16573009 24 P a g e

Step 1: Two prime numbers are chosen, p = 29429 q = 16421 Step 2: pq is computed to obtain the semi prime number n. n = pq = 29429 16421 = n = 483253609 Step 3: The third step is the computation of the totient function of the semi prime number n. ( )( ) ( )( ) θ ( n) = p 1 q 1 = 16421 1 29429 1 = 16420 29428 = 483207760 Step 4: A number e is selected such that 1< e < θ, where e and θ are co prime. Let e = 1373 Step 5: A number d is to be calculated such that de 1(mod θ ) This means that d is the modular multiplicative inverse of e modθ In this case, d is such that d 1373 1(mod 483207760) 25 P a g e

This means that d is a number such that 1373 d 483207760 has a remainder of 1. Using a Texas instruments TI-84 calculator a table can be generated. The function used to generate the table was a remainder function of the form: Remainder (Dividend, Divisor) = Remainder (1373 x, 483207760) The table generated was: X value Function value (Remainder when divided by 120) 1 1373.. 224534994 483203642 224534995 483205015 224534996 483206388 224534997 1 224534998 1374 224534999 2747 224535000 4120...... The value of d as determined using the table is 224534997. 26 P a g e

Step 6: The cipher text for a padded integer needs to be generated. For a padded integer P, e the cipher text C is such that, p c( mod n) The message can now be encrypted step by step. As mentioned in the beginning the padded integer is: 16573009 1373 The cipher text is thus 16573009 c ( mod 483253609) Since the value of the exponent and numbers was large, the software WX Maxima was used to generate the value of c. The modulus computation function was used: c = 94490746 27 P a g e

The message Deploy is now encrypted using the RSA algorithm and it now looks like this when it is sent: 94490746 Step 7: Decryption is achieved by computing using the Cipher text and the hidden key d. d The plain text is related to the cipher text by the following: c p( mod n) 224534997 For c = 94490746, 94490746 p( mod 483253609) WX maxima was again used for modulus computation. However, due to the presence of large exponents, the application crashed: 28 P a g e

The computational engine wolfram alpha was instead used: http://www.wolframalpha.com/input/?i=94490746%5e224534997+mod+483253609 Upon computation, the value of p obtained was: 16573009 Upon matching the integer to the appropriate alphabet in the pad, the message Deploy surfaces again. Encryption and decryption is thus achieved. 29 P a g e

EXAMPLE 3: Let us assign the following 2 digit numbers to the letters of the English alphabet: A message Begin plan A is to be sent using this pad. B has a padded value of 19. E has a padded value of 63. G has a padded value of 57. I has a padded value of 05. N has a padded value of 41. _ has a padded value of 48. P has a padded value of 08. L has a padded value of 95. A has a padded value of 52. N has a padded value of 41. _ has a padded value of 48. A has a padded value of 52. 30 P a g e

The message when substituted by the numbers on the pad looks like this: 196357054148089552414852 Step 1: Two prime numbers are chosen, p = 10275310759763418059 q =148214403901214408297 The large prime numbers were obtained by factorizing random numbers in WX Maxima. Step 2: pq is computed to obtain the semi prime number n. n = pq = 10275310759763418059 148214403901214408297 = n = 1522949059158069535282090098747929235523 Step 3: The third step is the computation of the totient function of the semi prime number n n ( p )( q ) ( 10275310759763418059 1)( 148214403901214408297 1) θ ( ) = 1 1 = = 10275310759763418058 148214403901214408296 = 1522949059158069535123600384086951409168 Step 4: A number e is selected such that 1< e < θ, where e and θ are co prime. Let e = 1380083 31 P a g e

Step 5: A number d is to be calculated such that de 1(mod θ ) This means that d is the modular multiplicative inverse of e modθ In this case, d is such that d 1380083 1(mod1522949059158069535123600384086951409168) This means that d is a number such that has a remainder of 1. 1380083 d 1522949059158069535123600384086951409168 The table for such a large value of θ ( n) could not be generated. The online computational engine wolfram alpha was used instead to compute the value of d: http://www.wolframalpha.com/input/?i=d*1380083 1%28mod+15229490591580695351236 00384086951409168%29 d = 1446095518989829947574048636004153748491 32 P a g e

Step 6: The cipher text for a padded integer needs to be generated. For a padded integer P, e the cipher text C is such that, p c( mod n) The message can now be encrypted step by step. There integers assigned to each letter in the pad. The padded integer is thus: 196357054148089552414852 The resulting cipher text is thus: 1380083 ( ) 196357054148089552414852 c mod1522949059158069535282090098747929235523 Wolfram alpha was again used for modulus computation: http://www.wolframalpha.com/input/?i=196357054148089552414852%5e1380083%28mod +1522949059158069535282090098747929235523%29 33 P a g e

c =464432392357698248160066061811080738626 The message Begin plan A is encrypted using the RSA algorithm and it now looks like this when it is sent: 464432392357698248160066061811080738626 Step 7: Decryption is achieved by computing using the Cipher text and the hidden key d. d The plain text is related to the cipher text by the following: c p( mod n) For c = 464432392357698248160066061811080738626, 1446095518989829947574048636004153748491 464432392357698248160066061811080738626 p ( mod1522949059158069535282090098747929235523) 34 P a g e

The modulus computation for decryption was achieved using wolfram alpha: http://www.wolframalpha.com/input/?i=464432392357698248160066061811080738626%5 E1446095518989829947574048636004153748491%28mod+1522949059158069535282090 098747929235523%29 Upon computation, the value of p obtained is: 196357054148089552414852 Upon matching the integer to the appropriate alphabet in the pad, the message Begin plan A surfaces again. Encryption and decryption is thus achieved using large prime numbers and modulus. 35 P a g e

FINAL NUMBER THEORY PROOF FOR THE FUNCTIONING OF RSA The examples demonstrate a general algorithm that defines RSA. It was found that RSA functions because of a relationship between the semi prime modulus, and keys. The RSA algorithm states the following conditions: 1. Two prime numbers p and q are chosen to compute the semi prime modulus n. 2. The totient function of n is θ ( n) = ( p 1)( q 1) and the public key e is chosen such that it is smaller than and relatively prime to θ ( n). 3. The public key is the modular multiplicative inverse of e mod θ ( n). e 4. The padded integer m is encrypted using the function m c ( mod n) d 5. The cipher text c is decrypted using the function c m( mod n).. Consider, m e c ( mod n) or c = m e ( mod n) d d And c m( mod n) or m = c ( mod n) Now, since c = m e d ( mod n), substituting for c in m c ( mod n) = gives: d ( ) ( ) e m = ( m mod n ) mod n Simplifying the expression, ( ) d d m = m e e ( mod n) = m ( mod n) 36 P a g e

This is because the modulus inside and outside the bracket is the same thus resulting in a single modulus. A simple example can demonstrate this property of modular arithmetic. 7 mod 3 = 1 2 2 (7 mod 3) = 1 = 1 2 7 mod 3 = 49 mod 3 = 1 d So eventually, m = m e ( mod n) d Therefore it needs to be proven that m m ( mod n) = e. 37 P a g e

INITIATING THE PROOF: d is the modular multiplicative inverse of e mod θ ( n). That is ed 1(mod θ ( n)). So, ed 1(mod θ( n)) ed 1 0(mod θ ( n)) θ( n) ( ed 1) However, n = pq and, θ ( n) = ( θ ( p))( θ ( q)) θ ( n) = ( p 1)( q 1) So, θ ( n) ( ed 1), ( θ ( p))( θ ( q)) ( ed 1) ( p 1)( q 1)( ed 1) A property of divisors is that, if a number divides a dividend, the factors of the divisors also divide the dividend. Now, by the property of divisors, implies θ ( p) θ ( q) ( ed 1) θ ( p) ( ed 1) and θ ( q) ( ed 1) Now, since θ( p) divides ( ed 1), an integer k exists such that θ ( p) k = ( ed 1). 38 P a g e

Since, θ ( p) = ( p 1), k( p 1) = ( ed 1). de de Now, consider that m mod p = m mod p. This is important because it can now be stated that de de m m mod p This can also be written as = de de 1+ 1 de 1 m m mod p ( m ) mmod p But, ( ed 1) = k( p 1) de k( p 1) m ( m ) m(mod p) Now, it was stated previously that p is a prime number. Because of this, two possibilities regarding the relationship between p and m exist. 1. m is either relatively prime to p since p is a prime number 2. Or m is a multiple of p There now exist two cases in relation with p and m. 39 P a g e

CASE 1: when m is relatively prime to p p 1 By Fermat s little theorem, a 1 0( mod p) Replacing a with m, the result can be rewritten: m p 1 m p 1 ( p) ( p) 1 0 mod 1 mod By modular congruence, if an exponent is added on one side, it is also carried over to the other side. Therefore, for the integer k, m k ( p 1) ( p) k 1 mod However, 1 raised to any exponential power is 1 itself. Therefore, m k ( p 1) m k ( p 1) ( p) 1( mod p) k 1 mod But, k( p 1) = ( ed 1). So now, using the previously obtained result de k( p 1) ( ) (mod ) and the fact that m m m p k( p 1) = ( ed 1), de m m(mod p) 40 P a g e

CASE 2: when m is divisible by p p m p m k For any integer k Let l = k, as previously encountered So if k were to be replaced by de, de m p would leave a remainder of 0 since: p m, p m p m k de This can be rewritten as: m 0(mod p), m de 0(mod p) Now, since m and de m are both congruent to 0(mod p ), they are congruent to each other. de m m (mod p) de Therefore, in both cases, the result m m (mod p) is derived. de Similarly, using the same argument as used in case of p, the result m m (mod q) for the prime number q can be derived. 41 P a g e

d The result m m ( mod n) = e now needs to be derived using the aforementioned results. This can be done using the independent lemma previously proved on pages 20 and 21. Consider that, de m m (mod p) de m m (mod q) Since, the two prime numbers p and q both have the same modulus computation, their multiple pq will also have the same modulus computation. de So, m m (mod pq). But pq = n, de So, it is proved that m m (mod n) 42 P a g e

EFFECTIVENESS OF THE RSA ALGORITHM INFORMATION THEORETIC SECURITY: Information theoretically secure systems are completely secure with regards to information theory in that an adversary may never have any information about the cryptosystem without the required private key. The information in such systems is thus secure even if the adversary has unlimited computational power. COMPUTATIONAL SECURITY: Computationally secure systems are secure because the computational power required to break the systems is unavailable. A typical example of a computationally intensive task is the prime factorization of very large numbers. THE RSA PROBLEM 11 : e Given an RSA public key ( n, e ) and a cipher text, c m ( mod n), to compute m. 11 RSA Problem ~Ronald L. Rivest, MIT Laboratory for Computer Science and Burt Kaliski, RSA Laboratories. - December 10, 2003 43 P a g e

To solve the RSA Problem an adversary, who doesn t know the private key, must nonetheless invert the RSA function. The RSA Assumption is that the RSA Problem is hard to solve when the modulus n is sufficiently large and randomly generated, and the plaintext m (and hence the cipher text c ) is a random integer between 0 and n 1. The inversion of RSA requires the factorization of the modulus number n. If the value of n is that of a small integer, n becomes very easy to factor. For example, if n = 9991, it becomes easy to determine its factors. It can be found out by mental calculation that the factors of 9991 are 97 and 103. However, a large value of n such as that used in example 3 is difficult to factor. This is because prime numbers that are used to create the modulus n occur randomly along the number line and the prime factorization of a large n can be a computationally intensive process. Larger values of n need to be used to ensure that the prime factorization of n takes non polynomial time. USE OF RSA IN MODERN COMMUNICATION: The RSA algorithm is used to transfer data over the internet. Modern communication entails the transmission of data digitally and includes the sending of files and sensitive messages, commercial transactions, and sensitive social or personal information. All of this information is transmitted by secure websites using secure socket layers (SSL) which make use of RSA. The computationally intensive task of factorizing the modulus n makes RSA very secure. At the same time, the availability of a public key that can be exchanged between websites and computers without compromising security makes RSA an optimum choice for computer security. 44 P a g e

CONCLUSION The investigation in this extended essay addresses the research question: How does the RSA algorithm function and why is it used in modern communication? and demonstrates the relationship between number theory and RSA cryptography. Modular mathematics is used to create functions that are used for encryption and decryption. The two functions used are inverse functions due to which the padded integer appears from the cipher text after decryption. Because of the result provided by the Chinese remainder theorem, the modulus n yields the same modulus computation as its two prime factors, p d and q. The public key, private key, and modulus are related by m m ( mod n) this relation that is eventually proven to be true. = e and it is Furthermore, the RSA algorithm functions based on the results provided by mathematical theorems such as Fermat s little theorem. Prime numbers are immensely important in the functioning of RSA. Since prime numbers are located at random intervals, it is difficult to locate them in a given interval of numbers. Due to this, the prime factorization of any large number becomes a difficult task, especially if the number in question is a large semi prime number. The modulus n is a semi prime number which needs to be factorized in order to break RSA encryption. As the value of n gets larger, it becomes increasingly difficult to factorize and the task requires streamlined algorithms or mathematical applications and a lot of computational power. 45 P a g e

The RSA algorithm is used for the purposes of encryption and security in modern communication. This is chiefly because: 1. The encryption provided by RSA is difficult to break due to the difficulty involved in factoring large modulus numbers as explained previously. 2. The encryption provided by RSA is asymmetric or private key encryption that does not rely on just one key but on two separate keys known as the public and private keys. This makes the distribution of keys for encryption much easier and does not lead to the compromise of the private key that can be kept a secret. FURTHER INVESTIGATION: The fascinating RSA algorithm and the field of number theory offer a great number of possibilities that can be explored and investigated. The RSA algorithm discussed in this essay made use of only 2 prime numbers. Variants of RSA known as multi prime RSA can be investigated wherein more than 2 prime numbers can be used to generate the modulus instead of 2: n = pqr or n = pqrs. This might have an effect on the already computationally complex task of factoring the modulus. Another topic that can be investigated are any potential weaknesses that appear in e d the modular functions p c( mod n) and c p( mod n) and whether there exists any theoretical weakness that can be mathematically exploited to break RSA encryption. 46 P a g e

BIBLIOGRAPHY [1] S. P. Glasby Central Washington University http://www.cwu.edu/_glasbys/ February 2002 [2] Weisstein, Eric W. "Algorithm." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/algorithm.html [3] Insall, Matt and Weisstein, Eric W. "Modular Arithmetic." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/modulararithmetic.html [4] Hobson, Nick; Nichol, Reid; and Weisstein, Eric W. "Modular Inverse." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/modularinverse.html 47 P a g e

[5] Weisstein, Eric W. "Fermat's Little Theorem." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/fermatslittletheorem.html [6] Weisstein, Eric W. "Totient Function." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/totientfunction.html [7] Weisstein, Eric W. "Chinese Remainder Theorem." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/chineseremaindertheorem.html [8] Weisstein, Eric W. "Euler's Totient Theorem." From MathWorld--A Wolfram Web Resource. http://mathworld.wolfram.com/eulerstotienttheorem.html [9] Massachusetts institute of technology http://web.mit.edu/16.070/www/lecture/big_o.pdf 48 P a g e

[10] Terr, David. "Polynomial Time." From MathWorld--A Wolfram Web Resource, created by Eric W. Weisstein. http://mathworld.wolfram.com/polynomialtime.html [11] RSA Problem ~Ronald L. Rivest, MIT Laboratory for Computer Science and Burt Kaliski, RSA Laboratories. - December 10, 2003 49 P a g e