title | filename | chapternum |
---|---|---|
Multiparty secure computation |
lec_17_SFE |
18 |
Multiparty secure computation I: Definition and Honest-But-Curious to Malicious complier { #sfeonechap }
Wikipedia defines cryptography as "the practice and study of techniques for secure communication in the presence of third parties called adversaries". However, I think a better definition would be:
Cryptography is about replacing trust with mathematics.
After all, the reason we work so hard in cryptography is because a lack of trust. We wouldn't need encryption if Alice and Bob could be guaranteed that their communication, despite going through wireless and wired networks controlled and snooped upon by a plethora of entities, would be as reliable as if it has been hand delivered by a letter-carrier as reliable as Patti Whitcomb, as opposed to the nosy Eve who might look in the messages, or the malicious Mallory, who might tamper with them. We wouldn't need zero knowledge proofs if Vladimir could simply say "trust me Barack, this is an authentic nuke". We wouldn't need electronic signatures if we could trust that all software updates are designed to make our devices safer and not, to pick a random example, to turn our phones into surveillance devices.
Unfortunately, the world we live in is not as ideal, and we need these cryptographic tools. But what is the limit of what we can achieve? Are these examples of encryption, authentication, zero knowledge etc. isolated cases of good fortune, or are they special cases of a more general theory of what is possible in cryptography? It turns out that the latter is the case and there is in fact an extremely general formulation that (in some sense) captures all of the above and much more. This notion is called multiparty secure computation or sometimes secure function evaluation and is the topic of this lecture. We will show (a relaxed version of) what I like to call "the fundamental theorem of cryptography", namely that under natural computational conjectures (and in particular the LWE conjecture, as well as the RSA or Factoring assumptions) essentially every cryptographic task can be achieved. This theorem emerged from the 1980's works of Yao, Goldreich-Micali-Wigderson, and many others. As we'll see, like the "fundamental theorems" of other fields, this is a results that closes off the field but rather opens up many other questions. But before we can even state the result, we need to talk about how can we even define security in a general setting.
The key notion is that cryptography aims to replace trust. Therefore, we imagine an ideal world where there is some universally trusted party (cryptographer Silvio Micali likes to denote by Jimmy Carter, but feel free to swap in your own favorite trustworthy personality) that communicates with all participants of the protocol or interaction, including potentially the adversary. We define security by stating that whatever the adversary can achieve in our real world, could have also been achieved in the ideal world.
For example, for obtaining secure communication, Alice will send her message to the trusted party, who will then convey it to Bob.
The adversary learns nothing about the message's contents, nor can she change them.
In the zero knowledge application, to prove that there exists some secret
But this paradigm goes well beyond this. For example, second price (or Vickrey) auctions are known as a way to incentivize bidders to bid their true value. In these auctions, every potential buyer sends a sealed bid, and the item goes to the highest bidder, who only needs to pay the price of the second-highest bid. We could imagine a digital version, where buyers send encrypted versions of their bids. The auctioneer could announce who the winner is and what was the second largest bid, but could we really trust him to do so faithfully? Perhaps we would want an auction where even the auctioneer doesn't learn anything about the bids beyond the identity of the winner and the value of the second highest bid? Wouldn't it be great if there was a trusted party that all bidders could share with their private values, and it would announce the results of the auction but nothing more than that? This could be useful not just in second price auctions but to implement many other mechanisms, especially if you are a Danish sugar beet farmer.
There are other examples as well. Perhaps two hospitals might want to figure out if the same patient visited both, but do not want (or are legally not allowed) to share with one another the list of people that visited each one. A trusted party could get both lists and output only their intersection.
The list goes on and on. Maybe we want to aggregate securely information of the performance of Estonian IT firms or the financial health of wall street banks. Almost every cryptographic task could become trivial if we just had access to a universally trusted party. But of course in the real world, we don't. This is what makes the notion of secure multiparty computation so exciting.
We now turn to formal definitions. As we discuss below, there are many variants of secure multiparty computation, and we pick one simple version below.
A $k$-party protocol is a set of efficiently computable
Here is one attempt of a definition that is clean but a bit too strong, which nevertheless captures much of the spirit of secure multiparty computation:
Let
- The tuple
$(y_1,\ldots,y_k)$ of outputs of all the parties (both controlled and not controlled by the adversary) in an execution of the protocol where$A$ controls the parties in$T$ and the inputs of the parties not in$T$ are given by${ x_i }_{i\in [k]\setminus T}$ .
- The tuple
$(y_1,\ldots,y_k)$ that is computed using the following process:
a. We let
b. For every
\
That is, the protocol is secure if whatever an adversary can gain by taking complete control over the set of parties in
Note that in particular if
The definition above is a little too strong, in the following sense.
Consider the case that
This means that we would be able to distinguish between the output in the real and ideal setting.4
This motivates the following, slightly more messy definition, that allows for the ability of the adversary to abort the execution at any point in time:
Let
- The tuple
$(y_1,\ldots,y_k)$ of outputs of all the parties (both controlled and not controlled by the adversary) in an execution of the protocol where$A$ controls the parties in$T$ and the inputs of the parties not in$T$ are given by${ x_i }_{i\in [k]\setminus T}$ we denote by$y_i = \top$ if the$i^{th}$ party aborted the protocol.
- The tuple
$(y_1,\ldots,y_k)$ that is computed using the following process:
a. We let
b. For
c. Let
Here are some good exercises to make sure you follow the definition:
-
Let
$F$ be the two party functionality such that$F(H|C,H')$ outputs$(1,1)$ if the graph$H$ equals the graph$H'$ and$C$ is a Hamiltonian cycle and otherwise outputs$(0,0)$ . Prove that a protocol for computing$F$ is a zero knowledge proof5 system for the language of Hamiltonicity.6 -
Let
$F$ be the$k$ -party functionality that on inputs$x_1,\ldots,x_k \in {0,1}$ outputs to all parties the majority value of the$x_i$ 's. Then, in any protocol that securely computes$F$ , for any adversary that controls less than half of the parties, if at least$n/2+1$ of the other parties' inputs equal$0$ , then the adversary will not be able to cause an honest party to output$1$ .
It is an excellent idea for you to pause here and try to work out at least informally these exercises.
Amazingly, we can obtain such a protocol for every functionality:
Under reasonable assumptions7 for every polynomial-time computable
MPCthm{.ref} was originally proven by Yao in 1982 for the special case of two party functionalities, and then proved for the general case by Goldreich, Micali, and Wigderson in 1987. As discussed below, many variants of this theorem has been shown, and this line of research is still ongoing.
There is in fact not a single theorem but rather many variants of this fundamental theorem obtained by great many people, depending on the different security properties desired, as well as the different cryptographic and setup assumptions. Some of the issues studied in the literature include the following:
-
Fairness, guaranteed output delivery: The definition above does not attempt to protect against "denial of service" attacks, in the sense that the adversary is allowed, even in the ideal case, to prevent the honest parties from receiving their outputs.
As mentioned above, without honest majority this is essential for simlar reasons to the issue we discussed in our lecture on bitcoin why achieving consensus is hard if there isn't a honest majority. When there is an honest majority, we can achieve the property of guaranteed output delivery, which offers protection against such "denial of service" attacks. Even when there is no guaranteed output delivery, we might want the property of fairness, whereas we guarantee that if the honest parties don't get the output then neither does the adversary. There has been extensive study of fairness and there are protocols achieving variants on it under various computational and setup assumptions. -
Network models: The current definition assumes we have a set of
$k$ parties with known identities with pairwise secure (confidential and authenticated) channels between them. Other network models studies include broadcast channel, non-private networks, and even no authentication). -
Setup assumptions: The definition does not assume a trusted third party, but people have studied different setup assumptions including a public key infrastructure, common reference string, and more.
-
Adversarial power: It turns out that under certain condition, it can be possible to obtain secure multiparty computation with respect to adversaries that have unbounded computational power (so called "information theoretic security"). People have also studies different variants of adversaries including "honest but curious" or "passive adversaries", as well as "covert" adversaries that only deviate from the protocol if they won't be caught. Other settings studied limit the adversary's ability to control parties (e.g., honest majority, smaller fraction of parties or particular patterns of control, adaptive vs static corruption).
-
Concurrent compositions: The definition displayed above are for standalone execution which is known not to automatically imply security with respect to concurrent composition, where many copies of the same protocol (or different protocols) could be executed simultaneously. This opens up all sorts of new attacks.8 See Yehuda Lindell's thesis (or this updated version) for more. A very general notion known as "UC security" (which stands for "Universally Composable" or maybe "Ultimate Chuck") has been proposed to achieve security in these settings, though at a price of additional setup assumptions, see here and here.
-
Communication: The communication cost for MPCthm{.ref} can be proportional to the size of the circuit that computes
$F$ . This can be a very steep cost, especially when computing over large amounts of data. It turns out that we can sometimes avoid this cost using fully homomorphic encryption or other techniques. -
Efficiency vs. generality: While MPCthm{.ref} tells us that essentially every protocol problem can be solved in principle, its proof will almost never yield a protocol you actually want to run since it has enormous efficiency overhead. The issue of efficiency is the biggest reason why secure multiparty computation has so far not had a great many practical applications. However, researchers have been showing more efficient tailor-made protocols for particular problems of interest, and there has been steady progress in making those results more practical. See the slides and videos from this workshop for more.
Is multiparty secure computation the end of crypto? The notion of secure multiparty computation seems so strong that you might think that once it is achieved, aside from efficiency issues, there is nothing else to be done in cryptography. This is very far from the truth. Multiparty secure computation do give a way to solve a great many problems in the setting where we have arbitrary rounds of interactions and unbounded communication, but this is far from being always the case. As we mentioned before, interaction can sometimes make a qualitative difference (when Alice and Bob are separated by time rather than space). As we've seen in the discussion of fully homomorphic encryption, there are also other properties, such as compact communication, which are not implied by multiparty secure computation but can make all the difference in contexts such as cloud computing. That said, multiparty secure computation is an extremely general paradigm that does apply to many cryptographic problems.
Further reading: The survey of Lindell and Pinkas gives a good overview of the different variants and security properties considered in the literature, see also Section 7 in this survey of Goldreich. Chapter 6 in Pass and Shelat's notes is also a good source.
Suppose we have the following setup: an auctioneer wants to sell some item and run a second-price auction, where each party submits a sealed bid, and the highest bidder gets the item for the price of the second highest bid. However, as mentioned above, the bidders do not want the auctioneer to learn what their bid was, and in general nothing else other than the identity of the highest bidder and the value of the second highest bid. Moreover, we might want the payment is via an electronic currency such as bitcoin, so that the auctioneer not only gets the information about the winning bid but an actual self-certifying transaction they can use to get the payment.
Here is how we could obtain such a protocol using secure multiparty computation:
-
We have
$k$ parties where the first party is the auctioneer and parties$2,\ldots,k$ are bidders. Let's assume for simplicity that each party$i$ has a public key$v_i$ that is associated with some bitcoin account.9 We treat all these keys as the public input. -
The private input of bidder
$i$ is the value$x_i$ that it wants to bid as well as the secret key$s_i$ that corresponds to their public key. -
The functionality only provides an output to the auctioneer, which would be the identity
$i$ of the winning bidder as well as a valid signature on this bidder transferring$x$ bitcoins to the key$v_1$ of the auctioneer, where$x$ is the value of the second largest valid bid (i.e.,$x$ equals to the second largest$x_j$ such that$s_j$ is indeed the private key corresponding to$v_j$ .)
It's worthwhile to think about what a secure protocol for this functionality accomplishes. For example:
-
The fact that in the ideal model the adversary needs to choose its queries independently means that the adversary cannot get any information about the honest parties' bids before deciding on its bid.
-
Despite all parties using their signing keys as inputs to the protocol, we are guaranteed that no one will learn anything about another party's signing key except the single signature that will be produced.
-
Note that if
$i$ is the highest bidder and$j$ is the second highest, then at the end of the protocol we get a valid signature using$s_i$ on a transaction transferring$x_j$ bitcoins to$v_1$ , despite$i$ not knowing the value$x_j$ (and in fact never learning the identity of$j$ .) Nonetheless,$i$ is guaranteed that the signature produced will be on an amount not larger than its own bid and an amount that one of the other bidders actually bid for.
I find the ability to obtain such strong notions of security pretty remarkable. This demonstrates the tremendous power of obtaining protocols for general functionalities.
It sometimes makes sense to use multiparty secure computation for cryptographic computations as well. For example, there might be several reasons why we would want to "split" a secret key between several parties, so no party knows it completely.
-
Some proposals for key escrow (giving government or other entity an option for decrypting communication) suggested to split a cryptographic key between several agencies or institutions (say the FBI, the courts, etc..) so that they must collaborate in order to decrypt communication, thus hopefully preventing unlawful access.
-
On the other side, a company might wish to split its own key between several servers residing in different countries, to ensure not one of them is completely under one jurisdiction. Or it might do such splitting for technical reasons, so that if there is a break in into a single site, the key is not compromised.
There are several other such examples. One problem with this approach is that splitting a cryptographic key is not the same as cutting a 100 dollar bill in half. If you simply give half of the bits to each party, you could significantly harm security. (For example, it is possible to recover the full RSA key from only $27%$ of its bits).
Here is a better approach, known as secret sharing:
To securely share a string
For every
We leave the proof of secretsharinglem{.ref} as an exercise.
Secret sharing solves the problem of protecting the key "at rest" but if we actually want to use the secret key in order to sign or decrypt some message, then it seems we need to collect all the pieces together into one place, which is exactly what we wanted to avoid doing.
This is where multiparty secure computation comes into play, we can define a functionality
Moreover, secret sharing can be generalized so that a threshold other than
We will complete the proof of (a relaxed version of) the fundamental theorem over this lecture and the next one. The proof consists of two phases:
-
A protocol for the "honest but curious" case using fully homomorphic encryption.
-
A reduction of the general case into the "honest but curious" case where the adversary follows the protocol precisely but merely attempts to learn some information on top of the output that it is "entitled to" learn. (This reduction is based on zero knowledge proofs and is due to Goldreich, Micali and Wigderson)
We note that while fully homomorphic encryption yields a conceptually simple approach for the second step, it is not currently the most efficient approach, and rather most practical implementations are based on the technique known as "Yao's Garbled Ciruits" (see this book or this paper or this survey ) which in turn is based a notion known as oblivious transfer which can be thought of as a "baby private information retrieval" (though it preceded the latter notion).
We will focus on the case of two parties. The same ideas extend to
We start from the second stage. Giving a reduction transforming a protocol in the "honest but curious" setting into a protocol secure in the malicious setting. That is, we will prove the following theorem:
There is a polynomial-time "compiler"
The remainder of this section is devoted to the proof of hbctomalthm{.ref}.
For ease of notation we will focus on the
The main idea is the following: we do the compilation one party at a time - we first transform the protocol so that it will remain secure even if Alice tries to cheat, and then transform it so it will remain secure even if Bob tries to cheat.
Let's focus on Alice.
Let's imagine (without loss of generality) that Alice and Bob alternate sending messages in the protocol with Alice going first, and so Alice sends the odd messages and Bob sends the even ones.
Lets denote by
Let's assume for starters that Alice's strategy is deterministic (and so there is no random tape
Really, please stop and think why this will not be secure.
\newpage
Did you stop and think?
The problem is that at every step Alice proves that there exists some input
A commitment scheme for strings of length
-
Hiding (sender's security): For every two sender inputs
$x,x' \in {0,1}^\ell$ , and no matter what efficient strategy the receiver uses, it cannot distinguish between the interaction with the sender when the latter uses$x$ as opposed to when it uses$x'$ .
-
Binding (reciever's security): No matter what (efficient or non efficient) strategy the sender uses, if the reciever follows the protocol then with probability
$1-negl(n)$ , there will exist at most a single string$x\in{0,1}^\ell$ such that the transcript is consistent with the input$x$ and some sender randomness$r$ .
That is, a commitment is the digital analog to placing a message in a sealed envelope to be opened at a later time. To commit to a message
We have already seen a commitment scheme before (due to Naor): the receiver sends a random
We can now describe the transformation ensuring the protocol is secure against a malicious Alice in full, for the case that that the original strategy of Alice is deterministic (and hence uses no random coins)
-
Initially Alice and Bob engage in a commitment scheme where Alice commits to her input
$x_1$ . Let$\tau$ be the transcript of this commitment phase and$r_{com}$ be the randomness Alice used during it.10 -
For
$i=1,2,\ldots$ :-
If
$i$ is even then Bob sends$m_i$ to Alice -
If
$i$ is odd then Alice sends$m_i$ to Bob and then they engage in a zero knowledge proof that there exists$x_1,r_{com}$ such that (1)$x_1,r_com$ is consistent with$\tau$ , and (2)$m_i = f(x_1,m_1,\ldots,m_{i-1})$ . The proof is repeated a sufficient number of times to ensure that if the statement is false then Bob rejects with$1-negl(n)$ probability. -
If the proof is rejected then Bob aborts the protocol.
-
We will not prove security but will only sketch it here, see Section 7.3.2 in Goldreich's survey for a more detailed proof:
-
To argue that we maintain security for Alice we use the zero knowledge property: we claim that Bob could not learn anything from the zero knowledge proofs precisely because he could have simulated them by himself. We also use the hiding property of the commitment scheme. To prove security formally we \ need to show that whatever Bob learns in the modified protocol, he could have learned in the original protocol as well. We do this by simulating Bob by replacing the commitment scheme with commitment to some random junk instead of
$x_1$ and the zero knowledge proofs with their simulated version. The proof of security requires a hybrid argument, and is again a good exercise to try to do it on your own. -
To argue that we maintain security for Bob we use the binding property of the commitment scheme as well as the soundness property of the zero knowledge system. Once again for the formal proof we need to show that we could transform any potentially malicious strategy for Alice in the modified protocol into an "honest but curious" strategy in the original protocol (also allowing Alice the ability to abort the protocol). It turns out that to do so, it is not enough that the zero knowledge system is sound but we need a stronger property known as a proof of knowledge. We will not define it formally, but roughly speaking it means we can transform any prover strategy that convinces the verifier that a statement is true with non-negligible probability into an algorithm that outputs the underlying secret (i.e.,
$x_1$ and$r_com$ in our case). This is crucial in order to trasnform Alice's potentially malicious strategy into an honest but curious strategy.
We can repeat this transformation for Bob (or Charlie, David, etc.. in the
So far we assumed that the original strategy of Alice in the honest but curious is deterministic but of course we need to consider probabilistic strategies as well.
One approach could be to simply think of Alice's random tape
- Alice selects
$r'\leftarrow_R{0,1}^m$ at random and engages in a commitment protocol to commit to$r'$ . - Bob selects
$r'' \leftarrow_R{0,1}^m$ and sends it to Alice in the clear. - The result of the coin tossing protocol will be the string
$r=r'\oplus r''$ .
Note that Alice knows
The notion of multiparty secure computation - defining it and achieving it - is quite subtle and I do urge you to read some of the other references listed above as well. In particular, the slides and videos from the Bar Ilan winter school on secure computation and efficiency, as well as the ones from the winter school on advances in practical multiparty computation are great sources for this and related materials.
Footnotes
-
Note that here $k$ is not a string which the secret key but the number of parties in the protocol. ↩
-
Protocols for $k>2$ parties require also a broadcast channel but these can be implemented using the combination of authenticated channels and digital signatures. ↩
-
Fixing the input and output sizes to $n$ is done for notational simplicity and is without loss of generality. More generally, the inputs and outputs could have sizes up to polynomial in $n$ and some inputs or output can also be empty. Also, note that one can define a more general notion of stateful functionalities, though it is not hard to reduce the task of building a protocol for stateful functionalities to building protocols for stateless ones. ↩
-
As a side note, we can avoid this issue if we have an honest majority of players - i.e. if $|T|<k/2$, but this of course makes no sense in the two party setting.) ↩
-
Actually, if we want to be pedantic, this is what's known as a zero knowledge argument system since soundness is only guaranteed against efficient provers. However, this distinction is not important in almost all applications. ↩
-
Our treatment of the input graph $H$ is an instance of a general case. While the definition of a functionality only talks about private inputs, it's very easy to include public inputs as well. If we want to include some public input $Z$ we can simply have $Z$ concatenated to all the private inputs (and the functionality check that they are all the same, otherwise outputting
error
or some similar result). ↩ -
Originally this was shown under the assumption of trapdoor permutations (which can be derived from the Factoring or RSA conjectures) but it is known today under a variety of other assumptions, including in particular the LWE conjecture. ↩
-
One example of the kind of issues that can arise is the "grandmasters attack" whereby someone with no knowledge of chess could play two grandmasters simultaneously, relaying their moves to one another and thereby guaranteeing a win in at least one of the games (or a draw in both). ↩
-
As we discussed before, bitcoin doesn't have the notion of accounts but rather what we mean by that for each one of the public keys, the public ledger contains a sufficiently large amount of bitcoins that have been transferred to these keys (in the sense that whomever can sign w.r.t. these keys can transfer the corresponding coins). ↩
-
Note that even though we assumed that in the original honest-but-curious protocol Alice used a deterministic strategy, we will transform the protocol into one in which Alice uses a randomized strategy in both the commitment and zero knowledge phases. ↩