{"id":29704333,"url":"https://github.com/eth-sri/dp-sniper","last_synced_at":"2025-10-06T15:37:26.965Z","repository":{"id":39718141,"uuid":"349022167","full_name":"eth-sri/dp-sniper","owner":"eth-sri","description":"A machine-learning-based tool for discovering differential privacy violations in black-box algorithms.","archived":false,"fork":false,"pushed_at":"2022-05-26T23:46:01.000Z","size":147,"stargazers_count":21,"open_issues_count":1,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-08T00:15:48.711Z","etag":null,"topics":["differential-privacy","machine-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eth-sri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-18T09:58:19.000Z","updated_at":"2024-04-23T01:51:14.000Z","dependencies_parsed_at":"2022-08-28T05:41:14.244Z","dependency_job_id":null,"html_url":"https://github.com/eth-sri/dp-sniper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/eth-sri/dp-sniper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eth-sri%2Fdp-sniper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eth-sri%2Fdp-sniper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eth-sri%2Fdp-sniper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eth-sri%2Fdp-sniper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eth-sri","download_url":"https://codeload.github.com/eth-sri/dp-sniper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eth-sri%2Fdp-sniper/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266691581,"owners_count":23969182,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-privacy","machine-learning"],"created_at":"2025-07-23T14:10:07.925Z","updated_at":"2025-10-06T15:37:21.916Z","avatar_url":"https://github.com/eth-sri.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DP-Sniper\n\nA machine-learning-based tool for discovering differential privacy violations in black-box algorithms.\n\n## Install\n\nWe recommend installing DP-Sniper using\n[conda](https://conda.io/projects/conda/en/latest/user-guide/install/index.html).\n\nAfter installing conda, you can install DP-Sniper by running its installation\nscript [install.sh](./install.sh):\n\n```bash\nbash ./install.sh\n```\n\nYou can ignore the warning `ResourceWarning: unclosed running multiprocessing\npool`.\n\n_Note: The above steps are sufficient to use the main package `dpsniper`. If you would like to run the experiments from the SP 2021 research paper, you have to follow additional installation steps as described in [eval_sp2021/README.md](eval_sp2021/README.md))._\n\n## Basic Usage\n\nThe following command tests the differential privacy of the Laplace mechanism,\nexplained in detail in file [dpsniper/example.py](dpsniper/example.py):\n\n```bash\nconda activate dp-sniper\npython dpsniper/example.py # may take a while due to an extensive final confirmation\n```\n\nThis commands stores temporary outputs and log files to the folder\n`example_outputs` of the current working directory.\n\n### Testing Your Own Mechanism\n\nDP-Sniper is a black-box approach. To run DP-Sniper or DD-Search on your own\nmechanism, you only have to implement the method `m` of the abstract class\n`Mechanism` defined in\n[dpsniper/mechanisms/abstract.py](dpsniper/mechanisms/abstract.py) and modify\nthe code snippet in [dpsniper/example.py](dpsniper/example.py). See\n[dpsniper/mechanisms](dpsniper/mechanisms) for example implementations of\npopular mechanisms.\n\n## Publication\n\nThis is an implementation of the approach presented in the following research paper:\n\n\u003e B. Bichsel, S. Steffen, I. Bogunovic and M. Vechev. 2021.\n\u003e DP-Sniper: Black-Box Discovery of Differential Privacy Violations using Classifiers.\n\u003e In IEEE Symposium on Security and Privacy (SP 2021).\n\nThe main algorithms DD-Search and DP-Sniper from the paper can be found in\n[dpsniper/search/ddsearch.py](dpsniper/search/ddsearch.py) and\n[dpsniper/attack/dpsniper.py](dpsniper/attack/dpsniper.py), respectively.\n\n### Citing this Work\n\nYou are encouraged to cite the above publication using the following BibTeX entry\nif you use DP-Sniper for academic research.\n\n    @inproceedings{bichsel2021dpsniper,\n        author={Bichsel, Benjamin and Steffen, Samuel and Bogunovic, Ilija and Vechev, Martin},\n        title = {DP-Sniper: Black-Box Discovery of Differential Privacy Violations using Classifiers},\n        booktitle = {2021 IEEE Symposium on Security and Privacy (SP)},\n        year = {2021},\n        pages = {391-409},\n        doi = {10.1109/SP40001.2021.00081},\n        url = {https://doi.org/10.1109/SP40001.2021.00081},\n        publisher = {IEEE Computer Society},\n        address = {Los Alamitos, CA, USA},\n        month = {may}\n    }\n\n\n### Evaluation\n\nYou can find instructions on how to reproduce the evaluation results of our paper in the folder [eval_sp2021](eval_sp2021/README.md).\n\n## License\n\nMIT License, see [LICENSE](LICENSE).\n\nThis repository includes third-party code from\n[statdp](https://github.com/cmla-psu/statdp), marked as `MIT License, Copyright\n(c) 2018-2019 Yuxin Wang`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feth-sri%2Fdp-sniper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feth-sri%2Fdp-sniper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feth-sri%2Fdp-sniper/lists"}