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-1.11.2-cp314-cp314-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

desilofhe-1.11.2-cp314-cp314-manylinux_2_34_x86_64.whl (974.2 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.11.2-cp314-cp314-macosx_11_0_x86_64.whl (822.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.11.2-cp314-cp314-macosx_11_0_arm64.whl (727.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

desilofhe-1.11.2-cp313-cp313-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.11.2-cp313-cp313-manylinux_2_34_x86_64.whl (974.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.11.2-cp313-cp313-macosx_11_0_x86_64.whl (822.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.11.2-cp313-cp313-macosx_11_0_arm64.whl (727.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.11.2-cp312-cp312-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.11.2-cp312-cp312-manylinux_2_34_x86_64.whl (974.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.11.2-cp312-cp312-macosx_11_0_x86_64.whl (821.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.11.2-cp312-cp312-macosx_11_0_arm64.whl (726.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.11.2-cp311-cp311-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.11.2-cp311-cp311-manylinux_2_34_x86_64.whl (973.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.11.2-cp311-cp311-macosx_11_0_x86_64.whl (821.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.11.2-cp311-cp311-macosx_11_0_arm64.whl (726.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.11.2-cp310-cp310-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.11.2-cp310-cp310-manylinux_2_34_x86_64.whl (973.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.11.2-cp310-cp310-macosx_11_0_x86_64.whl (818.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.11.2-cp310-cp310-macosx_11_0_arm64.whl (723.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file desilofhe-1.11.2-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3ffeebc00688209168e50f0632844505f267dfe841b5cfb8d2d9fd209fe665c8
MD5 15c1fbd53d1907ef907cca4f446bdf9b
BLAKE2b-256 a5e4ae2e83b47934a4d2424ba07cdc0068f667521f5dc9441ea4c14f9df30690

See more details on using hashes here.

File details

Details for the file desilofhe-1.11.2-cp314-cp314-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3686b5510a578c339fc78590ad499eb2dacb2e38c5c769d8fa8541df11a4567d
MD5 1a2f7e7cad400e0e589a19641340954f
BLAKE2b-256 50e6838390f639578678d24e3ffaea0098f300945712e116fec8b46971cb6c7d

See more details on using hashes here.

File details

Details for the file desilofhe-1.11.2-cp314-cp314-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3ca8940051e98ae35c7ce6c7d6b114d5ae6d2dfa927a5a4bda935209424cc9e9
MD5 13379d360e824b10169561e9efd2c7ef
BLAKE2b-256 320768850c545d6f6f88fa1c89bb18f123bedf60311f41944dcf0b249ef40e35

See more details on using hashes here.

File details

Details for the file desilofhe-1.11.2-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2555edc607709e5f19c01eb8c6f875a1659f023a00ff2aa470f1a6af1b5c9890
MD5 998f71fe6fcca42169685282f821baae
BLAKE2b-256 56ca2555f6e1883b89bc4b5faadfc33b8742aa4869a2295142c03c73668f24f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7f86a619ff053192a16f3db7d31971fbb967bc06e71a76a9c47998bb2e68690d
MD5 b46171da99f137b293e03894aba93795
BLAKE2b-256 ecf7166cc034ae5c0947c9790ddb3562d37626bc62d3c5fbabc0c6834e57d2b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b9dd09c64a8698a6f66a45a0742d284beb1364f7156f8f81c8d611def031af0a
MD5 3e2a10e3ca36d2b9d7a04e1fad3af905
BLAKE2b-256 37e9e5cabfc0b27e1cc7e951030d01be32309963a25f421ba5a9aeb3686e4513

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 bb6bec312e20d6ea25e3cc2948f4dc166e0954f9f2718687bf0945d34b9602c9
MD5 a7c32c898fe7de32b73a96f276417f70
BLAKE2b-256 05fe042d92a9e02e5dbf3caedfd4a04d1dbe89039d16e5beb788926b4be44d7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cb6a42117d28327ceb26e826d47a8fde4c313f5e5cc3b0e8eb1300f0895677bc
MD5 c782576ca175f3e9466f5e9b8e1fcf57
BLAKE2b-256 0f5fc09d3675d8dbbaa25db3d267deca9f81e8ac248e57f7689bd798babb3937

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e1203afdfbeae3b7319e8d40bf076f2236124e7efaf5c6ed7d4232d915bb956a
MD5 00511454ab809e5b42b436c15b60f427
BLAKE2b-256 f89ae91ff1aef65383b1e61535479a522f8c25c24f17adcf801586af93e5c5e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cd31e998719be392c7198cdcbc90386cc220ad5a941a3e87035dfd384d4f09ed
MD5 4c1358a34f4b6c63210b9f98ba4e1195
BLAKE2b-256 275a6a642e89c20fdb54e0b13c8eea9f3cacb351a76f94cb97e660f803add58d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 62ccdff90d716ed417eee3bdfe8490fdb0ee721d9c12e7d231b7cd874b446621
MD5 d284e712bf5f3f8d42482e764469a079
BLAKE2b-256 b88903c89f989d6c1b34c51f41512672193456c4cbe4324715f94e30e404841a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e10c2d962400fd0e995002f189adbeb5a315a0edc67ce3da482d85c53663651
MD5 1a4ec02df2160c8894708d9edc9d44e4
BLAKE2b-256 7f03d8d65a79449cf4450618de04b70f0157a0c5c045924911c024f385bb0dbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 796f5f87b6fa9f9e96332bd00d7b7472ec8b15bb0467f9133863ac23adeae343
MD5 db67663c4fa0f82924f0beed7a47da91
BLAKE2b-256 1a352ffa00a848624dc17776536f4471a7ea19da0b304aee93425b09d1ed58ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 bb325c0c6828171de18ecd99b0c563bffb99129db0f399218780b0ddb3830ebf
MD5 d3e6678f1e45fc94edb2fa044689b428
BLAKE2b-256 f119eccdf40bfd97715d1800e4f552bf100f2d9694fb351a816d30df1e5beedb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a87aa5acb480de6378cd712338536cd26271d4259869cfa5d32457c8c97182e3
MD5 11d1e4af868e90fe565e0cddef99db3e
BLAKE2b-256 a2a704ded936d78d2c536c4b622e0d32036191dc288ab6331626b126c43791de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c3b31e91f2840a5609e95d47355165540ade57754161784ddbb92c56f6565608
MD5 5a81002ec8e13f04dfad7d76a75d29cc
BLAKE2b-256 3949b599393332a3ba17ff1ce510ff2d4a2146b869830caf64eaaabd0113185e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8a503e25e65e4617d63950a534a194f2aec38383da7dcce28e4c33639e774e5c
MD5 9ed27405417491e3c0321b62b84528c5
BLAKE2b-256 5caf92c02aa77c483f23f4d3aec8cc42af07c07b64612df01f4b1cbde2dabf86

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d2782112beab36b29edf49c9374869ee60e3157f030a74788f867f1f3327a60e
MD5 b252fd471802e74e4f6a28ae4a3d0f2f
BLAKE2b-256 3562962371f4b0e64598743228bb4e63f4c87189273563e2003004bf5f3f99d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 683e88990a5b48be38e1a6225377d044ed67f19f4bbb90e67be412ec537ddef3
MD5 52c708a75d1de96ba019de0bbd8af705
BLAKE2b-256 4150b0deafbc21051f603b588d51a09a80c955f599de293de505e09e56950683

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9451b3a9ec3b517b65b3cf6a9b9b314bf3acdcb6439cedc9d0d8a0bb1a2aea1
MD5 9c34e7f37066d13e14a25ff1e0d9f70a
BLAKE2b-256 ff16380e33bd6b90dd016b8db626ccf3688f33ff784aeba2f5ac8810e2fc2d01

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