Skip to main content

Welcome to Liberate.FHE!

Liberate.FHE is an open-source Fully Homomorphic Encryption (FHE) library for bridging the gap between theory and practice with a focus on performance and accuracy.

Liberate.FHE is designed to be user-friendly while delivering robust performance, high accuracy, and a comprehensive suite of convenient APIs for developing real-world privacy-preserving applications.

Liberate.FHE is a pure Python and CUDA implementation of FHE. So, Liberate.FHE supports multi-GPU operations natively.

The main idea behind the design decisions is that non-cryptographers can use the library; it should be easily hackable and integrated with more extensive software frameworks.

Additionally, several design decisions were made to maximize the usability of the developed software:

  • Make the number of dependencies minimal.
  • Make the software easily hackable.
  • Set the usage of multiple GPUs as the default.
  • Make the resulting library easily integrated with the pre-existing software, especially Artificial Intelligence (AI) related ones.

Key Features

  • RNS-CKKS scheme is supported.
  • Python is natively supported.
  • Multiple GPU acceleration is supported.
  • Multiparty FHE is supported.

Quick Start

from liberate import fhe
from liberate.fhe import presets

# Generate CKKS engine with preset parameters
grade = "silver"  # logN=14
params = presets.params[grade]

engine = fhe.ckks_engine(**params, verbose=True)

# Generate Keys
sk = engine.create_secret_key()
pk = engine.create_public_key(sk)
evk = engine.create_evk(sk)

# Generate test data
m0 = engine.example(-1, 1)
m1 = engine.example(-10, 10)

# encode & encrypt data
ct0 = engine.encorypt(m0, pk)
ct1 = engine.encorypt(m1, pk, level=5)

# (a + b) * b - a
result = (m0 + m1) * m1 - m0
ct_add = engine.add(ct0, ct1)  # auto leveling
ct_mult = engine.mult(ct1, ct_add, evk)
ct_result = engine.sub(ct_mult, ct0)

# decrypt & decode data
result_decrypted = engine.decrode(ct_result, sk)

If you would like a detailed explanation, please refer to the official documentation.

How to Install

Clone this repository

git clone https://github.com/Desilo/liberate-fhe.git
cd liberate-fhe

Install dependencies

poetry install

Run Cuda build Script.

python setup.py install
# poetry run python setup.py install

Build a python package

poetry build

Install Liberate.FHE library

pip install .
# poetry run python -m pip install .

Documentation

Please refer to Liberate.FHE for detailed installation instructions, examples, and documentation.

Citing Liberate.FHE

@Misc{Liberate_FHE,
  title={{Liberate.FHE: A New FHE Library for Bridging the Gap between Theory and Practice with a Focus on Performance and Accuracy}},
  author={DESILO},
  year={2023},
  note={\url{https://github.com/Desilo/liberate-fhe}},
}

License

  • Liberate.FHE is available under the BSD 3-Clause Clear license. If you have any questions, please contact us at contact@desilo.ai.

Release files for liberate-fhe 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for liberate-fhe 0.9.1
File Size Uploaded
liberate_fhe-0.9.1.tar.gz 97.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for liberate-fhe 0.9.1
File Interpreter ABI Platform
liberate_fhe-0.9.1-cp311-cp311-manylinux_2_35_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.35+ x86-64 Details
liberate_fhe-0.9.1-cp310-cp310-manylinux_2_35_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.35+ x86-64 Details

Total release size: 27.6 MB

Release files / liberate_fhe-0.9.1.tar.gz

Download URL liberate_fhe-0.9.1.tar.gz
Size 97.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6c370062e916b755c91f457fdde3fb1213f64ac021d76726a573afbe3f7a854f
BLAKE2b-256 checksum
How to use checksums
1668f613ff4014059968a9486b2a8aa199ea6a98f93b420500eb4bc813360ede
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.2 Linux/5.15.0-86-generic

Release files / liberate_fhe-0.9.1-cp311-cp311-manylinux_2_35_x86_64.whl

Download URL liberate_fhe-0.9.1-cp311-cp311-manylinux_2_35_x86_64.whl
Size 13.8 MB
Tags CPython 3.11 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
dedb1b7ed1c79c01a8ac1a9322ce45740dabb70ee1294fc17718536e3f15a7b5
BLAKE2b-256 checksum
How to use checksums
9b0f3ab543ac87d65a123f0fe807e8a1274464e14da0ae7723cc9caf65221aea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.2 Linux/5.15.0-86-generic

Release files / liberate_fhe-0.9.1-cp310-cp310-manylinux_2_35_x86_64.whl

Download URL liberate_fhe-0.9.1-cp310-cp310-manylinux_2_35_x86_64.whl
Size 13.7 MB
Tags CPython 3.10 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
2a5fb872df991c01784bae78bddd12929c580281ba61b7a27fc4366d0fc49d33
BLAKE2b-256 checksum
How to use checksums
700a0ba91e4294933d77658ed45719da5b42d7b8b1ba32888946c1f59ccb540a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.10.2 Linux/5.15.0-86-generic

Release history Release notifications | RSS feed

This release

0.9.1 This release

3 release files

0.9.0

2 release files

0.2.0

5 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page