Skip to main content

The DESILO Fully Homomorphic Encryption (FHE) library

Project description

The DESILO FHE Library

Welcome to the DESILO FHE library!

The DESILO FHE library is a homomorphic encryption library that is fast and intuitive. It delivers state-of-the-art performance, maximum accuracy, and versatile usability. Designed to be accessible and efficient for everyone, from beginners unfamiliar with homomorphic encryption to experts developing advanced algorithms.

Built on C++ and CUDA, the DESILO FHE library is optimized for both CPUs and NVIDIA GPUs. It includes a Python wrapper for easy use and seamless integration into existing AI workflows. Additionally, it supports CPU parallelization for environments without GPU access.

Currently, the DESILO FHE library supports real and complex number operations based on the RNS-CKKS scheme, with plans to expand to various integer-based schemes in the future. It provides a powerful solution adaptable to diverse environments and requirements.

Documentation

Please refer to the official documentation for detailed installation instructions, examples, and documentation.

Quickstart

Encrypt / Decrypt

Encryption and decryption require a public key and a secret key, respectively. The public key is generated from the secret key. You can encrypt and decrypt data as shown below. Note that CKKS is a real-number-based scheme, so a very small error is introduced during encryption and decryption.

from desilofhe import Engine

engine = Engine()

secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)

data = [1, 2, 3]
encrypted = engine.encrypt(data, public_key)
decrypted = engine.decrypt(encrypted, secret_key)

print(decrypted[:3]) # [1. 2. 3.]

Add / Subtract

To add or subtract ciphertext, no additional keys are required beyond the public and secret keys. You can encrypt data separately and then perform addition and subtraction as follows:

from desilofhe import Engine

engine = Engine()

secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)

data1 = [1, 2, 3]
encrypted1 = engine.encrypt(data1, public_key)

data2 = [4, 5, 6]
encrypted2 = engine.encrypt(data2, public_key)

added = engine.add(encrypted1, encrypted2)
subtracted = engine.subtract(encrypted1, encrypted2)

decrypted1 = engine.decrypt(added, secret_key)
decrypted2 = engine.decrypt(subtracted, secret_key)

print(decrypted1[:3], decrypted2[:3]) # [5. 7. 9.] [-3. -3. -3.]

Multiply

To multiply ciphertexts, a special key called the relinearization key is required due to the nature of homomorphic encryption. You can encrypt data and perform multiplication as shown below. Note that ciphertexts in homomorphic encryption have a maximum multiplication depth, which will decrease after multiplication.

from desilofhe import Engine

engine = Engine()

secret_key = engine.create_secret_key()
public_key = engine.create_public_key(secret_key)
relinearization_key = engine.create_relinearization_key(secret_key)

data1 = [1, 2, 3]
encrypted1 = engine.encrypt(data1, public_key)

data2 = [4, 5, 6]
encrypted2 = engine.encrypt(data2, public_key)

multiplied = engine.multiply(encrypted1, encrypted2, relinearization_key)

decrypted = engine.decrypt(multiplied, secret_key)

print(decrypted[:3]) # [~4 ~10 ~18]
print(encrypted1.level, encrypted2.level, multiplied.level) # 7 7 6

Contact

If you have any questions, please contact us at library@desilo.ai.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

desilofhe-1.0.3-cp313-cp313-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.0.3-cp313-cp313-manylinux_2_34_x86_64.whl (426.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.0.3-cp313-cp313-macosx_11_0_x86_64.whl (356.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.0.3-cp313-cp313-macosx_11_0_arm64.whl (313.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.0.3-cp312-cp312-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.0.3-cp312-cp312-manylinux_2_34_x86_64.whl (426.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.0.3-cp312-cp312-macosx_11_0_x86_64.whl (355.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.0.3-cp312-cp312-macosx_11_0_arm64.whl (313.1 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.0.3-cp311-cp311-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.0.3-cp311-cp311-manylinux_2_34_x86_64.whl (425.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.0.3-cp311-cp311-macosx_11_0_x86_64.whl (356.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.0.3-cp311-cp311-macosx_11_0_arm64.whl (314.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.0.3-cp310-cp310-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.0.3-cp310-cp310-manylinux_2_34_x86_64.whl (424.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.0.3-cp310-cp310-macosx_11_0_x86_64.whl (354.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.0.3-cp310-cp310-macosx_11_0_arm64.whl (312.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

desilofhe-1.0.3-cp39-cp39-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

desilofhe-1.0.3-cp39-cp39-manylinux_2_34_x86_64.whl (424.4 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.0.3-cp39-cp39-macosx_11_0_x86_64.whl (354.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.0.3-cp39-cp39-macosx_11_0_arm64.whl (312.5 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file desilofhe-1.0.3-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1b890dd9083294c4b09fafbab38a6c2fe7e969a8d29d776eeb254d2ae8fbbc75
MD5 0c7b13ccda7a51b199a392194143ecc1
BLAKE2b-256 8bfc8986015ad69ab6c139b69b481a2c5d5c4fa59642d7cd366106654ab00232

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e7c7356d7eeedf3f1ac71032aeaa1de8437c0dd989baf636cea47096d197b259
MD5 69561d5d0cdc4872556dc7aade386a15
BLAKE2b-256 afeaef3cfb245fc6469a5c54551f6937e5774a366ae56dc6b614302154fa5980

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp313-cp313-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 908d95d1817c8d172ff407970e1d945573680a23873001fecc74bd5add52019a
MD5 f993280bef0c01b1b2793f920f7f4476
BLAKE2b-256 d5687bf02490e2f3ceaac0d8b802a77a56362361423c3e549bd83f78b86df239

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7a8cfe5410344ebeb9cd4e3f9af93dead585923e2dc09696394d5226ea4017ac
MD5 fc3eec60ab45fe2f34b4fda34a80c574
BLAKE2b-256 6cd96e200537f1d38e60e2554777842577c8df48171dec535562e251ab8a66c5

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 81897436195320f43a6ff666a3dddb225fc38f7d2ad9e652cc03fc5d483c6f94
MD5 39a166e677bd90f40a7c5afc3394c72f
BLAKE2b-256 da54d918c72346c1f5e5500cd52d8185753cff3f9704d852e370cc6d59accc3b

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 14eecfd1c0d9ae36a3dfd037eba2f9427c3d7b00c15b66572ae7d233e903d1ed
MD5 429da02f63b5d836fac950f9d47f6503
BLAKE2b-256 6bec95b0716e21fbf78dbd274b8c2892dcc574a49efbeccc310936256008e251

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d2cad0bb18bdb95bec8dea336a32bcef1d64c463a3a32e500819a60b685769c1
MD5 c66546047a5352ea7f8d13fb00183519
BLAKE2b-256 e51567070914655401e3f1080e3aaa83a8aa040aa7ee7fe8c6db215f842c75e4

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c85fa2b4524110096352be65eb79e81005e25d6897a9c42d0b22935fc3db90a4
MD5 91c4f03007154d5ebe3588038f88ff5a
BLAKE2b-256 f49335d974d1d0828dfde9f7f70d9192422f868b235e5d4fdfc9be8efc716a4e

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 aee7d4d39b6370169a7f874bf1c2634c85e3eac44a93eeffcebb83925280a13f
MD5 c95278e51fb9ce20e663c49ff0c0d9a9
BLAKE2b-256 d5aa9a643bbf79d9b1357061c6ad498f7dff53cad826eab3b33718fe592e218d

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3bc1c507b9b46d7f2a20297959567214c615482614f10c773ce1edf665a89f84
MD5 5a819293bd6f8102b7451297e5f10454
BLAKE2b-256 5cce63a84a646288b6633068a64ce340b64aff1208521ba41bc52f1cb124802e

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1b9d54711d5a5b7694a90963c315d7d1edb03462da2470a7e5ec6bc009a28a3a
MD5 ddaf08d34c36796db71e2996641250fa
BLAKE2b-256 53648378ac2cd4f3f28f9003076c03ece4bf18eb03bc30cf728c1da36c45e76b

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3987970dcf15e6050528d8461aa8d1164983db430d656535b82861e7c8821143
MD5 fd756ce90863a788a9be0c76344be6b6
BLAKE2b-256 d260c22eedc66742129b6ca45d5e8b81ddbd2315642e58368bd2dc8c690b82a5

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b8a44c2332c15e60400427c3ecac0bd2709999ae2213b9c63c3e8e672d565da8
MD5 cf249bd2cd43f1b665e41f6ae3041d1a
BLAKE2b-256 1bb50dc77118ecad0cfaeadba2a950f96a4446f38a1d17a26fffd71dd08794d3

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 694a18354e87297c9e2f90e8abf7d1928e12bdc8962d54f1abbe8d29a4f8f7e9
MD5 35fa53bf8ef60a3821af7fb1fde1cd22
BLAKE2b-256 1cb04d57cb128af7b213c470fd03727e3d51866563c64a2d8d9a6b3599fb975b

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1ce785eaa601f8d07d37c88df3a9beb1d9523b44d607472ed91f4b34289df96a
MD5 8ee7aead1d9c24ab428dd0493c982115
BLAKE2b-256 0ffb07854f4e99ff9494ac986646cc7f16c29c901dd479676a777e7f623807af

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 919f13deca780277d321a56b687e14134247ae7cbb4054b0ac0f18bb144dbc89
MD5 a70807a44329903f7f8f62a6eb8336a9
BLAKE2b-256 d3187209181059bc407f2c25fb2230a0111812be584c14475fea5c21b0cf1be5

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp39-cp39-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 921ca8d638c482025994c1c8f61b69ac2b7dec2f12416769b0dcadb2b7f5bcee
MD5 7712b7b3b8dedbd530f192a9299cda65
BLAKE2b-256 34265e9457839b0ffecb6f993dd7dd988ce2f47d5763f12ac36b6ffca6990b53

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7818f3e5e6dce10481011a9906c53bdddddf2a20fa4434dc245aecc28f423e39
MD5 43a04205ff6b48738f27d2da9bf36ed7
BLAKE2b-256 a7e06e60b9b5e5e40a01d3cdab0e6ba44992492d3446575605e6ab8913a266ac

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 71a73dc23e495330101ff4f77162a2cf5b2777991acdf966d7fd11c0f932cf1c
MD5 d49431358a655c9f9ff8def27b8387fa
BLAKE2b-256 301194f98525ca23363cbae6826f544161362ba78316e099df86247e6e823331

See more details on using hashes here.

File details

Details for the file desilofhe-1.0.3-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for desilofhe-1.0.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8fb2386d4f780a459c8715e399a80798ffcfc332691258fe64e40a912f1387eb
MD5 d62a96bda4432bf3949bc9314b6851a0
BLAKE2b-256 18d9ca21abe0417c880bf610b866532ed2980164757db40e1d1ccf04fe8219ec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page