Public Key Cryptography

Similar documents
An Introduction to Cryptography

Chapter 8 Public-key Cryptography and Digital Signatures

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

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

CRYPTOGRAPHY AND NUMBER THEORY

10 Modular Arithmetic and Cryptography

CIS 551 / TCOM 401 Computer and Network Security

10 Public Key Cryptography : RSA

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

Discrete Mathematics GCD, LCM, RSA Algorithm

Number Theory & Modern Cryptography

Encryption: The RSA Public Key Cipher

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

Topics in Cryptography. Lecture 5: Basic Number Theory

ECE596C: Handout #11

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

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

Number Theory. Modular Arithmetic

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

Cryptography. pieces from work by Gordon Royle

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

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

Lecture 1: Introduction to Public key cryptography

The RSA cryptosystem and primality tests

RSA. Ramki Thurimella

Week 7 An Application to Cryptography

Integers and Division

Introduction to Cryptography. Lecture 6

NET 311D INFORMATION SECURITY

Introduction to Modern Cryptography. Benny Chor

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

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

NUMBER THEORY FOR CRYPTOGRAPHY

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

CPSC 467b: Cryptography and Computer Security

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

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

Introduction to Public-Key Cryptosystems:

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

Simple Math: Cryptography

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

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

Implementation Tutorial on RSA

Math.3336: Discrete Mathematics. Mathematical Induction

THE RSA CRYPTOSYSTEM

Ma/CS 6a Class 3: The RSA Algorithm

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

Algorithmic Number Theory and Public-key Cryptography

CPSC 467b: Cryptography and Computer Security

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

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

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

MEETING 6 - MODULAR ARITHMETIC AND INTRODUCTORY CRYPTOGRAPHY

MATH3302 Cryptography Problem Set 2

Number Theory A focused introduction

Powers in Modular Arithmetic, and RSA Public Key Cryptography

Mathematical Foundations of Public-Key Cryptography

Cryptography IV: Asymmetric Ciphers

Number theory (Chapter 4)

MATHEMATICS EXTENDED ESSAY

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

Number Theory and Group Theoryfor Public-Key Cryptography

Final Exam Math 105: Topics in Mathematics Cryptology, the Science of Secret Writing Rhodes College Tuesday, 30 April :30 11:00 a.m.

Elliptic Curve Cryptography

basics of security/cryptography

Ma/CS 6a Class 2: Congruences

ICS141: Discrete Mathematics for Computer Science I

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

Numbers. Çetin Kaya Koç Winter / 18

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Asymmetric Encryption

Asymmetric Cryptography

Chapter 4 Asymmetric Cryptography

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

CS March 17, 2009

Public Key Cryptography

RSA RSA public key cryptosystem

Elementary Number Theory Review. Franz Luef

Eindhoven University of Technology MASTER. Kleptography cryptography with backdoors. Antheunisse, M. Award date: 2015

A Readable Introduction to Real Mathematics

Elementary Number Theory MARUCO. Summer, 2018

Carmen s Core Concepts (Math 135)

CS483 Design and Analysis of Algorithms

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

Clock Arithmetic and Euclid s Algorithm

Mathematics of Cryptography

W3203 Discrete Mathema1cs. Number Theory. Spring 2015 Instructor: Ilia Vovsha. hcp://

Introduction to Cryptography. Lecture 8

Discrete mathematics I - Number theory

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

University of Regina Department of Mathematics & Statistics Final Examination (April 21, 2009)

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

Public-Key Encryption: ElGamal, RSA, Rabin

Jong C. Park Computer Science Division, KAIST

Cryptography and Number Theory

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

Public-Key Cryptosystems CHAPTER 4

Final Report. Cryptography and Number Theory Boot Camp NSF-REU. Summer 2017

8.1 Principles of Public-Key Cryptosystems

Ma/CS 6a Class 2: Congruences

Transcription:

Public Key Cryptography Spotlight on Science J. Robert Buchanan Department of Mathematics 2011

What is Cryptography? cryptography: study of methods for sending messages in a form that only be understood by the recipient. cryptanalysis: study of methods for defeating cryptography. cryptology: study of both cryptography and cryptanalysis.

Terminology Plaintext: the un-encrypted, clearly readable form of a message. Ciphertext: the encrypted form of the plaintext, readable only with the key to the cipher.

Public Key Cryptography In some cryptographic systems, the key used to encipher the message must be kept hidden from the public and should be known only by the sender and recipient of the message. There are other cryptographic systems in which each party has a private key (which they keep secret) and a public key which they publish so that others may send them encrypted messages which only they can decrypt. The public key functions as the recipient s cryptographic telephone number.

Overview of Public Key Cryptography Suppose Alice wants to send Bob a message which only Bob will be able to read. 1 Alice looks up Bob s public key and enciphers the plaintext using his public key.

Overview of Public Key Cryptography Suppose Alice wants to send Bob a message which only Bob will be able to read. 1 Alice looks up Bob s public key and enciphers the plaintext using his public key. 2 Alice sends Bob the ciphertext (or even publishes it in the newspaper!).

Overview of Public Key Cryptography Suppose Alice wants to send Bob a message which only Bob will be able to read. 1 Alice looks up Bob s public key and enciphers the plaintext using his public key. 2 Alice sends Bob the ciphertext (or even publishes it in the newspaper!). 3 Bob decrypts the ciphertext using his private key.

RSA Public Key Cryptography One of the most popular public key cryptographic systems is known as RSA. It was developed by Adi Shamir Ronald Rivest Leonard Adelman.

A Little Number Theory Definition A prime number is a whole number p greater than 1 whose only divisors are p and 1. An integer which is not prime is called a composite number.

A Little Number Theory Definition A prime number is a whole number p greater than 1 whose only divisors are p and 1. An integer which is not prime is called a composite number. Definition If a and b are positive integers, the greatest common divisor of a and b is number denoted gcd(a, b) and is the positive integer d satisfying both of the following properties: d divides a and d divides b, if c is an integer and c divides a and c divides b, then c divides d.

A Little Number Theory Definition A prime number is a whole number p greater than 1 whose only divisors are p and 1. An integer which is not prime is called a composite number. Definition If a and b are positive integers, the greatest common divisor of a and b is number denoted gcd(a, b) and is the positive integer d satisfying both of the following properties: d divides a and d divides b, if c is an integer and c divides a and c divides b, then c divides d. Definition If gcd(a, b) = 1 we say that a and b are relatively prime.

Examples 4 = gcd(16, 60) 13 = gcd(13, 65)? = gcd(72, 81)

Euclidean Algorithm To find the gcd(a, b): 1 If b divides a evenly, gcd(a, b) = b. 2 If not, replace a by b and replace b by the remainder of a b and go back to step 1. A Java applet implementing the Euclidean Algorithm is also available.

Example Find gcd(105, 56) using the Euclidean Algorithm.

Example Find gcd(105, 56) using the Euclidean Algorithm. a b 105 56 56 49 49 7 gcd(105, 56) = 7

Linear Combinations Definition If a and b are integers, then an expression of the from ax + by where x and y are also integers is called a linear combination of a and b.

Linear Combinations Definition If a and b are integers, then an expression of the from ax + by where x and y are also integers is called a linear combination of a and b. Theorem If a and b are integers, then gcd(a, b) is the smallest positive integer which can be written as a linear combination of a and b.

Modular Arithmetic Definition Two integers n and m are congruent modulo k (or equivalent modulo k) written symbolically as when k divides n m evenly. n m (mod k) 65 13 (mod 26) since 65 13 26 = 2.

Modular Arithmetic Definition Two integers n and m are congruent modulo k (or equivalent modulo k) written symbolically as when k divides n m evenly. n m (mod k) 65 13 (mod 26) since 65 13 26 = 2. Corollary If a and b are relatively prime then b has a multiplicative inverse modulo a.

Extended Euclidean Algorithm To find x and y such that use the tabular method. gcd(a, b) = ax + by Start the table like this: x y d 1 0 a 0 1 b???

Extended Euclidean Algorithm To find x and y such that gcd(a, b) = ax + by use the tabular method. Start the table like this: x y d 1 0 a 0 1 b??? To fill in the next row: 1 Find q and r such that a b = q + r b. 2 Multiply next to last row by q and subtract from third to last row. 3 Keep appending rows to the table until r = 0.

Example x y d 1 0 105 0 1 56 1 1 49 1 2 7 ( 1)(105) + (2)(56) = 7 A Java applet implementing the Extended Euclidean Algorithm is also available.

More Number Theory Definition If N is the set of all positive integers then for each positive integer n define φ(n) to be the number of positive integers less than or equal to n which are relatively prime to n. Such a function φ is called the Euler phi function.

Euler Phi Function (1 of 2) Do you notice a pattern? 80 60 40 20 n

Euler Phi Function (2 of 2) n φ(n) n φ(n) 1 1 6 2 2 1 7 6 3 2 8 4 4 2 9 6 5 4 10 4

Euler Phi Function (2 of 2) n φ(n) n φ(n) 1 1 6 2 2 1 7 6 3 2 8 4 4 2 9 6 5 4 10 4 Lemma If p is prime, then φ(p) = p 1.

Euler Phi Function (2 of 2) n φ(n) n φ(n) 1 1 6 2 2 1 7 6 3 2 8 4 4 2 9 6 5 4 10 4 Lemma If p is prime, then φ(p) = p 1. Lemma If p and q are distinct primes, then φ(pq) = φ(p)φ(q) = (p 1)(q 1).

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 1 let p = 1009 and q = 2003.

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 2 forms the product n = pq, 1 let p = 1009 and q = 2003. 2 n = 2021027

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 2 forms the product n = pq, 3 computes φ(n), 1 let p = 1009 and q = 2003. 2 n = 2021027 3 φ(2021027) = (1009 1)(2003 1) = 2018016

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 2 forms the product n = pq, 3 computes φ(n), 4 selects integer e such that gcd(e, φ(n)) = 1, 1 let p = 1009 and q = 2003. 2 n = 2021027 3 φ(2021027) = (1009 1)(2003 1) = 2018016 4 e = 1003 (for example)

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 2 forms the product n = pq, 3 computes φ(n), 4 selects integer e such that gcd(e, φ(n)) = 1, 5 finds the multiplicative inverse d of e (mod φ(n)), 1 let p = 1009 and q = 2003. 2 n = 2021027 3 φ(2021027) = (1009 1)(2003 1) = 2018016 4 e = 1003 (for example) 5 d = 1311811 (for this e)

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 2 forms the product n = pq, 3 computes φ(n), 4 selects integer e such that gcd(e, φ(n)) = 1, 5 finds the multiplicative inverse d of e (mod φ(n)), 6 private key is d, public key is (e, n). 1 let p = 1009 and q = 2003. 2 n = 2021027 3 φ(2021027) = (1009 1)(2003 1) = 2018016 4 e = 1003 (for example) 5 d = 1311811 (for this e) 6 private key is 1311811, public key is (1003, 2021027).

Getting Public and Private Keys A public agency (call it the Key Utility ) 1 selects two large primes p and q, 2 forms the product n = pq, 3 computes φ(n), 4 selects integer e such that gcd(e, φ(n)) = 1, 5 finds the multiplicative inverse d of e (mod φ(n)), 6 private key is d, public key is (e, n). 1 let p = 1009 and q = 2003. 2 n = 2021027 Remark: only the Key Utility knows p and q. 3 φ(2021027) = (1009 1)(2003 1) = 2018016 4 e = 1003 (for example) 5 d = 1311811 (for this e) 6 private key is 1311811, public key is (1003, 2021027).

Public Keys are Like Telephone Numbers Suppose Alice and Bob have the following keys. Key Holder Public Key Private Key Alice (e a, n a ) = (1003, 2021027) d a = 1311811 Bob (e b, n b ) = (10007, 2021027) d b = 1197863

Public Keys are Like Telephone Numbers Suppose Alice and Bob have the following keys. Key Holder Public Key Private Key Alice (e a, n a ) = (1003, 2021027) d a = 1311811 Bob (e b, n b ) = (10007, 2021027) d b = 1197863 Private key d a is known only to Alice (and the Key Utility), while private key d b is known only to Bob (and the Key Utility).

Public Keys are Like Telephone Numbers Suppose Alice and Bob have the following keys. Key Holder Public Key Private Key Alice (e a, n a ) = (1003, 2021027) d a = 1311811 Bob (e b, n b ) = (10007, 2021027) d b = 1197863 Private key d a is known only to Alice (and the Key Utility), while private key d b is known only to Bob (and the Key Utility). If Alice wants to send a message to Bob, she looks up Bob s public key (e b, n b ).

Encrypting Using RSA Alice wants to send the message hi to Bob. 1 Alice converts hi to a number, m. Letter h i ASCII Code 104 105 m = 104105

Encrypting Using RSA Alice wants to send the message hi to Bob. 1 Alice converts hi to a number, m. Letter h i ASCII Code 104 105 m = 104105 2 Alice creates the ciphertext c using the formula c m e b (mod n b ) c = 104105 10007 (mod 2021027) c = 1086444 and sends it to Bob. Alice can try this Java applet if she needs help with modular exponentiation.

Encrypting Using RSA Alice wants to send the message hi to Bob. 1 Alice converts hi to a number, m. Letter h i ASCII Code 104 105 m = 104105 2 Alice creates the ciphertext c using the formula c m e b (mod n b ) c = 104105 10007 (mod 2021027) c = 1086444 and sends it to Bob. Alice can try this Java applet if she needs help with modular exponentiation. Remark: if m > n b break m into chunks smaller than n b.

Bob Decrypts the Ciphertext When Bob receives the ciphertext c he uses his private key d b and computes m c d b (mod n b ) m = 1086444 1197863 (mod 2021027) m = 104105.

Bob Decrypts the Ciphertext When Bob receives the ciphertext c he uses his private key d b and computes m c d b (mod n b ) m = 1086444 1197863 (mod 2021027) m = 104105. ASCII Code 104 105 Letter h i

ASCII Character Codes a 97 f 102 k 107 p 112 u 117 b 98 g 103 l 108 q 113 v 118 c 99 h 104 m 109 r 114 w 119 d 100 i 105 n 110 s 115 x 120 e 101 j 106 o 111 t 116 y 121 z 121

Is RSA Secure? The security of RSA depends on the difficulty in factoring large numbers like n.

Is RSA Secure? The security of RSA depends on the difficulty in factoring large numbers like n. If n = pq where p and q are prime numbers with more than 500 digits each then n has more than 1000 digits.

Is RSA Secure? The security of RSA depends on the difficulty in factoring large numbers like n. If n = pq where p and q are prime numbers with more than 500 digits each then n has more than 1000 digits. It takes approximately 4.7 10 22 years to factor a 500-digit composite number using today s computers.

Is RSA Secure? The security of RSA depends on the difficulty in factoring large numbers like n. If n = pq where p and q are prime numbers with more than 500 digits each then n has more than 1000 digits. It takes approximately 4.7 10 22 years to factor a 500-digit composite number using today s computers. As computers get faster, we can keep increasing n.

Will We Run Out of Primes? Theorem There are infinitely many prime numbers.

Will We Run Out of Primes? Theorem There are infinitely many prime numbers. Proof. Suppose there are only finitely many primes p 1 < p 2 < < p k.

Will We Run Out of Primes? Theorem There are infinitely many prime numbers. Proof. Suppose there are only finitely many primes p 1 < p 2 < < p k. Form the number q = (p 1 )(p 2 ) (p k ) + 1 > p k. This number is either prime or composite.

Will We Run Out of Primes? Theorem There are infinitely many prime numbers. Proof. Suppose there are only finitely many primes p 1 < p 2 < < p k. Form the number q = (p 1 )(p 2 ) (p k ) + 1 > p k. This number is either prime or composite. 1 q (mod p i )

Will We Run Out of Primes? Theorem There are infinitely many prime numbers. Proof. Suppose there are only finitely many primes p 1 < p 2 < < p k. Form the number q = (p 1 )(p 2 ) (p k ) + 1 > p k. This number is either prime or composite. 1 q (mod p i ) No (known) prime evenly divides q.

Will We Run Out of Primes? Theorem There are infinitely many prime numbers. Proof. Suppose there are only finitely many primes p 1 < p 2 < < p k. Form the number q = (p 1 )(p 2 ) (p k ) + 1 > p k. This number is either prime or composite. 1 q (mod p i ) No (known) prime evenly divides q. Either q itself is prime or there is a prime larger than p k which divides q.

Where Can You Learn More? The modern language of cryptology is mathematics. Major in mathematics in college. Take a course in number theory. The National Security Agency employs and educates cryptologists. The National Cryptologic Museum has exhibits on ancient and modern cryptography.