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

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.5.1-cp313-cp313-manylinux_2_34_x86_64.whl (587.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.5.1-cp313-cp313-macosx_11_0_x86_64.whl (485.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.5.1-cp313-cp313-macosx_11_0_arm64.whl (427.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.5.1-cp312-cp312-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.5.1-cp312-cp312-manylinux_2_34_x86_64.whl (587.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.5.1-cp312-cp312-macosx_11_0_x86_64.whl (485.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.5.1-cp312-cp312-macosx_11_0_arm64.whl (426.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.5.1-cp311-cp311-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.5.1-cp311-cp311-manylinux_2_34_x86_64.whl (585.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.5.1-cp311-cp311-macosx_11_0_x86_64.whl (485.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.5.1-cp311-cp311-macosx_11_0_arm64.whl (427.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.5.1-cp310-cp310-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.5.1-cp310-cp310-manylinux_2_34_x86_64.whl (584.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.5.1-cp310-cp310-macosx_11_0_x86_64.whl (482.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.5.1-cp310-cp310-macosx_11_0_arm64.whl (425.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

desilofhe-1.5.1-cp39-cp39-musllinux_1_2_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

desilofhe-1.5.1-cp39-cp39-manylinux_2_34_x86_64.whl (584.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.5.1-cp39-cp39-macosx_11_0_x86_64.whl (482.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.5.1-cp39-cp39-macosx_11_0_arm64.whl (425.9 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e868190a6c60fcfb693730dd25d633b859a280e5a91306795583a055af39070b
MD5 ed9b445ed79d4da9260b84a2d80fab92
BLAKE2b-256 bfeb61edc6fb309f3b4c1e776cd59f8aed42021c4c06cc79ab6a151bd610464d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 deda4c76ecff0314f22559e77545866db9bd21275bab1ca86f9973e5dfb71423
MD5 6554fb30a4500b8b5955ff007ef50355
BLAKE2b-256 6d16400d46b743fbe691e873f6bbb4a1c0cef756fc4d7bd013d55ffb01a59452

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 233fbe5dbc652dd5b9fc0697d3e00a566091d64b13d11a00519ffff196924f85
MD5 8fec932af13f0b23b514fe70cfd5467f
BLAKE2b-256 e577eb76031eeb54d1fb4b03af2b3434ad98f92bdc78171974591f98162ad631

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fa460d89e0371fe1a2ebd083663e39ed4a2b188c60052abbb51c91a24ae559e1
MD5 a31dc5e81a2338f23d168fe1d60bc230
BLAKE2b-256 36689793906c3da4903df82e22eff3f648af767b2d9bc6e04507aeb92ea2c758

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 30d12332496baaf6ac9a144e3ec0059120e9c63061c1d2bbb62b720d47ba07b5
MD5 711c5022732f25caebd65273c44680a8
BLAKE2b-256 50a68a123e3d280f661490c9e8f1deacb777df2d0d7586f392a795e4c6aba6e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 016c333e479b2d43528504f195b8e625ad6e2a50a6c68df974d27e7ad321e4c0
MD5 72ffa2aa249bbb2bb935ea28aa2a0d2a
BLAKE2b-256 7ea74093148ed78e42f909027e9d5bfd3d31a81ffa1e5a58dc13cc60954fbcb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d313d94ef665b15177645275ccaf4b9d610f91229532dc96c3692de63031ebec
MD5 0e1778c4467fc0173d88a7af0fdbf758
BLAKE2b-256 da538555c455db2dfe01c999d49a0bb974c4e88116b7b05f1b5ec75946eb9a1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cf5969c951727de74bbd63ec8235ab5b1cd4bd699821419d43b53ed7ea01bea1
MD5 65e7d87f161c6e531be8a4b00d1962d2
BLAKE2b-256 6dc01371ee8bd9fca09c9975d8355df066092b7f98d115c9f62064ba6d2f6509

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 18882a84f34df25afc173752d9158cef1006fd0de5173e26b4f2a528633ac7c2
MD5 a4edf69bbe4aaf81db9063a99fa1fe86
BLAKE2b-256 e4c3668d628f945c1d02032ce6e132ac5a2bc54b3c90ba6f291d537e665593ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0af08ca787bd27ca493746a7bea04958142a6e976cea6cb1c672054d43c2946f
MD5 f545e751551f92aca7655c55d5e95657
BLAKE2b-256 5ce034ddefc9074b6cd64a47cdbb3744404379f04f259c4b1e59f706b25eff3c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a43db1a9169a9603876126e1ae0d27ca4ce3d33b8595f16a7f2e0712b1b50133
MD5 2f1c628d4e5878cad27919092558ea3c
BLAKE2b-256 c8cde2f78ddbb361af4496d4dc470b7f8d63294188badb6cc9e5ae2b17eea172

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e4aa9bf48e29bbac00a984bb5a34ad01de627d33baa426fe282bbac0f9a4d6d2
MD5 0f35b1d201da735cedc88d7c0c3380d8
BLAKE2b-256 d8a403e8601be632c5eb155a60bffd951d8414c99328d2faa1e367d9ac91f36e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3bb30457efc54b33c16a912ca13306c860cd232a162d4a2ecccc85cbd79658b6
MD5 a3a11a12ad659270b742bc0c0c7cabc0
BLAKE2b-256 307f130ae80bf814ea112911e62a582b7b54bfe97cb27e9c42fe40060db23d01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a4681f82a5af8596ef77a5066aedc06a950d36e0228b3f226f736f375ff6c926
MD5 a2a80a2a0da57c66ea16def8f908cce1
BLAKE2b-256 403797d38b5fca6bff7b5fad81897daaf5a79dfbed94373fed0d6f19b297be5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 96a27dee2cca82d4d7a3a71ecbcfc2b5cafa914f049b3119d845883a8320e832
MD5 c3bc8764123821538a60321f561f21e6
BLAKE2b-256 ba1ad757e7a2454cd73545f34cd977fb640dbcd94fb314bfc187ef641c2ea9ab

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 20be9865d22991979b8f0f4d0765892411fd09386f4e043d15c010732d0b64ab
MD5 43b0181d383a4c7281f9c393b2da31e2
BLAKE2b-256 beaaec0eea384ca5fdadfda70169a66cf0faeddf06c6f278ec680c57bdb9a3b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 542dc54515f644a30e346c0d17b0f31f4307e3e893bcf6b262a5385ac94d9c05
MD5 ef15a63cf8b5eba8291650a72d79873e
BLAKE2b-256 43f7d9dff33d1a84912d52d0e08940db3b0a8a5a779db40933311a9cfae8a2f3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3a51206c83b07d00dba9334af7cfd1571050aa8fdf041d90e5e8edd66b1da5aa
MD5 d87739e147c469035de697476f744168
BLAKE2b-256 5d9e82da5242fc9f27e4f87a56c6387e4798c8083f41a986b18519db9e0dfa7b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 cc27e138b0f2fe71e0a3ed134e41a65fcc3eaa81a0c92e7dfde9ddd57b4d5b17
MD5 068f88ef51bb9846dbe077242ac010e0
BLAKE2b-256 eb6cf25467448138b83ff5851de90f97d257d3cdd40c0250b63b26873daa1a62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37c317a3f441f33ac8eb18a170ef7478eedf28e7b492e71dba838e76743030d5
MD5 5de61dbe14ac45c5518ab6d0292bd6d9
BLAKE2b-256 cb001917129c0b81a2cc280047a510030331f3167e42769aba6752768d5e30e0

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