# 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
```python
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](https://docs.desilo.ai/liberate-fhe/getting-started/quick-start).
# How to Install
### Clone this repository
```shell
git clone https://github.com/Desilo/liberate-fhe.git
cd liberate-fhe
```
### Install dependencies
```shell
poetry install
```
### Run Cuda build Script.
```shell
python setup.py install
# poetry run python setup.py install
```
### Build a python package
```shell
poetry build
```
### Install Liberate.FHE library
```shell
pip install .
# poetry run python -m pip install .
```
# Documentation
Please refer to [Liberate.FHE](https://docs.desilo.ai/liberate-fhe/api-references/docs) for detailed installation
instructions, examples, and documentation.
# Citing Liberate.FHE
```text
@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.
Raw data
{
"_id": null,
"home_page": "https://desilo.ai/",
"name": "liberate-fhe",
"maintainer": "Juwhan Kim",
"docs_url": null,
"requires_python": ">=3.9,<3.12",
"maintainer_email": "juwhan.kim@desilo.ai",
"keywords": "DESILO,python,cryptohraphy,privacy,encryption,cuda,homoomrphic encryption,homomorphic encryption library,fhe,gpu accelerated,liberate",
"author": "Juwhan Kim",
"author_email": "juwhan.kim@desilo.ai",
"download_url": "https://files.pythonhosted.org/packages/16/68/f613ff4014059968a9486b2a8aa199ea6a98f93b420500eb4bc813360ede/liberate_fhe-0.9.1.tar.gz",
"platform": null,
"description": "# Welcome to Liberate.FHE!\n\nLiberate.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.\n\nLiberate.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.\n\nLiberate.FHE is a pure Python and CUDA implementation of FHE. So, Liberate.FHE supports multi-GPU operations natively.\n\nThe 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. \n\nAdditionally, several design decisions were made to maximize the usability of the developed software:\n\n- Make the number of dependencies minimal.\n- Make the software easily hackable.\n- Set the usage of multiple GPUs as the default.\n- Make the resulting library easily integrated with the pre-existing software, especially Artificial Intelligence (AI) related ones.\n\n# Key Features\n\n- RNS-CKKS scheme is supported.\n- Python is natively supported.\n- Multiple GPU acceleration is supported.\n- Multiparty FHE is supported.\n\n# Quick Start\n\n```python\nfrom liberate import fhe\nfrom liberate.fhe import presets\n\n# Generate CKKS engine with preset parameters\ngrade = \"silver\" # logN=14\nparams = presets.params[grade]\n\nengine = fhe.ckks_engine(**params, verbose=True)\n\n# Generate Keys\nsk = engine.create_secret_key()\npk = engine.create_public_key(sk)\nevk = engine.create_evk(sk)\n\n# Generate test data\nm0 = engine.example(-1, 1)\nm1 = engine.example(-10, 10)\n\n# encode & encrypt data\nct0 = engine.encorypt(m0, pk)\nct1 = engine.encorypt(m1, pk, level=5)\n\n# (a + b) * b - a\nresult = (m0 + m1) * m1 - m0\nct_add = engine.add(ct0, ct1) # auto leveling\nct_mult = engine.mult(ct1, ct_add, evk)\nct_result = engine.sub(ct_mult, ct0)\n\n# decrypt & decode data\nresult_decrypted = engine.decrode(ct_result, sk)\n```\n\nIf you would like a detailed explanation, please refer to\nthe [official documentation](https://docs.desilo.ai/liberate-fhe/getting-started/quick-start).\n\n# How to Install\n\n### Clone this repository\n\n```shell\ngit clone https://github.com/Desilo/liberate-fhe.git\ncd liberate-fhe\n```\n\n### Install dependencies\n\n```shell\npoetry install\n```\n\n### Run Cuda build Script.\n\n```shell\npython setup.py install\n# poetry run python setup.py install\n```\n\n### Build a python package\n\n```shell\npoetry build\n```\n\n### Install Liberate.FHE library\n\n```shell\npip install .\n# poetry run python -m pip install .\n```\n\n# Documentation\n\nPlease refer to [Liberate.FHE](https://docs.desilo.ai/liberate-fhe/api-references/docs) for detailed installation\ninstructions, examples, and documentation.\n\n\n# Citing Liberate.FHE\n\n```text\n@Misc{Liberate_FHE,\n title={{Liberate.FHE: A New FHE Library for Bridging the Gap between Theory and Practice with a Focus on Performance and Accuracy}},\n author={DESILO},\n year={2023},\n note={\\url{https://github.com/Desilo/liberate-fhe}},\n}\n```\n\n# License\n\n- Liberate.FHE is available under the *BSD 3-Clause Clear license*. If you have any questions, please contact us at contact@desilo.ai.\n",
"bugtrack_url": null,
"license": "BSD-3-Clause-Clear",
"summary": "A Fully Homomorphic Encryption (FHE) library for bridging the gap between theory and practice with a focus on performance and accuracy",
"version": "0.9.1",
"project_urls": {
"Documentation": "https://docs.desilo.ai/liberate-fhe/",
"Homepage": "https://desilo.ai/",
"Repository": "https://github.com/desilo/liberate-fhe"
},
"split_keywords": [
"desilo",
"python",
"cryptohraphy",
"privacy",
"encryption",
"cuda",
"homoomrphic encryption",
"homomorphic encryption library",
"fhe",
"gpu accelerated",
"liberate"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "700a0ba91e4294933d77658ed45719da5b42d7b8b1ba32888946c1f59ccb540a",
"md5": "c4c11531736ba634aab6cb8fbd25c395",
"sha256": "2a5fb872df991c01784bae78bddd12929c580281ba61b7a27fc4366d0fc49d33"
},
"downloads": -1,
"filename": "liberate_fhe-0.9.1-cp310-cp310-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "c4c11531736ba634aab6cb8fbd25c395",
"packagetype": "bdist_wheel",
"python_version": "cp310",
"requires_python": ">=3.9,<3.12",
"size": 13700707,
"upload_time": "2023-11-27T04:07:08",
"upload_time_iso_8601": "2023-11-27T04:07:08.261894Z",
"url": "https://files.pythonhosted.org/packages/70/0a/0ba91e4294933d77658ed45719da5b42d7b8b1ba32888946c1f59ccb540a/liberate_fhe-0.9.1-cp310-cp310-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "9b0f3ab543ac87d65a123f0fe807e8a1274464e14da0ae7723cc9caf65221aea",
"md5": "f3e6456f882485f08e5c7a2fb637da70",
"sha256": "dedb1b7ed1c79c01a8ac1a9322ce45740dabb70ee1294fc17718536e3f15a7b5"
},
"downloads": -1,
"filename": "liberate_fhe-0.9.1-cp311-cp311-manylinux_2_35_x86_64.whl",
"has_sig": false,
"md5_digest": "f3e6456f882485f08e5c7a2fb637da70",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.9,<3.12",
"size": 13780949,
"upload_time": "2023-11-27T04:07:13",
"upload_time_iso_8601": "2023-11-27T04:07:13.550801Z",
"url": "https://files.pythonhosted.org/packages/9b/0f/3ab543ac87d65a123f0fe807e8a1274464e14da0ae7723cc9caf65221aea/liberate_fhe-0.9.1-cp311-cp311-manylinux_2_35_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1668f613ff4014059968a9486b2a8aa199ea6a98f93b420500eb4bc813360ede",
"md5": "e46af2e94705bfaaa1569bab2661f06f",
"sha256": "6c370062e916b755c91f457fdde3fb1213f64ac021d76726a573afbe3f7a854f"
},
"downloads": -1,
"filename": "liberate_fhe-0.9.1.tar.gz",
"has_sig": false,
"md5_digest": "e46af2e94705bfaaa1569bab2661f06f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<3.12",
"size": 97049,
"upload_time": "2023-11-27T04:07:16",
"upload_time_iso_8601": "2023-11-27T04:07:16.182093Z",
"url": "https://files.pythonhosted.org/packages/16/68/f613ff4014059968a9486b2a8aa199ea6a98f93b420500eb4bc813360ede/liberate_fhe-0.9.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-11-27 04:07:16",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "desilo",
"github_project": "liberate-fhe",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "liberate-fhe"
}