Multi-Party Computation for the Masses

66
Multi-Party Computation for the Masses David Evans www.cs.virginia.ed u/evans CROSSING – Where Quantum Physics, Cryptography, System Security and Software Engineering meet Darmstadt, 1 June 2015

Transcript of Multi-Party Computation for the Masses

Page 1: Multi-Party Computation for the Masses

Multi-Party Computation for the Masses

David Evanswww.cs.virginia.edu/evans

CROSSING – Where Quantum Physics, Cryptography, System Security and Software Engineering meet Darmstadt, 1 June 2015

Page 2: Multi-Party Computation for the Masses

(De)Motivating Application

AliceBob

Page 3: Multi-Party Computation for the Masses

AliceBob

Genome Compatibility Protocol

“Genetic Dating”

GeneticMatchr

WARNING!

Reproduction not

recommended

Your offspring would have

good immune systems!

processing…Start[Don’t sue us.]

GeneticMatchr

WARNING!

Reproduction not

recommended

Your offspring would have

good immune systems!

processing…Start[Don’t sue us.]

(De)Motivating Application

Page 4: Multi-Party Computation for the Masses

Cost to sequence genome“Moore’s Law”

20012002

20032004

20052006

20072008

20092010

20112012

20132014

$1,000

$10,000

$100,000

$1,000,000

$10,000,000

$100,000,000

“Moore’s Law”

Page 5: Multi-Party Computation for the Masses

Cost to sequence genome

20012002

20032004

20052006

20072008

20092010

20112012

20132014

$1,000

$10,000

$100,000

$1,000,000

$10,000,000

$100,000,000

“Moore’s Law”

Tomorrow: Jean-Pierre Hubaux“Whole Genome Sequencing: Revolutionary Medicine or Privacy Nightmare?”

Page 6: Multi-Party Computation for the Masses

Secure Two-Party Computation

AliceBob

Bob’s Genome Alice’s Genome

Can Alice and Bob compute a function on private data, without exposing anything about their data besides the result?

r = f(a, b)

Page 7: Multi-Party Computation for the Masses

Bob’s Genome

Secure Two-Party Computation

AliceBob

“private”

and “correct”

r = f(a, b)

Alice’s Genome

Can Alice and Bob compute a function on private data, without exposing anything about their data besides the result?

Page 8: Multi-Party Computation for the Masses

Yao’s Garbled Circuit ProtocolAlice (circuit generator) Bob (circuit evaluator)

Garbled Circuit Protocol

Andrew Yao, 1980s

secret input a secret input bAgree on function f

r = f(a, b)r = f(a, b)Learns nothing else about b Learns nothing else about a

Page 9: Multi-Party Computation for the Masses

Regular LogicInputs Output

xa b

0 0 00 1 01 0 01 1 1

a b

x

AND

Page 10: Multi-Party Computation for the Masses

“Obfuscated” LogicInputs Output

xa b

a1 b0 x0

a0 b1 x0

a1 b1 x1

a1 b0 x0

a0 or a1

x

AND

b0 or b1

ai, bi, xi are random values, chosen by generator but meaningless to evaluator.

Page 11: Multi-Party Computation for the Masses

Inputs Outputxa b

a1 b0 x0

a0 b1 x0

a1 b1 x1

a1 b0 x0

a0 or a1

x

AND

b0 or b1

Leaks information!

“Obfuscated” Logicai, bi, xi are random values, chosen by generator but meaningless to evaluator.

Page 12: Multi-Party Computation for the Masses

Garbled LogicInputs Output

xa b

a1 b0 Ea1 || b0 (x0)

a0 b1 Ea0 || b1 (x0)

a1 b1 Ea1 || b1 (x1)

a0 b0 Ea0 || b0 (x0)

a0 or a1

x

AND

b0 or b1

Page 13: Multi-Party Computation for the Masses

Garbled LogicInputs Output

xa b

a1 b0 Ea1 || b0 (x0)

a0 b1 Ea0 || b1 (x0)

a1 b1 Ea1 || b1 (x1)

a0 b0 Ea0 || b0 (x0)

a0 or a1

x

AND

b0 or b1

G

Garbled Table

Page 14: Multi-Party Computation for the Masses

Gar

bled

Circ

uit P

roto

col Alice (generator)

Sends ai, based on her input

Bob (evaluator)Picks random values for a{0, 1}, b{0, 1}, x{0, 1}

Ea1||b0 (x0)

Ea0||b1 (x0)

Ea1||b1 (x1)

Ea0||b0 (x0) Evaluates circuit,

decrypting one row of each garbled gate

xrSends hashes to decode outputs

r

Page 15: Multi-Party Computation for the Masses

Gar

bled

Circ

uit P

roto

col Alice (generator)

Sends ai, based on her input

Bob (evaluator)Picks random values for a{0, 1}, b{0, 1}, x{0, 1}

Ea1||b0 (x0)

Ea0||b1 (x0)

Ea1||b1 (x1)

Ea0||b0 (x0) Evaluates circuit,

decrypting one row of each garbled gate

xrSends hashes to decode outputs

r

How does the Bob learn his own input values?

Page 16: Multi-Party Computation for the Masses

Primitive: Oblivious TransferAlice (generator) Bob (evaluator)

Oblivious Transfer Protocol

b0 , b1 selector i

biLearns nothing else about i

Learns nothing about other value

Rabin, 1981; Even, Goldreich, and Lempel, 1985; …

Page 17: Multi-Party Computation for the Masses

a0,0 or a

0,1

G0

b0,0 or b

1,0

G1

x0 or x1 G2

x1,0 or x1,1

a1,0 or a

1,1

b1,0 or b

1,1

Ea0,1||b0,0(x0,0)

Ea0,0||b0,1(x0,0)

Ea0,1||b0,1(x0,1)

Ea0,0||b0,1(x0,0)

Ea1,1||b1,1(x1,1)

Ea1,0||b1,1(x1,0)

Ea1,1||b1,0(x1,0)

Ea1,0||b1,0(x1,0)

x2,0 or x2,1

Chain gates to securely compute any discrete function!

Ex0,0||x1,0(x2,0)

Ex0,1||x1,1(x2,1)

Ex0,1||x1,0(x2,0)

Ex0,0||x1,0(x2,0)

Page 18: Multi-Party Computation for the Masses

18

Building Computing Systems

Digital Electronic Circuits Garbled Circuits

Operate on known data Operate on encrypted wire labels

One-bit logical operation requires moving some electrons a few nanometers

One-bit logical operation requires performing four encryption operations

Reuse is great! Reuse is not allowed!

Ea1||b0 (x0)

Ea0||b1 (x0)

Ea1||b1 (x1)

Page 19: Multi-Party Computation for the Masses

20012002

20032004

20052006

20072008

20092010

20112012

20132014

$1,000

$10,000

$100,000

$1,000,000

$10,000,000

$100,000,000

Cost to sequence genome

[Fairplay, USENIX Sec 2004]

>$1M

MPC Cost (“Moore’s Law”)

Estimated cost of 10k x 10k Smith-Waterman, 4T gates

Page 20: Multi-Party Computation for the Masses

for (i = 1; i <= n1; ++i) { for(j = 1; j <= n2; ++j) { Accum temp = acMin (dp[i][j-1], dp[i-1][j]); obliv bool d = true; obliv if (acLessEq(dp[i-1][j-1], temp)) { acCopy(&temp, &dp[i-1][j-1]); d = (s1[i-1] != s2[j-1]); }

Scaling MPC

Gate Execution

Protocols

Ea0,1||b0,0(x0,0)

Ea0,0||b0,1(x0,0)

Ea0,1||b0,1(x0,1)

Ea0,0,|b0,1(x0,0)

Circuit Construction

Private Biometrics[NDSS 2011]

Machine Learning [S&P 2013]

Personalized Medicine,Medical Research[USENIX Sec 2011]

Private Set Intersection [NDSS 2012]

Obliv-C

Page 21: Multi-Party Computation for the Masses

for (i = 1; i <= n1; ++i) { for(j = 1; j <= n2; ++j) { Accum temp = acMin (dp[i][j-1], dp[i-1][j]); obliv bool d = true; obliv if (acLessEq(dp[i-1][j-1], temp)) { acCopy(&temp, &dp[i-1][j-1]); d = (s1[i-1] != s2[j-1]); }

Scaling MPC

Gate Execution

Protocols

Ea0,1||b0,0(x0,0)

Ea0,0||b0,1(x0,0)

Ea0,1||b0,1(x0,1)

Ea0,0,|b0,1(x0,0)

Circuit Construction

Private Biometrics[NDSS 2011]

Machine Learning [S&P 2013]

Personalized Medicine,Medical Research[USENIX Sec 2011]

Private Set Intersection [NDSS 2012]

Obliv-C

Page 22: Multi-Party Computation for the Masses

Talk

Out

line

Gate Execution

Protocols

Enca0,1,b0,0(x0,0)

Enca0,0,b0,1(x0,0)

Enca0,1,b0,1(x0,1)

Enca0,0,b0,1(x0,0)

Circuit Construction

This AfternoonFarinaz Koushanfar

“TinyGarble: Synthesis of Highly Compact Circuits for Secure Computation”

Stefan Katzenbeisser“Towards Practical Two-Party Computations”

z1

z2

Page 23: Multi-Party Computation for the Masses

Two Halves Make a WholeReducing Data Transfer in

Garbled Circuits using Half Gates Samee Zahur, Mike Rosulek, and David Evans. In EuroCrypt 2015.Samee Zahur

(UVa PhD Student)

+ =

Page 24: Multi-Party Computation for the Masses

Background: Point-and-Permute

Enca0,,b0,(c0)

Enca0,,b1(c0)

Enca0,,b0(c0)

Enca1,b1(c1)

Encoding garble table entries:

Input wire labels(with selection bits)

Output wire label

Beaver, Micali and Rogaway [STOC 1990]

Page 25: Multi-Party Computation for the Masses

Background: Garbled Row Reduction

Naor, Pinkas and Sumner [1999]

Page 26: Multi-Party Computation for the Masses

Background: Garbled Row Reduction

Naor, Pinkas and Sumner [1999]

Page 27: Multi-Party Computation for the Masses

Background: Garbled Row Reduction

Naor, Pinkas and Sumner [1999]

Page 28: Multi-Party Computation for the Masses

Background: Free-XOR

Kolesnikov and Schneider [2008]

Global generator secret

Page 29: Multi-Party Computation for the Masses

Background: Free-XOR

Kolesnikov and Schneider [2008]

Global generator secret

Page 30: Multi-Party Computation for the Masses

Background: Free-XOR

Kolesnikov and Schneider [2008]

Global generator secret

XOR are free! No ciphertexts or encryption needed.

Page 31: Multi-Party Computation for the Masses

Half Gates

Yan Huang, David Evans, and Jonathan Katz. Private Set Intersection: Are Garbled Circuits Better than Custom Protocols? [NDSS 2012]

Page 32: Multi-Party Computation for the Masses

Yan Huang, David Evans, and Jonathan Katz. Private Set Intersection: Are Garbled Circuits Better than Custom Protocols? [NDSS 2012]

Page 33: Multi-Party Computation for the Masses

Yan Huang, David Evans, and Jonathan Katz. Private Set Intersection: Are Garbled Circuits Better than Custom Protocols? [NDSS 2012]

Journal of the ACM, January 1968

swap gates, configured (by generator) to do random permutation

Page 34: Multi-Party Computation for the Masses

Generator Half Gate

Known to generator (but secret to evaluator)

Page 35: Multi-Party Computation for the Masses

Generator Half Gate

Known to generator (but secret to evaluator)

Page 36: Multi-Party Computation for the Masses

Swapper: “Generator Half Gate”

Known to generator (but secret to evaluator)

With Garbled Row Reduction:

Page 37: Multi-Party Computation for the Masses

Evaluator Half-Gate

Known to evaluator (but secret to generator)

Page 38: Multi-Party Computation for the Masses

Evaluator Half-Gate

Known to evaluator (but secret to generator)

But, we need a gate where both inputs are secret…

Page 39: Multi-Party Computation for the Masses

Half + Half = Full Secret Gate

random bit selected by generator

“leaked”unknownknownunknown

Page 40: Multi-Party Computation for the Masses

Half + Half = Full Secret Gate

random bit selected by generator

“leaked”unknownknownunknown

Page 41: Multi-Party Computation for the Masses

Half + Half = Full Secret Gate

random bit selected by generator

“leaked”unknownknownunknown

Page 42: Multi-Party Computation for the Masses

Half + Half = Full Secret Gate

random bit selected by generator

generator half gate evaluator half gate

“leaked”unknownknownunknown

Page 43: Multi-Party Computation for the Masses

Standard Gates Half GatesGenerator Encryptions (H) 4 4Evaluator Encryptions (H) 1 2Ciphertexts Transmitted 3 2XORs Free ✓ ✓Bandwidth 33%Execution Time (edit distance) 25%Energy 21%

Page 44: Multi-Party Computation for the Masses

Standard Gates Half GatesGenerator Encryptions (H) 4 4Evaluator Encryptions (H) 1 2Ciphertexts Transmitted 3 2XORs Free ✓ ✓Bandwidth 33%Execution Time (edit distance) 25%Energy 21%

Page 45: Multi-Party Computation for the Masses

Is one ciphertext enough?

Page 46: Multi-Party Computation for the Masses

Is one ciphertext enough?

No, two is minimum at least assuming garbling schemes use only random oracle and linear operations.

Page 47: Multi-Party Computation for the Masses

for (i = 1; i <= n1; ++i) { for(j = 1; j <= n2; ++j) { Accum temp = acMin (dp[i][j-1], dp[i-1][j]); obliv bool d = true; obliv if (acLessEq(dp[i-1][j-1], temp)) { acCopy(&temp, &dp[i-1][j-1]); d = (s1[i-1] != s2[j-1]); }

Scaling MPC

Gate Execution

Protocols

Ea0,1||b0,0(x0,0)

Ea0,0||b0,1(x0,0)

Ea0,1||b0,1(x0,1)

Ea0,0,|b0,1(x0,0)

Circuit Construction

Private Biometrics[NDSS 2011]

Machine Learning [S&P 2013]

Personalized Medicine,Medical Research[USENIX Sec 2011]

Private Set Intersection [NDSS 2012]

obliv-C

Page 48: Multi-Party Computation for the Masses

48

Fairplay

Malkhi, Nisan, Pinkas and Sella [USENIX Sec 2004]

SFDL Program

SFDL Compiler

Circuit (SHDL)

Alice Bob

Garbled Tables Generator

Garbled Tables Evaluator

SFDL Compiler

Page 49: Multi-Party Computation for the Masses

Pipe

lined

Exe

cutio

n Circuit-Level Application

GC Framework(Evaluator)

GC Framework (Generator)

Circuit StructureCircuit Structure

Yan Huang(UVa PhD,U Indiana)

Yan Huang, David Evans, Jonathan Katz, and Lior Malka. Faster Secure Two-Party Computation Using Garbled Circuits. USENIX Security 2011.

x1

x2y1

y2z1

z2

Page 50: Multi-Party Computation for the Masses

20012002

20032004

20052006

20072008

20092010

20112012

20132014

$100

$1,000

$10,000

$100,000

$1,000,000

$10,000,000

$100,000,000

Free-XOR

Pipelining, +

Half G

ates

(Estimates for 2PC, 4T gates)

100s gates/second

100k gates/second

~5M gates/second

Page 51: Multi-Party Computation for the Masses

Semi-Honest (“Honest but Curious”)Alice Bob

generated circuits

generator oblivious transfer

Evaluates

rr

output decoding/sharing

r = f(a, b)

Only provides privacy and correctness guarantees if circuit is generated honestly!

Page 52: Multi-Party Computation for the Masses

Standard Fix: “Cut-and-Choose”

Generator(Alice)

Evaluator(Bob)

(1) N instances of generated circuit

(5) If okay, evaluate rest and select majority output

(4) checks all revealed circuits

(2) Challenge: choose a random subset

(3) Keys for selected circuits

Provides security against active attacker, but for reasonable security N > 300

Page 53: Multi-Party Computation for the Masses

20012002

20032004

20052006

20072008

20092010

20112012

20132014

$100

$1,000

$10,000

$100,000

$1,000,000

$10,000,000

$100,000,000

Semi-Honest

Active Security

SymmetricCut-and-Choose

[HKE 2013]

Page 54: Multi-Party Computation for the Masses

Semi-Honest is Half-Way TherePrivacy

Nothing is revealed other than the output

(Not) CorrectnessThe output of the protocol is f(a, b)

Generator EvaluatorMalicious-resistant OT

Semi-Honest GCAs long as evaluator doesn’t send result (or complaint) back, privacy for evaluator is guaranteed.

Page 55: Multi-Party Computation for the Masses

Dual Execution ProtocolsYan Huang, Jonathan Katz, David Evans.

[IEEE S&P (Oakland) 2012]Mohassel and Franklin. [PKC 2006]

Page 56: Multi-Party Computation for the Masses

Dual Execution ProtocolAlice Bob

first round execution (semi-honest)generator evaluator

generatorevaluatorz=f(x, y)

Pass if z = z’ and correct wire labelsz’, learned outputwire labels

second round execution (semi-honest)

z'=f(x, y)z, learned outputwire labels

fully-secure, authenticated equality test

Page 57: Multi-Party Computation for the Masses

Security PropertiesCorrectness: guaranteed by authenticated, secure equality testPrivacy: Leaks one (extra) bit on average

adversarial circuit fails on ½ of inputsMalicious generator can decrease likelihood of being caught, and increase information leaked when caught (but decreases average information leaked): at extreme, circuit fails on just one input.

Page 58: Multi-Party Computation for the Masses

Proving Security: Malicious

A BIdeal World

yx

Adversary receives:f (x, y)

Trusted Party in Ideal W

orld

Standard Malicious Model: can’t prove this for Dual Execution

Real WorldA B

yx

Show equivalence

Corrupted party behaves

arbitrarily

Secure Computation Protocol

Page 59: Multi-Party Computation for the Masses

Proof of Security: One-Bit Leakage

A BIdeal World

yx

Controlled bymalicious A

g R {0, 1}g is an arbitrary Boolean function selected by adversary

Adversary receives:f (x, y) and g(x, y)

Trusted Party in Ideal W

orldCan prove equivalence to this for Dual Execution protocols

Page 60: Multi-Party Computation for the Masses

Intuition: 1-bit Leak

Cheating detected

Victim’s Possible InputsInputs where

f (?, y) = r

Broken Circuit for these Inputs

Page 61: Multi-Party Computation for the Masses

ImplementationAlice Bob

first round execution (semi-honest)generator evaluator

z=f(x, y)

Pass if z = z’ and correct wire labelsz’, learned outputwire labels

generatorevaluator second round execution (semi-honest)

z'=f(x, y)z, learned outputwire labels

Recall: work to generate is 2x work to evaluate!

fully-secure, authenticated equality test

Page 62: Multi-Party Computation for the Masses

20012002

20032004

20052006

20072008

20092010

20112012

20132014

$100

$1,000

$10,000

$100,000

$1,000,000

$10,000,000

$100,000,000

Semi-Honest

Active Security

Dual Execution

Page 63: Multi-Party Computation for the Masses

Secure Computation for the Masses?Remarkable progress in past 10 years

Costs reduced by 1012

Beginning to see commercial deploymentsScaling number of parties still very hardChallenge of End-to-End Trust

Trusting Software Understanding leaks from outputUser-understandable information release policies

Page 64: Multi-Party Computation for the Masses

David [email protected]

www.cs.virginia.edu/evansoblivc.org

mightBeEvil.org

Collaborators (this work): Yan Huang, Jonathan Katz, Mike Rosulek, Samee ZahurFunding: NSF, AFOSR, Google

Page 65: Multi-Party Computation for the Masses

Not Used

Page 66: Multi-Party Computation for the Masses