Appendix A. Proof of Theorem 1
Proof: The proof has two steps: first we assume that our KEM is safer than our IDKEM and in the second step we assume the IDKEM is safer. From thee two steps we will conclude that in both scenarios, our hybrid KEM has a security similar to the strongest primitive. Meaning that even if one of them is broken, the other will keep the hybrid construction secure.
The proof in both steps proceeds using the standard hybrid argument, which is common in indistinguishable proofs: We show that an adversary cannot distinguish between two scenarios by building hybrid scenarios where we gradually transform from the first scenario to the second, and we show that this gradual change can be detected only if an adversary is able to break one of our assumptions.
Step 1: Assuming that KEM is Safer than IDKEM
Hybrid Game 2: This game is described below and using Algorithm 17. It lies between hybrid KEM Game 0 and hybrid KEM Game 1. In Game 2 we replace the real key produced by
by a random and uniform key, keeping the ciphertext
intact. But we do not do the same for the key produced by
. To produce consistent behavior, our decapsulation query now will produce the same random value every time it needs to decapsulate
.
Hybrid Attack Game 2 and 3 |
- 1:
- 2:
- 3:
- 4:
- 5:
- 6:
- 7:
- 8:
▹ Randomly chosen key from key space K
- 9:
- 10:
- 11:
- 12:
- 13:
- 14:
returnb
|
Algorithm 23 Decapsulation Query for Hybrid Attack Games 2 and 3 |
- 1:
Decaps():
- 2:
if then
- 3:
- 4:
else
- 5:
- 6:
- 7:
end if
- 8:
- 9:
- 10:
- 11:
if then ▹ Only in Hybrid Game 2
- 12:
▹ Only in Hybrid Game 2
- 13:
end if
- 14:
- 15:
- 16:
- 17:
if then
- 18:
return ⊥
- 19:
else
- 20:
return
- 21:
end if
|
Hybrid Game 2 and 3. The main difference between these Games and Hybrid KEM Game 0 for is that in the challenge, we replaced the secret produced by KEM.Encaps with a value chosen randomly and uniformly. In Hybrid Game 2, we maintain consistency in the Decapsulation query by performing the tests in lines 12-13. In Hybrid Game 3, such consistency is not maintained.
Clearly, distinguishing between Hybrid KEM Game 2 and Hybrid KEM Game 0 is as hard as distinguishing between KEM Game 0 and KEM Game 1: if an adversary
could distinguish between both of them, it could be used to produce an adversary
that breaks the KEM security as described in
Section 2.1. To show this, we build adversary
as follows:
-
Challenge: When chooses which identity will be the target for its attack. Without losing generality, we will assume that the identity already had its public key revealed by a Public Key Query. Otherwise, we could just simulate this query. This means that the identity has an existing public key in the dictionary:
- 1:
procedure()
- 2:
- 3:
if
then
- 4:
cannot succeed and halts.
- 5:
end if
- 6:
gets the challenge from its challenger
- 7:
return
- 8:
end procedure
Notice that when adversary
is interacting with KEM Game 0, it produces responses for
compatible with Hybrid KEM Game 0. When
is interacting with KEM Game 1, it produces responses compatible with Hybrid KEM Game 2. Adversary
will produce a coherent output without halting only if it manages to guess the correct value for
k during initialization, otherwise it will halt during the challenge or during some decapsulation query. Guessing correctly has a probability of
. Assuming that this is true, the probability of
succeeds are exactly the same that
succeeds. Therefore, if
is the event where some adversary
outputs 1 in Hybrid KEM Game 0 and
is the event where some adversary
, we have for the corresponding adversary
:
This result gives the negligible upper bound for distinguishing between those two games:
Hybrid Game 3: This hybrid Game is very similar to Hybrid Game 2. The main difference is that we no longer keep a consistent response in the Decapsulation Query when adversary tries to decapsulate the value . Instead, if we are queried a value like this, we return the true decapsulation. In other words, we ommit the lines 10 and 11 described in the Decapsulation from Figure 8. Besides this change, the new Hybrid Game 3 is defined precisely as the Hybrid Game 2.
Notice that in Hybrid Game 3, the only way to distinguish the difference in the queries compared with Hybrid Game 2 is if the adversary can make a Decapsulation query with a pair where the second element is equal to the one present in the challenged ciphertext and the first element is different. It must also produce a valid tag that the MAC accepts; otherwise, in both Hybrid Games, the Decapsulation query would return ⊥.
Therefore, if we had an adversary
that would be able to distinguish between Hybrid Game 3 and Hybrid Game 2, then we can also use it to create an adversary
that can win the MAC Attack Game (Sub
Section 2.3). We can build
as follows:
-
Initialization: Adversary will try to break the MAC security controlling the rightmost bits from the key, which are the bits produced by IDKEM (they cannot be considered independent random and uniform values in this Game, so it is important to control their bits in the MAC key). It follows the steps below:
Use all the KEM, IDKEM and MAC algorithms to initialize adversary with key and to produce valid responses for all the queries performed by . It exchanges messages with exactly like a valid challenger until produces its challenge, sending as the target identity to attack. Let be the corresponding public key associated with such identity.
Use the IDKEM and KEM algorithms to get an encapsulation for such , getting also separately the secret produced by IDKEM and , its correspondingly encapsulation.
return
As discussed, the probability of
succeeding is the same as
getting a distinct behaviour between Hybrid Game 2 and Hybrid Game 3, which is the probability that it forges a tag for the MAC. Therefore, we get the following upper bound:
Finally, there is no difference between Hybrid Game 3 and KEM Game 1. In both cases, we return the true decapsulation for all queries, without trying to keep consistency with the encapsulation in the challenge. In Hybrid Game 3, the secret is computed with a XOR operation between a random and uniform value and some other value
(as in Hybrid Attack Game 2 and 3, line 9). The result of such XOR is also a random and uniform value. Therefore, both games have no difference:
Therefore, combining all these results, we have that for all adversaries
, there are adversaries
and
such that:
Therefore, if KEM is safer than ID-KEM, we can use this upper bound, ignoring ID-KEM.
Step 2: Assuming that ID-KEM is safer than KEM
In the previous step, we shown that it is possible to ignore the security of ID-KEM and state the security of HKEM in terms only of the security of KEM and MAC. So, even if the ID-KEM is completely insecure, this do not necessarily compromise the security of HKEM.
In this step, we will show that it is also possible to state the security of HKEM using only the ID-KEM and MAC security, ignoring the KEM. Therefore, if the KEM is completely insecure, HKEM would still retain the security based on the other primitives.
The new Hybrid Games will be considered: Game 2’ and Game 3’. As they are not much different than Game 2 and Game 3, we describe them more briefly and show how we can use them to complete the proof.
Hybrid Game 2’: The main difference here is that instead of replacing the KEM secret (like in line 8, Hybrid Attack Game 2 and 3) by a random and uniform value, we do this with the ID-KEM secret (we do “
”). And then show that if some adversary could distinguish between Hybrid Game 2’ and Hybrid KEM Game 0, it could be used to build an adversary
that breaks the IND-CCA security for ID-KEM. The remaining of the proof is analogous, except that now adversary
do not need to guess which identity will be attacked. As both KEMs are in the multi-user setting,
can make its queries to reply for all queries presented by
. Adversary
chooses which identity it will attack after the adversary
makes the same choice. Therefore, we get the following upper bound:
Hybrid Game 3’: As in Hybrid Game 3, here we update the Decapsulation query from Hybrid Game 2’ to always perform a proper decapsulation, not maintaining consistency with the random value that replaced the decapsulation of in Hybrid Game 2’. Again, it is possible to distinguish Game 2’ and Game 3’ only if an adversary can forge a tag in our MAC. The adversary , in this case, works as before, but it will choose to control the leftmost bits from the MAC key instead of the rightmost, as these values must be consistent with the secret produced by the KEM. This modification does not change the results; we have the same upper bound as before.
Combining both cases, we have that for all adversaries
, there are adversaries
,
and
such that:
This upper bound concludes our security proof: it shows that given our assumptions, the upper bound for any attacker advantage in breaking our scheme is negligible. □
Appendix B. Proof of Theorem 2
Proof:As discussed in the text, we will use a modified KEM Attack Game where the adversary tries to distinguish between Game 0 and Game 1 or forge an ECDSA signature in either game. This augmented KEM attack game allows the adversary to query ECDSA signatures and assumes that the signature and the KEM (a DHKEM) share the same key.
Following the proof from [
17], the operation on line 5 of the ECDSA signature algorithm (Sub
Section 2.4.1) is ideally modeled as a composition of functions
that maps a group element to an integer modulo
q. The function
maps each elliptic curve point to a string encoding the x-coordinate of the point,
is a bijective random oracle, and
performs a modulo
q operation, where
q is the elliptic curve group order.
First, we create a hybrid Attack Game 2 and show that if we had an adversary able to forge signatures or distinguish between Attack Game 0 and Game 1, then we could solve the computational Diffie-Hellman problem using an adversary . Our adversary will not act exactly like Game 0 or Game 1 from the KEM Attack Game. Instead, it will model a new Game 2, a hybrid between the two. Adversary operates as follows:
-
Initialization:Adversary is initialized with the security parameter and with a computational Diffie-Hellman instance . Its objective is to find .
Adversary also initializes as an empty list that will store tuples with and to simulate the bijective random oracle . Another list, , is also initialized as empty and will store values produced by backward queries to the bijective random oracle. It also initializes empty lists and , which will help to produce consistent responses when simulating the random oracle for the KEM. A fifth list, , is also initialized as empty and will store signatures produced during signing queries. A list of Q distinct values is also randomly sampled from set B: , where Q is the expected number of queries to the bijective random oracle. Finally, a counter t is initialized to zero and will be incremented for each query to the bijective random oracle.
Adversary then initializes adversary , providing it with a randomness source , sending as the security parameter and as the public key.
Bijective Random Oracle Query: When produces a query to check for , adversary checks if there is some or . If so, it sends as a response. Otherwise, it increments the counter t, stores in , and sends as a response.
Backward Bijective Random Oracle Query: When produces a query asking for , adversary first checks if there is already some value or some value . If so, it sends as a response. Otherwise, it chooses uniformly at random a new value that is not present in or . If is not in the range of function , adversary stores in and sends as a response. Otherwise, if is in the range of , it is discarded, and adversary samples a random that is used to compute a new . The tuple is stored in and is sent as a response.
-
KEM Random Oracle Query: When sends a query asking for the KEM random oracle output for message , we follow these steps:
If , then we send as a response;
We try to parse as three points in the elliptic curve G. If this is not possible, we sample uniformly a random value from the oracle range, store in , and send as a response;
Let be the three elliptic curve points parsed from . If or if is not a Diffie-Hellman tuple, then we sample uniformly at random a value from the oracle range, store in , and send as a response;
If is a Diffie-Hellman tuple and , we check if . If so, this means that , and we have found a solution for the computational Diffie-Hellman problem. Otherwise, if , we check if there is a tuple in . If so, we send as a response. Suppose we have not produced a response yet. In that case, we choose uniformly at random a value from the oracle range, store in and also store in to remember that is the correct decapsulation for when using our public key value . Then we send as a response.
Signing Query: If sends a signing query with message , can simulate a valid signature, even without knowing the secret key, as follows. First, it chooses uniformly at random some value from the bijective random oracle range B. If , which happens with negligible probability, then cannot produce a consistent signature and halts. Otherwise, it samples a random and computes . Finally, it computes and checks if either or are already present in some tuple in . If so, also fails to simulate a consistent bijective random oracle and halts. Otherwise, it stores in and sends the signature as the response to the query. If some invalid value is produced when creating the signature (for example, or ), adversary can just try again, as done when creating a legitimate signature with the standard algorithm. All messages and signatures this query produces are stored in .
Challenge:To produce a challenge, adversary generates the KEM challenge by choosing as the ciphertext c. Note that the correct secret should be the random oracle output for the input . Since it does not know the value of , instead, adversary simply chooses uniformly at random some value k from the oracle range and sends as the challenge. Notice that as the secret is chosen randomly and independently of the ciphertext, this behavior cannot be distinguished from Game 1, where the secret is also chosen randomly.
Decapsulation Query: When queries for the decapsulation of some , adversary checks if there is a tuple in . If so, it sends as a response. Otherwise, chooses uniformly at random some value from the range of the random oracle, stores in , and sends as a response.
-
Finalization:After all queries, we assume that adversary produces as output a bit trying to distinguish if it was in Game 0 or Game 1, and a possible forgery for the ECDSA signature.
As we mentioned, the Game that adversary simulates is indistinguishable from Game 1, as the secret k sent during the challenge was chosen uniformly at random and is independent of the ciphertext . However, given the nature of the random oracle, the only way to discover that the secret k sent during the challenge is random and not the decapsulation of is by identifying that the oracle output for (the real encapsulation of ) is different from k. The adversary would discover this only if it sends an oracle query for . If it does so, it reveals to the solution for the computational Diffie-Hellman problem. Therefore, even when using the keys to produce signatures, breaking the DH-KEM is still as hard as solving the computational Diffie-Hellman problem.
Let’s assume we obtained a valid forgery for the ECDSA signature. From these values, adversary can compute . Therefore, let k be the discrete logarithm of . We know from the exponents that , even if we do not know the values of k and a. Now, it is possible to compute and, without loss of generality, we can assume there is a pair in or in containing as the first value. This could be because adversary queried it from the bijective random oracle or because this value was produced during a signing query.
First, consider the case where was produced during a signing query. This means that also produced some other signature in the past in the form such that and such that . It can recover these values by searching in . Therefore, it can obtain the equation , from which can also obtain a and then compute the solution to the computational Diffie-Hellman problem.
In the second case, we have . This means the tuple was produced by a backward bijective random oracle query. In this case, we know the value such that . From this, and the definition of , obtains the equation , which allows it to isolate the value of discrete logarithm a and compute the solution for the computational Diffie-Hellman problem.
Finally, in the third case, we have produced by a bijective random oracle query. In this case, for some .
Adversary can then produce a new sequence of distinct values from B: and execute adversary again, using fresh new lists, giving the same source of randomness and using the same input as before. The only difference is that when producing responses for the bijective random oracle if the counter t is incremented to some value , we use the new value instead of the previous one. By the Forking Lemma, if produces a forgery of this type with non-negligible probability, then with non-negligible probability, we get two forgeries from both executions such that the first produced a signature using . The second uses (if this is not the case, fails and aborts). Let be the second forgery. Combining the signatures from both executions, can derive the equation . The discrete logarithm a can be obtained from this, and the solution to the computational Diffie-Hellman problem can be computed.
The other two possibilities not mentioned above are that adversary
produces a forgery by finding a collision in the hash function
G, or in the last equation, an adversary could produce values such that
. Adversary
would fail to compute the discrete logarithm in these cases. Fortunately, these events have negligible probability if
G is collision-resistant and has high division entropy resistance, which, as discussed in [
17], is required to ensure the security of the ECDSA signature.
Therefore, except with negligible probability,
will not fail to simulate a bijective random oracle (we omit the calculus of such probabilities; they are the same found in ECDSA proof from [
17]). If adversary
forges a signature, adversary
computes the solution for the computational Diffie-Hellman problem. Moreover, a solution is also computed with non-negligible probability if adversary
breaks the IND-CCA2 security of the DH-KEM with non-negligible probability. □