CPSC 467b: Cryptography and Computer Security

Similar documents
CPSC 467b: Cryptography and Computer Security

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

Lecture Notes, Week 6

CPSC 467b: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security

RSA RSA public key cryptosystem

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

CPSC 467b: Cryptography and Computer Security

Lecture 1: Introduction to Public key cryptography

CPSC 467: Cryptography and Computer Security

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

10 Concrete candidates for public key crypto

A polytime proof of correctness of the Rabin-Miller algorithm from Fermat s Little Theorem

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

CIS 551 / TCOM 401 Computer and Network Security

Introduction to Modern Cryptography. Benny Chor

CSE 521: Design and Analysis of Algorithms I

Introduction to Number Theory. The study of the integers

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

Ma/CS 6a Class 4: Primality Testing

Applied Cryptography and Computer Security CSE 664 Spring 2018

9 Knapsack Cryptography

Solutions to homework 2

CPSC 467b: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security

Discrete Mathematics GCD, LCM, RSA Algorithm

Mathematics of Cryptography

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

Public-Key Cryptosystems CHAPTER 4

Lecture 16 Chiu Yuen Koo Nikolai Yakovenko. 1 Digital Signature Schemes. CMSC 858K Advanced Topics in Cryptography March 18, 2004

The running time of Euclid s algorithm

The RSA cryptosystem and primality tests

Factorization & Primality Testing

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

Introduction to Cybersecurity Cryptography (Part 5)

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

Corollary 4.2 (Pepin s Test, 1877). Let F k = 2 2k + 1, the kth Fermat number, where k 1. Then F k is prime iff 3 F k 1

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

CPSC 467: Cryptography and Computer Security

10 Public Key Cryptography : RSA

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

Public Key Encryption

Lecture 11: Non-Interactive Zero-Knowledge II. 1 Non-Interactive Zero-Knowledge in the Hidden-Bits Model for the Graph Hamiltonian problem

Public Key Encryption

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

1. Algebra 1.7. Prime numbers

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

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

Number theory (Chapter 4)

ENEE 457: Computer Systems Security 10/3/16. Lecture 9 RSA Encryption and Diffie-Helmann Key Exchange

1 Number Theory Basics

Factoring Algorithms Pollard s p 1 Method. This method discovers a prime factor p of an integer n whenever p 1 has only small prime factors.

Solution to Midterm Examination

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

6.045: Automata, Computability, and Complexity (GITCS) Class 17 Nancy Lynch

Cryptography IV: Asymmetric Ciphers

Lecture Notes, Week 10

Public-Key Encryption: ElGamal, RSA, Rabin

Introduction to Public-Key Cryptosystems:

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

Aspect of Prime Numbers in Public Key Cryptosystem

Public Key Cryptography

A Guide to Arithmetic

CPSC 467: Cryptography and Computer Security

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

CPSC 467: Cryptography and Computer Security

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.

Chapter 6 Randomization Algorithm Theory WS 2012/13 Fabian Kuhn

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

CPSC 467: Cryptography and Computer Security

Ma/CS 6a Class 4: Primality Testing

CPSC 467: Cryptography and Computer Security

Lecture 22: RSA Encryption. RSA Encryption

Basic elements of number theory

Basic elements of number theory

COMP4109 : Applied Cryptography

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

Asymmetric Encryption

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

Some Facts from Number Theory

Winter 2008 Introduction to Modern Cryptography Benny Chor and Rani Hod. Assignment #2

LARGE PRIME NUMBERS (32, 42; 4) (32, 24; 2) (32, 20; 1) ( 105, 20; 0).

RSA: Genesis, Security, Implementation & Key Generation

ECE 646 Lecture 8. RSA: Genesis, Security, Implementation & Key Generation

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

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

CPSC 467: Cryptography and Computer Security

8 Elliptic Curve Cryptography

Lecture 22. We first consider some constructions of standard commitment schemes. 2.1 Constructions Based on One-Way (Trapdoor) Permutations

Lecture 4 Chiu Yuen Koo Nikolai Yakovenko. 1 Summary. 2 Hybrid Encryption. CMSC 858K Advanced Topics in Cryptography February 5, 2004

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

Cryptography. pieces from work by Gordon Royle

FERMAT S TEST KEITH CONRAD

Primality Testing- Is Randomization worth Practicing?

CS 282A/MATH 209A: Foundations of Cryptography Prof. Rafail Ostrovsky. Lecture 7

Algorithms (II) Yu Yu. Shanghai Jiaotong University

Private Key Cryptography. Fermat s Little Theorem. One Time Pads. Public Key Cryptography

Transcription:

CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 10 February 19, 2013 CPSC 467b, Lecture 10 1/45

Primality Tests Strong primality tests Weak tests of compositeness Reformulation of weak tests of compositeness Examples of weak tests RSA Security Factoring n Computing φ(n) Finding d directly Finding plaintext One-way and Trapdoor Permutations CPSC 467b, Lecture 10 2/45

Primality Tests CPSC 467b, Lecture 10 3/45

Algorithms for testing primality The remaining problem for generating an RSA key is how to test if a large number is prime. A deterministic primality test is a deterministic procedure that correctly answers composite or prime for each input n 2. At first sight, this problem seems as hard as factoring. In 2002, Manindra Agrawal, Neeraj Kayal and Nitin Saxena found a deterministic primality test which runs in time Õ(N 12 ). This was later improved to Õ(N 6 ). Here, N is the length of the number to be tested when written in binary, and Õ hides a polylogarithmic factor in N. (See Wikipedia.) Even now it is not known whether any deterministic primality test is feasible in practice. CPSC 467b, Lecture 10 4/45

Extended primality tests There do exist fast probabilistic algorithms for testing primality. To arrive at a probabilistic algorithm, we extend the notion of a deterministic primality test in two ways: 1. We give it an extra helper string a. 2. We allow it to answer?, meaning I don t know. Thus, an extended primality test is a deterministic algorithm T (n, a) with three possible answers: composite, prime, or?. If the algorithm gives a non-? answer, that answer must be correct for n, and we say that the helper string a is a witness to that answer for n. CPSC 467b, Lecture 10 5/45

Probabilistic primality testing algorithm We can build a probabilistic primality testing algorithm from an extended primality test T (n, a). Algorithm P 1 (n): repeat forever { Generate a random helper string a; Let r = T (n, a); if (r? ) return r; }; This algorithm has the property that it might not terminate (in case no witness to the correct answer for n is ever found), but if it does terminate, the returned answer is correct. CPSC 467b, Lecture 10 6/45

Trading off non-termination against possibility of failure By bounding the number of trials, termination is guaranteed at the cost of possible failure. Let t be the maximum number of trials that we are willing to perform. The algorithm then becomes: Algorithm P 2 (n, t): repeat t times { Generate a random helper string a; Let r = T (n, a); if (r? ) return r; } return? ; Now the algorithm is allowed to give up and return?, but only after trying t times to find the answer. CPSC 467b, Lecture 10 7/45

Strong primality tests Strong primality tests A primality test T (n, a) is strong if, for every n 2, there are many witnesses to the correct answer for n. For a strong test, the probability is high that a random helper string is a witness, so the algorithm P 2 will usually succeed. We do not know of any feasibly computable strong primality test. Fortunately, a weaker test can still be useful. CPSC 467b, Lecture 10 8/45

Weak tests Weak tests of compositeness A weak test of compositeness T (n, a) is only required to have many witnesses to the correct answer when n is composite. When n is prime, a weak test always answers?, so there are no witnesses to n being prime. Hence, the test either outputs composite or? but never prime. An answer of composite means that n is definitely composite, but these tests can never say for sure that n is prime. CPSC 467b, Lecture 10 9/45

Weak tests Use of a weak test of compositeness Let T (n, a) be a weak test of compositeness. Algorithm P 2 is a best effort attempt to prove that n is composite. Since T is a weak test, we can slightly simplify P 2. Algorithm P 3 (n, t): repeat t times { Generate a random helper string a; if (T (n, a) = composite ) return composite ; } return? ; P 3 returns composite just in case it finds a witness a to the compositeness of n. CPSC 467b, Lecture 10 10/45

Weak tests Algorithm P 3 using a weak test When algorithm P 3 answers composite, n is definitely composite. Turning this around, we have: If n is composite and t is sufficiently large, then with high probability, P 3 (n, t) outputs composite. If n is prime, then P 3 (n, t) always outputs?. CPSC 467b, Lecture 10 11/45

Weak tests Meaning of output? It is tempting to interpret? as meaning n is probably prime. However, it makes no sense to say that n is probably prime; n either is or is not prime. It also is not true that if I guess prime whenever I see output? that I will be correct with high probability. Why not? Imagine the test is run repeatedly on n = 15. Every now and then the output will be?, but prime is never correct in this case. What does make sense is to say that the probability is small that P 3 answers? when n is in fact composite. CPSC 467b, Lecture 10 12/45

Weak tests Finding a random prime Algorithm GenPrime(k): const int t=20; do { Generate a random k-bit integer x; } while ( P 3 (x, t) == composite ); return x; The number x that GenPrime() returns has the property that P 3 failed to find a witness, but there is still the possibility that x is composite. CPSC 467b, Lecture 10 13/45

Weak tests Success probability for GenPrime(k) We are interested in the probability that the number returned by GenPrime(k) is prime. This probability depends on both the failure probability of P 3 and also on the density of primes in the set being sampled. The fewer primes there are, the more composite numbers are likely to be tried before a prime is encountered, and the more opportunity there is for P 3 to fail. What would happen if the set being sampled contained only composite numbers? CPSC 467b, Lecture 10 14/45

Boolean tests Boolean test of compositeness We now reformulate weak tests of compositeness as Boolean functions. A Boolean function τ(n, a) can be interpreted as a weak test of compositeness by taking true to mean composite and false to mean?. There s nothing deep here. We re just changing notation. CPSC 467b, Lecture 10 15/45

Boolean tests Meaning of a Boolean test of compositeness Let τ(n, a) be a Boolean test of compositeness. Write τ a (n) to mean τ(n, a). If τ a (n) = true, we say that τ a succeeds on n, and a is a witness to the compositeness of n. If τ a (n) = false, then τ a fails on n and gives no information about the compositeness of n. Clearly, if n is prime, then τ a fails on n for all a, but if n is composite, then τ a may succeed for some values of a and fail for others. CPSC 467b, Lecture 10 16/45

Boolean tests Useful tests A test of compositeness τ is useful if there is a feasible algorithm that computes τ(n, a); for every composite number n, τ a (n) succeeds for a fraction c > 0 of the helper strings a. CPSC 467b, Lecture 10 17/45

Boolean tests Sample use of a useful test Suppose for simplicity that c = 1/2 and one computes τ a (n) for 100 randomly-chosen values for a. If any of the τ a succeeds, we have a proof a that n is composite. If all fail, we don t know whether or not n is prime or composite. But we do know that if n is composite, the probability that all 100 tests fail is only 1/2 100. CPSC 467b, Lecture 10 18/45

Boolean tests Application to RSA In practice, we use GenPrime(k) to choose RSA primes p and q, where the constant t is set according to the number of witnesses and the confidence levels we would like to achieve. For c = 1/2, using t = 20 trials gives us a failure probability of about one in a million when testing a composite number a. We previously argued that we expect to test 355 numbers, 354 of which are composite, in order to find one suitable RSA prime. For an RSA modulus n = pq, we then expect to test 708 composite numbers on average, giving P 3 that many opportunities to fail. Hence, the probability that the resulting RSA modulus is bad is roughly 708/10 6 1/1412. t can be increased if this risk of failure is deemed to be too large. CPSC 467b, Lecture 10 19/45

Example tests Finding weak tests of compositeness We still need to find useful weak tests of compositeness. We begin with two simple examples. While neither is useful, they illustrate some of the ideas behind the useful tests that we will present later. CPSC 467b, Lecture 10 20/45

Example tests The division test δ a (n) Let δ a (n) = (2 a n 1 and a n). Test δ a succeeds on n iff a is a proper divisor of n, which indeed implies that n is composite. Thus, {δ a } a Z is a valid test of compositeness. Unfortunately, it isn t useful since the fraction of witnesses to n s compositeness is exponentially small. For example, if n = pq for p, q prime, then the only witnesses are p and q, and the only tests that succeed are δ p and δ q. CPSC 467b, Lecture 10 21/45

Example tests The Fermat test ζ a (n) Let ζ a (n) = (2 a n 1 and a n 1 1 (mod n)). By Fermat s theorem, if n is prime and gcd(a, n) = 1, then a n 1 1 (mod n). Hence, if ζ a (n) succeeds, it must be the case that n is not prime. This shows that {ζ a } a Z is a valid test of compositeness. For this test to be useful, we would need to know that every composite number n has a constant fraction of witnesses. CPSC 467b, Lecture 10 22/45

Example tests Carmichael numbers (Fermat pseudoprimes) Unfortunately, there are certain composite numbers n called Carmichael numbers 1 for which there are no witnesses, and all of the tests ζ a fail. Such n are fairly rare, but they do exist. The smallest such n is 561 = 3 11 17. 2 Hence, Fermat tests are not useful tests of compositeness according to our definition, and they are unable to distinguish Carmichael numbers from primes. Further information on primality tests may be found in section C.9 of Goldwasser and Bellare. 1 Carmichael numbers are sometimes called Fermat pseudoprimes. 2 See http://en.wikipedia.org/wiki/carmichael number for further information. CPSC 467b, Lecture 10 23/45

RSA Security CPSC 467b, Lecture 10 24/45

Attacks on RSA The security of RSA depends on the computational difficulty of several different problems, corresponding to different ways that Eve might attempt to break the system. Factoring n Computing φ(n) Finding d directly Finding plaintext We examine each in turn and look at their relative computational difficulty. CPSC 467b, Lecture 10 25/45

Factoring RSA factoring problem Definition (RSA factoring problem) Given a number n that is known to be the product of two primes p and q, find p and q. Clearly, if Eve can find p and q, then she can compute the decryption key d from the public encryption key (e, n) (in the same way that Alice did when generating the key). This completely breaks the system, for now Eve has the same power as Bob to decrypt all ciphertexts. This problem is a special case of the general factoring problem. It is believed to be intractable, although it is not known to be NP-complete. CPSC 467b, Lecture 10 26/45

φ(n) φ(n) problem Definition (φ(n) problem) Given a number n that is known to be the product of two primes p and q, compute φ(n). Eve doesn t really need to know the factors of n in order to break RSA. It is enough for her to know φ(n), since that allows her to compute d = e 1 (mod φ(n)). Computing φ(n) is no easier than factoring n. Given n and φ(n), Eve can factor n by solving the system of quadratic equations n = pq φ(n) = (p 1)(q 1) for p and q using standard methods of algebra. CPSC 467b, Lecture 10 27/45

Finding d Decryption exponent problem Definition (Decryption exponent problem) Given an RSA public key (e, n), find the decryption exponent d. Eve might somehow be able to find d directly from e and n even without the ability to factor n or to compute φ(n). That would represent yet another attack that couldn t be ruled out by the assumption that the RSA factoring problem is hard. However, that too is not possible, as we now show. CPSC 467b, Lecture 10 28/45

Finding d Factoring n knowing e and d We begin by finding unique integers s and t such that and t is odd. 2 s t = ed 1 This is always possible since ed 1 0. Express ed 1 in binary. Then s is the number of trailing zeros and t is the value of the binary number that remains after the trailing zeros are removed. Since ed 1 0 (mod φ(n)) and 4 φ(n) (since both p 1 and q 1 are even), it follows that s 2. CPSC 467b, Lecture 10 29/45

Finding d Square roots of 1 (mod n) Over the reals, each positive number has two square roots, one positive and one negative, and no negative numbers have real square roots. Over Z n for n = pq, 1/4 of the numbers have square roots, and each number that has a square root actually has four. Since 1 does have a square root modulo n (itself), there are four possibilities for b: ±1 mod n and ± r mod n for some r Z n, r ±1 (mod n). CPSC 467b, Lecture 10 30/45

Finding d Finding a square root of 1 (mod n) Using randomization to find a square root of 1 (mod n). Choose random a Z n. Define a sequence b 0, b 1,..., b s, where b i = a 2i t mod n, 0 i s. Each number in the sequence is the square of the number preceding it (mod n). The last number in the sequence is b s = a ed 1 mod n. Since ed 1 (mod φ(n)), it follows using Euler s theorem that b s 1 (mod n). Since 1 2 mod n = 1, every element of the sequence following the first 1 is also 1. Hence, the sequence consists of a (possibly empty) block of non-1 elements, following by a block of one or more 1 s. CPSC 467b, Lecture 10 31/45

Finding d Using a non-trivial square root of unity to factor n Suppose b 2 1 (mod n). Then n (b 2 1) = (b + 1)(b 1). Suppose further that b ±1 (mod n). Then n (b + 1) and n (b 1). Therefore, one of the factors of n divides b + 1 and the other divides b 1. Hence, p = gcd(b 1, n) is a non-trivial factor of n. The other factor is q = n/p. CPSC 467b, Lecture 10 32/45

Finding d Randomized factoring algorithm knowing d Factor (n, e, d) { //finds s, t such that ed 1 = 2 s t and t is odd s = 0; t = ed 1; while (t is even ) {s++; t/=2; } } // Search for non-trivial square root of 1 (mod n) do { // Find a random square root b of 1 (mod n) choose a Z n at random; b = a t mod n; while (b 2 1 (mod n)) b = b 2 mod n; } while (b ±1 (mod n)); // Factor n p = gcd(b 1, n); q = n/p; return (p, q); CPSC 467b, Lecture 10 33/45

Finding d Notes on the algorithm Notes: b 0 is the value of b when the innermost while loop is first entered, and b k is the value of b after the k th iteration. The inner loop executes at most s 1 times since it terminates just before the first 1 is encountered, that is, when b 2 1 (mod n). At that time, b = b k is a square root of 1 (mod n). The outer do loop terminates if and only if b ±1 (mod n). At that point we can factor n. The probability that b ±1 (mod n) for a randomly chosen a Z n is at least 0.5. 3 Hence, the expected number of iterations of the do loop is at most 2. 3 (See Evangelos Kranakis, Primality and Cryptography, Theorem 5.1.) CPSC 467b, Lecture 10 34/45

Finding d Example Suppose n = 55, e = 3, and d = 27. 4 Then ed 1 = 80 = (1010000) 2, so s = 4 and t = 5. Now, suppose we choose a = 2. We compute the sequence of b s. b 0 = a t mod n = 2 5 mod 55 = 32 b 1 = (b 0 ) 2 mod n = (32) 2 mod 55 = 1024 mod 55 = 34 b 2 = (b 1 ) 2 mod n = (34) 2 mod 55 = 1156 mod 55 = 1 b 3 = (b 2 ) 2 mod n = (1) 2 mod 55 = 1 b 4 = (b 3 ) 2 mod n = (1) 2 mod 55 = 1 The last b i 1 in this sequence is b 1 = 34 1 (mod 55), so 34 is a non-trivial square root of 1 modulo 55. It follows that gcd(34 1, 55) = 11 is a prime divisor of n. 4 These are possible RSA values since n = 5 11, φ(n) = 4 10 = 40, and ed = 81 1 (mod 40). CPSC 467b, Lecture 10 35/45

plaintext A ciphertext-only attack against RSA Eve isn t really interested in factoring n, computing φ(n), or finding d, except as a means to read Alice s secret messages. A problem we would like to be hard is Definition (ciphertext-only problem) Given an RSA public key (n, e) and a ciphertext c, find the plaintext message m. CPSC 467b, Lecture 10 36/45

plaintext Hardness of ciphertext-only attack A ciphertext-only attack on RSA is no harder than factoring n, computing φ(n), or finding d, but it does not rule out the possibility of some clever way of decrypting messages without actually finding the decryption key. Perhaps there is some feasible probabilistic algorithm that finds m with non-negligible probability, maybe not even for all ciphertexts c but for some non-negligible fraction of them. Such a method would break RSA and render it useless in practice. No such algorithm has been found, but neither has the possibility been ruled out, even under the assumption that the factoring problem itself is hard. CPSC 467b, Lecture 10 37/45

One-way and Trapdoor Permutations CPSC 467b, Lecture 10 38/45

One-way permutations A one-way permutation is a permutation f that is easy to compute but hard to invert. To invert f means to find, for each element y, the unique x such that f (x) = y. Here, easy means computable in probabilistic polynomial time. Hard to invert means that no probabilistic polynomial time algorithm can find x given y with non-negligible success probability. CPSC 467b, Lecture 10 39/45

Negligible functions A function is said to be negligible if it goes to zero faster than any inverse polynomial. Definition (2.1 in Goldwasser-Bellare) ν is negligible if for every constant c 0 there exists an integer k c such that ν(k) < k c for all k k c. In other words, no matter what c you choose, ν(k) < k c for all sufficiently large k. CPSC 467b, Lecture 10 40/45

One-way functions More generally, any function f is one-way if it is easy to compute but hard to invert, where now invert means to find, given y in the range of f, any element x such that f (x) = y. Definition (2.2 in Goldwasser-Bellare) A function f : {0, 1} {0, 1} is one-way if: 1. There exists a PPT 5 that on input x outputs f (x); 2. For every PPT algorithm A there is a negligible function ν A such that for all sufficiently large k, Pr[ f(z) = y: x $ {0, 1} k ; y f(x); z A(1 k, y) ] ν A (k) 5 Probabilistic polynomial time Turing machine. CPSC 467b, Lecture 10 41/45

Fine points Here, k is a security parameter that measures the length of the argument x to f. It is also provided to A as input, in unary, so that A s running time is measured correctly as a function of k. Again we have several sources of randomness which jointly determine the probability that A successfully inverts f. In particular, the string y on which we wish to invert f is not chosen uniformly from strings of a given length but instead is chosen according the probability of y being the image under f of a uniformly chosen x from {0, 1} k. CPSC 467b, Lecture 10 42/45

Trapdoor functions A trapdoor function f is a one-way function that becomes easy to invert on a subset of its domain given a secret trapdoor string. Definition (2.15 of Goldwasser-Bellare, corrected) A trapdoor function is a one-way function f : {0, 1} {0, 1} such that there exists a polynomial p and a probabilistic polynomial time algorithm I such that for every k there exists a t k {0, 1} such that t k p(k) and for all x {0, 1} k, then I (f (x), t k ) = z, where f (z) = f (x). Taking this apart, it says that f, when restricted to strings of length k, can be inverted by the algorithm I when I is given a suitable trapdoor string t k. CPSC 467b, Lecture 10 43/45

A more intuitive formulation of trapdoor function In the usual formulation of trapdoor function, we imagine f being chosen at random from a family of one-way functions. The trapdoor string is the secret that allows f to be inverted. The idea is that f is regarded as a function of two arguments, k and x, where k and x are both bounded by a polynomial in the security parameter s. f (k, x) should be a one-way function but with the additional trapdoor property: There is a PPT algorithm I and a polynomial p such that for every s and every k {0, 1} with k p(s), there exists a t k {0, 1} with t k p(s) such that for all x {0, 1} s, then I (f (k, x), t k ) = z, where f (k, z) = f (k, x). CPSC 467b, Lecture 10 44/45

The RSA function The RSA function is the map f ((n, e), x) = x e (mod n). It is believed to be a trapdoor function with security parameter s when n is restricted to length s strings, n is is the product of two distinct primes of approximately the same length, e Z φ(n), and x Z n. Here, the index k is the pair (n, e), and the trapdoor t k = (n, d), where d is the RSA decryption exponent. The mathematically inclined will notice that this function does not quite fit the earlier definitions because of the restrictions on the domains of n, e, and x. We leave it to a more advanced course to properly sort out such details. CPSC 467b, Lecture 10 45/45