This repository contains a prototype implementation of the DP-PIR protocol accompanying the Usenix Security 2022 paper "Batched Differentially Private Information Retrieval".
This repository contains our DP-PIR implementation, in addition to code for running the experiments shown in the paper, including experiments with our two baselines: Checklist (both Punc and DPF), and SealPIR.
Our code uses TCP sockets. For performance reasons, our code tries to set the TCP read and write buffers to a large size that exceeds the default allowed size.
If running the code on AWS using our script (see below), our scripts will take care of this step for you.
If you are running the code on a local machine, you will need to change this allowed size your host machine. Regardless of whether you are using the machine directly or via our Docker container. On Ubuntu, this can be done using:
sudo sysctl -w net.core.rmem_max=123289600
sudo sysctl -w net.core.wmem_max=123289600
If you skip this step or decide not change the allowed TCP buffer size. Our code will still work correctly, but may exhibit relatively worse performance. Our code will display a warning if it encounters any issue setting up these buffer sizes.
We developed and tested this code using ubuntu 20.04, g++-11 and bazel 4.2.1. node.js is required to run the orchestrator, and python3 is required to run the plotting scripts. Finally, go 1.16 is required to run Checklist.
We recommend using the provided docker container to obtain all these dependencies and configuration.
# Build the docker container
docker build -t dppir-image .
# Run the docker container in the background
docker run --name dppir -d -t dppir-image
# Open a terminal inside the container to execute commands in
docker exec -it dppir /bin/bash
cd /DPPIR
Our protocol consists of two or more parties and a client. Each of these entities needs to be run as its own separate process. In reality, these entities should be deployed on separate machines.
You can run a simple example locally using the provided configuration file at config/example.txt.
This example configuration is for two parties, epsilon 1 and delta 0.1, and a database of size
100.
First, you need to run the two parties, each in their own separate terminals. If you are using the docker container, you need to open different terminals in the container for each one.
# Run the first party
bazel run --config=opt //DPPIR:main -- --config=config/example.txt --stage=all --role=party --party_id=0 --server_id=0
# Run the second party (in a different terminal)
bazel run --config=opt //DPPIR:main -- --config=config/example.txt --stage=all --role=party --party_id=1 --server_id=0
Then, in a third different terminal, you can run the client and provide it with the number of queries to make (say 100):
bazel run --config=opt //DPPIR:main -- --config=config/example.txt --stage=all --role=client --server_id=0 --queries=100
Due to our bazel setup, the config files must be located under config/. The --stage argument
specifies whether to run the online or offline stages (or both if all is provided).
You can generate your own configuration file with your own parameters by running. The absolute file path should be used for the output config file command line argument:
bazel run --config=opt //DPPIR/config:gen_config -- /full/path/to/config/outfile.txt
We recommend using our orchestrator to run experiments. It will take care of creating the configuration per the experiment parameter, and assigning and tracking the progress of the workers.
First, you must run the orchestrator:
cd experiments/orchestrator
# you need to run "npm install" if you are not using the docker container.
node main.js
Second, in a separate terminal, you must spawn some local workers. You can do that using: