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

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

desilofhe-1.7.0-cp314-cp314-manylinux_2_34_x86_64.whl (662.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.7.0-cp314-cp314-macosx_11_0_x86_64.whl (553.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.7.0-cp314-cp314-macosx_11_0_arm64.whl (488.1 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

desilofhe-1.7.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.7.0-cp313-cp313-manylinux_2_34_x86_64.whl (662.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.7.0-cp313-cp313-macosx_11_0_x86_64.whl (553.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.7.0-cp313-cp313-macosx_11_0_arm64.whl (488.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.7.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.7.0-cp312-cp312-manylinux_2_34_x86_64.whl (662.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.7.0-cp312-cp312-macosx_11_0_x86_64.whl (552.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.7.0-cp312-cp312-macosx_11_0_arm64.whl (487.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.7.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.7.0-cp311-cp311-manylinux_2_34_x86_64.whl (659.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.7.0-cp311-cp311-macosx_11_0_x86_64.whl (552.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.7.0-cp311-cp311-macosx_11_0_arm64.whl (487.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.7.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.7.0-cp310-cp310-manylinux_2_34_x86_64.whl (659.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.7.0-cp310-cp310-macosx_11_0_x86_64.whl (549.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.7.0-cp310-cp310-macosx_11_0_arm64.whl (485.6 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0231502aabf0384011a8ea1ab48b0748c72d07bc51b07d888496f3c2f1c72277
MD5 8fc40ffd3111dd2e1fa6e49d7280843b
BLAKE2b-256 508217b940738b58f4da5ec7fc8e1cc789024261b15fd0de6469b735e2ffd0dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f669593a99cb37f2748233ea61fbc91ad1afe2ba8a7f91af394b6b36b43d4f2a
MD5 addbe865982e153e4b096222921e9b80
BLAKE2b-256 0c630c42ee3242e6768abc4e572ea76b64e8b2f5cea8ad55629df115e915fae5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 023438ece2264693a69dd5ee8d61feee34108f6f786cf11dc78c201960595b38
MD5 093cc038b716be02f55ff6bcda0a8fcd
BLAKE2b-256 853b65d73432f38cd4d7066e733c8a08653ddf17ac2806601fd13849ff0f067d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b7ec1665dcb91245cd758275bb84ad5704d0a93e16929d07b06c00dd6dddb47
MD5 a929f0887281f69e02e58384a6b569d9
BLAKE2b-256 f021254ae0ca290c89062c94d1d542c35a4017b731010623920f98acc040e4cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 74eebe27c5f57d8a86206177fb1dd071da19f728c7d1edcc665c5c9403999e26
MD5 541c787bf96386b053a525df88d6332d
BLAKE2b-256 ea8da882bde28cc3170c57af78041a58e5398c7d6e9a510fb4845029ae71aba3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e04dd9139c6d86e36b7a58dcdc6ed946645cd73cb64d4dffbfe861ef39c0124a
MD5 3d7ee3420afcd320ab6f3709dfd2c5ea
BLAKE2b-256 7bb1f90c6e377c0b762fa80bdda678ec88430cd1e321442642433a48f40aded0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3a239ecf2eac568bf181d2fb9eebb0f6f413d639a10bd971fe348c658fcb82ff
MD5 4465e104bf2c6275e3b772dcf1b28227
BLAKE2b-256 4dd0060780cda6735e623675115bb9947d361f037a2ae84b60aa5a467a96e821

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7bf5e73b88009b36b729d4c59cf1e54363f93b96009b92023dc8c549eaa90e6c
MD5 9d3836d903f4d4fe101856e97fc86094
BLAKE2b-256 2bc4ba0b85e2276c0662c67cf6c39e3716980db3437c639914f1a763be4b6d0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6ac74baa406b1d0f11874dc8eed8c71e4d3a75432ff9d9110f9928a8a412be42
MD5 316492e1d27874a54e6b63805787c92d
BLAKE2b-256 56b64b7e6f75d11bbb87b01e1c7bde07165f9d5a6d7868b5a50c38d13ef9982e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e4d1ffa2f8bddf67221209eb95df8765c56e23d9c845a787f08675b94c38d438
MD5 8d5bb72e66a2978fa9d3de276b6b5fbc
BLAKE2b-256 dcf26e5cb5b78c4d7204fe553687c3268b1b1d6671a88fec662bd0363733bc10

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7ca6e55fdea4518a1f5b5d4cb3a450b2102481f0ab35b48f18f33a8c73c4ecfc
MD5 31d72ed7b21e4790c810e70d9698bf0a
BLAKE2b-256 60bdf73ebfe990f7eb1b2657a3fe5cbf9405b8ae337e3015b4f3b3baebe3c590

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d375cb54b07575395ec012e3fc1a2eab17a9ead716d16f24752d34c811bf7e04
MD5 f3ec2aee092a91aab8b27d2ad7b7335c
BLAKE2b-256 88ab7a4060eab5d5352523ae0079a3bfd8c96e0f8d002d9a493c95f04de92ea4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b01a88516887752a229989cdb60b9daeef90b5da47f98753d7d93b08cb958a76
MD5 a41c2144f8843fe85320558e38a5717e
BLAKE2b-256 ee0a1a34708648172748a6b5bfd971394e0f69dc767b1c77895ccc228fd558b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1f82b176105cf9ba34295a75f06c0998bb9c6aa1ca4ab95d70b8523b40a5d23e
MD5 853d18fcf7f4ff171139b61af15274a6
BLAKE2b-256 260313c0f010e2f4943ba42d9a79057be6ebf6c203900c0d9a89faee61d3df29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 377912922d8e9f33cd3d3dd1c2a1d0168d3b2f52aad060f46e808d105408644a
MD5 d2ea67f86318f89cc669efab4c7263b9
BLAKE2b-256 eba1ac15f5455a6d4cca0ed71602ed9632d5404b8fa19f2edb5cb17a0be032f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8f7409d20b1d6f79f7805c1c357dcd91f6ae63139f24e31ac1898dde2795977d
MD5 b4ae9ef8739b39bc88257aad6a029e42
BLAKE2b-256 6dae1a061f559a025e4d72fb6ebc89bf75baf71ea72bc35be54fef4c92ed7283

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 34b430c94671eddd2c0bb930d18c74fd44e7b98fb9f9cd054017cc3b11297cd1
MD5 edbef0b3090210c3d18fd4a205ca72fb
BLAKE2b-256 bd1a56e6ba4862143be7db57bf76b1b24320f55fc52ef20d3dde10b812170ce1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 73beff5a4e0653d0ecc43f6772acba66bef9fdd981081e26b905c4759a285bd2
MD5 996e65cc4651be3ecc35ecf2126e2c28
BLAKE2b-256 6a2b57ee67fb26f4b288be5310bee26d94f9d2cfd4be1b03ac9cdd122189267d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 11ce591f78325004be8b204f239a483160918cc7f52b9452b0260dfcf80276a6
MD5 d1659eb1a6593f9dabf79189a7f385dd
BLAKE2b-256 3494c0bfab3ca174bc36e7f61df901a6db018c3faa858830f84093d3fcfe961c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27d9b3153f8deb84fd1cd5d6f69a50ee34d8fd6dc98d77be39f5f5990741d7b8
MD5 85f88d2279c397a754a69a20235e1358
BLAKE2b-256 f8ab155c26b4eae2f15a54e328f80774d563fcae0b044c8f0c6aabbbe149ba33

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