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

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

desilofhe-1.11.1-cp314-cp314-manylinux_2_34_x86_64.whl (973.0 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.11.1-cp314-cp314-macosx_11_0_x86_64.whl (821.5 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.11.1-cp314-cp314-macosx_11_0_arm64.whl (727.2 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

desilofhe-1.11.1-cp313-cp313-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.11.1-cp313-cp313-manylinux_2_34_x86_64.whl (972.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.11.1-cp313-cp313-macosx_11_0_x86_64.whl (821.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.11.1-cp313-cp313-macosx_11_0_arm64.whl (727.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.11.1-cp312-cp312-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.11.1-cp312-cp312-manylinux_2_34_x86_64.whl (972.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.11.1-cp312-cp312-macosx_11_0_x86_64.whl (820.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.11.1-cp312-cp312-macosx_11_0_arm64.whl (726.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.11.1-cp311-cp311-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.11.1-cp311-cp311-manylinux_2_34_x86_64.whl (972.6 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.11.1-cp311-cp311-macosx_11_0_x86_64.whl (820.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.11.1-cp311-cp311-macosx_11_0_arm64.whl (725.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.11.1-cp310-cp310-musllinux_1_2_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.11.1-cp310-cp310-manylinux_2_34_x86_64.whl (971.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.11.1-cp310-cp310-macosx_11_0_x86_64.whl (817.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.11.1-cp310-cp310-macosx_11_0_arm64.whl (723.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0b5ebdf34e19f9af8c08c80b4df7be285eb62c8b78f2824ba2e92e61adf64dc6
MD5 2e54fa15d03c94a8489d5cdcee304b72
BLAKE2b-256 2d0f1cc86f737ea1b271d926d8bf4965224f1e196c8a504879e20da18db36fa7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d79383c3c9533bd116fe4214f61e13c75ab0fda0e47291e1dd91c33004d346fb
MD5 786fbe4e0afede73bb50b0d20feaf98d
BLAKE2b-256 2827011de25b185636b90bd0f04a1d255b0b4dc93a4fbbfcc9ab52525ed801d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c794802468f5ee774f10de9bb1a3f87fb7241160147ed6c33ef9b00ca51c9bcf
MD5 dc051e9bf7fefafc696714dc4b4bdcd9
BLAKE2b-256 5e8acfc3e9c14c127e699674f0225565b2e45df6bf7f7c8ca3204f7ef415853f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c84b169bcd3acbbefc81595222d24ebc83623acb36969dc127afbbc6ba949ff
MD5 85512b4a7c3328dced8eda603a46eb6a
BLAKE2b-256 81ad9b3b07e7bc83cf1b72371c880143b6e063d15ab476b77f0fd54c89ef3843

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a976d70234d7269a8cdffed49eaa7b61336668a4f3d84fe56149936f5816ab69
MD5 b203f3eee44ed556ea921f17604f08b6
BLAKE2b-256 624c0ab7f6ce54a96afb505390561726ad4caba893913fee8d74d3362bda0cde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 a7638adbd05c2319680832b7ac9108637f4bbc0a25423e42bb7a06564d723f9f
MD5 8ab24daa1f3ecbee91a32ce511e6abe3
BLAKE2b-256 9dd23deea1e5250d7625e3ea47cfa1c525609bb609b80c55ba77f30733ede9bb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7da6bb2719484aa51c82b04213a60ab2b79acb3baa9b27da0e2de4ce128caf2a
MD5 5e254c970a98e6e513ee550b29752eff
BLAKE2b-256 432be99e0c4932caa2167c23f6a77b9188c22fdf65c4d9ede9ac3f53c4ce1343

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6b22ca73a9d90ecaea7fb32217eb930ac651ff24de1bda0eb7555e88c20a6505
MD5 097d6e3b36b0dc07d1d9aed25216676e
BLAKE2b-256 143ba9fe5cf80f485627943ff0145a8756e1b2409c5a61f584bb8cae2be46fd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 80c33e5712ff638a7420f75460bce6f0abb9097aa7ce6edce84719ea0a75da67
MD5 d0d6564fe567187539fca43be8d1a6c5
BLAKE2b-256 c6f7386dfd01d11e6ab86bc90119ebd1ee07924596ec59e028cdc0a6ec8d59dd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 57ea8de9af8dcaa60ba26595997d4c995990a90c1a515a34392421c28540611b
MD5 78c571e94569affd8a1ab3fb38107d89
BLAKE2b-256 b78427cc282cd335aecd89bb79213af34b56d9d456606037efb387082247f627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 8dcec6fd9c5d9dd4118c7fd4e304c9dbd29f180f26eadf425ba0617edbc8d9bd
MD5 2f1aa109ff8fd110a64a016fde3cbbd8
BLAKE2b-256 d7e6ee89997fab236b41e24e579b0f1044619aa7c1cb685ebc32f59976016828

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d522f9171c263f3ac871199528e9685047ae89519b773ec805852ee136bacc8
MD5 b122a2cc61e728fd914ca427cc37128f
BLAKE2b-256 bfecab5cf61f7c0834d99dce32b48d7440642d2116c25cd95728881411c01229

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b55a2666e1fcdcf284b5f595314d59fdf6a0b84ac592011aac8eb3febcea0e32
MD5 b16fc3971c917d5ff6b25de785d5a8ea
BLAKE2b-256 9cc9910613cbb46966a44e5b5558dda89de02f2af98be422cef3c9d6ce14116b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 405cf61696d0db034b1f656c231c784fee217304f219da7567c099cac8ebc535
MD5 e89c5d7a534f86653d9da21368a05e1f
BLAKE2b-256 52e9341bcd3fa2eed88a8a6282a969c7f266a352169a20f535ab6abeb2cbbb0e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b364c9ab419e89ab7b09dace05a65043fb2777b82ed920606a4f926b0766a01f
MD5 a4aa0908a2f94888365d7617c687ef64
BLAKE2b-256 f1e43fc1a66cad18b5c1c2f67a9521a603cdd3ec403bbadfe6f94defc6b92ffa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ba5a2f9870b48c721e6c5d7b6f326af10c5e9ab44bccf1dd3a70c016bb3fadaf
MD5 0a76f8d66ef202cdeed5ea1cfdf9584b
BLAKE2b-256 9be487d73792a1d6d6786c814814d23e87d9d7eb97387b289860be72adef671f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b3c8157e3c0b557b9507c64df794491444abea3afd51e97d44ed1bb75507a185
MD5 5b15e53510fe7d17fa661a7837303784
BLAKE2b-256 e3bd7d584d86b135a2a3e83fb4c6581e72504b820a6cbd83ed205b12abb423cc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7cc7ab5f1ee19d4ccee32b83fa0f580644a5b35f8b9040051f4180d0824db7f5
MD5 5dac1075fa175eaf8508708be2ae6acd
BLAKE2b-256 72fbe8ab35ff4f2679461eb42c61f125e63bdb5fe1dc7387a2aea1d874076d6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c7faaa31e356debfc599489794a281709ea40f5974817bae2ad04a2193d23101
MD5 f93b5592518d03fda16efadb9cea354e
BLAKE2b-256 3864b9e66fe969696026336b71112536115359ae40bb2dd55435f71cab27b561

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6270cb1e41e203e9c1f0a53bc17d6cc2a9e0b2667fbf131984580fd2bef3c557
MD5 2a83e0bef6e733ca499fe46117e65834
BLAKE2b-256 461f13f2a664f1e7a7eead076cd0d77af87f9067770607654b66e77a194e8629

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