{"id":13654960,"url":"https://github.com/Huelse/SEAL-Python","last_synced_at":"2025-04-23T10:31:37.819Z","repository":{"id":40424019,"uuid":"196965816","full_name":"Huelse/SEAL-Python","owner":"Huelse","description":"Microsoft SEAL 4.X For Python","archived":false,"fork":false,"pushed_at":"2024-04-14T09:01:01.000Z","size":8862,"stargazers_count":301,"open_issues_count":8,"forks_count":67,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-05-22T09:05:40.123Z","etag":null,"topics":["encryption","he","homomorphic-encryption","microsoft-seal","pyseal","python-bindings","seal","seal-python"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Huelse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["https://paypal.me/huelse99"]}},"created_at":"2019-07-15T09:16:52.000Z","updated_at":"2024-08-02T03:02:02.868Z","dependencies_parsed_at":"2024-01-07T08:10:01.147Z","dependency_job_id":"fb1c71f6-fb0d-4d0f-a4ac-38308c99e0f8","html_url":"https://github.com/Huelse/SEAL-Python","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huelse%2FSEAL-Python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huelse%2FSEAL-Python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huelse%2FSEAL-Python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Huelse%2FSEAL-Python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Huelse","download_url":"https://codeload.github.com/Huelse/SEAL-Python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250416406,"owners_count":21426984,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["encryption","he","homomorphic-encryption","microsoft-seal","pyseal","python-bindings","seal","seal-python"],"created_at":"2024-08-02T03:00:53.145Z","updated_at":"2025-04-23T10:31:37.494Z","avatar_url":"https://github.com/Huelse.png","language":"C++","funding_links":["https://paypal.me/huelse99"],"categories":["Libraries"],"sub_categories":["[Sunscreen](https://sunscreen.tech/)"],"readme":"## Microsoft SEAL For Python\n\nMicrosoft [**SEAL**](https://github.com/microsoft/SEAL) is an easy-to-use open-source ([MIT licensed](https://github.com/microsoft/SEAL/blob/master/LICENSE)) homomorphic encryption library developed by the Cryptography Research group at Microsoft.\n\n[**pybind11**](https://github.com/pybind/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.\n\nThis is a python binding for the Microsoft SEAL library.\n\n\n\n## Contents\n\n* [Build](#build)\n* [Note](#note)\n  * [Serialize](#serialize)\n  * [Other](#other)\n* [FAQ](#faq)\n\n\n\n## Build\n\n* ### Linux\n\n  Recommend: Clang++ (\u003e= 10.0) or GNU G++ (\u003e= 9.4), CMake (\u003e= 3.16)\n\n  ```shell\n  # Optional\n  sudo apt-get install git build-essential cmake python3 python3-dev python3-pip\n\n  # Get the repository or download from the releases\n  git clone https://github.com/Huelse/SEAL-Python.git\n  cd SEAL-Python\n\n  # Install dependencies\n  pip3 install numpy pybind11\n\n  # Init the SEAL and pybind11\n  git submodule update --init --recursive\n  # Get the newest repositories (dev only)\n  # git submodule update --remote\n\n  # Build the SEAL lib without the msgsl zlib and zstandard compression\n  cd SEAL\n  cmake -S . -B build -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF -DSEAL_USE_ZSTD=OFF\n  cmake --build build\n  cd ..\n\n  # Run the setup.py, the dynamic library will be generated in the current directory\n  python3 setup.py build_ext -i\n\n  # Test\n  cp seal.*.so examples\n  cd examples\n  python3 4_bgv_basics.py\n  ```\n\n  Build examples: `-DSEAL_BUILD_EXAMPLES=ON` \n\n  [More cmake options](https://github.com/microsoft/SEAL#basic-cmake-options)\n\n\n* ### Windows\n\n  Visual Studio 2019 or newer is required. x64 support only! And use the **x64 Native Tools Command Prompt for VS**  command prompt to configure and build the Microsoft SEAL library. It's usually can be found in your Start Menu.\n\n  ```shell\n  # Run in \"x64 Native Tools Command Prompt for VS\" command prompt\n  cmake -S . -B build -G Ninja -DSEAL_USE_MSGSL=OFF -DSEAL_USE_ZLIB=OFF\n  cmake --build build\n\n  # Build\n  pip install numpy pybind11\n  python setup.py build_ext -i\n\n  # Test\n  cp seal.*.pyd examples\n  cd examples\n  python 4_bgv_basics.py\n  ```\n\n  Microsoft SEAL official [docs](https://github.com/microsoft/SEAL#building-microsoft-seal-manually).\n\n\n* ### Docker\n\n  requires: [Docker](https://www.docker.com/)\n\n  To build source code into a docker image (from this directory):\n  ```shell\n  docker build -t huelse/seal -f Dockerfile .\n  ```\n\n  To use the image by running it as an interactive container:\n  ```shell\n  docker run -it huelse/seal\n  ```\n\n\n\n## Note\n\n* ### Serialize\n\n  See more in `examples/7_serialization.py`, here is a simple example:\n\n  ```python\n  cipher.save('cipher')\n  load_cipher = Ciphertext()\n  load_cipher.load(context, 'cipher')  # work if the context is valid.\n  ```\n\n  Supported classes: `EncryptionParameters, Ciphertext, Plaintext, SecretKey, PublicKey, RelinKeys, GaloisKeys`\n\n\n* ### Other\n\n  There are a lot of changes in the latest SEAL lib, we try to make the API in python can be used easier, but it may remain some problems unknown, if any problems or bugs, report [issues](https://github.com/Huelse/SEAL-Python/issues).\n\n  Email: [topmaxz@protonmail.com](mailto:topmaxz@protonmail.com?subject=Github-SEAL-Python-Issues)\n\n\n\n## FAQ\n\n1. ImportError: undefined symbol\n\n   Build a shared SEAL library `cmake . -DBUILD_SHARED_LIBS=ON`, and get the `libseal.so`,\n\n   then change the path in `setup.py`, and rebuild.\n\n\n2. ImportError: libseal.so... cannot find\n\n   a. `sudo ln -s /path/to/libseal.so  /usr/lib`\n\n   b. add `/usr/local/lib` or the `SEAL/native/lib` to `/etc/ld.so.conf` and refresh it `sudo ldconfig`\n\n   c. build in cmake.\n\n\n3. BuildError:\n\n   1. C++17 at least\n   \n   2. x86_64 is required, which `x86_32` is not supported\n\n\n4. ModuleNotFoundError: No module named 'seal'\n\n   The `.so` or `.pyd` file must be in the current directory, or you have `install` it already.\n\n\n5. Windows Error LNK2001, RuntimeLibrary and MT_StaticRelease mismatch\n\n   Only `x64` is supported, Choose `x64 Native Tools Command Prompt for VS`.\n\n\n6. Warning about building the dynamic library with static library in MacOS, etc.\n\n   1. Build a shared SEAL library by adding a CMake option `-DBUILD_SHARED_LIBS=ON`\n\n   2. Edit `extra_objects` in setup.py to `*.dylib` or else.\n\n\n\n## Contributing\n\n* Professor: [Dr. Chen](https://zhigang-chen.github.io/)\n\n* [Contributors](https://github.com/Huelse/SEAL-Python/graphs/contributors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHuelse%2FSEAL-Python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FHuelse%2FSEAL-Python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FHuelse%2FSEAL-Python/lists"}