OpenMined / PySyft

Perform data science on data that remains in someone else's server
https://www.openmined.org/
Apache License 2.0
9.48k stars 2k forks source link

Internal, Fast "from scratch" Re-build of Paillier #13

Closed iamtrask closed 6 years ago

iamtrask commented 7 years ago

Description: We are currently wrapping a Python implementation of the Paillier cryptosystem. While it is a great implementation, we want to be able to integrate one into our project a bit more closely. Furthermore, we would like to leverage lower level libraries for C, BLAS, and/or GPU integration when available. As such, this project endeavors to rebuild Paillier from scratch in a way that is more performant than the current (while also leaning on (ISSUE 12) for fixed point precision instead of having it deeply coupled to the encryption algorithm (as in python-paillier).

Acceptance Criteria:

  1. The new implementation supports the major homomorphic operations (with unit tests demonstrating) a. Public / Private Key Generation, Serialization, and Deserialization b. Encryption and Decryption c. Addition Between Encrypted Numbers d. Multiplication of an Encrypted Number by a Decrypted Scalar e. Leverages vector "packing" for increased performance (thus, the base data structure is a vector, not a scalar)
  2. The new implementation by default calls a highly performant runtime at least as fast as THIS
  3. The new implementation can support BLAS if available (and if BLAS is faster than (2))
  4. The new implementation can support CUDA and/or OpenCL GPU if available on a machine.
  5. This implementation is constructed in a new library called PyPaillier (OpenMined/PyPaillier) and integrated into Syft proper.
  6. Benchmarking suite documents the performance across a range of key sizes and backends.
iamtrask commented 7 years ago

@samsontmr this one could be split into sub-tasks too based on the underlying architecture (C, Blas, and CUDA tickets)

mortendahl commented 7 years ago

just a few inputs:

based on this it would seem reasonable to me to go with phe for now, and give this re-implementation task a somewhat low priority

iamtrask commented 7 years ago

@mortendahl given your feedback I'm inclined to agree.

iamtrask commented 7 years ago

assigned it to Lithium milestone (our latest one yet laid out), and it'll be a low priority there as well :)

iamtrask commented 7 years ago

Rumor has it that the folks who built python-paillier are about to release a CUDA version