GithubHelp home page GithubHelp logo

trustworthycomputing / plasma Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 402 KB

Code for "PLASMA: Private, Lightweight Aggregated Statistics against Malicious Adversaries"

Home Page: https://eprint.iacr.org/2023/080.pdf

License: MIT License

Rust 99.50% Dockerfile 0.50%
applied-cryptography distributed-point-functions heavy-hitters secret-sharing private-statistics

plasma's Introduction

PLASMA: Private, Lightweight Aggregated Statistics against Malicious Adversaries

WARNING: This is not production-ready code.

This is software for a research prototype. Please do NOT use this code in production. This repository builds upon heavy-hitters.

How to cite this work

PLASMA will appear in PoPETS 2024 (the preprint can be accessed here). You can cite this work as follows:

@Article{PoPETS:MouSarTso24,
  author =       "Dimitris Mouris and
                  Pratik Sarkar and
                  Nektarios Georgios Tsoutsos",
  title =        "{PLASMA: Private, Lightweight Aggregated Statistics against Malicious Adversaries}",
  year =         2024,
  volume =       2024,
  month =        July,
  journal =      "{Proceedings on Privacy Enhancing Technologies}",
  number =       3,
  pages =        "1--19",
}

Build & Run With Docker Compose

The following runs three servers and the leader each in a different container:

❯❯ docker compose up

Getting started

First, make sure that you have a working Rust installation:

❯❯ rustc --version
rustc 1.67.1
❯❯ cargo --version
cargo 1.67.1

Note that we don't require the exact Rust version, but this is the one we used in our experiments.

Build from sources

cargo build --release

Run the tests:

cargo test --release

Heavy Hitters

First off, run the servers in different shells.

Server 0:

cargo run --release --bin server -- --config src/bin/config_8.json --server_id 0

Server 1:

cargo run --release --bin server -- --config src/bin/config_8.json --server_id 1

Server 2:

cargo run --release --bin server -- --config src/bin/config_8.json --server_id 2

Now, the servers should be ready to process client requests. In a forth shell, run the following command to send 100 client requests to the servers:

Clients:

cargo run --release --bin leader -- --config src/bin/config_8.json -n 100

To run with the presence of malicious clients include the --malicious flag followed by the percentage of malicious clients to generate ([0.0, 0.9]). For instance, to run with 5% malicious clients use:

cargo run --release --bin leader -- --config src/bin/config_8.json -n 100 --malicious 0.05

The config file

The client and servers use a common configuration file, which contains the parameters for the system. An example of one such file is in src/bin/config_8.json. The contents of that file are here:

{
  "data_bytes": 1,
  "threshold": 0.01,
  "server_0": "0.0.0.0:8000",
  "server_1": "0.0.0.0:8001",
  "server_2": "0.0.0.0:8002",
  "addkey_batch_size": 1000,
  "hashes_batch_size": 100000,
  "unique_buckets": 1000,
  "zipf_exponent": 1.03
}

The parameters are:

  • data_bytes: Number of bytes of each string (x8 for bits).
  • threshold: The servers will output the collection of strings that more than a threshold of clients hold.
  • server0, server1, and server2: The IP:port of tuple for the two servers. The servers can run on different IP addresses, but these IPs must be publicly addressable.
  • addkey_batch_size: The number of each type of RPC request to bundle together. The underlying RPC library has an annoying limit on the size of each RPC request, so you cannot set these values too large.
  • unique_buckets and zipf_exponent: Each simulated client samples its private string from a Zipf distribution over strings with parameter zipf_exponent and support unique_buckets.

Trustworthy Computing Group

plasma's People

Contributors

jimouris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.