Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Client/Server for Distributed Laplace Perturbation Algorithm

Project description

GPLv3 Release

Client and server applications providing Distributed Laplace Perturbation Algorithm (DLPA).

The DLPA has been introduced by Vibhor Rastogi and Suman Nath in “Differentially Private Aggregation of Distributed Time-Series with Transformation and Encryption,” and published in SIGMOD 2010.

Client

This package has client class dlpa.DLPAClient. To create an instance, the constructor takes two arguments:

  • host: Address of a DLPA server,
  • port: Port number of the DLPA server.

Although the client class implements several protocols defined in DLPA, get_key and encrypt_noisy_sum are the only method users might have interest.

The get_key requests a client key to the server. It takes one argument, client ID, and returns a client key object.

The other method encrypt_noisy_sum runs the Entryp-Noisy-Sum protocol, which is the key protocol of DLPA. It takes the following four arguments:

  • ck: Client key.
  • client_id: Client ID.
  • value: Scalar or vector to be sent to the server by Encrypt-Sum protocol.
  • epsilon: Parameter to generate Laplace noises.

and returns a time slot when the request is attached.

Server

dlpa-server command runs a server application of DLPA. The following is the usage of this command:

usage: dlpa-server [-h] --port PORT --clients NCLIENT
                   [--max-workers MAX_WORKERS] [--key-length M_LENGTH]
                   [--time-span SPAN]

optional arguments:
  -h, --help            show this help message and exit
  --port PORT           Listening port number.
  --clients NCLIENT     The number of clients.
  --max-workers MAX_WORKERS
                        The maximum number of workers (default: 10).
  --key-length M_LENGTH
                        Bit length of the secret key (default: 2048).
  --time-span SPAN      Second of one time slot.

Note that the port number and the number of clients are necessary arguments.

You can also starts a server from another python script by using dlpa.server function. The function takes the following keyword arguments:

  • port: Port number the created server listen.
  • max_workers: The maximum number of workers.
  • nclient: The number of clients connecting this server.
  • m_length: Bit length of the secret key.

and returns a server object, which has a method stop(t) to stop the server within the given time t. Callers are responsible for calling the method to close the server.

Installation

$ pip install --upgrade psi-dlpa

Additionaly, if you install gmpy2, computation time will be reduced. To install gmpy2 in mac, you also need to install mpc, mpfr, and libmp. Those three packages are available in Homebrew.

License

This software is released under The GNU General Public License Version 3, see COPYING for more detail.

The functions, powmod, invert, and getprimeover, defined in src/dlpa/util.py are made by Data61 | CSIRO and released under the GPLv3. The original source code is here.

Project details


Release history Release notifications

This version

0.3.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for psi-dlpa, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size psi-dlpa-0.3.0.tar.gz (46.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page