Skip to content
PyHeal is a Python wrapper for Microsoft SEAL aimed at making operations easier to use.
Python C++ CMake
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pybind11 @ a1b71df
pyheal
seal @ 9392689
seal_wrapper
.gitmodules
CMakeLists.txt
LICENSE
README.md
example_usage.py
requirements.txt
setup.py

README.md

pyHeal

This project implements Python wrappers for Homomorphic Encryption libraries, aimed at being more Python friendly.

It currently contains:

  • A pybind11 based Python wrapper for Microsoft SEAL in seal_wrapper
  • A Pythonic wrapper for seal_wrapper in pyheal/wrapper.py
  • A Python ciphertext type of object that allows math operations as if they were python numbers in pyheal/ciphertext_op.py
  • A standard encoder/decoder interface for seal encoders and encryptors for use of the CiphertextOp objects in pyheal/encoders.py.

Tests:

  • A partial re-implementation of Microsoft SEAL's examples using wrapper.py in tests.py
  • A large number of tests for PyHEAL and CiphertextOp in pyheal/test_pyheal.py

Setup

Clone using: Git v2.13+: git clone --recurse-submodules (repository URL)

Git v1.6.5 - v2.12: git clone --recursive (repository URL)

For a repository that has already been cloned or older versions of git run: git submodule update --init --recursive

Build

This project can be built directly using pip3. Optionally create and activate a new Python virtual environment using virtualenv first, for example:

python3 -m virtualenv ./venv --python python3

#Linux
source ./venv/bin/activate

#Windows
#venv\Scripts\activate

Install dependencies and package:

pip3 install .

Usage

import pyheal


# Set encryption params + obtain an EncryptorOp object
...
encryptor = EncryptorOp(...)
decryptor = Decryptor(...)

v1 = encryptor_encoder.encode(10)
v2 = encryptor_encoder.encode(20)

result = v1 + v2

print(decryptor.decrypt(result)) # Prints 30 after decrypt 

See example_usage.py for more usage examples.

You can’t perform that action at this time.