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

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

desilofhe-1.14.1-cp314-cp314-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.14.1-cp314-cp314-macosx_11_0_x86_64.whl (875.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.14.1-cp314-cp314-macosx_11_0_arm64.whl (776.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.14.1-cp313-cp313-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.14.1-cp313-cp313-macosx_11_0_x86_64.whl (875.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.14.1-cp313-cp313-macosx_11_0_arm64.whl (776.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.14.1-cp312-cp312-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.14.1-cp312-cp312-macosx_11_0_x86_64.whl (875.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.14.1-cp312-cp312-macosx_11_0_arm64.whl (776.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.14.1-cp311-cp311-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.14.1-cp311-cp311-macosx_11_0_x86_64.whl (874.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.14.1-cp311-cp311-macosx_11_0_arm64.whl (774.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.14.1-cp310-cp310-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.14.1-cp310-cp310-macosx_11_0_x86_64.whl (871.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.14.1-cp310-cp310-macosx_11_0_arm64.whl (773.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8e9caab35a5e1ca36f3ca81dc38d4a126f11bb227be4cd2c65f38652cf29faab
MD5 f0dd843604df56611c0b3a41e3eb7b27
BLAKE2b-256 d6f6f23adab37da8d780661226cc8ab5114caf1dcfc69a9606e9207464dd7d7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2c5e7a067f19ba2b35799717a53e0ff1eb46ca3c465699ba99e3d344d3f0d4df
MD5 cada9e98f41e10650b0be98a2329284d
BLAKE2b-256 a40759336b6c9ae822da07f4eabf3358164f461c44056100b6eb049492f65861

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c7b7c12ec9711940a33378c1ae7b480da607a1d50e8c7c13d7a7e703ade25fc6
MD5 78f5c31370508292d780acf54075f8a7
BLAKE2b-256 952fb302e5b369189262ae641af69c293b1cc434491078bf37ca98a42ae2e9e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5bf5ef23b901fc1944bd4c3a392ac40fde2deba7b0eb32db334818d109f6a26
MD5 16570ecb50b8be90be6591dd9994ae5c
BLAKE2b-256 f32b5fda8a8f6dd817f53d44e2488be67a0cf60e8cf8dee1cdb90d7844ded125

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 80009fd0db4ec7c9a56ca5950c3a4edf2ba46b974a8e66d8d3363d15111739c6
MD5 2477ced3b2b7619d5c6789da0755f549
BLAKE2b-256 19091e58d163fce2f200d03e457ee93d38af13511f43fb18d311cef33a379b44

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 277540040a10a6dc14b155bcf3cbf4f9285b8182b3ff7d3398d679e72d741eba
MD5 7b2dd9d430ba701f5b7e3bb3e36cd335
BLAKE2b-256 ad931161d13f2aa8ef53cf981ab144ad7d2f5b0929532e2663e86330d6124e7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4b4f0dbedaeedfa6c1a58cf106445418750897f74e7fd6c4e6dfcdbac0768544
MD5 84175a0c8e4cd1eaac86158324ae5798
BLAKE2b-256 0bb27c7e4d4ed904a73799871ff265a07e584b109267a03cc33d71f1bb508714

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0de340b0b41629198599435a282b12c64d5fa785375093615adc972eb092cf9b
MD5 bb3f2c97cccf378b1905b7a6b143c9d9
BLAKE2b-256 dd4e78f9baf5feab4fe25f8d6180ea1e1457ad7f231d244e7bf4cdee54a23fb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b9d8fca41b2f1bc597086b129955c586b31274fcf289f59f75960e4b98589be6
MD5 da32762cf76fb55f5fc8b3f56ba21eb6
BLAKE2b-256 a08d1ee0f20355b6c1654137f490114ee916111f61ff1fd9a2a75e6fe61f3d70

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0316de814afa7d092ca992e4ac80db319d3c695ac3b5f060ee5de0abb8541dd1
MD5 7c7927ad5e069278ce085bcc783e0e24
BLAKE2b-256 099d310d15de61545b958f76458b50614f2612dc4f295bd59f09c3fc340bb253

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 127e35c3e0050bd9d3f5ef96e59ec2cf8328b3cfecaf66391deeb16cc099c098
MD5 2a495ac38876a7836d33ea85a69118b3
BLAKE2b-256 4137ffbad1b13abc0aa03aa62d49da48ca04d5347fabc8360fc61269bf3738b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b34ae10ae66785faa88eb70628edcc98b277b822acf53eeb64882c4b6b5a430a
MD5 67031ebf69833c877dd1f2af832ae362
BLAKE2b-256 7d81b9b6e8775bcb4ea86c2026d4095c537caf624206202623130a9d59b2a537

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bc600bbef7b3727d5e061bd2e68eb75ed5cf6375d020b1875f24c0832b02450c
MD5 d58244af48a63518760329cbb58b6651
BLAKE2b-256 e1c9909a0139b2cc7c256eec0f95cf436b3d5d2c41968e86be2905e05d9dc33f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 dea2d65118bbd74ffac2343fd90c5329c10e88654a894cc32d39e98005fe7c7b
MD5 f0ee79bcbdef2da24a04174c02e06a36
BLAKE2b-256 feab32b87128aa25a96019705bad3280b2613c618233636afb2d3204f7d8ca33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0adc4277af6b1aa183178488faeed7174448ad3052be97c1753e21f068d14e9f
MD5 9c111b0a2a0acd8f640095e72596b74e
BLAKE2b-256 057c59dc7ae15f54ab0617ba5d7db4050b482cd32dbd1ec0f833bfe5a50eea13

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a6a548966c4c146bc3d9cfa1106d01cfa2ed7a5995da30cea93186e223c53ff
MD5 b6f66358d4b573ab9cb6e8150dd6bc6b
BLAKE2b-256 3a7fc781fe439b45dac9e27054cf1ddedd45141d77f82b1985b7ca0df90f6ec1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0f1358fca6490960213bf37018b4dcbfdded203756c8f38b4019014e7872d9c7
MD5 f6f97d88407174b320e7de4b81488140
BLAKE2b-256 5a4237092ef065fdcc954813addcc73ba3a0ac244f48384310010ae27cb51267

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 93801ea2895766b0dc939bcfcd31185d410a31db3f35c46cc18e844028433c45
MD5 fc49e3ba15c9a6bfd2c21fe36a61fd37
BLAKE2b-256 e8326a9086cc4d09f34f7ad36043e708fc0821a6980677db9485269975df3d77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 509e68694507f53f52eed2f2416889e1046b593d8b5832de590d7ce32371252c
MD5 ffbcd8536632e6ee9f5bb91bac553ca3
BLAKE2b-256 c7dd658936193ef440b64014536df66ed88e9c8885976eb50af68abc49369a6a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37d1fb2d683136195977154f10f65a961af48fff3f56523db913a859c0efd4cd
MD5 8404194fc1fb4b66ec57bd7d9a73ad67
BLAKE2b-256 a75b60a1a473263799fb4e8a3ad0bf31f79fcd71062314ab548e58b1cb5d88c2

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