Code Monkey home page Code Monkey logo

apbhcd / pyfhel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ibarrond/pyfhel

0.0 0.0 0.0 15.75 MB

PYthon For Homomorphic Encryption Libraries, perform encrypted computations such as sum, mult, scalar product or matrix multiplication in Python, with NumPy compatibility. Uses SEAL/PALISADE as backends, implemented using Cython.

Home Page: https://pyfhel.readthedocs.io/

License: GNU General Public License v3.0

C++ 25.41% Python 20.25% CMake 0.10% Cython 54.01% Dockerfile 0.23%

pyfhel's Introduction

iCodecov Documentation Status PyPI version Maintenance GitHub issues License: GPL v3

Python library for ADDITION, SUBSTRACTION, MULTIPLICATION and SCALAR PRODUCT over encrypted integers (BFV) and approximated floating point values (CKKS). This library acts as an optimized Python API for C++ Homomorphic Encryption libraries.

๐ŸŽ Language Python (3.7+), with Cython and C++ (:warning: requires a C++17 compiler โš ๏ธ.)
๐Ÿ’ป OS Linux, Windows & MacOS.
๐Ÿ”ข Version 3.4.1 (stable)
๐Ÿ“š Docs In readthedocs!
โœ๏ธ Demos/Examples In the docs with the outputs, sources in the examples folder.
๐Ÿ”Œ Backends SEAL, OpenFHE (WIP). Shipped alongside Pyfhel.
๐Ÿ‘ท Authors Alberto Ibarrondo (IDEMIA & EURECOM) and Alexander Viand (ETH Zurich).
๐ŸŽ“ Original Collaborators Melek Onen (EURECOM), Laurent Gomez (SAP Labs).

If you wish to cite Pyfhel in your derived work, please use the following BibTeX entry:

  @inproceedings{ibarrondo2021pyfhel,
  title={Pyfhel: Python for homomorphic encryption libraries},
  author={Ibarrondo, Alberto and Viand, Alexander},
  booktitle={Proceedings of the 9th on Workshop on Encrypted Computing \& Applied Homomorphic Cryptography},
  pages={11--16},
  year={2021}
}


Install & Uninstallโ€‚ Summaryโ€‚ Contributingโ€‚ Bugs & Feature Requestsโ€‚ Legal Disclaimer



Install & Uninstall

To install Pyfhel from PyPI, run (WARNING! it takes several minutes to compile and install, be patient!):

> pip install Pyfhel

To install the latest version, you can clone this repository with all the submodules and install it by running:

> git clone --recursive https://github.com/ibarrond/Pyfhel.git
> pip install .

To uninstall, just run:

> pip uninstall Pyfhel

Installing a C/C++ Compiler

Pyfhel requires a C/C++ compiler with C++17 support. We have tested:

  • gcc6 to gcc12 in Linux/MacOS/Windows WSL. To install:
    • Ubuntu: sudo apt install gcc g++
    • MacOS: brew install gcc. MacOS users must set the environment variables gcc and gxx to the installed compilers, e.g.:
      > export gcc=/usr/local/bin/gcc-12
      > export gxx=/usr/local/bin/g++-12
  • MSVC2017 and MSVC2019 in Windows. To install:
    • Install Visual C++ Build tools (Download here, guide in here)

Summary

PYthon For Homomorphic Encryption Libraries, Pyfhel implements functionalities of multiple Homomorphic Encryption libraries such as addition, multiplication, exponentiation or scalar product in Python. Pyfhel uses a syntax similar to normal arithmetics (+,-,*). This library is useful both for simple Homomorphic Encryption Demos as well as for complex problems such as Machine Learning algorithms.

Pyfhel is built on top of Afhel, an Abstraction Homomorphic Encryption Libraries in C++. Afhel serves as common API for all backends. Additionally, this project contains a large series of Demos & Tests for Pyfhel.

This repository contains:

  • docs/ Documentation, generated automatically using sphinx and pushed to readthedocs.
  • examples/ Demos and small programs to showcase multiple functionalities.
  • Pyfhel/ contains the source code for Pyfhel and Afhel.
  • Pyfhel/backend, underlying C++ libraries SEAL & PALISADE.

Contributing

This is the standard process to develop/contribute:

  1. Code a new feature/fix a bug. Using Cython for the .pyx and .pxd extensions, C++ for Afhel or Python for examples/tests/other.

  2. Build/Install Pyfhel locally. Use either pip install . or python3 setup.py build (for verbose output and fine control. Run python3 setup.py --help for further options).

  3. Test changes (requires installing pytest). Run the tests locally by executing pytest . in the root directory, and make sure all tests pass.

    • Code coverage (requires installing pytest-cov). Add an empty .cov file in the root directory, and build/install the project locally (pip install .). To run coverage tests, execute pytest --cov . in the root directory, and then coverage html to obtain a report.

You're ready to go! Just create a pull request to the original repo.

Bugs & Feature Requests

Please fill the Bug Report template to provide all the essential info to reproduce your issue and solve the problem.

If you wish to have new functionality added to Pyfhel, you are more than welcome to request it via the Feature template.

Legal disclaimer

This project is Open Source under the GNU GPLv3 License (LICENSE file). Hence, Pyfhel can be used, modified, and copied freely provided that developers:

  1. Acknowledge and mention the original authors of Pyfhel in any derived development, that is, Alberto Ibarrondo (IDEMIA & EURECOM) and Alexander Viand (ETH Zurich) (maybe even cite the paper!).

  2. Offer the exact same License, allowing legal permission to copy, distribute and/or modify any SW using Pyfhel. Hence, any software using Pyfhel must remain Open Source.

pyfhel's People

Contributors

aakankshaduggal avatar alexanderviand avatar alexgadai avatar aquint-zama avatar benqalu avatar davidbstein avatar devharsh avatar hodgesmr avatar ibarrond avatar josegironn avatar kokeshim0chi avatar marcwil avatar pyup-bot avatar remyauda avatar severos avatar tanu17 avatar tdonovic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.