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.1.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.1.0-cp313-cp313-manylinux_2_34_x86_64.whl (463.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.1.0-cp313-cp313-macosx_11_0_x86_64.whl (402.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.1.0-cp313-cp313-macosx_11_0_arm64.whl (352.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (463.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.1.0-cp312-cp312-macosx_11_0_x86_64.whl (401.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.1.0-cp312-cp312-macosx_11_0_arm64.whl (352.3 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (463.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.1.0-cp311-cp311-macosx_11_0_x86_64.whl (402.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (353.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (461.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.1.0-cp310-cp310-macosx_11_0_x86_64.whl (400.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (351.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

desilofhe-1.1.0-cp39-cp39-manylinux_2_34_x86_64.whl (461.6 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.1.0-cp39-cp39-macosx_11_0_x86_64.whl (400.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (351.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6130f0f013fd86ba8627e00cc30bf3a62f4cd02199928bf2a9a3dc006845a7e1
MD5 1e6a162833e76c0556d45e2ef317d46a
BLAKE2b-256 8ac1dbfb3545c52fdce62a2d0f82b94cea022f16d0687822e80005925b5c3e45

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1c2675f34382f0f52d534f92f7eca6183e79c60d567cdbd81acdb9bae718cd64
MD5 53efa50722c2ac9564f810d9b3a638b8
BLAKE2b-256 3892ea1ead81cebab34a49054e9b748b5753194524566c630c976980d4784bb7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 87dd7d1f2587a435f947bc0f708b80058a9807e93d6638920a560dc468722572
MD5 ca75ceab84df328d17e2c9fdf5c7fc7c
BLAKE2b-256 8c3140985014cb671fa5487b1974c3a47bc150d53c222c301b64dc34556c57f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 39c4cacffcf3e46d2c5a700c4779c39f079d45dae67a68827ac3ff84fc9ca62d
MD5 b87b130dce08c75ebc865ba3f2200083
BLAKE2b-256 82fe72bf08e6c2d6cee76c0d1d3b9524813bb9aa9fe1a5d8a405c9c23aaae2ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 75ff3c1a9b2547007fba46e382c9c6eff0b1877ac8f041767259d942a690b2d8
MD5 37daf6335276ec3a88c872ebef8a8724
BLAKE2b-256 9d75192dde7fb81a4418fd08c9e6dd8af254043e6627ebde7056d26360f2d18b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 86304de012c29ef0e6ceb4bb46e5f8793a3dba045ac51d5bdc9a4658de056d65
MD5 56d6fbf0e23f5274eaf7b15675cbdbdc
BLAKE2b-256 0d8ae459eca404cc6d124516585eefc8e4269d0075fce522cc9b04ccf2f6a1f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 03a8dc53266acc9f7facd27fee506d9577e2878537c6f64e6c9324632b305c05
MD5 6ea9110cceba19e3a7b755d8f50d00dd
BLAKE2b-256 6bae1231807af0d7458a7687952d3c44352aaab9faacb3432b70c91c930d8b8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2f24a3543e006eea568e1cbe4334a9ff943a5e41f872ebecbe7d7a16933a0800
MD5 0e816eba20b4d4dc03385f487ab24b27
BLAKE2b-256 783202d6e234980c104d6dec7ee77dda0ef40f641b93bb5d57cdceaf45bd6ade

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4ee7cb9eb11c07a9042d95093891df394ede640518ccb79890031dc4aff7d2a9
MD5 daacde2b3f47c32b0ea77c7c5c082abe
BLAKE2b-256 2729366d03ce58b30032ff3d66cfdd251d0cf5993b0162bb0c7d716899816bb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cea6f7274482ecdb8625879d949f06a4c6f1369b9ca5a9c4c9c2be8b13b461f5
MD5 34b5bb739d2d381b7c620610c8ee3d74
BLAKE2b-256 07505d04689de9ab79d40b2e283423812a2bb07f001943a525f26be24fcf00b5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 14117c885c91ff320ac34c254fa23423b6e05687ed786503a2bf92a4f536aa50
MD5 449bf985dd0c3ab75ef991788645af30
BLAKE2b-256 5e6c10148ffc131d4e94ffe9b0b8dfd7e0e5c4a39f557991c1508cf69fcc5176

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d3445310f88775b6d465ab4d7075c2bd1517c8e84a8b1dcdc26d0e652312b9e9
MD5 2033587e4853d701a5ef3edf209da24a
BLAKE2b-256 a2e85e55045b432481d216f187a41b3f488dbd080a299a4ee378730849c2345c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2a4cc353402c92a1290e1cd7714a7bd8bdd56df8351fc269112b9df3e364e565
MD5 19b326f2a47ded0929cb9a4047ba525d
BLAKE2b-256 050a9a3094c0f9ec8bc94657be94828feaff66e613264abe232eff1886e959f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 350990079a4f08b45330a00bc3a4086ededa0fb1f5cc3e92515977de15f274d9
MD5 adee6e37b856f1dd8a54b3fcd1efc043
BLAKE2b-256 19d04919fd61104fffe11c64b240e746fe72d20b77ba9f4eee367df96d33bcb0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 babb6de9987e8e04a17e5d2438b5fdbf643305ff21a16d1031f8022221b87682
MD5 e4a9abb6bc21b602b25bd3a193267cf1
BLAKE2b-256 32680fbe59bbb85d4eec43c2bf186d87ddbd2df01858f043e117a88ae4fb24df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd38cbff652b2e6ec25beff343a313edac8cbc1d1f9572369bc3400a4824997c
MD5 0c1a6dd052ed979c1660d01c35a6aede
BLAKE2b-256 590f36585c175f1cbc964eca7df37ed603b881cded20cae4224ba5b59e6394f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bda2a493d41379729a3970987a82c7eb1a496463d51dd8211ea2fb3956cbbb1e
MD5 18f36bdebd41e91d99f0fd456cf3b57d
BLAKE2b-256 2e84ab0cb11f722bd016f6ba1592d78fcf17394f0743bbda0412f46b1d15aaf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 95ee78d760c54f671fba5826cd3e7718e8f28691df6de38cd3b9b202776a0e53
MD5 cf38c241c3f332ab8ff12f6d005e35f9
BLAKE2b-256 8909959fb26cc8076fe286b274f4bf9e1edc509c3024fcc2b708f815ba930007

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fde6e9f598b2e627aa3c679a4b870b047119c1f590d82e9cfccca2c4fbd37207
MD5 ac3051849647231975988302426c3027
BLAKE2b-256 939195011869cba87b042983f978ff4940ec78de5e69c0e9b4450ca71623f79c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e30909c306b7442788f557b49251b0147e7ce2706683608b6b1d25f16169d71f
MD5 8dd735687e34aa7dd2cae5a890627906
BLAKE2b-256 0cf40ac801045eaa93e6d7281d5bcfbf75534a456494441efb86d63abdb8e253

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