Docsity

Hybrid Encryption: A Combination of Asymmetric and Symmetric Encryption, Study notes of Computer Science

Toggle sidebar
bg1
Chapter 11
Asymmetric Encryption
The setting of public-key cryptography is also called the “asymmetric” setting due to the asymmetry
in key information held by the parties. Namely one party has a secret key while another has the
public key that matches this secret key. This is in contrast to the symmetry in the private key
setting, where both parties had the same key. Asymmetric encryption is thus another name for
public-key encryption, the mechanism for achieving data privacy in the public key or asymmetric
setting.
Our study of asymmetric encryption (following our study of other primitives) will begin by
searching for appropriate notions of security, and models and formalizations via which they are
captured. We then consider constructions, where we look at how to design and analyze various
schemes.
With regard to notions of security, we will be able to build considerably on our earlier study
of symmetric encryption. Indeed, from this point of view there is very little difference between
symmetric and asymmetric encryption; not much more than the fact that in the latter the adversary
gets the public key as input. This is important (and re-assuring) to remember. All the intuition and
examples we have studied before carry over, so that we enter the study of asymmetric encryption
already having a good idea of what encryption is, how security is modeled, and what it means
for a scheme to be secure. Accordingly we will deal with the security issues quite briefly, just
re-formulating the definitions we have seen before.
The second issue (namely constructions) is a different story. Designs of asymmetric encryption
schemes rely on tools and ideas different from those underlying the design of symmetric encryp-
tion schemes. Namely in the asymmetric case, the basis is (typically) computationally intractable
problems in number theory, while for the symmetric case we used block ciphers. Thus, the greater
part of the effort in this chapter will be on schemes and their security properties.
11.1 Asymmetric encryption schemes
An asymmetric encryption scheme is just like a symmetric encryption scheme except for an asym-
metry in the key structure. The key pk used to encrypt is different from the key sk used to decrypt.
Furthermore pk is public, known to the sender and also to the adversary. So while only a receiver
in possession of the secret key can decrypt, anyone in possession of the corresponding public key
can encrypt data to send to this one receiver.
1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Hybrid Encryption: A Combination of Asymmetric and Symmetric Encryption and more Study notes Computer Science in PDF only on Docsity!

Chapter 11

Asymmetric Encryption

The setting of public-key cryptography is also called the “asymmetric” setting due to the asymmetry in key information held by the parties. Namely one party has a secret key while another has the public key that matches this secret key. This is in contrast to the symmetry in the private key setting, where both parties had the same key. Asymmetric encryption is thus another name for public-key encryption, the mechanism for achieving data privacy in the public key or asymmetric setting. Our study of asymmetric encryption (following our study of other primitives) will begin by searching for appropriate notions of security, and models and formalizations via which they are captured. We then consider constructions, where we look at how to design and analyze various schemes. With regard to notions of security, we will be able to build considerably on our earlier study of symmetric encryption. Indeed, from this point of view there is very little difference between symmetric and asymmetric encryption; not much more than the fact that in the latter the adversary gets the public key as input. This is important (and re-assuring) to remember. All the intuition and examples we have studied before carry over, so that we enter the study of asymmetric encryption already having a good idea of what encryption is, how security is modeled, and what it means for a scheme to be secure. Accordingly we will deal with the security issues quite briefly, just re-formulating the definitions we have seen before. The second issue (namely constructions) is a different story. Designs of asymmetric encryption schemes rely on tools and ideas different from those underlying the design of symmetric encryp- tion schemes. Namely in the asymmetric case, the basis is (typically) computationally intractable problems in number theory, while for the symmetric case we used block ciphers. Thus, the greater part of the effort in this chapter will be on schemes and their security properties.

11.1 Asymmetric encryption schemes

An asymmetric encryption scheme is just like a symmetric encryption scheme except for an asym- metry in the key structure. The key pk used to encrypt is different from the key sk used to decrypt. Furthermore pk is public, known to the sender and also to the adversary. So while only a receiver in possession of the secret key can decrypt, anyone in possession of the corresponding public key can encrypt data to send to this one receiver.

2 ASYMMETRIC ENCRYPTION

Definition 11.1 An asymmetric encryption scheme AE = (K, E, D) consists of three algorithms, as follows:

  • The randomized key generation algorithm K (takes no inputs and) returns a pair (pk, sk) of keys, the public key and matching secret key, respectively. We write (pk, sk) ← K$ for the operation of executing K and letting (pk, sk) be the pair of keys returned.
  • The encryption algorithm E takes the public key pk and a plaintext (also called a message) M to return a value called the ciphertext. The algorithm may be randomized, but not stateful. We write C ← E$ pk (M ) or C ← E$ (pk, M ) for the operation of running E on inputs pk, M and letting C be the ciphertext returned.
  • The deterministic decryption algorithm D takes the secret key sk and a ciphertext C 6 = ⊥ to return a message M. We write M ← Dsk (C) or M ← D(sk, C).

The message space associated to a public key pk is the set Plaintexts(pk) of all M for which Epk (M ) never returns ⊥. We require that the scheme provide correct decryption, which means that for any key-pair (pk, sk) that might be output by K and any message M ∈ Plaintexts(pk), if C was returned by Epk (M ) then Dsk (C) = M.

Let R be an entity that wants to be able to receive encrypted communications. The first step is key generation: R runs K to generate a pair of keys (pk, sk) for itself. Note the key generation algorithm is run locally by R. Anyone in possession of R’s public key pk can then send a message M privately to R. To do this, they would encrypt M via C ← Epk (M ) and send the ciphertext C to R. The latter will be able to decrypt C using sk via M ← Dsk (C). Note that an entity wishing to send data to R must be in possession of R’s public key pk, and must be assured that the public key is authentic, meaning really is the R’s public-key, and not someone else’s public key. We will look later into mechanisms for assuring this state of knowledge. But the key management processes are not part of the asymmetric encryption scheme itself. In constructing and analyzing the security of asymmetric encryption schemes, we make the assumption that any prospective sender is in possession of an authentic copy of the public key of the receiver. This assumption is made in what follows. A viable scheme of course requires some security properties. But these are not our concern now. First we want to pin down what constitutes a specification of a scheme, so that we know what are the kinds of objects whose security we want to assess. The key usage is the “mirror-image” of the key usage in a digital signature scheme. In an asymmetric encryption scheme, the holder of the secret key is a receiver, using the secret key to decrypt ciphertexts sent to it by others. In a digital signature scheme, the holder of the secret key is a sender, using the secret key to tag its own messages so that the tags can be verified by others. The last part of the definition says that ciphertexts that were correctly generated will decrypt correctly. The encryption algorithm might be randomized, and must for security. But unlike in a sym- metric encryption scheme, we will not consider stateful asymmetric encryption algorithms. This is because there is no unique sender to maintain state; many different entities are sending data to the receiver using the same public key. The decryption algorithm is deterministic and stateless. We do not require that the message or ciphertext be strings. Many asymmetric encryption schemes are algebraic or number-theoretic, and in the natural formulation of these schemes messages might be group elements and ciphertexts might consist of several group elements. However, it is understood that either messages or ciphertexts can be encoded as strings wherever necessary. (The

4 ASYMMETRIC ENCRYPTION

C ← EK (Mb) Return C

Thus the oracle encrypts one of the messages, the choice of which being made according to the bit b. Now we consider two “worlds”:

World 0: The oracle provided to the adversary is Epk (LR(·, ·, 0)). So, whenever the adversary

makes a query (M 0 , M 1 ) to its oracle, the oracle computes C ← E$ pk (M 0 ), and returns C as the answer.

World 1: The oracle provided to the adversary is Epk (LR(·, ·, 1)). So, whenever the adversary makes a query (M 0 , M 1 ) to its oracle, the oracle computes C ← E$ pk (M 1 ), and returns C as the answer.

We call the first world (or oracle) the “left” world (or oracle), and we call the second world (or oracle) the “right” world (or oracle). The problem for the adversary is, after talking to its oracle for some time, to tell which of the two oracles it was given. The adversary queries makes some number of queries to its oracle, and then outputs a bit. This bit has some probability of equaling one. The probability is over the choice of the keys (pk, sk) as made by the key-generation algorithm, any random choices made by the oracle, and any other random choices made by the adversary in its computation. We look at this probability in each of the two worlds as the basis for the definition. We suggest that the reader return to the chapter on symmetric encryption to refresh his or her mind about this model. In particular remember that the encryption function is randomized, and the oracle implementing it is thus randomized too. Each time the oracle computes a ciphertext, it does so by running the encryption algorithm with fresh coins.

Definition 11.2 Let AE = (K, E, D) be an asymmetric encryption scheme, let b ∈ { 0 , 1 }, and let A be an algorithm that has access to an oracle and returns a bit. We consider the following experiment:

Experiment Expind AE- cpa-b(A) (pk, sk) ← K$ b′^ ← AEpk^ (LR(·,·,b))(pk) Return b′

The ind-cpa-advantage of A is defined as

Advind AE - cpa(A) = Pr

[ Expind AE- cpa-^1 (A) = 1

] − Pr

[ Expind AE - cpa-^0 (A) = 1

] .

As usual, the time-complexity mentioned above is the worst case total execution time of the entire experiment. This means the adversary complexity, defined as the worst case execution time of A plus the size of the code of the adversary A, in some fixed RAM model of computation (worst case means the maximum over A’s coins or the answers returned in response to A’s oracle queries), plus the time for other operations in the experiment, including the time for key generation and the computation of answers to oracle queries via execution of the encryption algorithm. Another convention we make is that the length of a query M 0 , M 1 to a left-or-right encryption oracle is defined as |M 0 |. (We can assume without loss of generality that this equals |M 1 | since otherwise the oracle returns ⊥ and so the query would be useless.) The total message length, which

Bellare and Rogaway 5

is the sum of the lengths of all oracle queries, is another parameter of interest. We say that the total message length is at most μ if it is so in the worst case, meaning across all coin tosses and answers to oracle queries in the experiment. We consider an encryption scheme to be “secure against chosen-plaintext attack” if a “rea- sonable” adversary cannot obtain “significant” advantage, where reasonable reflects its resource usage. The technical notion is called indistinguishability under chosen-ciphertext attack, denoted IND-CPA.

11.2.2 Security against chosen-ciphertext attack

Stories introducing chosen-ciphertext attack can be somewhat whimsical. One is about the so- called “lunchtime attack.” Entity R goes to lunch while leaving his console accessible. For the short period of the lunch break, an adversary gets access to this console; when the lunch break is over, the adversary has to leave before it is discovered at the console by the legitimate user, returning from lunch. The access is such that the adversary cannot actually read the secret decryption key sk (imagine that sk is in protected hardware) but does have the capability of executing the algorithm Dsk (·) on input any ciphertext of its choice. At that time if the adversary has in hand some ciphertext it wants to decrypt, it can certainly do so; there is nothing one can do to prevent that. However, it may be able to do even more. For example, perhaps there is some clever sequence of calls to Dsk (·) via which the latter can be made to output sk itself. (These calls would not be made under normal execution of the algorithm on normal ciphertexts, but the adversary concocts weird ciphertexts that make the decryption routine do strange things.) Having sk means the adversary could decrypt traffic at any time in the future, even after the lunch break. Alternatively, the adversary is able to call Dsk (·) on some inputs that result in the adversary’s gaining some information that would enable it to decrypt some fraction of ciphertexts it might see later, after the lunch break, when it no longer has access to Dsk (·). These are the eventualities we want to prevent. This scenario is artificial enough that were it the only motivation, it would be natural to wonder whether it is really worth the trouble to design schemes to withstand chosen-ciphertext attack. But this is not the main motivation. The real motivation arises from gathering evidence that asymmetric encryption schemes secure against chosen-ciphertext attack are the desired and appropriate tool for use in many higher level protocols, for example protocols for authenticated session key exchange. There a party decrypts a random challenge message to prove its identity. This leaves it open to a chosen-ciphertext attack on the part of an adversary who sends ciphertexts in the guise of challenges and obtains their decryption. Were this attack to reveal the secret key, the adversary could impersonate the legitimate entity at a later date, since it would now itself possess the ability to decrypt the challenges sent by others. Based on this and other such applications, we would like to design asymmetric encryption schemes that are secure against very strong kinds of chosen-ciphertext attack. To illustrate let’s consider the following game. An adversary A is given a challenge ciphertext C and must output the corresponding plaintext to win the game. The adversary is given the public key pk under which C was created, and is also given access to the oracle Dsk (·) allowing decryption under the secret key sk corresponding to pk. A trivial way for the adversary to win the game is to invoke its oracle on C. This triviality is the one thing disallowed. We allow the adversary to invoke Dsk (·) on any input C′^6 = C. Of course it may invoke the oracle multiple times; all the inputs provided to the oracle must however be different from C. If from the information so gathered the adversary can

Bellare and Rogaway 7

an adversary making just one lr-encryption oracle query and having other resources comparable to that of the original adversary. This is true both under chosen-plaintext and chosen-ciphertext attack, as indicated in the following.

Theorem 11.4 Let AE = (K, E, D) be an asymmetric encryption scheme. Let B be an ind-cpa adversary who makes at most qe queries to its left-or-right encryption oracle. Then there exists an ind-cpa adversary A making at most one query to its left-or-right encryption oracle and such that

Advind AE- cpa(B) ≤ qe · Advind AE- cpa(A). (11.1)

Furthermore, the running time of A is that of B. Similarly, let B be an ind-cca adversary who makes at most qe queries to its left-or-right encryption oracle. Then there exists an ind-cca adversary A making at most one query to its left-or-right encryption oracle and such that

Advind AE- cca(B) ≤ qe · Advind AE- cca(A). (11.2)

Furthermore, the number of decryption oracle queries made by A is the same as made by B, and the running time of A is that of B.

In a qualitative sense, this theorem can be interpreted as saying that an asymmetric encryption scheme secure against adversaries making just one lr-encryption query is also secure against adver- saries making many lr-encryption queries. This will simplify later analyses by allowing us to focus on adversaries that make only one lr-encryption query. An important element making this result possible is that in an asymmetric encryption scheme, an adversary can itself encrypt any message it wants, because it has the public (encryption) key. In the symmetric setting, the adversary cannot directly encrypt a message, but may only do so via an oracle that holds the key. An analogue of the above is true in the symmetric setting, but requires that the adversary be provided not only with an lr-encryption oracle but also with an encryption oracle.

Proof of Theorem 11.4: The statement corresponding to Equation (11.1) follows from the state- ment corresponding to Equation (11.2) by considering an ind-cca adversary who makes no queries to its decryption oracle, so we need only prove the statement corresponding to Equation (11.2).

We will use what’s called a “hybrid argument”. We will associate to B a sequence of experiments

Exp^0 AE (B) , Exp^1 AE (B) ,... , Expq AE (B) (11.3)

such that, if we let

P (i) = Pr

[ Expi AE (B) = 1

]

for i ∈ { 0 , 1 ,... , q}, then it will be the case that

P (0) = Pr

[ Expind AE - cca-^0 (B) = 1

] (11.4)

P (q) = Pr

[ Expind AE - cca-^1 (B) = 1

]

. (11.5)

In other words, the first and last experiments in our sequence will correspond to the world 0 and world 1 experiments, respectively, in Definition 11.2. If so, Definition 11.2 tells us that

Advind AE - cca(B) = P (q) − P (0).

8 ASYMMETRIC ENCRYPTION

Oracle HE (^) pki (M 0 , M 1 ) j ← j + 1 If j ≤ i then C ← E$ pk (M 1 ) else C ← E$ pk (M 0 ) EndIf Return C

Experiment Expi AE (B) (pk, sk) ← K$ d ← BHE^ pki (·,·),Dsk^ (·) (pk) Return d

Adversary AEpk^ (LR(·,·,b)),Dsk^ (·)(pk) j ← 0 ; I ← {$ 1 ,... , q} Subroutine OE(M 0 , M 1 ) j ← j + 1 If j < I then C ← E$ pk (M 1 ) EndIf If j = I then C ← E$ pk (LR(M 0 , M 1 , b)) EndIf If j > I then C ← E$ pk (M 0 ) EndIf Return C End Subroutine d ←$ BOE(·,·),Dsk^ (·)(pk) Return d

Figure 11.1: Hybrid oracles and experiments related to the construction of ind-cca adversary A in the proof of Theorem 11.4.

Now comes a trick. We consider the sum q∑− 1

i=

[P (i) − P (i)].

Its value, of course, is 0. Hence, from the above,

Advind AE- cca(B) = P (q) − P (0)

= P (q) +

q∑− 1

i=

[P (i) − P (i)] − P (0)

∑^ q

i=

P (i) −

q∑− 1

i=

P (i).

We will now construct ind-cca-adversary A so that

Pr

[ Expind AE- cca-^1 (A) = 1

]

q

∑^ q

i=

P (i) (11.6)

10 ASYMMETRIC ENCRYPTION

∑^ q

i=

P (i − 1) ·

q

q∑− 1

i=

P (i) ·

q

which justifies Equation (11.7). This concludes the proof.

11.4 Hybrid encryption

Before we present constructions of asymmetric encryption schemes, it is useful to get some idea of the context in which they are used. Given an asymmetric encryption scheme AE = (Ka, Ea, Da), one rarely encrypts data directly with it. Rather, to encrypt M under a public key pk of this scheme, we first pick a random key K for a symmetric encryption scheme SE = (Ks, Es, Ds), encrypt K under pk via the asymmetric scheme to get a ciphertext Ca, encrypt M under K via the symmetric scheme to get a ciphertext Cs, and transmit (Ca, Cs). This is called hybrid encryption. More precisely, hybrid encryption is a transform that given any asymmetric encryption scheme and any symmetric encryption scheme associates to them a new asymmetric encryption scheme:

Scheme 11.5 Let AE = (Ka, Ea, Da) be an asymmetric encryption scheme, and let SE = (Ks, Es, Ds) be a stateless symmetric encryption scheme such that Keys(SE) ⊆ Plaintexts(pk) for every pk that might be output by Ka. The hybrid encryption scheme associated to AE, SE is the asymmetric encryption scheme AE = (Ka, E, D) whose key-generation algorithm is the same as that of AE and whose encryption and decryption algorithms are defined as follows:

Algorithm Epk (M ) K ← K$ s^ ; Cs^ ← E$ Ks (M ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ pka (K) ; C ← (Ca, Cs) Return C

Algorithm Dsk (C) Parse C as (Ca, Cs) K ← Da sk (Ca) If K = ⊥ then return ⊥ M ← DsK (Cs) Return M

Under this hybrid encryption scheme, one can (asymmetrically) encrypt any message M that is in the plaintext-space of the underlying symmetric encryption scheme.

Hybrid encryption is used for numerous reasons. The principal one is cost. The number-theoretic operations underlying common asymmetric encryption schemes are computationally costly relative to the operations on block ciphers that underly common symmetric encryption schemes. In practice one wants to minimize the amount of data to which these number-theoretic operations are applied. Accordingly, rather than encrypt the possibly long message M directly under pk via the given asymmetric scheme, one uses hybrid encryption. The costly number-theoretic operations are thus applied only to data whose length k is fixed and not dependent on the length of M. This context tells us that when we design asymmetric encryption schemes, we can typically assume that the message space consists of short strings. This will facilitate our constructions. However, before we adopt the hybrid encryption paradigm we need to know that it “works,” meaning that it is secure. In assessing the strength of hybrid encryption, we use as usual the

Bellare and Rogaway 11

provable-security philosophy and approach. A hybrid encryption scheme is built from two com- ponents: a base asymmetric encryption scheme and a base symmetric encryption scheme. The appropriate question to ask is whether the assumed security of the components suffices to guar- antee security of the hybrid scheme based on them. It turns out that it does, and moreover for security under both chosen-plaintext and chosen-ciphertext atttacks. Theorem 11.6 below addresses the first case, and Theorem 11.7 the second. (Although the latter implies the former, we state and prove them separately because the proof has some delicate issues and ideas and is best understood via an incremental approach.)

Theorem 11.6 Let AE = (Ka, Ea, Da) be an asymmetric encryption scheme, let SE = (Ks, Es, Ds) be a stateless symmetric encryption scheme such that

Keys(SE) ⊆ Plaintexts(pk)

for every pk that might be output by Ka, and let AE = (Ka, E, D) be the hybrid encryption scheme associated to AE, SE as per Scheme 11.5. Let k denote the length of keys output by Ks. Let B be an ind-cpa-adversary attacking AE. Then there exist ind-cpa adversaries A 00 , 01 , A 11 , 10 attacking AE, and an adversary A attacking SE, such that

Advind AE - cpa(B)

≤ Advind AE- cpa(A 00 , 01 ) + Advind AE - cpa(A 11 , 10 ) + Advind SE - cpa(A). (11.8)

Furthermore, suppose B had time complexity at most t, made at most q queries to its left-or-right encryption oracle, these totalling at most μ bits in length. Then A 00 , 01 , A 11 , 10 each have time- complexity at most t and make at most q left-or-right encryption oracle queries, each query being k bits long. Also A has time-complexity at most t, and makes only one query to its left-or-right encryption oracle.

The qualitative interpretation of Theorem 11.6 is that if AE and SE are each assumed to be secure against chosen-plaintext attack, then AE is also secure against chosen-plaintext attack. On the quantitative front, note that the advantage of AE against an attack involving q lr-encryption queries is upper bounded as a function of the advantage of SE against an attack involving only a single lr-encryption query. This means that the symmetric encryption scheme used may be very weak and yet the hybrid asymmetric encryption scheme will be secure. For example, the encryption algorithm of the symmetric encryption scheme could apply a pseudorandom bit generator to the key to get an output of |M | bits and XOR this with the message to get the ciphertext. In particular, the symmetric encryption scheme could be deterministic.

Proof of Theorem 11.6: These constructions are not as straightforward as some we have seen in the past. We will need to “isolate” the asymmetric and symmetric components of AE in such a way that an attack on this scheme can be broken down into attacks on the component schemes. To do this we will use a hybrid argument. We will associate to B a sequence of experiments

Exp^00 AE (B) , Exp^01 AE (B) , Exp^11 AE (B) , Exp^10 AE (B) (11.9)

such that, if we let

P (α, β) = Pr

[ Expαβ AE (B) = 1

] (11.10)

Bellare and Rogaway 13

Oracle HE (^) pk^00 (M 0 , M 1 ) K 0 ← K$ s^ ; K 1 ← K$ s Cs^ ← E$ s(K 0 , M 0 ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ a(pk, K 0 ) C ← (Ca, Cs) Return C

Oracle HE (^) pk^01 (M 0 , M 1 ) K 0 ← K$ s^ ; K 1 ← K$ s Cs^ ← E$ s(K 0 , M 0 ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ a(pk, K 1 ) C ← (Ca, Cs) Return C

Oracle HE (^) pk^11 (M 0 , M 1 ) K 0 ← K$ s^ ; K 1 ← K$ s Cs^ ← E$ s(K 0 , M 1 ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ a(pk, K 1 ) C ← (Ca, Cs) Return C

Oracle HE (^) pk^10 (M 0 , M 1 ) K 0 ← K$ s^ ; K 1 ← K$ s Cs^ ← E$ s(K 0 , M 1 ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ a(pk, K 0 ) C ← (Ca, Cs) Return C

Figure 11.2: Hybrid lr-encryption oracles used in the proof of Theorem 11.6.

This defines our experiments in terms of the oracles, and, finally, the oracles themselves are specified in Fig. 11.2. Each hybrid lr-encryption oracle is paramterized by a pair (α, β) of bits and takes input a pair M 0 , M 1 of messages. Examining the oracles, you will see that they are mostly identical, different only in the quantities that have been boxed. Each oracle picks not one but two keys K 0 , K 1 , independently at random, for symmetric encryption. It then encrypts Mα under K 0 via the symmetric encryption scheme to get a ciphertext Cs, and it encrypts Kβ under the public key via the asymmetric encryption scheme to get a ciphertext Ca. It returns the pair (Ca, Cs).

Note oracles HE (^) pk^00 (·, ·) and HE (^) pk^10 (·, ·) do not actually use K 1. We have asked these oracles to pick K 1 only to highlight the common template underlying all four oracles.

Observe that oracle HE (^) pk^00 (·, ·) and oracle Epk (LR(·, ·, 0)) are equivalent in the sense that their responses to any particular query are identically distributed. Similarly oracle HE (^) pk^10 (·, ·) and oracle Epk (LR(·, ·, 1)) are equivalent. This means that Equations (11.11) and (11.12) are true, which is the first requirement of a successful hybrid argument.

The new hybrid lr-encryption oracles we introduce may seem rather bizarre at first since they do not necessarily return valid ciphertexts. For example, oracle (0, 1) will return a ciphertext (C a, Cs) in which Cs^ is the encryption of M 0 under a key K 0 , but Ca^ is not an encryption of K 0 as it ought to be under the definition of AE, but rather is the encryption of a random, unrelated key K 1. Thus, in the corresponding hybrid experiment, B is not getting the types of responses it “expects.” But nonetheless, being an algorithm with access to an oracle, B will execute and eventually return a bit. The meaning of this bit may be unclear, but we will see that this does not matter.

Before constructing A 01 , 00 so that Equation (11.13) is true, let us try to explain the intuition. Con- sider hybrid lr-encryption oracles (0, 0) and (0, 1). Note that in both experiments, C s^ is computed

14 ASYMMETRIC ENCRYPTION

Adversary A

Ea pk (LR(·,·,b)) 01 , 00 (pk) Subroutine OE(M 0 , M 1 ) K 0 ← K$ s^ ; K 1 ← K$ s Cs^ ← E$ s(K 0 , M 0 ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ pka (LR(K 0 , K 1 , b)) Return (Ca, Cs) End Subroutine d ←$ BOE(·,·)(pk) Return d

Adversary A

E pka (LR(·,·,b)) 10 , 11 (pk) Subroutine OE(M 0 , M 1 ) K 0 ← K$ s^ ; K 1 ← K$ s Cs^ ← E$ s(K 0 , M 1 ) If Cs^ = ⊥ then return ⊥ Ca^ ← E$ pka (LR(K 1 , K 0 , b)) Return (Ca, Cs) End Subroutine d ←$ BOE(·,·)(pk) Return d

Figure 11.3: Adversaries attacking AE constructed for the proof of Theorem 11.6.

in exactly the same way. This means that the difference between P (0, 0) and P (0, 1) measures the ability of the adversary to tell whether Ca^ encrypts the key underling Cs^ or not. This is something we can relate solely to the security of the base asymmetric encryption scheme.

Adversary A 01 , 00 attacking the base asymmetric encryption scheme AE is specified in Fig. 11.3. As per Definition 11.2, it has access to a lr-encryption oracle E (^) pka (LR(·, ·, b)). Its strategy is to define a subroutine OE and then run B, using OE to reply to B’s oracle queries. Subroutine OE takes input a pair M 0 , M 1 of messages, picks a pair of keys for symmetric encryption, and finally returns a ciphertext which is computed using a call to the given oracle E (^) pka (LR(·, ·, b)).

Consider A 01 , 00 in world 1, meaning its oracle is E (^) pka (LR(·, ·, 1)). In that case, the ciphertext Ca computed by subroutine OE(·, ·) is an encryption of K 1 , and thus subroutine OE(·, ·) is equivalent to oracle HE (^) pk^01 (·, ·). On the other hand, when A 01 , 00 is in world 0, meaning its oracle is E (^) pka (LR(·, ·, 0)), the ciphertext Ca^ computed by subroutine OE(·, ·) is an encryption of K 0 , and thus subroutine OE(·, ·) is equivalent to oracle HE (^) pk^00 (·, ·). Hence

Pr

[ Expind AE - cpa-^1 (A 01 , 00 ) = 1

] = Pr

[ Exp^01 AE (B) = 1

]

Pr

[ Expind AE - cpa-^0 (A 01 , 00 ) = 1

] = Pr

[ Exp^00 AE (B) = 1

] .

Subtracting, and remembering the notation of Equation (11.10), we get

Advind AE- cpa(A 01 , 00 ) = P (0, 1) − P (0, 0) ,

which justifies Equation (11.13).

We leave to the reader the task of verifying Equation (11.15) based on the construction of A 11 , 10 given in Fig. 11.3, and now proceed to the construction of the ind-cpa adversary A attacking the base symmetric encryption scheme.

The intuition here is that the (0, 1) and (1, 1) hybrid experiments both compute C a^ as an encryption of key K 1 , but differ in which message they symmetrically encrypt under K 0 , and thus the difference between P (0, 1) and P (1, 1) measures the ability of the adversary to tell which message C s^ encrypts

16 ASYMMETRIC ENCRYPTION

Oracle HE (^) pki (M 0 , M 1 ) j ← j + 1 K 0 ← K$ s^ ; K 1 ← K$ s If j ≤ i then Cs^ ← E$ s(K 0 , M 1 ) else Cs^ ← E$ s(K 0 , M 0 ) EndIf If Cs^ = ⊥ then return ⊥ Ca^ ← E$ a(pk, K 1 ) C ← (Ca, Cs) Return C

Experiment Expi AE (B) (pk, sk) ← K$ a d ← BHE^ pki (·,·) (pk) Return d

Adversary AEKs^ (LR(·,·,b)) (pk, sk) ← K$ a^ ; j ← 0 ; I ← {$ 1 ,... , q} Subroutine OE(M 0 , M 1 ) j ← j + 1 K 0 ← K$ s^ ; K 1 ← K$ s If j < I then Cs^ ← E$ s(K 0 , M 1 ) EndIf If j = I then Cs^ ← E$ Ks (LR(M 0 , M 1 , b)) EndIf If j > I then Cs^ ← E$ s(K 0 , M 0 ) EndIf If Cs^ = ⊥ then return ⊥ Ca^ ← E$ a(pk, K 1 ) Return (Ca, Cs) End Subroutine d ←$ BOE(·,·)(pk) Return d

Figure 11.4: Hybrid oracles and experiments related to the construction of ind-cpa adversary A in the proof of Theorem 11.6.

= Pr

[ Expind SE - cpa-^1 (A) = 1

] − Pr

[ Expind SE - cpa-^0 (A) = 1

]

∑^ q

i=

Pr

[ Expind SE - cpa-^1 (A) = 1 | I = i

] · Pr [I = i]

∑^ q

i=

Pr

[ Expind SE - cpa-^0 (A) = 1 | I = i

] · Pr [I = i]

Bellare and Rogaway 17

∑^ q

i=

P (i) · Pr [I = i] −

∑^ q

i=

P (i − 1) · Pr [I = i]

q

∑^ q

i=

P (i) − P (i − 1)

q

· [P (1, 1) − P (0, 1)].

In the last step we used Equation (11.17). Re-arranging terms, we get Equation (11.14). This completes the proof.

We now proceed to the chosen-ciphertext attack case. The scheme itself is unchanged, but we now claim that if the base components are secure against chosen-ciphertext attack, then so is the hybrid encryption scheme.

Theorem 11.7 Let AE = (Ka, Ea, Da) be an asymmetric encryption scheme, let SE = (Ks, Es, Ds) be a stateless symmetric encryption scheme such that

Keys(SE) ⊆ Plaintexts(pk)

for every pk that might be output by Ka, and let AE = (Ka, E, D) be the hybrid encryption scheme associated to AE, SE as per Scheme 11.5. Let k denote the length of keys output by Ks, and let c denote the length of a ciphertext created by E a^ on input a k-bit message. Let B be an ind-cpa- adversary attacking AE. Then there exist ind-cpa adversaries A 01 , 00 , A 10 , 11 attacking AE, and an adversary A attacking SE, such that

Advind AE- cca(B)

≤ Advind AE - cca(A 01 , 00 ) + Advind AE- cca(A 10 , 11 ) + Advind SE - cca(A). (11.18)

Furthermore, suppose B had time complexity at most t, made at most qe queries to its left-or-right encryption oracle, these totalling at most μe bits in length, and at most qd queries to its decryption oracle, these totalling at most μd bits in length. Then A 00 , 01 , A 11 , 10 each have time-complexity at most t and make at most qe left-or-right encryption oracle queries, each query being k bits long, and at most qd queries decryption oracle queries, each at most c bits long. Also A has time-complexity at most t, makes only one query to its left-or-right encryption oracle, and at most qd queries to its decryption oracle.

Proof of Theorem 11.7: We use a hybrid experiment template similar to the one in the proof of Theorem 11.6, but there are some tricky issues regarding decryption oracles. Let us try to highlight these before proceeding to the constructions.

Since B now has access to a decryption oracle, the (α, β) hybrid experiment of the proof of Theorem 11.6 will have to be enhanced to provide B with an oracle that plays the role of the decryption oracle that B expects. A natural first thought is to set this to the actual decryption or- acle Dsk (·). Now, let us look ahead to the construction of A 01 , 00. Besides subroutine OE to replace B’s lr-encryption oracle, A 01 , 00 will have to provide a subroutine OD to replace B’s decryption oracle. This seems easy at first glance, because A 01 , 00 , itself being a ind-cca-adversary, has access to a decryption oracle Dsk (·) for the base asymmetric encryption scheme. Thus, it can simulate

Bellare and Rogaway 19

Experiment Expαβ AE (B) (pk, sk) ← K$ a^ ; j ← 0 d ← BHE^

αβ pk (·,·),HDsk (·,·)(pk) Return d

The experiment initializes a counter j to 0, and then runs B, replacing B’s lr-encryption oracle with a hybrid lr-encryption oracle, and B’s decryption oracle with a hybrid decryption oracle. Note that the hybrid lr-encryption depends on (α, β) but the hybrid decryption oracle does not. However, the two oracles share state, in the form of counter j as well as quantities that are created and stored by the hybrid lr-encryption oracle and then accessed by the hybrid decryption oracle.

The hybrid lr-encryption oracles, shown in Fig. 11.5, are equivalent to the corresponding ones of Fig. 11.2 in the sense that on any inputs M 0 , M 1 , the output of the (α, β) hybrid lr-encryption oracle of Fig. 11.5 is distributed identically to the output of the (α, β) hybrid lr-encryption oracle of Fig. 11.2. However, the code of the hybrid lr-encryption oracles has been enhanced to do some extra internal book-keeping.

The hybrid decryption oracle invokes a subroutine Find that given a value T and a list T 1 ,... , Tj returns the smallest j such that T = Tj if such a j exists, and 0 if T 6 ∈ {T 1 ,... , Tj }. It uses this to see whether the asymmetric component of the ciphertext it is given to decrypt was previously returned by a partner (α, β) hybrid lr-encryption oracle. If not, it decrypts the given ciphertext via the decryption algorithm of scheme AE, using the secret key sk which it is given. Else, it decrypts the symmetric component of the ciphertext under the key K 0 ,j chosen at the time the asymmetric component was first created.

As in the proof of Theorem 11.6, for any α, β ∈ { 0 , 1 }, we let

P (α, β) = Pr

[ Expαβ AE (B) = 1

] .

Observe that the hybrid decryption oracle is equivalent to Dsk (·) in the cases (α, β) ∈ {(0, 0), (1, 0)} because in these cases, the asymmetric component of the ciphertext produced by the hybrid lr- encryption oracle is an encryption of K 0 ,j. Thus we have

P (1, 0) = Pr

[ Expind AE - cca-^1 (B) = 1

]

P (0, 0) = Pr

[ Expind AE - cca-^0 (B) = 1

] .

Following the proof of Theorem 11.6, our proof of Equation (11.18) is complete if we can construct adversaries A 01 , 00 , A, A 10 , 11 such that

P (0, 1) − P (0, 0) ≤ Advind AE - cca(A 01 , 00 ) (11.19) P (1, 1) − P (0, 1) ≤ Advind SE - cca(A) (11.20) P (1, 0) − P (1, 1) ≤ Advind AE - cca(A 10 , 11 ). (11.21)

The constructions of A 01 , 00 and A 10 , 11 are shown in Fig. 11.6. Each adversary runs B, replacing B’s lr-encryption oracle with a subroutine OE and B’s decryption oracle with a subroutine OD.

Note the OD subroutine calls Dsk (·). It does not actually have sk but it can implement this by running the code of Dsk (·) shown in Scheme 11.5 and using its Da sk (·) oracle.

20 ASYMMETRIC ENCRYPTION

Adversary A

E pka (LR(·,·,b)),Da sk (·) 01 , 00 (pk) j ← 0 Subroutine OE(M 0 , M 1 ) j ← j + 1 K 0 ,j ← K$ s^ ; K 1 ,j ← K$ s Cjs ← E^ $ s(K 0 ,j , M 0 ) If Csj = ⊥ then return ⊥ Cja ← E^ $ pka (LR(K 0 ,j , K 1 ,j , b)) Return (Cja , Csj ) End Subroutine Subroutine OD(C) Parse C as (Ca, Cs) l ← Find (Ca; C 1 a ,... , Cja ) If l 6 = 0 then M ← Ds(K 0 ,l, Cs) If l = 0 then M ← D(sk, C) Return M End Subroutine d ←$ BOE(·,·),OD(·)(pk) Return d

Adversary A

E pka (LR(·,·,b)),Da sk (·) 10 , 11 (pk) j ← 0 Subroutine OE(M 0 , M 1 ) j ← j + 1 K 0 ,j ← K$ s^ ; K 1 ,j ← K$ s Csj ← E^ $ s(K 0 ,j , M 1 ) If Cjs = ⊥ then return ⊥ Caj ← E^ $ pka (LR(K 1 ,j , K 0 ,j , b)) Return (Ca, Cs) End Subroutine Subroutine OD(C) Parse C as (Ca, Cs) l ← Find (Ca; C 1 a ,... , Cja ) If l 6 = 0 then M ← Ds(K 0 ,l, Cs) If l = 0 then M ← D(sk, C) Return M End Subroutine d ←$ BOE(·,·),OD(·)(pk) Return d

Figure 11.6: Adversaries attacking AE constructed for the proof of Theorem 11.7.

We note that A 01 , 00 and A 10 , 11 are legal in the sense that they never query their decryption oracle D ska (·) on a ciphertext previously returned by their lr-encryption oracle E (^) pka (LR(·, ·, b). This is ensured by the definition of OD, which, if given a ciphertext C = (Ca, Cs) whose asymmetric component Ca^ was previously returned by E pka (LR(·, ·, b), does not call Da sk (·), but instead directly computes the symmetric decryption of Cs^ under a key K 0 ,j satisfying Cja = Ca.

We leave to the reader to extend the arguments of the proof of Theorem 11.6 to verify that Equa- tions (11.19) and (11.21) are true, and proceed to the construction of the ind-cca adversary A attacking the base symmetric encryption scheme. We associate to any i ∈ { 0 ,... , q} the oracle and experiment defined in Fig. 11.7. The experiment shown in that figure initializes counter j and then runs B with the shown oracle and also with the hybrid decryption oracle HDsk (·) that we defined previously. The two oracles share state in the form of a counter j and as well as quantities that are created and stored by HE (^) pki (·, ·) and then accessed by HDsk (·).

Our ind-cca adversary A attacking the base symmetric encryption scheme SE is depicted in Fig. 11.7. The novelty here, as compared to Fig. 11.4, is the subroutine OD defined by A. Note that it considers three cases for the value of l. In the second case, it computes a response by invoking A’s given decryption oracle DsK (·). In the third case it computes a response using the fact that it knows sk.

We must check that A is legal, meaning that it never queries its decryption oracle with a ciphertext