- Description: Homomorphic Encryption Library for Python. Allows ADDITION, SUBSTRACTION, MULTIPLICATION, SCALAR PRODUCT and binary operations (AND, OR, NOT, XOR, SHIFT & ROTATE) over encrypted vectors of integers/binaries.
- Language: Python2.7 on top of C++ (with Cython).
- Dependencies: HElib, GMP, NTL
- License: GNU GPL v3
PYthon For HELib, Pyfhel implements some basic functionalities of HElib as a Homomorphic Encryption library such as sum, mult, or scalar product in Python (currently only for Python2.7). Pyfhel allows the use of HElib inside Python and with a syntax similar to normal arithmetics (+,-,*). This library is useful both for simple Homomorphic Encryption Demos as well as for complex problems such as implementing Machine Learning algorithms.
Pyfhel is built on top of Afhel, an Abstraction For HELib in C++. Afhel uses an unordered Map to manage HElib Cyphertexts using key-value storage with keys of type String. It implements the most important the HElib operations using only the keys for its functions, adding some extra functionalities not present in HElib such as Scalar Product.
Additionally, this project contains a large series of Demos & Tests for HElib, Afhel & Pyfhel.
Last but not least, we include a Makefile to compile and install HElib as a shared library, which can then be linked to other C++ programs using the tag -fhe
.
Follow the instructions in INSTALL.md for the complete installation process.
Update by running inthe src/ directory:
> sudo make upgrade
Installation process creates several files that are no longer needed. If you want to erase them, as well as any executable created inside this project (files ending by _x) and any environment files (.aenv, these are very big):
> sudo make clean
Uninstalling all components at once is performed by running:
> sudo make uninstall
If you want to uninstall any particular component, navigate to HElib/src/, Afhel/ or Pyfhel/ directories and run that same command.
-
src/
contains the source code for Pyfhel, Afhel and HElib. -
docs/
includes all documentation of the project:- Doc.md: Essential documentation of the project. A recommended reading material.
- Doc_API.md: Comprehensive list of all classes & methods available in Pyfhel.
-
src/Demos_Tests
, a collection of Demos and Tests for all three libraries -
src/.Makefiles/Makefile_HElib
, a makefile to compile and install HElib as a dynamic library (-fhe
).
- Author: Alberto Ibarrondo @ibarrond in collaboration with EURECOM (Melek Onen).
- Latest release: 16/04/2018
This library was created originally for the project "Privacy for Big Data Analytics" in EURECOM. The SW is based on HElib by Shai Halevi, HEIDE by Grant Frame, analysis of addition by Matheus S.H. Cruz. In compliance with their respective Licenses, I name all of them in this section. This project could not be possible without them. For any legal disclaimer, please contact me. Also, the same type of license (GNU GLPv3) applies to Afhel & Pyfhel, as mandated.
Pyfhel can be used modified, copied in any way you see fit. This project is Open Source under the GNU GPLv3 License (LICENSE file), therefore developers that use Pyfhel MUST comply with the following:
- Acknowledge and mention the original authors of Pyfhel in any derived development, that is, Alberto Ibarrondo & EURECOM.
- Offer the exact same License, allowing legal permission to copy, distribute and/or modify any SW using Pyfhel. Hence, any software using Pyfhel must be Open Source.