Presentation is loading. Please wait.

Presentation is loading. Please wait.

Secure Multiparty Computation Ivan Damgård, Department of Computer Science, Aarhus Universitet.

Similar presentations


Presentation on theme: "Secure Multiparty Computation Ivan Damgård, Department of Computer Science, Aarhus Universitet."— Presentation transcript:

1 Secure Multiparty Computation Ivan Damgård, Department of Computer Science, Aarhus Universitet

2 Private Information PIN codes, Customer database of a company, patient journals in a hospital,.. - Valuable information must be confidential, and must not be lost. -But often ADDED value can be obtained by combining private data from different sources -A few examples...

3 Simple ”first price” Auction Participants bid for an item, highest bid wins. Each player has private information: the max price you are willing to pay. Of course everyone want to pay as little as possible Goal: find winner and price to pay in a fair way.

4 Dobbele Auktion – an “Exchange” Many sellers and buyers want to trade different quantities of some commodity. Each seller is willing to sell different quantities, depending on the price. Likewise for buyers Goal find a fair market price, given supply and demand in the market, in a fair way. For instance, maximal price you want to buy at must remain private.

5 Benchmarking Some companies working in the same sector have data describing how well business is going: production costs, turnover, salaries, etc. Goal: each company wants to find out how well it is doing in comparison to the others. - But of course without revealing information to competitors..

6 Databases and Privacy Many (public) institutions have data on certain citizens. Goal: extract statistics and other data from all databases, to do reserach or better administration. - But without breaking privacy regulations by giving a single entity access to all data at the same time.

7 A Fundamental Problem A number of players each possess private inputs and we want to to compute some function on these inputs securely: -Result is correct -The intended result is the only new information released A naive idea: give all data to a trusted party, he computes the result we want, sends it to us, and then forgets what he saw. Unrealistic or much too expensive. Can we do without a trusted 3. party? First ingredient of a solution.. Secret-sharing: how to share a secret with others – wihtout revealing it..

8 Secret Sharing Instead of keeping a secret piece of data in one place, we let n parties share the knowledge of s: The owner (the dealer) makes n shares, constructed such that: If you know enough shares, s is easy to compute. if you have too few, you know nothing. Example: s=3. Shares are two random numbers wich when added gives you s, say 5 and -2. Given only one number: no idea what s is. This is actually a cheat: we cannot really choose randomly among all integers. But if we do it instead modulo a fixed number, say 7, everything makes complete sense. Will go there later..

9 Mere generally: (n,t) Secret Sharing From secret s make n shares, such that: t shares (or fewer) give no information on s from t+1 shares (or more) easy to get s. Can now give n shares to n different players. If you trust that at most t are corrupt or get their data stolen, you secret is safe. As long as at least t+1 are willing to help you cannot loose your secret.

10 Exsistence: (n,t) secret sharing exists for any n and t. Example- (n,1): shares are points on a random line, where intersection with y-axis gives you s. · · · · s 1 234 Two points determine a line and hence s. Given only one point s can be whatever.. s?? t>1?..it takes 3 points to determine a degree 2 curve, generally t+1 points for a degree t curve..

11 It gets even better.. We can compute on data while they are secret-sharet - Secure multiparty Computation. · · · · s 1 234 s’s’ · · · · To secrets, s og s’ are shared. All add their shares of s og s’. We get shares of s+s’ We computed the sum, even if no one knows s or s’’ !! Multiplication works too, but more complicated, we need a more formal approach to get there.. · · · · s+s’

12 The MPC problem n players P1, P2, …, Pn Player Pi holds input xi Goal: for some given function f with n inputs and n outputs, compute f(x1,…,xn)= (y1,…,yn) securely, i.e., we want a protocol such that: Pi learns the correct value of yi No information on inputs in leaked to Pi, other than what follows from xi and yi. We want this to hold, even when some of the players behave adversarially. For instance, they pool their information to learn more than they are supposed to. Model this: up to t of the players are corrupted by an adversary.

13 In a picture Adv The players Synchronous communication x2, y2 x1, y1 x3, y3x4,y4 Corrupt Adv can choose which players to corrupt statically or adaptively – but set of corrupted players must be at most of size t. Corruption can be passive: just observe computation and mess. Or active: take full control Inputs, Desired outputs Open channels: Adv sees all messages; or Secure point-to-point: no info on honest-to- honest mess.

14 Goal of MPC – a bit more precisely Adv T Exchange inputs/results with players Corrupt Want protocol to be equivalent to a trusted (uncorruptible) party T, who gets inputs from players, computes results and returns them to the players.

15 FIRST Goal Want to do secure computing of ANY function. Passive security, at most t players are corrupted, assume 2t < n and secure point-to-point channels We want perfect (unconditional) security, meaning: Adversary learns (of course) xi and yi for the corrupted players, but nothing more, regardless of how much computing power (s)he has. As we shall see: 2t < n is the best we can do with this goal, for larger t it’s impossible.

16 Secret Sharing again, more formally F : the finite field with p elements, aka the integers mod p. To secret-share s in F, we choose a random polynomial f s of degree at most t, such that f s (0)= s f(X) = s + r 1 X + … + r t X t where the r i are uniformly random in F Then we give f s (i) to player P i. Fact (follows from Lagrange interpolation) From any t+1 shares, can reconstruct f s, and hence s. Any t shares have distribution independent of s, hence no info on s. Exercise: show that any t shares are independent and uniformly distributed over F.

17 NOTATION and some facts [a,f a ] t = (f a (1),…, f a (n)) (players each hold one value) - also: f a is of degree at most t. [a,f a ] t + [b,f b ] t = [a+b,f a +f b ] t (players add their shares) c [a,f a ] t = [ca, cf a ] t (all players multiply by c) [a,f a ] t * [b,f b ] t = [ab,f a f b ] 2t (all players multiply their shares) Reconstruction vector: if deg(h)<= n, then there exists (r 1,…,r n ) such that h(0) = r 1 h(1) +… r n h(n) (Lagrange interpolation) If we set h= f a f b, then we have ab = r 1 h(1) +… r n h(n) Note that by assumption on t, we have indeed deg(h) = 2t < n

18 Multiplication protocol Given [a,f a ] t, [b,f b ] t we do: [a,f a ] t * [b,f b ] t = [ab,f a f b ] 2t (all players multiply their shares) Each Pi now has f a f b (i) = h(i). Will secret share value using polynomial f i and send shares to the others, so we have [h(i),f i ] t Then do linear combinations to get r 1 [h(1), f 1 ] t + …+ r n [h(n), f n ] t = [ab, r 1 f 1 +…+r n f n ] t

19 Full MPC protocol Note: any computation can be done by multiplication and addition in a finite field F, aka an arithmetic circuit over F. Input Sharing phase Each player Pi secret-shares his input xi, so we have [xi, f xi ] t Computation Phase For each add or mult to do on inputs a,b we have [a,f a ] t, [b,f b ] t so do corresponding subprotocol to get Secret sharings of a+b or ab. Opening Phase Can assume we have [y i, f yi ] t for y i to be given to P i. Each player send its share to Pi, who reconstructs value.

20 Proof of Security Result must be correct. This is trivial by construction. But we also want to say that if Adv corrupts a set C of players, he learns only {(xi, yi)| P i in C} To show this formally, we use the simulation paradigm I show you B but claim that you really only learnt a smaller piece of info A. My claim is true if given A, you could easily compute all of B by yourself. So Definition says there must exist an efficient simulator S such that the random variables S({(xi, yi)| Pi in C}) and {View i | P i in C } have same distribution Exercise: Construct S (remember last exercise!)

21 The Simulator S Input for S: {(xi, yi)| Pi in C}, C corrupt set of players. Input sharing phase S lets players in C share their input For each player not in C, S picks t random numbers in F for each input and give to players in C Computation Phase Additon and mult. by constant gates: nothing to do Multiplication gates: Players in C do local mult. and share the product. For each player not in C, S picks t random numbers in F and give to players in C. Opening Phase For each yi where Pi in C: S knows t shares s1,.., st in yi held by C. S interpolates polynomial f consistent with yi and s1,..,st. Computes values for honest players and send to Pi. For yi where Pi not in C: nothing to do for S.

22 Optimality of the bound t< n/2 Assume 2-party protocol for A and B, where A holds b A, B holds b B Protocol computes b A AND b B securely Say A has b A =0. Means result is 0, so A should learn nothing new. Claim: After doing the protocol, A can nevertheless compute b B ! Let T be the transcript of the protocol (all messages in order). A can ask herself: if instead I had used b A =1 could the same transcript T have been produced? Let’s assume for the moment that she can find the answer to this..

23 A can ask herself: if instead I had used b A =1 could the same transcript T have been produced? Let’s assume for the moment that she can find the answer to this.. If NO: then b A =0 is uniquely determined from T. Means B can learn b A from T so he must have b B = 1. If YES: then both values of b A are possible given T. But then B cannot have b B =1. If he had it should have been possible for him to determine b A was 0. And it’s not, so we conclude that b A =0. To find the answer, A can basically do exhaustive search over all possible choices of randomness she could have used. For more than 2 parties, can show that a solution for t>=n/2 would imply 2-party protocol.

24 Conclusion We can compute any function with perfect, passive security if t< n/2 If t >= n/2, some functions are impossible to compute securely. Exercise: Show that the OR of two bits cannot be securely computed. Exercise: show that the XOR of two bits can be securely computed.

25 What if we make computational assumptions? Suppose we can do public key crypto. So we have a key generation algorithm that makes pairs (pk, sk). Additional assumption: say we have an alternative key generation that ONLY outputs public key pk. These look just like normal keys. Means that from E pk (m), cannot find m. El-Gamal is an example: Normally, public key is h= g sk mod p, where you first choose sk at random and then compute h. But you could also just choose h at random… Public keys generated this way have exactly the normal distribution.

26 Computing the AND using public key crypto.. A makes (pk, sk) and pk’ with unknown secret key. If b A =0 send (pk, pk’) to B else send (pk’, pk). B gets a pair (pk0, pk1). If b B =0 compute and send (E pk0 (0), E pk1 (0)) If b B =1 compute and send (E pk0 (0), E pk1 (1)) A gets 2 ciphertexts back (C0, C1) can decrypt one of them. Decrypt and output the decryption result. Send also to B. Exercise Why is the result correct? If B has a 0, why can’t B tell which input A is using? If A has a 0, why can’t A tell which input B is using?

27 Towards protocols with Active/Malicious Security. 3 problems with passively secure protocol: When secret sharing values, players may send shares that are not consistent with a polynomial of degree <= t. When revealing shares of a value, players may lie about their shares. When doing the local multiplications, players may secret share an incorrect value. Basic idea for solving this: must make sure that players are committed to their shares.

28 Commitment? Player P holds a value v In addition players hold additional data related to v. This does not allow other players to compute v, but If P wants to reveal v, the others can check that P gives them the right value. A simple example for two players P1 has v and also a value m (an “authentication code”) P2 has random values a,b, where m= av+b (In practice, would need protocols for setting up these values without revealing v – not this talk.) If P1 later wants to reveal v, must also send m. P2 checks that m=av+b. Can show that if P1 tries to send incorrect value, P2 will accept with probability at most 1/p.

29 A Paradigm for Actively Secure Protocols Maintain an invariant where for each value a in the computation, Value a is secret-shared, so player Pi holds share ai and in addition, Pi is committed to ai. Ensures that we can reliably open a if it is an output value. Makes it possible for Pi to convince other players that he is computing correctly on his shares. Need protocols for this and for establishing invariant initially on the input values. Result: If t< n/3 can compute any function with perfect security against malicious adversary.

30 Why is perfect security impossible for t>= n/3? Assume 3 parties A,B,C, where one may be malicious. Turns out it is impossible to even broadcast a single bit. Phrased as computation of a function: A has input b, no input for B and C. All parties should output b. Intuition: A must send b to both B and C. Say B is honest, gets b from A. How can he know that C heard the same thing? Has to ask C. If C says “I heard 1-b”, clear that A or B is corrupt, but no way to decide. Further result If t< n/2 and we are given a broadcast channel for free, can compute any function with small error probability.

31 Using MPC for practical Problems Clear that many applications require correctness and some amount of privacy, and that in principle this can be handled with MPC. But exactly what computation is required? Often the case in practice: Need to do to integer arithmetic on relatively small numbers. Typically 32 bits enough. Often addition, multiplication and comparison is sufficient. Division sometimes needed – but often we can work around.

32 A Caveat? We wanted integer addition and multiplication, but protocols typically come with add/mult modulo p? No problem if sizes of numbers can be controlled: just choose p large enough so that no overflow occurs. We found that 65-bit p was OK in the cases we looked at (where inputs were 32 bits or less). But what about comparison? Given [a], [b] want to compute [v] where v is a bit such that v=0 if a< b, and 1 otherwise. - Not trivial! Could do add/multiply efficiently because all numbers are shared ”in one piece.” But this also means we have no direct access to the binary representation of a and b  can’t directly use the ideas from earlier in the talk. No small arithmetic circuit over p exists for comparison.

33 A solution Problem: hard to go from [c] to [c 0 ], [c 1 ],…, [c n ] where [c i ] is i’th bit of c. Observation: much easier go from [c 0 ], [c 1 ],…, [c n ] to [c]: just multiply by 2-powers and add. Suppose we know a,b are at most t-bit numbers. Algorithm 1. Generate random shared 0/1 values [r 0 ],…., [r n ], compute [r], where r= r 0 + 2 r 1 + … + 2 n r n n chosen so r >> a,b 2. Compute and open T= r + 2 t +a – b (statistically secure since r >> a,b). 3. Remaining problem: if we subtract bit-wise shared number r from the public T, will bit no. t be set? This is easy: enough to do a linear (in t) number of binary operations.

34 Efficiency back in 2008: 3 players, passive security, secret sharing over 65 bit prime Running on 3 up-to-date machines on a LAN Multiplication: 1 msec. Comparison: 30 msec. These days: Using preprocessing, orders of magnitude better efficiency for two players and malicious security. Requires additional ideas and protocols we did not have time for here.. Current state of the art for MPC: We can match the speed of a PC from the 90-ties (Intel 80386)

35 First Industrial application of MPC: done by Research project SIMAP (Secure Information Managing and Processing) Goal: develop new MPC protocols, and also domain specific programming language for applications of MPC: Secure Multiparty Computation Language (SMCL) Partners: Crypto and Programming language groups from Aarhus University, economists from Copenhagen University, Danisco.

36 Application Scenario A double auction, trading some commodity. Many sellers, many buyers. Each bid from a seller is a list of numbers: ”At each possible price per unit, I want to sell this much” – similar for buyers. For each possible price, we (securely) add up bids to find total supply, and total quantity in the market at that price. price/unit quantity Market clearing price Can now open everybody’s bids at the mcp, to see what they get to sell(buy). Demand goes down, supply up with increasing price, so can find solution by binary search: number of comparisons logarithmic in number of prices. Note: comparison results can be public supply demand

37 Set-up in Practice Input Clients provide inputs: visit web page, applet sent out, bids are typed in, secret- shared and encrypted under servers’ keys Coordinator handles communication Stores encrypted inputs Servers perform the actual computation

38 Multiparty Computation Goes Live In January 2008, the first industrial application of MPC ran in Denmark. A nation-wide double auction for trading production rights for sugar beets. 1200 bidders, 4000 potential prices. Each quantity in a bid encoded as 32 bit number. Computation used secret sharing over a 65-bit prime. Secure computation took about 30 minutes, all incl. Most time spent on decrypting shares.

39 Why Sugar beets? Company Danisco has all sugar production in Denmark. Farmers have contracts that give them the right to deliver certain amounts of beets. Contracts can be traded between farmers, but almost no trading historically. However, EU has now reduced support for sugar beet production drastically  Production can only survive if it moves to where it pays off best  need for a nation wide market, natural solution is a double auction.

40 Why Multiparty Computation? Farmers cannot accept that Danisco runs auction: bids represent private information on your economic situation - can be misused later by Danisco. Danisco cannot accept that farmers do it themselves: Danisco needs some control because some farmers owe Danisco money. Alternatives: Danisco and Farmers could cooperate to do it ”manually”. Means that one or more persons will have access to bids in cleartext. Implies we need a security policy everyone can agree on. Hard to negotiate. Secure hardware? Not really different from the above! Who owns the hardware box? Who installs it? Maintains it? Backs it up? Trusted party (consulting house) could be used. Too expensive.

41 Solution secure against 1 passively corrupted player? Everyone was happy with this: No one was really worried that the other would launch an active attack. But it seemed very attractive that no one has to know anything sensitive at any point. No need to agree on security policy involving everyone. How did you convince them that the system was secure? We did not have to – they just believed us!

42 Industrial MPC Partisia (DK, spin-off from Aarhus Uni) ShareMind (Estonia) Galois (USA) Voltage Security (GB and Israel) Etc, etc.. In Academia Very hot research topic, focus on complexity of general and concrete secure computation, improvements come really, really fast. A few big basic research problems remain, though. Further Reading : recently from Cambrigde Univ. press, Cramer, Damgård and Nielsen: Secure Multiparty Computation and Secret Sharing. Has all of what I did and more, plus lots of references.


Download ppt "Secure Multiparty Computation Ivan Damgård, Department of Computer Science, Aarhus Universitet."

Similar presentations


Ads by Google