phe

A library for Partially Homomorphic Encryption in Python

https://github.com/data61/python-paillier

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    5 of 16 committers (31.3%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.9%) to scientific vocabulary

Keywords

cryptography homomorphic-encryption paillier python
Last synced: 6 months ago · JSON representation

Repository

A library for Partially Homomorphic Encryption in Python

Basic Info
  • Host: GitHub
  • Owner: data61
  • License: other
  • Language: Python
  • Default Branch: master
  • Size: 292 KB
Statistics
  • Stars: 625
  • Watchers: 32
  • Forks: 137
  • Open Issues: 23
  • Releases: 4
Topics
cryptography homomorphic-encryption paillier python
Created over 11 years ago · Last pushed over 2 years ago
Metadata Files
Readme Changelog License

README.rst

python-paillier  |release|
==========================

+---------------------+
|      |ciTest|       |
+---------------------+
|      |rtdM|         |
+---------------------+
|      |reqM|         |
+---------------------+

A Python 3 library implementing the Paillier Partially Homomorphic Encryption.

The homomorphic properties of the paillier crypto system are:

-  Encrypted numbers can be multiplied by a non encrypted scalar.
-  Encrypted numbers can be added together.
-  Encrypted numbers can be added to non encrypted scalars.

Citing
======

`python-paillier` is designed, developed and supported by `CSIRO's Data61 `__. If
you use any part of this library in your research, please cite it using the following BibTex entry::

    @misc{PythonPaillier,
      author = {CSIRO's Data61},
      title = {Python Paillier Library},
      year = {2013},
      publisher = {GitHub},
      journal = {GitHub Repository},
      howpublished = {\url{https://github.com/data61/python-paillier}},
    }


Running unit tests
------------------

::

   python setup.py test

Or use nose::

   nosetests


Note related to gmpy2
---------------------

`gmpy2` is not required to use the library, but is preferred. A pure Python implementation is available but 
`gmpy2` drastically improves performances. As indication on a laptop not dedicated to benchmarking, running the example
`examples/federated_learning_with_encryption.py` provided in the library took:
- 4.5s with `gmpy2` installed
- 35.7s without `gmpy2` installed

However, `gmpy2` is a requirement to run the tests.

Code History
------------

Developed at `Data61 | CSIRO `_.

Parts derived from the Apache licensed Google project:
https://code.google.com/p/encrypted-bigquery-client/


.. |release| image:: https://img.shields.io/pypi/v/phe.svg
    :target: https://pypi.python.org/pypi/phe/
    :alt: Latest released version on PyPi

.. |ciTest| image:: https://github.com/data61/python-paillier/actions/workflows/test.yml/badge.svg
    :target: https://github.com/data61/python-paillier/actions/workflows/test.yml
    :alt: CI Status

.. |reqM| image:: https://requires.io/github/data61/python-paillier/requirements.svg?branch=master
    :target: https://requires.io/github/data61/python-paillier/requirements/?branch=master
    :alt: Requirements Status of master

.. |rtdM| image:: https://readthedocs.org/projects/python-paillier/badge/?version=stable
   :target: http://python-paillier.readthedocs.org/en/latest/?badge=stable
   :alt: Documentation Status

Owner

  • Name: CSIRO Data61 Engineering & Design
  • Login: data61
  • Kind: organization

GitHub Events

Total
  • Issues event: 1
  • Watch event: 29
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 1
Last Year
  • Issues event: 1
  • Watch event: 29
  • Issue comment event: 3
  • Pull request event: 1
  • Fork event: 1

Committers

Last synced: over 2 years ago

All Time
  • Total Commits: 206
  • Total Committers: 16
  • Avg Commits per committer: 12.875
  • Development Distribution Score (DDS): 0.597
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Brian Thorne b****e@n****u 83
giorgiop g****i@a****u 46
Brian Thorne b****n@t****k 27
Brian Thorne b****e@c****u 15
Guillaume Smith g****h@d****u 6
wilko77 w****7@u****m 6
Brian Thorne h****e@g****m 5
Quentin Santos q****s@w****r 5
Brian Thorne b****n@h****z 3
dependabot[bot] 4****]@u****m 2
giorgiop g****i@n****u 2
wilko w****a@d****u 2
Brian Thorne B****e@d****u 1
Jakub Nabaglo j@n****l 1
Juntao Tan i****o@g****m 1
Wilko Henecka 3****7@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 60
  • Total pull requests: 47
  • Average time to close issues: 2 months
  • Average time to close pull requests: 7 days
  • Total issue authors: 34
  • Total pull request authors: 11
  • Average comments per issue: 1.47
  • Average comments per pull request: 0.64
  • Merged pull requests: 39
  • Bot issues: 0
  • Bot pull requests: 5
Past Year
  • Issues: 3
  • Pull requests: 2
  • Average time to close issues: about 4 hours
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • hardbyte (19)
  • giorgiop (3)
  • wlnancy (2)
  • Lsw-98 (2)
  • apbhcd (2)
  • xiyumerry (2)
  • Luidy (2)
  • yunusvrgl (2)
  • antvig (1)
  • drandreaskrueger (1)
  • Sky19980923 (1)
  • a22511234 (1)
  • rajeswar18 (1)
  • setsometso (1)
  • robomotic (1)
Pull Request Authors
  • hardbyte (22)
  • wilko77 (7)
  • dependabot[bot] (5)
  • giorgiop (3)
  • gusmith (3)
  • nbgl (1)
  • AuthoStats (1)
  • qsantos (1)
  • tanjuntao (1)
  • sylvainpelissier (1)
  • razi-rais (1)
Top Labels
Issue Labels
question (3) bug (2) effort2: medium (day) (2) best practice (2) P3: important (1) enhancement (1) state: Needs Design (1) state: Need more information (1) proposal (1) P4: nice to have (1) P2: required (1)
Pull Request Labels
dependencies (5) github_actions (5) bug (1) docs (1)

Packages

  • Total packages: 2
  • Total downloads:
    • pypi 11,988 last-month
  • Total docker downloads: 42
  • Total dependent packages: 5
    (may contain duplicates)
  • Total dependent repositories: 62
    (may contain duplicates)
  • Total versions: 23
  • Total maintainers: 4
pypi.org: phe

Partially Homomorphic Encryption library for Python

  • Versions: 22
  • Dependent Packages: 5
  • Dependent Repositories: 62
  • Downloads: 11,988 Last month
  • Docker Downloads: 42
Rankings
Dependent repos count: 1.9%
Dependent packages count: 2.4%
Stargazers count: 2.7%
Average: 3.3%
Docker downloads count: 3.8%
Forks count: 3.9%
Downloads: 4.9%
Last synced: 6 months ago
conda-forge.org: phe
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Forks count: 14.9%
Stargazers count: 16.3%
Average: 29.1%
Dependent repos count: 34.0%
Dependent packages count: 51.2%
Last synced: 6 months ago

Dependencies

docs/requirements.txt pypi
  • sphinx >=1.6.2
  • sphinxcontrib-napoleon >=0.6.1
requirements.txt pypi
  • click >=6.7
  • gmpy2 >=2.0.4
  • nose >=1.3.4
  • numpy >=1.9.1
  • pycrypto >=2.6.1
.github/workflows/build.yml actions
  • actions/checkout v3 composite
  • actions/download-artifact v3 composite
  • actions/setup-python v4 composite
  • actions/upload-artifact v3 composite
  • pypa/gh-action-pypi-publish v1.5.0 composite
.github/workflows/code-quality.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite