Git Product home page Git Product logo

seal-python's Introduction

Microsoft SEAL For Python

Microsoft SEAL is an easy-to-use open-source (MIT licensed) homomorphic encryption library developed by the Cryptography Research group at Microsoft.

pybind11 is a lightweight header-only library that exposes C++ types in Python and vice versa, mainly to create Python bindings of existing C++ code.

This is a python binding for the Microsoft SEAL library.

Contents

Build

Linux

CMake (>= 3.10), GNU G++ (>= 7.0) or Clang++ (>= 5.0), Python (>=3.6.8)

sudo apt-get update && sudo apt-get install g++ make cmake git python3 python3-dev python3-pip

git clone https://github.com/Huelse/SEAL-Python.git

cd SEAL/native/src
cmake .
make

pip3 install -r requirements.txt

# Check the path at first
# Setuptools (Recommend)
python3 setup.py build_ext -i
# or install
python3 setup.py install

Docs: setuptools pybind11

Windows

Visual Studio 2017 version 15.3 or newer is required to build Microsoft SEAL.

Open the SEAL/SEAL.sln in VS, config in x64, Release, WinSDK(17763, etc) mode and generate it.

python3 setup.py build_ext -i
# or install
python3 setup.py install

Microsoft official video SEAL in windows.

FAQ

  1. ImportError: undefined symbol

    Build a shared SEAL library cmake . -D SEAL_LIB_BUILD_TYPE=Shared, and get the libseal.so

    then change the lib path in setup.py or src/CMakeLists.txt, and rebuild.

  2. ImportError: libseal.so.3.4 cannot find

    a. sudo ln -s /path/to/libseal.so /usr/lib

    b. add /usr/local/lib or the SEAL/native/lib to /etc/ld.so.conf and refresh it sudo ldconfig

    c. build in cmake.

Tests

cd tests

python3 [example_name].py

  • The .so file must be in the same folder, or you had install it already.

Getting Started

C++ Python Description
1_bfv_basics.cpp 1_bfv_basics.py Encrypted modular arithmetic using the BFV scheme
2_encoders.cpp 2_encoders.py Encoding more complex data into Microsoft SEAL plaintext objects
3_levels.cpp 3_levels.py Introduces the concept of levels; prerequisite for using the CKKS scheme
4_ckks_basics.cpp 4_ckks_basics.py Encrypted real number arithmetic using the CKKS scheme
5_rotation.cpp 5_rotation.py Performing cyclic rotations on encrypted vectors in the BFV and CKKS schemes
6_performance.cpp 6_performance.py Performance tests for Microsoft SEAL

Future

  • pickle
  • microsoft gsl

About

This project is still testing now, if any problems(bugs), Issue please.

Email: [email protected]

Contributing

seal-python's People

Contributors

minhyannv avatar

Watchers

 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.