MOTION
0.01
Framework for mixed-protocol multi-party computation
|
We implemented three example programs to help a better understanding of Secure Multi-Party Computation and moreover of our framework. They illustrate a variety of common functionality requirements using three types of protocols: ArithmeticGMW, BooleanGMW, and BMR. A Python script geninput.py
is also provided and used to create files that can help generate inputs and the expected results for these examples.
This example takes two vectors of integers as inputs and computes a crosstabulation, which is a database operation that computes, in our case sums rather than average, by category.
The first party owns the data of each category, possibly more than one value for one category, and the second party holds the categories. This example allows these parties to find out the sum in each category without revealing the values in a category. The number of categories can be set using bins
, so the second party's input should not exceed bins-1
. If that's the case, then the modulo of this number will be computed and used.
In our example, the inputs can be given directly from terminal using --input
or from a file by specifying the path using --input-file
. For this example the protocol is set as BooleanGMW and cannot be chosen.
In order to analyze the obesity risk in different age groups, authorized researchers want to compute average BMI over anonymized health data stored at some medical institute. The researchers themselves know only the pseudonyms of the people in the database and their age group. The institute, on the other hand, knows only the pseudonyms of the people and their BMI. Also, neither the institute nor the researchers are allowed to reveal the cleartext data to anyone else. Now, both parties can use secure cross-tabulation to privately compute the sum of the BMIs in each age group as follows :
ID
: The pseudonym of each person.data
: The BMI of each person.ID
: The pseudonym of each person.categories
: The age groups from 0 ... bins-1
.The bins
is set according to the number of age groups. To do the computation, the data
from the institute will be grouped and accumulated by the categories
from the institute. A real example with a small number of data can be pictured like so :
This example takes two vectors of integers and computes the inner product ( scalar product, dot product) of these inputs. In other words, it computes the sum of the pairwise product of their elements. This allows two parties to compute the inner product of their inputs, without revealing the inputs itselves.
In our example, the inputs can be given directly from terminal using --input
or from a file by specifying the path using --input-file
. All three protocols (ArithmeticGMW, BooleanGMW, BMR) are supported.
This example takes an integer input from three different parties and computes the multiplication of these three inputs.
In our example, the inputs can be given directly from terminal using --input
or from a file by specifying the path using --input-file
. All three protocols (ArithmeticGMW, BooleanGMW, BMR) are supported.
This example takes three secret shared inputs from two parties and computes the multiplication of these inputs.
In our example, the inputs can only be given from a file by specifying the path using --input-file-shared
. Random inputs and the corresponding expected result can be generated using our Python script geninput.py
. This example supports ArithmeticGMW and BooleanGMW. However, each protocol needs different inputs so that it can work properly (see Examples).
with ^
as XOR computation.