{"id":13398553,"url":"https://github.com/google/differential-privacy","last_synced_at":"2025-08-13T01:23:25.611Z","repository":{"id":37735086,"uuid":"206320938","full_name":"google/differential-privacy","owner":"google","description":"Google's differential privacy libraries.","archived":false,"fork":false,"pushed_at":"2025-08-06T13:26:01.000Z","size":8479,"stargazers_count":3192,"open_issues_count":20,"forks_count":384,"subscribers_count":118,"default_branch":"main","last_synced_at":"2025-08-12T20:28:15.259Z","etag":null,"topics":["anonymization","differential-privacy","privacy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-04T13:04:15.000Z","updated_at":"2025-08-12T03:16:51.000Z","dependencies_parsed_at":"2023-02-16T19:01:16.716Z","dependency_job_id":"f88aa3f1-008e-434c-bee9-7ee505821786","html_url":"https://github.com/google/differential-privacy","commit_stats":{"total_commits":174,"total_committers":17,"mean_commits":"10.235294117647058","dds":"0.20114942528735635","last_synced_commit":"608350cb93138687393e392f6a9cf542c42678ce"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/google/differential-privacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdifferential-privacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdifferential-privacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdifferential-privacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdifferential-privacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/differential-privacy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fdifferential-privacy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270144681,"owners_count":24534931,"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-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":["anonymization","differential-privacy","privacy"],"created_at":"2024-07-30T19:00:28.363Z","updated_at":"2025-08-13T01:23:25.590Z","avatar_url":"https://github.com/google.png","language":"Go","funding_links":[],"categories":["C++","Differential Privacy Learning Resources","Go","其他_机器学习与深度学习","Go (134)","Code and Projects","Privacy Preserving Machine Learning","4. Code","Privacy and Safety","相关工具","Learning Resources","Privacy Learning Resources","5.4 DP Libraries","Resources","Awesome Privacy Engineering [![Awesome](https://awesome.re/badge.svg)](https://awesome.re)"],"sub_categories":["Interfaces","2.4 Differential Privacy in CCS, S\u0026P, NDSS, USENIX, Infocom from 2015-2019 (some of them are from 2020)","隐私相关领域法规/条例","Winetricks","Objective-C Tools, Libraries, and Frameworks","Mesh networks","Differential Privacy and Federated Learning"],"readme":"# Differential Privacy\n\n\u003e **NEW:**\n\u003e [Join our DP community in Slack](https://join.slack.com/t/dp-open-source/shared_invite/zt-35hw483tz-nS5YOtGjxCHk3Ek7WiXvlg)!\n\nThis repository contains libraries to generate ε- and (ε, δ)-differentially\nprivate (DP) statistics over datasets. It contains the following tools:\n\n*   [Privacy on Beam](privacy-on-beam) is an end-to-end differential privacy\n    framework for Go built on top of\n    [Apache Beam](https://beam.apache.org/documentation/). It is intended to be\n    easy to use, even by non-experts.\n*   [PipelineDP4j](pipelinedp4j) is an end-to-end differential privacy framework\n    for JVM languages (Java, Kotlin, Scala). It supports different data\n    processing frameworks such as\n    [Apache Beam](https://beam.apache.org/documentation/) and\n    [Apache Spark](https://spark.apache.org/). It is intended to be easy to use,\n    even by non-experts.\n*   Three \"DP building block\" libraries, in [C++](cc), [Go](go), and\n    [Java](java). These libraries implement basic noise addition primitives and\n    differentially private aggregations. Privacy on Beam and PipelineDP4j use\n    these libraries.\n*   A [stochastic tester](cc/testing), used to help catch regressions that could\n    make the differential privacy property no longer hold.\n*   A [differential privacy accounting library](python/dp_accounting), used for\n    tracking privacy budget.\n*   A [command line interface](examples/zetasql) for running differentially\n    private SQL queries with [ZetaSQL](https://github.com/google/zetasql).\n*   [DP Auditorium](python/dp_auditorium) is a library for auditing differential\n    privacy guarantees.\n\nIn addition to the tools listed above, it is worth mentioning two related\nprojects developed by [OpenMined](https://www.openmined.org/) that make use of\nour libraries:\n\n*   [PipelineDP](https://pipelinedp.io/) is an end-to-end differential privacy\n    framework for Python. It is the Python version of PipelineDP4j and is a\n    collaboration between Google and OpenMined. Its source code is located in\n    the [OpenMined repository](https://github.com/OpenMined/PipelineDP).\n*   [PyDP](https://github.com/OpenMined/PyDP) is a Python wrapper of our C++ DP\n    building block library.\n\nThe DP building block libraries, Privacy on Beam, PipelineDP4j and PipelineDP\nare suitable for research, experimental, or production use cases, while the\nother tools are currently experimental and subject to change.\n\n## Getting Started\n\nIf you are new to differential privacy, you might want to go through\n[\"A friendly, non-technical introduction to differential privacy\"](https://desfontain.es/privacy/friendly-intro-to-differential-privacy.html).\nUnderstanding the basics is helpful, even when using our high-level tools like\nPrivacy on Beam and PipelineDP4j. If you plan to use more low-level libraries\nsuch as DP building block libraries or other experimental tools, you might need\na more in-depth understanding of differential privacy. You can take a look at\n[a comprehensive guide for programmers by Joseph P. Near and Chiké Abuah](https://programming-dp.com/cover.html)\nor\n[other blog posts at Damien Desfontaines blog](https://desfontain.es/privacy/archives.html).\n\n### Explore the tools\n\nAll tools, except the DP Building block libraries, have their documentation in\ntheir respective directories. For example, Privacy on Beam has README in\n[the privacy-on-beam directory](privacy-on-beam), same for\n[the pipelinedp4j directory](pipelinedp4j).\n\nThe high-level documentation for DP Building block libraries follows below\nbecause they share a lot of commonalities. The language-specific documentation\ncan be found in respective directories.\n\nThere is also an [\"examples\"](examples) directory where you can find examples of\nhow to use the tools and libraries. The documentation in the tooling directories\nrefers to these examples.\n\n### How to Build\n\nTo build the tools and libraries, follow the instructions in their respective\ndirectories. The build process assumes you have cloned the Git repository. Most\ntools and libraries use [Bazel](https://bazel.build/) as a build system, see\ninstructions below to install it.\n\n#### Bazel\n\nTo use Bazel, you need to install Bazelisk, a tool that manages Bazel versions\nand installs the correct version of Bazel.\n[Follow the instructions for your platform on the Bazelisk GitHub page](https://github.com/bazelbuild/bazelisk?tab=readme-ov-file#installation).\n\n## DP Building Block Libraries\n\nThis documentation is common to all DP building block libraries. Currently, the\nlibraries support the following algorithms:\n\nAlgorithm                        | C++       | Go        | Java\n:------------------------------- | :-------: | :-------: | :-------:\nLaplace mechanism                | Supported | Supported | Supported\nGaussian mechanism               | Supported | Supported | Supported\nCount                            | Supported | Supported | Supported\nSum                              | Supported | Supported | Supported\nMean                             | Supported | Supported | Supported\nVariance                         | Supported | Supported | Supported\nQuantiles                        | Supported | Supported | Supported\nAutomatic bounds approximation   | Supported | Planned   | Supported\nTruncated geometric thresholding | Supported | Supported | Supported\nLaplace thresholding             | Supported | Supported | Supported\nGaussian thresholding            | Supported | Supported | Supported\nPre-thresholding                 | Supported | Supported | Supported\n\nImplementations of the Laplace mechanism and the Gaussian mechanism use\n[secure noise generation]. These mechanisms can be used to perform computations\nthat aren't covered by the algorithms implemented in our libraries.\n\n[secure noise generation]: ./common_docs/Secure_Noise_Generation.pdf\n\n### Caveats of the DP building block libraries\n\nDifferential privacy requires some bound on maximum number of contributions each\nuser can make to a single aggregation. The DP building block libraries don't\nperform such bounding: their implementation assumes that each user contributes\nonly a fixed number of rows to each partition. That number can be configured by\nthe user. The library neither verifies nor enforces this limit; it is the\ncaller's responsibility to pre-process data to enforce this.\n\nWe chose not to implement this step at the DP building block level because it\nrequires some *global* operation over the data: group by user, and aggregate or\nsubsample the contributions of each user before passing them on to the DP\nbuilding block aggregators. Given scalability constraints, this pre-processing\nmust be done by a higher-level part of the infrastructure, typically a\ndistributed data processing framework: for example, Privacy on Beam relies on\nApache Beam for this operation and PipelineDP4j relies on Apache Beam or Apacahe\nSpark. Therefore it is recommended to use the end-to-end tooling if possible:\nPrivacy on Beam for Go, PipelineDP4j for Kotlin/Scala/Java and PipelineDP for\nPython.\n\nFor more detail about our approach to building scalable end-to-end differential\nprivacy frameworks, we recommend reading:\n\n1.  [Differential privacy computations in data pipelines reference doc](https://github.com/google/differential-privacy/blob/main/common_docs/Differential_Privacy_Computations_In_Data_Pipelines.pdf),\n    which describes how to build such a system using any data pipeline framework\n    (e.g. Apache Beam or Apache Spark).\n2.  Our\n    [paper about differentially private SQL](https://arxiv.org/abs/1909.01917),\n    which describes such a system. Even though the interface of Privacy on Beam\n    and PipelineDP4j is different, it conceptually uses the same framework as\n    the one described in this paper.\n\n### Known issues\n\nOur floating-point implementations are subject to the vulnerabilities described\nin [Casacuberta et al. \"Widespread Underestimation of Sensitivity in\nDifferentially Private Libraries and How to Fix\nit\"](https://arxiv.org/abs/2207.10635) (specifically the rounding, repeated\nrounding, and re-ordering attacks). These vulnerabilities are particularly\nconcerning when an attacker can control some of the contents of a dataset and/or\nits order. Our integer implementations are not subject to the vulnerabilities\ndescribed in the paper (though note that Java does not have an integer\nimplementation).\n\nPlease refer to our [attack model](common_docs/attack_model.md) to learn more\nabout how to use our libraries in a safe way.\n\n## Reach out\n\n### Join Our Slack Community\n\nThe best way to connect with the Google Differential Privacy team and other DP\nenthusiasts is by joining our Slack community. It's the perfect place to ask\nquestions, get support, discuss new features, and stay up-to-date on all things\nrelated to our open-source DP libraries.\n\nClick\n[here](https://join.slack.com/t/dp-open-source/shared_invite/zt-35hw483tz-nS5YOtGjxCHk3Ek7WiXvlg)\nto join!\n\nOnce you're in, check out these key channels:\n\n*   #introductions: Say hello and tell us a bit about your interest in\n    differential privacy!\n*   #support: Get assistance with our DP libraries, ask questions, and\n    troubleshoot issues.\n*   #development: For contributors and developers to discuss code, pull\n    requests, and the project roadmap.\n*   #general: Official announcements, project news, and broader community\n    updates.\n\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://join.slack.com/t/dp-open-source/shared_invite/zt-35hw483tz-nS5YOtGjxCHk3Ek7WiXvlg\" style=\"display: inline-block; padding: 10px 20px; font-size: 16px; font-weight: bold; text-align: center; text-decoration: none; color: #fff; background-color: #4A154B; border-radius: 5px;\"\u003e\nJoin Our Slack \u003c/a\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n### Google Group\n\nIf you don't use Slack, you can join our\n[public discussion group](https://groups.google.com/g/dp-open-source-users).\n\n### Email\n\nSend us an email at dp-open-source@google.com to discuss your specific use cases\nprivately and how we can better assist you.\n\nPlease avoid sharing any personally identifiable information. If you need to\ndelete a previous message, please contact us.\n\n## Support\n\nWe are actively maintaining and improving the libraries. We welcome\ncontributions to this project. For pull requests, please review our\n[contribution guidelines](CONTRIBUTING.md) and consider joining the #development\nchannel in\n[our Slack workspace](https://join.slack.com/t/dp-open-source/shared_invite/zt-35hw483tz-nS5YOtGjxCHk3Ek7WiXvlg).\nWe will respond to issues filed in this project. If we plan to discontinue\nactive maintenance and issue responses, we will provide a notice here at least 3\nmonths in advance.\n\n## License\n\n[Apache License 2.0](LICENSE)\n\n## Support Disclaimer\n\nThis is not an officially supported Google product.\n\n## Related projects\n\n-   [OpenDP](https://opendp.org), a community effort around tools for\n    statistical analysis of sensitive private data.\n-   [JAX Privacy](https://github.com/google-deepmind/jax_privacy), a library to\n    train machine learning models with differential privacy.\n-   [TensorFlow Privacy](https://github.com/tensorflow/privacy), a TensorFlow\n    library that preceded JAX Privacy.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fdifferential-privacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fdifferential-privacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fdifferential-privacy/lists"}