Skip to content
A library for Partially Homomorphic Encryption in Python
Branch: master
Clone or download
nbgl Fix issues with overflows (#73)
* Fix issues with overflows

* Minor: PEP8

* Test that we actually fixed #62

* Get rid of a bunch of code by using the standard library...

* Minor: unused imports

* Minor: helpful comment
Latest commit 955f8c0 Jan 13, 2019


python-paillier Latest released version on PyPi

CI status of Master
Documentation Status
Requirements Status of master

A Python 3 library for 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.

Running unit tests

python test

Or use nose:


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/ 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:

No audit

This code has neither been written nor vetted by any sort of crypto expert. The crypto parts are mercifully short, however.

You can’t perform that action at this time.