CIS 5371 Cryptography 3. Private-Key Encryption and Pseudorandomness Based on: Jonathan Katz and Yehuda Lindel Introduction to Modern Cryptography 1 A Computational Approach to Cryptography • The principal of Kerchoffs essentially says that it is not necessary to use a perfectly-secret encryption scheme, but instead it suffices to use a scheme that cannot be broken in reasonable time with any reasonable probability of success. 2 A Computational Approach to Cryptography • That is, it suffices to use an encryption scheme that • can be broken in theory • but that cannot be broken in practice with probability better than 10−30 in 200 years using the fastest available supercomputer. 3 A Computational Approach 1. Security is only preserved against efficient adversaries 2. Adversaries can potentially succeed with some very small probability (small enough so that we are not concerned that it will ever really happen) 4 A concrete approach π−ππ . 5 The asymptotic approach • 6 The asymptotic approach 7 The asymptotic approach 8 The asymptotic approach – an example The effect that availability of faster computers might have on security in practice • Say we have a cryptographic scheme where honest parties are required to run for 106 β π2 cycles and for which an adversary is running for 108 β π4 cycles can succeed in breaking the scheme with probability 230 β 2−π . 9 The asymptotic approach – an example 10 The asymptotic approach – an example 2−80 . 11 The asymptotic approach – an example • The asymptotic approach has the advantage of not depending on any specific assumptions regarding, e.g., the type of computer an adversary will use. 12 Efficient Algorithms 13 Efficient Algorithms Generating randomness There are a number of ways random bits are obtained in practice. • One solution is to use a hardware random number generator that generates random bitstreams based on certain physical phenomena like thermal/electrical noise or radioactive decay. • Another possibility is to use software random number generators which generate random bitstreams based on unpredictable behavior such as the time between key-strokes, movement of the mouse, hard disk access times, and so on. 14 Efficient Algorithms Generating randomness • • Some modern operating systems provide functions of this sort. Note that, in either of these cases, the underlying unpredictable event is unlikely to directly yield uniformly-distributed bits, and so further processing of the initial bitstream is needed. Techniques for doing this are complex and poorly understood. 15 Efficient Algorithms Generating randomness • One must be careful in how random bits are chosen, and the use of badly designed or inappropriate random number generators can often leave a good cryptosystem vulnerable to attack. • Particular care must be taken to use a random number generator that is designed for cryptographic use, rather than a general-purpose random number generator which may be fine for some applications but not cryptographic ones 16 Negligible Success 17 Negligible Success 18 Proofs by Reduction Strategy 1. 2. Assume that some low-level problem is hard to solve. Then prove that the construction in question is secure given this assumption. 19 Proofs by Reduction The proof that a given construction is secure as long as some underlying problem is hard generally proceeds by presenting • an explicit reduction showing how to convert any efficient adversary A that succeeds in breaking the construction with non-negligible probability • into an efficient algorithm A’ succeeds in solving the problem that was assumed to be hard. 20 Proofs by Reduction To do this: 1. Fix some adversary A that succeeds in breaking a crypto construction ο with probability ο₯(n). 2. Construct an algorithm A’ (the reduction) that attempts to solve problem X using adversary A as a subroutine. 3. Given some instance x of X, algorithm A’ simulates for A an instance ο° of ο such that: If A can break ο° then A’ can break x with probability 1 π(π) . 4. Adversary A’ gives instance ο° to A to break. Then ο₯(π) A’ can solve instance x with probability π(π) 21 Proofs by Reduction Instance ο° of ο Solution to x Break 22 Computationally Secure Encryption (π) 23 Computationally Secure Encryption 24 Computationally Secure Encryption 25 Computationally Secure Encryption Equivalent version: | Pr[PrivK eav π΄′ , Π π, 0 = 1] - Pr PrivK eav π΄′ , Π π, 1 = 1 | ≤ negl(π) 26 Computationally Secure Encryption and π is chosen uniformly at random from {0,1}π . 27 Theorem Let (Gen,Enc,Dec) be a private-key encryption scheme that has indistinguishable encryptions in the presence of an eavesdropper. Then ο’ PPT adversaries π΄, any π there is a negligible function negl such that: Pr[π΄ 1π , πΈπππ (π) = ππ 1 ≤ + negl π , 2 where π is chosen randomly from {0,1}π , and the probability are taken over the random coins of π΄, the choice of π and π and any random coins used in the encryption process. 28 Proof of Theorem We shall reduce the problem “indistinguishability of the bits of encrypted messages” to the problem “indistinguishability of the encryptions of the messages” in the presence of an eavesdropper. 29 Security reduction: converting an adversary A ′ to an adversary A Algorithm A ′ (low level reference problem X) Adversary A Protocol Π, being analyzed πππ π‘ππππ π₯ ππ π πππ π‘ππππ ο° ππ Π Suppose A succeeds in solving ο°with advantage π π The reduction shows that A ′succeeds in solving x with advantage at least π π π πππ’π‘πππ π‘π π₯ π πππ’π‘πππ π‘π Π 30 Proof, in detail Let the advantage of π΄ be π′ π = Pr π΄(Encπ π = ππ − 1 2 . Let π ≤ π, and πΌ0π be the set of strings of length π whose π-th bit is 0 and πΌ1π be the set of strings of length π whose π-th bit is 1. Take ππ ∈ πΌππ . Then Pr π΄(Encπ ππ = π = Pr PrivK eav π΄′ , ο π = 1 = 1 2 +π π , (π π negligible) 1 = 2 Pr π΄ πΈπππ π0 π=0 1 =0 + Pr π΄ πΈπππ π1 π=1 2 =1 = Pr[π΄(πΈπππ π ) = ππ ] Then π′ = π 31 Proof of theorem– by reduction Algorithm A’ (message distinguisher) Adversary A (bit distinguisher) 1π 1π π0 , π1 π0 , π1 ππ ππ Suppose A succeeds with advantage π π in distinguishing the i-th bit of encrypted messages π′ π′ prediction of the message prediction of the value of the i-th bit 32 Semantic Security, Intro Theorem. Let (Gen,Enc,Dec) be a private-key encryption scheme that has indistinguishable encryptions in the presence of an eavesdropper. Then, ο’ PPT adversary π΄, ∃ a PPT algorithm A’ such that, ο’ polynomial-time computable functions π and sampleable sets π there is a negligible function negl(π) such that: |Pr π΄ 1π , πΈπππ π =π π − Pr π΄′ 1π = π π ≤ 1 2 + negl π , where the first probability is taken over uniform choice of π π {0,1}π and π π π, that randomness of A, and the randomness of πΈππ , and the second probability is taken over uniform choice of π π π and the randomness of A’. 33 Semantic Security: Definition A private-key encryption scheme (Gen,Enc,Dec) is semantically secure in the presence of an eavesdropper if ο’ PPT algorithm π΄, ο€ PPT π΄′ such that, ο’ PPT algorithm Samp and polynomial-time computable functions π, β the following is negligible: |Pr π΄ 1π , πΈπππ π , β π =π π Pr π΄′ 1π , π , β π − = π π |, where π is the output of Samp (1π ), and the probabilities are taken over the choices of π, π, the random coins of π΄, π΄′. 34 Semantic Security: Theorem A private-key encryption scheme has indistinguishable encryptions in the presence of an eavesdropper if and only if, it is semantically secure in the presence of an eavesdropper. 35