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.1-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.1-cp313-cp313-manylinux_2_34_x86_64.whl (465.7 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.1.1-cp313-cp313-macosx_11_0_x86_64.whl (401.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.1.1-cp313-cp313-macosx_11_0_arm64.whl (352.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.1.1-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.1-cp312-cp312-manylinux_2_34_x86_64.whl (465.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.1.1-cp312-cp312-macosx_11_0_x86_64.whl (400.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.1.1-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.1-cp311-cp311-manylinux_2_34_x86_64.whl (465.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.1.1-cp311-cp311-macosx_11_0_x86_64.whl (402.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

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

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.1.1-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.1-cp310-cp310-manylinux_2_34_x86_64.whl (463.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.1.1-cp310-cp310-macosx_11_0_x86_64.whl (399.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.1.1-cp310-cp310-macosx_11_0_arm64.whl (351.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

desilofhe-1.1.1-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.1-cp39-cp39-manylinux_2_34_x86_64.whl (463.2 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.1.1-cp39-cp39-macosx_11_0_x86_64.whl (400.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.1.1-cp39-cp39-macosx_11_0_arm64.whl (351.8 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cc1b8ee9ab00dbcf0f62c72bd175408bfe77064b18e7af1839aca5b6af7d3907
MD5 45a773ec678274ff240ec4c815b6ee49
BLAKE2b-256 35896844f8581ec5971d2011afc0387798c2359f3e8036d3e23db59bb784733e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e9558b4307b9c5147dc502059a0bec3b255c987855772edcdb17cc5c827ce855
MD5 665222fd566b55c322960424bfb09042
BLAKE2b-256 cb24e60ece318102e29eed5e36b3e62bb97d5f2833791f86526b4ad9a6ced3d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 093ccfbac7badb6f230c350dbcf208efd3ffcbd244f6de442ec8318f10a59d5c
MD5 46f0c8e53e64632951148f4dfb71e762
BLAKE2b-256 1e1803ba424884b7f1f104829aaab7debfc0932dd40b4bfc9cc12e7d4653b4c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 72d568556b91dcee4ac3d34bfd5d348f09ed3a16ef6556da322be99c220258d1
MD5 ec1e9c914778de5d4151f43315798ba0
BLAKE2b-256 73b3c2decf90671d38edcc764fb1d22da47ceb34edc54631555f8ce59886f2d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 94c7865f26c5e23187df264d0de3c06ff8f4c4e948125e224fcdf88f71e3135c
MD5 a898644092435c01e2c238f2ea2b1f47
BLAKE2b-256 1b8211e2763930e51101b9065799bbe45821964d0013dc2935f6560fd12f68fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4d22206091434cc7d8b7fd2b9b53890fe1086a7198fd0a2c846d9c847e216d44
MD5 dcb76c117f270c7f02b175a79feded97
BLAKE2b-256 d986e7825164b17ff27fb452776639b63d69b2dba785bfb61603a80267a641e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7a5fb4f825d350635e86d6b56ee3e7b7b4c6dae52982a50db93837f3075b35cf
MD5 40a9bd9c7ddb696aa4bc2d9563f4bb51
BLAKE2b-256 135a039884927cbdf377ab1d7330ac46eb2a75b076831f67eaad390b2c891ec2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4f6d8cf35afe02723c62431ef89f3587b809d3864095ecb9f6deae22351b05c
MD5 0a3b50dabf0644396dd903c0759022d0
BLAKE2b-256 be993e5eed70b9e5bd075dd91b2197d9a99871eb6f3d513bc84e5823cf562d79

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7e3116a7d5e4937c62ae1ba90e76e6b7599abf191f97b8d3d438371627cf3a5c
MD5 78a1fe8e0361bb2f0cd51266a7142bc9
BLAKE2b-256 786780d4808d48e49476f6aba684c86aeca20aa26faf7d511a4beae654805567

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3ed948666d35c23e7f19fb6a8dc2e71874207b097a448d24fbe53b75ee86e905
MD5 d4faf128bf63c1a991802025a6c7e029
BLAKE2b-256 0995e902a8d97c77c7bdccf75edda7b11f4c1ff0f21f2d0ccb919a8870117d3a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 995d8701053138da00c01d30a63cf27fc289430622e72029041d529872ea01d6
MD5 dfe90b466b25bad3bb093d3e98853f6d
BLAKE2b-256 7a525c9ce1fbfe8ba22fe1f4fa3886c8a3021249fd5b29c33300fef463add06c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e1d083623ee8c227b517ba2f021e198edc13553b4b70743b0bc345f246aff80
MD5 760dc01014e59645eadd7bdc6cab5b49
BLAKE2b-256 b353576dfb9aa3b9b8294ba2a8f266985db5981d19506fa4dacbbb9cf1d33604

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a6442ab450d11bcfcecf42ddf8956cb03bc4d2aa67f98756e05c9b8ba1b31762
MD5 cb74704e97c583c5fe5a62c99447ccdf
BLAKE2b-256 bc175595d8c57ba82bbfcd08452411d21fd526c6be9a03435e1b2299a8a10db6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 75b3bb3645d54894fad46401eef167c5e710c8d97b32e5ec73fd8f04f3b8fc33
MD5 4d06eef9075a525520f361652463e2f8
BLAKE2b-256 6162ab5cbe84c92a15ad9b1f1fd49abca8ea946ba26e078d826f68d9c8367562

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a40b840245c74e974d5de45c2d1350bba7a3633a062d2c3422074bf15c3e6c2e
MD5 f2bed247ca992472fedcdcce99fd9189
BLAKE2b-256 9f5bdfa3daee8bd3ed467f5fa2fe3b0e86935aa8ca29d43975ab79ddb6119c2d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4854f5a6d2c551e223181b3ab84cd60d9dd3f2225d0cebb31ec769ed737ea53a
MD5 850591079b3ad452fc772af01200c9e8
BLAKE2b-256 06212b9ad7663d05d4069f6cfdb64aaac9d11731add47b42abad2b2aba8bf6e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e5c8bde23804714eac28734fa7c7893de8ee2978c064a5df719430b0f3afd713
MD5 fdbd62a0e7234d45c29584c1ba9df1b6
BLAKE2b-256 6cc981e6f27a3ea0d4aa19fdb3a42f80cb2c86cbb810751b4a64b72f21adcef7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 aeef8f0b7bf1360373393693bad1638636ed20c7ac16e470004ec73cf0cdb353
MD5 a7c12dc1898e897ec606e4385c697342
BLAKE2b-256 cb6893cb8d77ad170bbba7096aa56d4bdd57ffd5574089abc14ae4e05345f86e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 baead071ce92b5d5f81561f60b313561ceaf01c49852518930cfa18637018cff
MD5 ad8cf136edba7fc3827bc9a0d2357a91
BLAKE2b-256 13eb71005c6f8cbfcc83e950a2cb55786b6ef20d2019d91174247a8fb44660d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 78cab7478f42cc5ef3327ee3e9231edf4065d27f098793014a3e9494aba4f02b
MD5 a6fe27b26ef16aecce3f9b9c2e5ec6ab
BLAKE2b-256 833078bbd398f8f0ffe4ee976aab572ff6af71f2ce3dcfb844808ea20717e4dc

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