{"id":18129190,"url":"https://github.com/jkawamoto/psi-dlpa","last_synced_at":"2025-04-06T14:27:21.476Z","repository":{"id":57455304,"uuid":"84462430","full_name":"jkawamoto/psi-dlpa","owner":"jkawamoto","description":"Distributed Laplace Perturbation Algorithm","archived":false,"fork":false,"pushed_at":"2017-10-26T02:55:28.000Z","size":3813,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-12T20:34:39.144Z","etag":null,"topics":["differential-equations","paste","privacy","sigmod"],"latest_commit_sha":null,"homepage":"https://jkawamoto.github.io/psi-dlpa/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jkawamoto.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-09T16:11:27.000Z","updated_at":"2020-09-07T02:03:28.000Z","dependencies_parsed_at":"2022-09-10T00:40:25.351Z","dependency_job_id":null,"html_url":"https://github.com/jkawamoto/psi-dlpa","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fpsi-dlpa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fpsi-dlpa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fpsi-dlpa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jkawamoto%2Fpsi-dlpa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jkawamoto","download_url":"https://codeload.github.com/jkawamoto/psi-dlpa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247494559,"owners_count":20947898,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["differential-equations","paste","privacy","sigmod"],"created_at":"2024-11-01T10:07:04.149Z","updated_at":"2025-04-06T14:27:21.456Z","avatar_url":"https://github.com/jkawamoto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Distributed Laplace Perturbation Algorithm\n[![GPLv3](https://img.shields.io/badge/license-GPLv3-blue.svg)](https://www.gnu.org/copyleft/gpl.html)\n[![Build Status](https://travis-ci.org/jkawamoto/psi-dlpa.svg?branch=master)](https://travis-ci.org/jkawamoto/psi-dlpa)\n[![wercker status](https://app.wercker.com/status/e2799a5e4bf381734ac6d2d5dc844f3e/s/master \"wercker status\")](https://app.wercker.com/project/byKey/e2799a5e4bf381734ac6d2d5dc844f3e)\n[![Release](https://img.shields.io/badge/release-0.3.0-brightgreen.svg)](https://github.com/jkawamoto/psi-dlpa/releases/tag/0.3.0)\n\nClient and server applications providing Distributed Laplace Perturbation\nAlgorithm (DLPA).\n\nThe DLPA has been introduced by\n[Vibhor Rastogi](https://www.linkedin.com/in/vibhor-rastogi-6b680152)\nand [Suman Nath](https://www.microsoft.com/en-us/research/people/sumann/)\nin \"[Differentially Private Aggregation of Distributed Time-Series with\nTransformation and Encryption](http://dl.acm.org/citation.cfm?id=1807247),\"\nand published in [SIGMOD 2010](http://www.sigmod2010.org/index.shtml).\n\n## Client\nThis package has client class `dlpa.DLPAClient`.\nTo create an instance, the constructor takes two arguments:\n\n* host: Address of a DLPA server,\n* port: Port number of the DLPA server.\n\nAlthough the client class implements several protocols defined in DLPA,\n`get_key` and `encrypt_noisy_sum` are the only method users might have interest.\n\nThe `get_key` requests a client key to the server.\nIt takes one argument, client ID, and returns a client key object.\n\nThe other method `encrypt_noisy_sum` runs the Entryp-Noisy-Sum protocol,\nwhich is the key protocol of DLPA.\nIt takes the following four arguments:\n\n* ck: Client key.\n* client_id: Client ID.\n* value: Scalar or vector to be sent to the server by Encrypt-Sum\n  protocol.\n* epsilon: Parameter to generate Laplace noises.\n\nand returns a time slot when the request is attached.\n\n## Server\n`dlpa-server` command runs a server application of DLPA.\nThe following is the usage of this command:\n\n```\nusage: dlpa-server [-h] --port PORT --clients NCLIENT\n                   [--max-workers MAX_WORKERS] [--key-length M_LENGTH]\n                   [--time-span SPAN]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  --port PORT           Listening port number.\n  --clients NCLIENT     The number of clients.\n  --max-workers MAX_WORKERS\n                        The maximum number of workers (default: 10).\n  --key-length M_LENGTH\n                        Bit length of the secret key (default: 2048).\n  --time-span SPAN      Second of one time slot.\n```\n\nNote that the port number and the number of clients are necessary arguments.\n\nYou can also starts a server from another python script by using `dlpa.server`\nfunction.\nThe function takes the following keyword arguments:\n\n* port: Port number the created server listen.\n* max_workers: The maximum number of workers.\n* nclient: The number of clients connecting this server.\n* m_length: Bit length of the secret key.\n\nand returns a server object, which has a method `stop(t)` to stop the server\nwithin the given time `t`.\nCallers are responsible for calling the method to close the server.\n\n## Installation\n```\n$ pip install --upgrade psi-dlpa\n```\n\nAdditionaly, if you install [gmpy2](https://pypi.python.org/pypi/gmpy2),\ncomputation time will be reduced.\nTo install gmpy2 in mac, you also need to install mpc, mpfr, and libmp.\nThose three packages are available in [Homebrew](https://brew.sh/).\n\n## License\nThis software is released under The GNU General Public License Version 3,\nsee [COPYING](COPYING) for more detail.\n\nThe functions, powmod, invert, and getprimeover, defined in `src/dlpa/util.py`\nare made by Data61 | CSIRO and released under the GPLv3.\nThe original source code is\n[here](https://github.com/n1analytics/python-paillier/blob/master/phe/util.py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkawamoto%2Fpsi-dlpa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjkawamoto%2Fpsi-dlpa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjkawamoto%2Fpsi-dlpa/lists"}