A Practical, Secure, and Verifiable Cloud Computing for Mobile Systems

 

 

 

home

 

people

 

documents

 

privacy preserving

search for nearest bank/ATM

 

implementation

 

license

 

code

 

acknowledgments

 

Source code:

Our source code is available for download from the following link.

 

 

Instructions for compilation

To compile our C++ source files in a Linux environment, use the following commands:

g++ -o Seed shareSeed.cpp -lssl -lcrypto

g++ -o PRNG prng.cpp -lssl -lcrypto

g++ -o GenerateCircuit gencirc.cpp -lssl -lcrypto

g++ -o CreateGarbledTables createGarbledTables.cpp -lssl -lcrypto

g++ -o Evaluate evaluateGarbledTables.cpp -lssl -lcrypto

g++ -o Op op_xor.cpp -lssl -lcrypto

g++ -o Alt Alt_Prng.cpp -lssl -lcrypto

 

Note that "ssl" and "crypto" libraries are required for compiling the code.

 

 

Circuit files

The file "circuit1.txt" contains the representation of a circuit with a single gate. It computes the function: XOR(w0, w1), where w0, w1 represent the bits on the two input wires.

 

The file "circuit2.txt" contains the representation of a circuit with three gates. It computes the function: XOR(XOR(w0, w1), AND(w2, w3)), where w0, w1, w2, w3 represent the bits on the four input wires.

 

 

Instructions for execution

To perform secure and verifiable computation, run the executable files in the following order:

 

Seed: This executable creates the necessary seed values depending on the number of parties.

Command line arguments: None

Input: Total number of parties (n).

 

 

PRNG: This executable generates the random bits using Blum, Blum, Shub generator. The number of parties (n) is probed by this program. It creates n PRNG files, one for each of the n parties. Each file consists of bits, where and is the number of wires in the circuit.

Command line arguments: None

Inputs:

1.) Filename of the circuit that has to be evaluated (example: circuit1.txt, circuit2.txt).

2.) Number of parties.

 

 

GenerateCircuit: This executable creates the auxiliary circuit, which is used by the n parties, to create their share of a garbled table entry using Goldreich's Secure MultiParty Computation protocol.

 

Run this executable twice:

For the 1st run of this executable, ensure that, in the source file, the variable 'A_gate_type' equals 'XOR', and redirect the output of the executable to a file with name input_xor.txt.

 

For the 2nd run of this executable, ensure that, in the source file, the variable 'A_gate_type' equals 'AND', and redirect the output of the executable to a file with name input_and.txt.

 

Thus, the circuits required to create garbled table entries for both the 'AND' gate and the 'XOR' gate are generated.

 

Note: The variable "num_parties" in the source file should equal the number of parties.

 

Command Line arguments: None

Inputs: None

 

The files (input_xor.txt, input_and.txt) serve as input for creation of garbled table shares.

 

 

CreateGarbledTables: This executable file is responsible for creation of the garbled table shares for each gate in the circuit. Run this executable once for each party.

Command Line parameters:

The first parameter refers to the IP Address of the local host (127.0.0.1). The rest of the parameters represent the TCP port numbers, used for communicating with the other parties. Note that each party communicates with (n-1) other parties.

 

The following diagram illustrates the communication between different parties when there are parties. Each number inside a box represents a TCP port number.

 

TCP Port Numbers for parties

 

 

w

 

The arrows are directed from sending party to the receiving party for oblivious transfers.

 

w

Party 1 always acts as a sender. The first port on the command line argument list for Party 1 is used for communicating with party2; the second port number in the argument list is used for communicating with party 3, and so on.

 

w

Note that there are (n-1) port numbers in the command line for each party.

 

w

Each pair of "boxes" connected using an arrow has the same port number.

 

w

The last party always acts as a chooser.

 

In addition to the command line parameters, this executable probes the user to enter the current party's number and the total number of parties.

 

A sample invocation of this executable with parties is shown below:

 

Party 1:

CreateGarbledTables 127.0.0.1 2000 2001 2002

Please enter the circuit file name along with extension, that has to be evaluated: circuit1.txt

Party number? 1

Total num of parties 4

 

Party 2:

CreateGarbledTables 127.0.0.1 2000 2003 2004

Please enter the circuit file name along with extension, that has to be evaluated: circuit1.txt

Party number? 2

Total num of parties 4

 

Party 3:

CreateGarbledTables 127.0.0.1 2001 2003 2005

Please enter the circuit file name along with extension, that has to be evaluated: circuit1.txt

Party number? 3

Total num of parties 4

 

Party 4:

CreateGarbledTables 127.0.0.1 2002 2004 2005

Please enter the circuit file name along with extension, that has to be evaluated: circuit1.txt

Party number? 4

Total num of parties 4

 

 

When the execution completes, garbled table shares for each gate in the circuit is created, for each party and are stored in separate files. The time taken to create the garbled table shares is also shown on output.

 

 

Op: This executable performs the XOR sum of all the shares of garbled table entries created by the parties.

Command line arguments: None

Inputs:

1.) Number of Parties

2.) Filename of the circuit

 

 

Evaluate: This executable evaluates the garbled circuit. It accesses the garbled table files to evaluate each garbled table.

Command line arguments: none

Inputs:

1.) Filename of the circuit, that has to be evaluated

2.) Total number of parties

3.) Input count (denotes the number of inputs)

4.) The actual input bits to the circuit

5.) Total number of wires in the circuit

 

This program stores the resulting garbled output in a file, which is accessed by Alt_Prng.

 

 

Alt: This executable is used by the client to generate bits corresponding to the pair of garbled values for the output wire, using the alternate form of Blum, Blum, Shub PRNG. It also extracts the output bits in plaintext form.

 

It verifies whether the evaluation is done correctly -- by comparing the output garbled value produced by the evaluator with the two expected garbled values for the output wire.

 

Command line arguments : none

Inputs :

1.) Number of parties

2.) Total number of wires in the circuit