Skip to main content

Distributed Laplace Perturbation Algorithm

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.

Metadata

Release files for psi-dlpa 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for psi-dlpa 0.3.0
File Size Uploaded
psi-dlpa-0.3.0.tar.gz 46.9 kB Details

Release files / psi-dlpa-0.3.0.tar.gz

Download URL psi-dlpa-0.3.0.tar.gz
Size 46.9 kB
Tags Source
SHA-256 checksum
How to use checksums
1d187697200932c9c01808675d4fcdb2c00f1b0548ca23344b0cfde5ad45a334
BLAKE2b-256 checksum
How to use checksums
341980465f57889a1172f955eb57cfcf694b40ce916f3c45bb3281519a49f207
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.3.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page