Draft Lecture Notes
Total Page:16
File Type:pdf, Size:1020Kb
CS-282A / MATH-209A Foundations of Cryptography Draft Lecture Notes Winter 2010 Rafail Ostrovsky UCLA Copyright © Rafail Ostrovsky 2003-2010 Acknowledgements: These lecture notes were produced while I was teaching this graduate course at UCLA. After each lecture, I asked students to read old notes and update them according to the lecture. I am grateful to all of the students who participated in this massive endeavor throughout the years, for asking questions, taking notes and improving these lecture notes each time. Table of contents PART 1: Overview, Complexity classes, Weak and Strong One-way functions, Number Theory Background. PART 2: Hard-Core Bits. PART 3: Private Key Encryption, Perfectly Secure Encryption and its limitations, Semantic Security, Pseudo-Random Generators. PART 4: Implications of Pseudo-Random Generators, Pseudo-random Functions and its applications. PART 5: Digital Signatures. PART 6: Trapdoor Permutations, Public-Key Encryption and its definitions, Goldwasser-Micali, El-Gamal and Cramer-Shoup cryptosystems. PART 7: Interactive Proofs and Zero-Knowledge. PART 8: Bit Commitment Protocols in different settings. PART 9: Non-Interactive Zero Knowledge (NIZK) PART 10: CCA1 and CCA2 Public Key Encryption from general Assumptions: Naor-Yung, DDN. PART 11: Non-Malleable Commitments, Non-Malleable NIZK. PART 12: Multi-Server PIR PART 13: Single-Server PIR, OT, 1-2-OT, MPC, Program Obfuscation. PART 14: More on MPC including GMW and BGW protocols in the honest-but-curious setting. PART 15: Yao’s garbled circuits, Efficient ZK Arguments, Non-Black-Box Zero Knowledge. PART 16: Remote Secure Data Storage (in a Cloud), Oblivious RAMs. CS 282A/MATH 209A: Foundations of Cryptography °c 2006-2010 Prof. Rafail Ostrovsky Part 1 1 Overview of Cryptography This section gives an overview of the various branches of cryptography. 1.1 Brief History While cryptography has been in use since the times of the Romans, it has only recently been formalized into a science. ² Claude Shannon (1940s) { Formalized \Perfect Security" while working on the ENIGMA project { De¯ned the private key communication model ² Whit¯eld Di±e and Martin Hellman (1970s) { Laid foundations for cryptographic techniques based on theoretical complexity assumptions; if a technique is cracked this directly implies a solution to a long- standing problem in mathematics { De¯ned public-key cryptography for secure transmissions over an insecure chan- nel ² Rivest, Shamir, and Adleman (1978) { RSA public-key cryptosystem ² Blum, Micali and Yao (in early 1980s) { Developed rigorous theoretical foundations of pseudo-random generators. ² Goldwasser and Micali (1980s) { Provided formal and ¯rst satisfactory de¯nition of encryption { Developed de¯nition for probabilistic encryption: partial information of the un- encoded message should not provide information about the encrypted message 1-1 1.2 Example Problem Spaces in Cryptography Secrecy in Communication Two parties (Alice and Bob) want to be able to communicate with each other in some manner such that an adversary (Eve) intercepting their communication will not be able to get any information about the message being sent. One simple protocol is as follows: ² Alice locks her message with lock LA and sends it to Bob. ² Bob locks the message with lock LB and sends it back to Alice. ² Alice unlocks LA and sends the message back again. ² Bob unlocks LB and reads the message. Non-Malleability A non-malleable encryption scheme has the property that it is di±cult to modify an en- crypted message to another similar message. As an example, consider a blind auction in which the auction-goers Gi send their bids to an auctioneer A. Without any encryption, A can collude with G1 so that G1 can send in a bid equal to max(Gi) + 1; i > 1. Simply using a commitment protocol f(bid) is not su±cient, as it can be possible for A to determine f(max(Gi) + 1); i > 1 without knowing the value of f(max(Gi)); i > 1. A non-malleable encryption scheme would prevent collusion. Authentication/Data Integrity In this problem Alice would like to send Bob a message in such a way that Eve cannot replace the message with her own message without Bob's knowledge. A common form of authentication is a digital signature, which is a piece of data that certi¯es a document so that the acceptor can be sure that it was issued by the correct sender. 1.3 Cryptographic Primitives Cryptographic primitives are used as building blocks to build more advanced security pro- tocols and cryptosystems. 1-2 Interactive/Zero Knowledge Proofs In an interactive proof (due GMR) there exist two parties, a prover P and a veri¯er V. P has a statement that he wishes to prove to V. P and V would like to run a protocol at the end of which V is convinced that the statement is true (to within any arbitrary degree of certainty) if it is true, but P (no matter how computationally powerful) is unable to prove a false statement to V. In a zero-knowledge proof, V should additionally gain no more knowledge than the validity of the statement; that is, V must accept the statement as true but does not know why it is true. Interactive proofs are far more powerful than conventional proofs, being able to prove any true statement in PSPACE. Regular proofs, by comparison, can only prove statements in NP. Coin-Flipping Protocols A coin flipping protocol is one in which Alice and Bob, who don't trust each other, run a protocol at the end of which, they agree on a fair coin flip such that neither of them can cheat. Commitment Protocols A commitment protocol is a protocol in which both parties commit to a decision in a way that appears simultaneous. This requires that once one party's decision is committed, he is unable to modify it, and also that the other party is unable to make an unfair decision based on the committed decision. Commitment protocols can form the basis for coin-flipping protocols. Secure Two-Party Computation In this protocol Alice and Bob have inputs xa and xb and they wish to compute some function f(xa; xb). At the end of the protocol, Alice and Bob should learn the computed value f(xa; xb) without learning the value of the other's input. 1-3 Private Information Retrieval Here, there is a database D of bits and a user wants to ¯nd out the value of bit i without revealing to the database program the index i. While this can be done by sending the user the entire database, there are more e±cient ways to provide the appropriate data without revealing this index i. 2 Background in Complexity Theory 2.1 Basing Cryptography on Complexity Theory Modern cryptography is based on assumptions on complexity thoery. One of these assump- tions is the existance of a one way function. Informally a one way function is a function that is easy to compute on an input, but given the output it is hard to come up with an inverse. Computation is computationally \easy" if it takes polynomial time in the size of the input. Computation is coputationally \hard" if it takes super-polynomial time in the size of the input. It is easy to see that if P=NP than no one way function can exist. Thus we must make the assumption that P 6= NP . While there is no proof that these complexity assumptions are true many researches believe them to be true. Once we have made some basic complexity assumptions we can then build protocols on these assumptions by showing that if the protocol is broken we can break the underlining complexity assumption. In other words if there is a program that can break the protocol we can use this program as a subroutine for breaking the underlining complexity assumption. Thus the protocol is at least as strong as the underlining complexity assumption. For example one complexity assumption is that it is hard to factor the product of two large primes. We can show that if we assume this to be hard then there exists a One- way Function. In turn, this implies that there exists a pseudo-random number generator which implies that there exists a secure commitment scheme. Finally, existence of a secure commitment scheme implies that there exists a coin-flipping protocol. Thus if there exists an adversary that can break the coin flipping protocol, we can use this adversary to factor large primes which would violate the complexity assumption. 2.2 Complexity Classes A language is a subset of a universal set of alphabet, that adheres to some rules. An algorithm is a procedure that decides if a given input is in the language. 1-4 The class of languages P is the set of all languages that can be recognized in deterministic polynomial time. The class of languages NP is the set of all languages that can be recognized in non- deterministic polynomial time. A Probabilistic Turing Machine is a non-deterministic Turing machine which randomly chooses transitions based on some underlying probability distribution. A probabilistic Tur- ing machine may give its output with certain error probabilities. Thus we can de¯ne com- plexity classes based on these error probabilities. 1 A function g(n): N ! N is negligible if 8c > 0; 9Nc > 0 such that 8n > Nc; jg(n)j < nc . Otherwise, g(n) is said to be non-negligible. Randomized Polytime (RP) is the set of all languages that can be recognized in poly- nomial time. Additionally, any RP algorithm satis¯es the following properties 1. it always runs in polynomial time as a function of input size.