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

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.13.0-cp314-cp314-macosx_11_0_x86_64.whl (872.3 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.13.0-cp314-cp314-macosx_11_0_arm64.whl (773.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.13.0-cp313-cp313-macosx_11_0_x86_64.whl (872.3 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.13.0-cp313-cp313-macosx_11_0_arm64.whl (773.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.13.0-cp312-cp312-macosx_11_0_x86_64.whl (871.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.13.0-cp312-cp312-macosx_11_0_arm64.whl (773.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.13.0-cp311-cp311-macosx_11_0_x86_64.whl (870.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.13.0-cp311-cp311-macosx_11_0_arm64.whl (771.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.13.0-cp310-cp310-macosx_11_0_x86_64.whl (867.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.13.0-cp310-cp310-macosx_11_0_arm64.whl (770.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a9034474ed06b3a45db519ce936b59f8a447a34686bb17fd0b922e501ecf2924
MD5 d94b7cf9fd78822e01dd2e2c8de714df
BLAKE2b-256 a879186de3f17e18f50f1579908da11612ee69671407d8f21d0e307fce10fcb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 688c26923e2501fa4106d4bc988747c670163a210d87523a682cdf846639aa79
MD5 908a7a2e80f053d81f2a54a9e8eb79cf
BLAKE2b-256 397083c961dc53116aa70e6d7455a86212f4c9f0a13112dbc5c42ddcdcd3a46e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7245507009d392304ef57f4ece7423582d84dd8275009bbeafbd9699c5c68026
MD5 a6fcb73acfe0fbb66f8addd62880e751
BLAKE2b-256 20b21005d239197ea18bd4391aec453dcf8070d6e3dd4c9f4d1b61f72edcfaed

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 555f16e259f67845f7d4943e34df36db265adb50adfe9ca1bb7d5acc2196a5e3
MD5 540901b9ff17a9f197d6335c37c56fd3
BLAKE2b-256 c79cb14b1165e2e78853821fad3f640c6295945130689889d86c81cbf283e0e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ee2d12673aa61b9aa20dfb5a196f6af797206a75209d4a3dd40add5821abe786
MD5 63a9f8d5aba63790f3757aee054f43d8
BLAKE2b-256 b27dc3f8b3c240a03c224c3de414ce8f34300ea1b1ec7f5bc4599119429fe621

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 26daf9a6c0d2c5d6af5c60d95ffbaf9d3c0ab91b608fd008793ddd5171d1befe
MD5 c08a2e73d6995f318bdf3b3e7d19eb0a
BLAKE2b-256 fa35a6375a80e9bb080c77fad42d6c12d48305c4efc2e1107fad78e5525e85a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 abee77461347c7031292a34a8f68a4c8a1343021a2ee342fe63de06fa0649194
MD5 355a58ceedf932b518a1c636d977c881
BLAKE2b-256 65d72403ffb3b71ff65ec17a136492d2c219e40bb9e6b9f8d973926dfac81e17

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80bed19d38d49a4c365dc7ddfa8b2f83e726d104d7c611c10df95e4476c8b6b0
MD5 62984d883dc6fe58d6cd6b69055dedd5
BLAKE2b-256 859b4df2ed90c5aa89425bf7d6d46650f9dcce67aefeae4738a6a6dd27595e4b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f9c41814895ceb13887b2d2f760bb0d88c6817414526fe142b3dde6c888821e6
MD5 0ec61efe8eac60f58099a1c9ad1ada75
BLAKE2b-256 bcf9bb2be5606c08f6c0e5dbe8f9eac346a37449733abc73e78464332d84a285

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 784bbefff640232501e8b34fc7e0910df40b81631668a77cf87922ffe44fb55a
MD5 a3219961d21c5f1c862a8970535bb018
BLAKE2b-256 a7eceb175173bce50f001bda026c6ea0249ee1b850fca3dbfeb20b3c7e977919

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6cdc188b21943b92b5f8e93e8b4598be3d71f0fef71fa423af6cc2f1606aa08b
MD5 772c68f67fd32cc16351ed38c72851b9
BLAKE2b-256 ff7f848686a95ec8b8b18b4c3a9dc31f27651e820d9130a65397f32711b99a30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1628d12ced633da6c35564dd8658ec0c73352c6e6f21399a494726e4ece3696a
MD5 398247b6b4498936ada57b9997d7f940
BLAKE2b-256 4e9f002c2dc00aeaff78a65c396977ecd75493f7e28f83173b1ca833d0bd94b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 671be7c7d1b5a3d067e2836d2b5fd9168d438095aef02fd42a9a40d711f4330b
MD5 e91905b8afbad043c3aef3eb9aeaf2e2
BLAKE2b-256 ce6016f5fcd97d76c0b70cd0bc9b614d2d080f5dc4c32444396184cb84e2f641

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3cc00cfcc55921746f8e928ea3ed93f497f45aebc826e9903c99c30d3d020907
MD5 70d0eb83f865fb6ac034aee6caecf2bf
BLAKE2b-256 a98749bbe52746328e3edbe693a55ce5c5a8f6a60031e940ca1cb6a6ca4104b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7daef6cca28887e7a33a69759b33294f7f952fdcfca408c8ef31ff326772bc6b
MD5 600274670610929d68dd92d72b1a019a
BLAKE2b-256 d15e548b67781335e9bbc904c12a9db1319ae7aecfd8eb0031bbede0ba90281e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9e0d1badac3cdc0ebdceb204be413f4017fd53ae2ea3da38053cb52562f3762f
MD5 c01696cef2b212b1c5edb0b2d90fc791
BLAKE2b-256 aa14ef7cfcdf6fbd6929a71e3917f0c37b09b2a62c8c6411312a205c0a9c02ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3a06b963935bab6a6fa105bc240aa45f10668bfb66b5cae7f56e1b0244a362d8
MD5 2ccb5a25855f522b74cee5b5bdc3ad35
BLAKE2b-256 63c9cba5cd20fea684274a5b61d69cfb9e9b5f4495a425b758f4f4419bd959f9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c3366a6c088af35f41784c4fba34827c41f05055beb059e38a88967044d19427
MD5 e29c42e1d6c9aa29cb49a3f3008bfef7
BLAKE2b-256 4f507864b6bab88474ecd807ddaf25d48923b49b142e8bc5eb6a20b309eafb01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c4c9e9662ea658dc7774d86c261711a32fc25eeec16c16921dd58ca7a1b77c15
MD5 cb9986769a9386a1b111b03169d8af12
BLAKE2b-256 99f83589ad4ad52bb05725a09aba0d4277089c52fca5a5e15181df48034921dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.13.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4b05f2965dc105274841957838557c1edda1d9ad76fadcbe00f0b8154db3f8a9
MD5 08a2f2c4093beb0312c82d085e1f1991
BLAKE2b-256 9817e9fc1b2dbfeea90aaf7482c096ef03eda1f1acad7e22a336164c3aeed7cd

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