450 likes | 659 Vues
GPU and CPU Parallelization of Honest-but-Curious Secure Two-Party Computation. Nathaniel Husted, Steve Myers, abhi shelat , Paul Grubbs. Alice and Bob want to compute a public function of their private inputs. Secure Two-party Computation. Disease Database. Alice. Bob.
E N D
GPU and CPU Parallelization of Honest-but-Curious Secure Two-Party Computation Nathaniel Husted, Steve Myers, abhishelat, Paul Grubbs
Alice and Bob want to compute a public function of their private inputs. Secure Two-party Computation Disease Database Alice Bob
Secure Two-party Computation Alice Bob Y X => Alice & Bob F(X,Y) Alice provides X. Bob provides Y. F(X,Y) is correctly calculated without Bob learning X and Alice learning Y.
Yao’s Garbled Circuits [Yao1986] X XOR 0 OUTPUTS Y XOR 1 0 F(X,Y) AND 2 OR 4 AND 3
I’m going to discuss the current fastest solution for processing Yao’s Garbled Circuits.
Yao’s Garbled Circuits [Yao1986] X XOR 0 OUTPUTS Y XOR 1 0 F(X,Y) = X + Y AND 2 OR 4 AND 3
Wires in Yao’s Garbled Circuits [Yao1986] • Alice must use randomlabels () for wire values instead of 0’s and 1’s. Label 0 () Wire 0 () Label 1 ()
Yao’s Garbled Circuits [Yao1986] F(X,Y) = X + Y X XOR 0 OUTPUTS 0xCC1C Y XOR 1 Label 0 = 0xF1F1 0x1112 0x1212 Label 1 = 0xABAB 0 0x1234 AND 2 0xFFCC OR 4 0x1203 0x93FA 0x8843 0x1103 0x4321 0xBA81 AND 3 0x9932 0x6753 0x9B3F
Encrypting Gates in Yao’s Garbled Circuits [Yao1986] Gate 2 () AND
Encrypting Gates in Yao’s Garbled Circuits [Yao1986] • Notation shortcut: = Gate 2 () AND
Garbling Gates in Yao’s Garbled Circuits [Yao1986] Gate 2 () AND
Garbling Gates in Yao’s Garbled Circuits [Yao1986] Gate 2 () AND
Garbling Gates in Yao’s Garbled Circuits [Yao1986] Gate 2 () AND
Yao’s Garbled Circuits [Yao1986] F(X,Y) = X + Y X XOR 0 OUTPUTS 0xCC1C Y XOR 1 Label 0 = 0xF1F1 0x1112 0x1212 Label 1 = 0xABAB 0 0x1234 AND 2 0xFFCC OR 4 0x1203 0x93FA 0x8843 0x1103 0x4321 0xBA81 AND 3 0x9932 0x6753 0x9B3F
Alice sends the generated circuit to Bob. • Alice sends ALL garbled truth tables to Bob. • BOB Sent over the network… • ALICE
Bob evaluates the circuit. • Evaluation is the reverse of generation. Gate 3 () AND = 0xCC1C = 0x1 = ?? = 0x1234 = 0x0
Bob evaluates the circuit. • Evaluation is the reverse of generation. Gate 3 () AND = 0xCC1C = 0x1 ENTRY TO DECODE = ?? = 0x1234 = 0x0
Bob evaluates the circuit. • Evaluation is the reverse of generation. Gate 3 () AND = 0xCC1C = 0x1 ENTRY TO DECODE = ?? = 0x1234 = 0x0
Other security models for Yao’s Garbled Circuits • Malicious-Leaks-A-Bit [Huang2013] • Benefits: • Attacker can analyze results and lie in the protocol. • Only requires one extra Generation and Evaluation. • Drawbacks: • Leaks 1-bit of output. • Fully Malicious [Lindell2013] • Benefits: • Leaks no information to the attacker. • Drawbacks • Requires Alice generate between 60 – 130 circuits. Bob must evaluate ~1/2 and verify the rest. • NOTE: Our methods can work with either of these models!
Contributions to Garbled Circuit Optimization • A method for accurately comparing garbled circuit systems with very different circuit formats. • A method for generating all gates in a circuit at once. • A method for reducing the number of calculations for each gate garbling. • A scalable generation method that can be combined with other best-in-class implementations.
Fast Garbled Circuit Processing With GPUs • GPUs are highly parallel Single Instruction Multiple Data (SIMD) processors. • We can use every “core” on the GPU to process a gate. • But the SIMD parallelism requires protocol modifications.
Generating all gates at once allows high through-put but requires protocol modification. • The Free XOR Technique [Kolesnikov2008] Gate 0 () XOR Label 0 () Label 1 () = Gate 2 () AND = : Randomly Generated Constant
Generating all gates at once allows high through-put but requires protocol modification. • Our modified Free XOR technique Gate 0 () XOR Label 0 () Label 1 () = Gate 2 () AND = : Randomly Generated Constant
Garbling Truth Tables in practice Gate 2 () AND
Reducing calculations required per-gate provided benefits over other GPU systems. • But recall there are three wires for every gate in the circuit…
Inputs and Outputs of SHA1 Buckets holding inputs: 4 … 16 1 2 3 15 Buckets holding algorithm state: E D B A C
Pre-computing SHA1 intermediate values Inputs for random wire values: Seed … 0x0 … Wire ID Seed Seed Seed Wire ID
Pre-computing SHA1 intermediate values Buckets holding inputs: Seed … 0x0 … Wire ID Seed Seed Seed Wire ID Only buckets used during the first 14 rounds. = Common for all Wires
Current and On-Going Work • Now implement the PCF2 circuit format developed by Kreuter et al. • Working on additional circuit optimizations on top of those provided by the PCF2 compiler. • Provide a full scale solution from honest-but-curious to fully malicious processing. • Multiple GPUs • Super computers • Experiments and source code are available upon request.
Using GPUs we show the fastest single machine garbled circuit generator • XOR Gates: ~ 60.2 Million Gates Per Second • TT Gates: ~34.1 Million Gates Per Second
1. Alice will generate the Yao’s circuit. • Alice must construct the circuit using a series of Boolean gates with two input wires and one output wire. • Each gate has a serial number and garbled truth table. Gate 0 () AND
Wires in Yao’s Garbled Circuits [Yao1986] • Alice must use randomlabels () for wire values instead of 0’s and 1’s. • Alice must use permutation bits (p-bits; ) to signify the label choice. P-bit 0 () = 0x1 Label 0 () = 0xA1B2 Wire 0 () Label 1 () = 0x192F P-bit 1 () = 0x0
Encrypting Gates in Yao’s Garbled Circuits [Yao1986] • How Alice creates garbled truth tables in two steps • Step 1: Create Encrypted Truth Table Gate 2 () AND = 0xA1B2 = 0x0 = 0x192F = 0x1
Encrypting Gates in Yao’s Garbled Circuits [Yao1986] • How Alice creates garbled truth tables in two steps • Step 1: Create Encrypted Truth Table Gate 2 () AND = 0xA1B2 = 0x0 STEP 1 OUTPUT = 0x192F = 0x1
Encrypting Gates in Yao’s Garbled Circuits [Yao1986] • How Alice creates garbled truth tables in two steps • Step 1: Create Encrypted Truth Table Gate 1 () XOR
Encrypting Gates in Yao’s Garbled Circuits [Yao1986] • How Alice creates garbled truth tables in two steps • Step 1: Create Encrypted Truth Table Gate 4 () OR
A basic overview of the Yao’s protocol • Assumptions: • Security Model: Honest but Curious • Process: • Alice will generate the Yao’s circuit. • Alice sends the generated circuit to Bob. • Bob will use Oblivious Transfer to learn Alice’s inputs. • Bob will evaluate the circuit. • Bob sends the output to Alice
Yao’s Garbled Circuits under an Honest-but-Curious Security Model • Alice generates wire labels and garbled truth tables for all wires and gates in a circuit. • Alice sends the garbled truth tables to Bob. • Bob obtains Alice’s input using Oblivious Transfer. • Bob evaluates the circuit. • Bob sends output to Alice. Both party can analyze data t all steps of this protocol but must perform all steps.
Bob performs Oblivious Transfer to obtain Alice’s Inputs Oblivious Transfer Bob Alice
So how fast can we process garbled circuits? • XOR Gates: ~ 60.2 Million Gates Per Second • TT Gates: ~34.1 Million Gates Per Second