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

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.0.2-cp313-cp313-manylinux_2_34_x86_64.whl (417.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.0.2-cp313-cp313-macosx_11_0_x86_64.whl (351.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.0.2-cp313-cp313-macosx_11_0_arm64.whl (309.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.0.2-cp312-cp312-manylinux_2_34_x86_64.whl (416.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.0.2-cp312-cp312-macosx_11_0_x86_64.whl (351.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.0.2-cp312-cp312-macosx_11_0_arm64.whl (308.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.0.2-cp311-cp311-manylinux_2_34_x86_64.whl (416.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.0.2-cp311-cp311-macosx_11_0_x86_64.whl (352.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.0.2-cp311-cp311-macosx_11_0_arm64.whl (310.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.0.2-cp310-cp310-manylinux_2_34_x86_64.whl (415.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.0.2-cp310-cp310-macosx_11_0_x86_64.whl (350.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.0.2-cp310-cp310-macosx_11_0_arm64.whl (308.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

desilofhe-1.0.2-cp39-cp39-manylinux_2_34_x86_64.whl (415.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.0.2-cp39-cp39-macosx_11_0_x86_64.whl (350.4 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.0.2-cp39-cp39-macosx_11_0_arm64.whl (308.4 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1d34f5ab7b00ba98677ad6925061328ba1b8ff100e636d9182d363eba8043951
MD5 71adfe69c051ccc11a6ac08905bf4460
BLAKE2b-256 4a985e3f6a5d3d4a2a663bce977f9651c5c1f9220916d6cfd3841a7c9dc31f54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ed8f50932bd5baf8f920c80c2a5afe63e13451111108d198b3d23f8adae26d19
MD5 42fe17d15f5faa7804334ce0a987543f
BLAKE2b-256 2cb8e67897cb304e6eabcf844210c43691dc46861af128b53e1fd058b1b2ef7c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 08850b21540ae680d3b9b1cbbd268813e3dab76a1174abb643a8975be6afc0ed
MD5 46206ef8c6fe130bbbea15d217a5ac5e
BLAKE2b-256 2a3e6e228d83a55490b95dfa073cef86aef7cc4e37b0c932fe1948e22fb6af62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 25b5004f6a507c4b21522745fe42ce63bb72d20b49925bc109313448473ff53c
MD5 f1e1ce8b5be1807c830086643a36bb42
BLAKE2b-256 6884f35d20a9053e384b0c938b30d04180c9f1473b3a1fd1d38885be642673bc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c41767103e4a4da44fd7a5bd77cffd8351cb9d25343f6433a82dc86b2a3833ea
MD5 281bf4d23a939a88910be2146e4c09f0
BLAKE2b-256 1e6d21ad9f29771e40c8cd9b9f9ebd2269abc674871befcce0bf979399e32424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e5c3f7f3743a7ccdbbaa6b280203aee63fd5606ca2a09e11f5ee5879f00f2c9a
MD5 b3a45b7ecb6061caf3494d8344607505
BLAKE2b-256 6dd0447c9d3d886d3b126333f3456a1aa46dc1ed5045854273675d1d3beb308e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9fda01e8f75837de0f79f3b0a83f5b8b507e8f2654fa6b7b984a19210b6cb09e
MD5 b604619d0a7d7b26275719dbb9a36833
BLAKE2b-256 1eef95354eb6c92732cbcae8a1599af660770d0d382c89867a0b192c1def2eeb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8e545b18d076e9b27d2e21ae42fd482300c4f4adec5c6bbf1b5d2362bfc48223
MD5 54c50d6333cce1774631c191e3b2da2a
BLAKE2b-256 e73ec3fe04f6ea57a717442c3b7535308fb38fff03d88918e98642c985d686bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9e765431fe2f1a9fa999e1db32ea37e158f6e1871563b4b697efbe0c072aa18b
MD5 1aac77cb51e22f38ad8e8e2572b468eb
BLAKE2b-256 8bdc9dfff7fc0a1f62cf9a988dbee98852f3b68505dcfa82f5f0d5591da1268a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b994673b5d4b61f3586b21ff0c2cd0491488ac898ca472dcce2f5b63e73ff985
MD5 957664dbb260451d164924c675efe362
BLAKE2b-256 23652ad5d45091fd9c9b6815b80b91145ecf3c3a0975389911b93a9aee91192d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0f602718e29c241fb0ab4b85e8611e842e702c9d1a0a79f349a6dcaafde545db
MD5 4e4973ef3ef7993aed1a33b78e6414c8
BLAKE2b-256 c20c0725e34bb7438fcd208d1e10271ebe9dd195e2a6d927a7189220b8145b1e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bc72224db87c735c98760d2bb5b66edf88b9d5095500d0cabd9ceaba758f1071
MD5 117e263c775b01653b2fa3fde6b71042
BLAKE2b-256 2c2e1756cf5e62a6c106e1ffd23a9a48c69ac99a96f6a708a2128ad4f85e5401

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 84d456bfd9fac0b89659050730cfa4bef0c1455d7db78b019242a1914466c2a1
MD5 a7d341035d301ea45a1145b87abb6a11
BLAKE2b-256 09504cb664a2f0d625d70f581b60efc8c151b83fc2fd0b6ac8ad038cb803ebf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5abb11a5f1b488ef0eda0159cf74de60693fed57738251e758c0f439fd136d22
MD5 ffdb280c7759e15bb6ab345197570da2
BLAKE2b-256 35f0ebbcfdaf1132668c57e97fdc33edb62c5bafe9ac77d918ffdab9868cf952

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a8da6a2e4bbe04b5edeccf9e449d06814e38f9fd8d6330f3f9d174bca34e0bdb
MD5 bda144892ecd0917c8e97127ce9ba559
BLAKE2b-256 771303e2defb47dd8169d0b284fd5867783f581502fa30a1d193937522f1f7f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 adc35c978fb63e87dbbddb280f72149751e6e1ff7963cbb79ec40f02ff47fc9e
MD5 c88c184d7a4701f055708b5e89249624
BLAKE2b-256 e4b6316168755d89b961d6a4f25e8e07dd311cc93f37d97499e2d478b9f8fe72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 cb76f236c73a960245be85dac17bd2af4a14fb11bac13917c7a22538e1ac0128
MD5 11d6ab25a9ab182d34131f562a15c2f3
BLAKE2b-256 12fc6048be0f2080e30bb3b57a076aad8b53bb49bd5e1b38e359de17b36309d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 30db38ece4e59ba934a135d46a47411a89bdfc7a7a0553bf63a90ea98d581bec
MD5 1e48a5d42c94d67be9e426194093ce01
BLAKE2b-256 ffde8388d8785c776c6e4e402054c435ca67ef5774803d3457bcc5f249ddae65

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6266af8c121a66c8ae71aea0e90c701c4cbe1c0449bd50baebe79eb918317e61
MD5 7ac04dda4e09a7ebec4732dc20fc0d1b
BLAKE2b-256 f40e4bac84cf56e6766047bf78226978a1fa02cea71adae538677a4b6597f39f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.0.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01c5f3f34d55ba7bde01aa21fae2e623d02f97ef3621393eebaa2bdbb660d75c
MD5 a432624e1760fae570db116b774f522d
BLAKE2b-256 6618582eba2f19e72ebdf6b82461756aa981fe902e1dbd2709f99bdd6d4ce1b1

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