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 can be done with a 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()

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

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

Encryption can also be done with a public key, which is genereated from a secret key.

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()

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

data2 = [4, 5, 6]
encrypted2 = engine.encrypt(data2, secret_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()
relinearization_key = engine.create_relinearization_key(secret_key)

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

data2 = [4, 5, 6]
encrypted2 = engine.encrypt(data2, secret_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_cu129-1.11.0-cp314-cp314-manylinux_2_34_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe_cu129-1.11.0-cp313-cp313-manylinux_2_34_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe_cu129-1.11.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe_cu129-1.11.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe_cu129-1.11.0-cp310-cp310-manylinux_2_34_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

File details

Details for the file desilofhe_cu129-1.11.0-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe_cu129-1.11.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8f01041fa959f943a64a210d27909dc1d29cacd4b1fcc7fe018b6a276aac3df6
MD5 12eff9687fb8e4105093c0f074c88475
BLAKE2b-256 8dac05e1ab02d92aebc10508472c0b1d746497e8cd60e1c341da7d7fd54b7c83

See more details on using hashes here.

File details

Details for the file desilofhe_cu129-1.11.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe_cu129-1.11.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8f62d3d88cf35afc1aee76838f0492154a1a394508f86cdfee12644bb6703f28
MD5 557a3ffe01c0e55d33c373c1d10afa5b
BLAKE2b-256 ee8ac16717030a93f8c4029b758b93fff6b74410f35ba772964412998ed86b2b

See more details on using hashes here.

File details

Details for the file desilofhe_cu129-1.11.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe_cu129-1.11.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2cc98e46268dc2d6629df68471d656410cd88ae6a72b147065c694a8e0970321
MD5 e228f3e321073552d534fefa5040ca2b
BLAKE2b-256 07397f4f6178bae5c7abf7341bfbe061068c8f4384aa9dee931f338ba823d319

See more details on using hashes here.

File details

Details for the file desilofhe_cu129-1.11.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe_cu129-1.11.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 066bedfa2faced0932d70b01cfa2e340153390e1e0c9e66bd0bc7646bd1a92e5
MD5 00e97f287e756bc2517b3fab2ad38802
BLAKE2b-256 eec17ea279478e1249cd3ac9eb023855db7d70e370642cf5dbc6fdf6f22b2276

See more details on using hashes here.

File details

Details for the file desilofhe_cu129-1.11.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe_cu129-1.11.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2edd08e25fd588872222587f13d1d1b5c7bce2f920c71a22dd11f56febca604e
MD5 cda6185bce374209417b40d076935d1a
BLAKE2b-256 7f3782aa7cbfbde7293955f68d27b7b4d63d4a71cd78a27f71131dc8e5794616

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