Cryptography: Joining the RSA Cryptosystem

Similar documents
Applied Cryptography and Computer Security CSE 664 Spring 2018

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

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

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

Introduction to Modern Cryptography. Benny Chor

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

basics of security/cryptography

CPSC 467b: Cryptography and Computer Security

ECE596C: Handout #11

Mathematics of Public Key Cryptography

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

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

Chapter 7 Randomization Algorithm Theory WS 2017/18 Fabian Kuhn

Mathematical Foundations of Public-Key Cryptography

Ma/CS 6a Class 3: The RSA Algorithm

Introduction to Public-Key Cryptosystems:

RSA Key Generation. Required Reading. W. Stallings, "Cryptography and Network-Security, Chapter 8.3 Testing for Primality

Cryptography CS 555. Topic 18: RSA Implementation and Security. CS555 Topic 18 1

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

CPSC 467b: Cryptography and Computer Security

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

University of Tokyo: Advanced Algorithms Summer Lecture 6 27 May. Let s keep in mind definitions from the previous lecture:

CSE 521: Design and Analysis of Algorithms I

Theoretical Cryptography, Lecture 13

Ma/CS 6a Class 4: Primality Testing

Lecture 22: RSA Encryption. RSA Encryption

CPSC 467b: Cryptography and Computer Security

Ma/CS 6a Class 2: Congruences

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

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

CPSC 467: Cryptography and Computer Security

Attempt QUESTIONS 1 and 2, and THREE other questions. penalised if you attempt additional questions.

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Encryption: The RSA Public Key Cipher

CSCI3390-Lecture 16: Probabilistic Algorithms: Number Theory and Cryptography

Public Key Encryption

10 Modular Arithmetic and Cryptography

1 What are Physical Attacks. 2 Physical Attacks on RSA. Today:

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?

Introduction to Modern Cryptography. Lecture RSA Public Key CryptoSystem 2. One way Trapdoor Functions

Ma/CS 6a Class 2: Congruences

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

Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Spring 2006

CPSC 467b: Cryptography and Computer Security

Primality Testing. 1 Introduction. 2 Brief Chronology of Primality Testing. CS265/CME309, Fall Instructor: Gregory Valiant

Public Key Cryptography

Lecture 1: Introduction to Public key cryptography

1 Rabin Squaring Function and the Factoring Assumption

Lecture 31: Miller Rabin Test. Miller Rabin Test

Introduction to Cybersecurity Cryptography (Part 5)

RSA. Ramki Thurimella

Lecture Notes, Week 6

Shor s Algorithm. Elisa Bäumer, Jan-Grimo Sobez, Stefan Tessarini May 15, 2015

10 Concrete candidates for public key crypto

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

Asymmetric Encryption

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

Theory of Computation Chapter 12: Cryptography

CPSC 467b: Cryptography and Computer Security

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

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

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

Lattices. A Lattice is a discrete subgroup of the additive group of n-dimensional space R n.

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

Number Theory and Algebra: A Brief Introduction

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

Number theory (Chapter 4)

MATH 158 FINAL EXAM 20 DECEMBER 2016

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

Mathematics of Cryptography

Other Public-Key Cryptosystems

Solutions to the Mathematics Masters Examination

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

Correctness, Security and Efficiency of RSA

Math.3336: Discrete Mathematics. Mathematical Induction

COMP4109 : Applied Cryptography

10 Public Key Cryptography : RSA

5199/IOC5063 Theory of Cryptology, 2014 Fall

In fact, 3 2. It is not known whether 3 1. All three problems seem hard, although Shor showed that one can solve 3 quickly on a quantum computer.

RSA Cryptosystem and Factorization

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

Discrete Mathematics GCD, LCM, RSA Algorithm

Cryptography and Security Midterm Exam

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

CPSC 467: Cryptography and Computer Security

Ma/CS 6a Class 4: Primality Testing

Cryptography IV: Asymmetric Ciphers

Topics in Cryptography. Lecture 5: Basic Number Theory

Introduction to Cryptography. Lecture 6

CIS 551 / TCOM 401 Computer and Network Security

COMP424 Computer Security

CS March 17, 2009

MATH3302 Cryptography Problem Set 2

Tutorial on Quantum Computing. Vwani P. Roychowdhury. Lecture 1: Introduction

18.310A Final exam practice questions

conp = { L L NP } (1) This problem is essentially the same as SAT because a formula is not satisfiable if and only if its negation is a tautology.

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

Cryptography CS 555. Topic 24: Finding Prime Numbers, RSA

Linear Congruences. The equation ax = b for a, b R is uniquely solvable if a 0: x = b/a. Want to extend to the linear congruence:

Transcription:

Cryptography: Joining the RSA Cryptosystem Greg Plaxton Theory in Programming Practice, Fall 2005 Department of Computer Science University of Texas at Austin

Joining the RSA Cryptosystem: Overview First, Bob randomly chooses two large (e.g., 512-bit) primes p and q Then, Bob computes n = pq, φ(n) = (p 1)(q 1), and a positive integer d < n such that d and φ(n) are relatively prime For example, any prime exceeding max(p, q) (and less than n) is a valid choice for d Then, Bob computes e such that de is congruent to 1 modulo φ(n) Thus e and φ(n) are also relatively prime Bob s public key is (e, n) and Bob s private key is (d, n) Remark: The scheme will also work if we use (d, n) as the public key and (e, n) as the private key We will discuss each of these steps in greater detail in the slides that follow

Primality Testing Surprisingly, there exist efficient (and polynomial time) algorithms for primality testing, that is, for determining whether a given integer n is prime or composite These algorithms do not work by factoring, since no efficient algorithms are known for factoring Miller gave the first polynomial-time primality testing algorithm in 1976 His work yields gives an efficient randomized algorithm In fact, it yields a deterministic algorithm subject to the extended Riemann hypothesis In a theoretical breakthrough, the first deterministic polynomial-time algorithm for primality testing was discovered in 2002 by Agrawal, Kayal, and Saxena Still, the primality testing algorithms used in practice are randomized, since they are faster (on average)

Prime Number Theorem Prime number theorem: As n tends to infinity, the fraction of the first n positive integers that are prime tends to 1 ln n For example, about a.002818 fraction of the numbers less than 2 512 are prime, and about a.002823 fraction of the numbers less than 2 511 are prime Thus, about a.002813 fraction of 512-bit numbers (i.e., with leading 1 bit in bit position 511, indexing from 0), or about one in 355.5, is prime So if we pick a set S of a few thousand 512-bit numbers independently and uniformly at random, we are overwhlemingly likely to pick at least one prime We can use an efficient primality test to find a prime in S We can make this approach more efficient by, e.g., picking only odd 512-bit numbers

Joining the RSA Cryptosystem: Implementation Given that we ve seen how to generate random large primes, we now know how to compute p, q, and d Of course, p and q also give us n = pq and φ(n) = (p 1)(q 1) All that is left is to compute e such that de is congruent to 1 modulo φ(n) We will compute e using the extended Euclid algorithm, as discussed on the next slide

Joining the RSA Cryptosystem: Computation of e Recall that given nonnegative integers x and y (at least one of which is nonzero), the extended Euclid algorithm calculates a and b such that ax + by = gcd(x, y) Set x to d and y to φ(n) Since d and φ(n) are relatively prime, gcd(d, φ(n)) = 1 Thus, the extended Euclid algorithm gives us a and b such that ad + bφ(n) = 1 Hence ad is congruent to 1 modulo φ(n) So we can just set e to the unique integer in {0,..., φ(n) 1} that is congruent to a modulo φ(n)

Joining the RSA Cryptosystem: Example Suppose we choose primes p = 47 and q = 59 (in practice, we would choose much larger primes) Then n = 47 59 = 2773 and φ(n) = 46 58 = 2668 Now suppose we choose d = 157 Note that 157 is a prime greater than p and q and hence is relatively prime to φ(n) Running the extended Euclid algorithm with x = 157 and y = 2668 yields e = 17 Bob s public key is (17, 2773) and his private key is (157, 2773)

RSA Encryption and Decryption Next time we ll see how to use Bob s public key to encrypt messages sent to Bob We ll also see how Bob uses his private key to decrypt these messages