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.0-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.0-cp314-cp314-manylinux_2_34_x86_64.whl (971.9 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.11.0-cp314-cp314-macosx_11_0_x86_64.whl (821.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.11.0-cp314-cp314-macosx_11_0_arm64.whl (727.6 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

desilofhe-1.11.0-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.0-cp313-cp313-manylinux_2_34_x86_64.whl (971.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.11.0-cp313-cp313-macosx_11_0_x86_64.whl (821.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.11.0-cp313-cp313-macosx_11_0_arm64.whl (727.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.11.0-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.0-cp312-cp312-manylinux_2_34_x86_64.whl (972.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.11.0-cp312-cp312-macosx_11_0_x86_64.whl (820.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.11.0-cp312-cp312-macosx_11_0_arm64.whl (726.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.11.0-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.0-cp311-cp311-manylinux_2_34_x86_64.whl (971.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.11.0-cp311-cp311-macosx_11_0_x86_64.whl (820.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.11.0-cp311-cp311-macosx_11_0_arm64.whl (726.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.11.0-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.0-cp310-cp310-manylinux_2_34_x86_64.whl (970.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.11.0-cp310-cp310-macosx_11_0_x86_64.whl (817.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.11.0-cp310-cp310-macosx_11_0_arm64.whl (723.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5804fa100785a953ae37551fd86dea572909f44e48819679a7ae938e769dc3e3
MD5 71413337a5952de4f79db64df3026157
BLAKE2b-256 c8dfd879fd9e07db08c889978a0ba0f4c7b2c02bbfe30bfd6457bcc1405e1fd8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 de3b4da090a42f6769703a0716909937b41deef784fcb90184ded85ad2e02d8d
MD5 acec8333fb58cb015ca23f18f1376c7f
BLAKE2b-256 6fcaca16201e0ef7eeedb2f7fc39a6401235459b231fb18d5dd27ad92b41cfd5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 3e07aeb7c2cd540f7e2679d79ed4b5f1802ac8615035c9cc629d1099b61d54cf
MD5 846e9c59bcc6a4ee04da6de291d56dea
BLAKE2b-256 79124a2b02856c58fd746941a05103ee4be1ecfe2c0b22b00104e655d7a73882

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7f832ff00c0dcd0d3ffc8de342cdc026d10df389bee242937f9dddaa94c401aa
MD5 f7812c001f82efadce5a4f3587f8edd8
BLAKE2b-256 026c4f7f7cbdefca08d1c642f8a5aefabd9cfa1dbe57118a3f1fa94451b4f411

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9ed07806b5f391bc99ab63014a132ee9672bf0debeb8b55e952bf203df09c7a0
MD5 d984d9e574285ccda8a17050ce7dad1a
BLAKE2b-256 f57209cbfaeff92d02f10fa0f865cf020cb6c400cfbd76c5a36fe169001a8626

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 2dfa28e30455d0c07284e785ad3212482a00d9b247aca76b49f22d01802c558f
MD5 bdfbba5e391c491b9241881bca605358
BLAKE2b-256 e19e0a2a009adeba0d5df99cbc0a26c7d6e5084638924dd957a1afb858f73c51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 63fe1d36af69ed05f520f59edd2a419be2b4fe794c122d643dfdc4fb81a8ce56
MD5 d9ed936d7ac8f833f6e99c5ecdc9ffab
BLAKE2b-256 92e2810ede41d38d96380770d2de43cdcba6b376e97efe002c70de99b2e501e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f92775030395b8c12f50e1232b7e6aca4b3e66eaa5d9605687e27f85d2f214a8
MD5 f75751db2993abdbb6d43b5cd5e1fabb
BLAKE2b-256 7e75b26423e26db7c820430e378cadcf51261e4f6c37e3bcf745a53faf9e9b9d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 dffd5bccc43ce7c29e492484e0610ff159d6ebb28950769af19575d2e2c503dc
MD5 02ccaa2a86c869893ff98a577bf0fde8
BLAKE2b-256 0fa17a43ee3fdfc33e37ab9ed4f7ae27983c0282df0fe7f2ecb6211f46f80dfc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 8c21ede9e2601dbb9465f597af3c208a11517c1c8235fc50cfcddfffb789c7e3
MD5 978cd8c7aadf32ef06f3f2d77cbb667a
BLAKE2b-256 2a915a4c4e11eef9b7914ae58f6b17d0507623ebc357621a6d73c8bc5a63d16d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0f47cd4a93e40da890d64a5cd5fec7fc4d52923b6b6317775cd07093f4a24a76
MD5 161998af9afb723ff45b3cab914ffa39
BLAKE2b-256 9fb3e54c913f2077f50dead0d23930261bccd348e47d6e5b56d92b5b1ed2e2c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 11d6024a84fb715ba9949371408a7aff91b4a02fdd8dda539d7c0bab94d7b675
MD5 5db2cbff80c477464ebe7ceaf8c4d431
BLAKE2b-256 4062f8ceb5f46f3e0df2f2399b3c0691be61b80b14c45c0b1cc3d8731740e153

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 57ad1018da6d29c602c4bb5b58dd6c121280fd354b070d44308f59e9aa81d828
MD5 9cd3538c1606a13c289629a1c1dffe87
BLAKE2b-256 41d894dd79490a466780407242f2497d02e30baa5a89ad379c68a1a1d3eb9312

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 3a856d4e8e63a3260965196804af52a05d27df45daa2988b727429eecec63c14
MD5 51dfcbc2111e7da868ba6d11a795068b
BLAKE2b-256 892d9f48999a3bd6f239b6edd0d15190b262de2a47452577bcc9feaadaef9969

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5843470108e6c9d78c5bf1fd933a5c9b82d28edb85c0a216096134b2ee4c6ecf
MD5 fc98471e60d1918efea500024ab02468
BLAKE2b-256 9d6c7bd814769c7c166c5d4f4564057571901bde3532fb5b9fa6b22e43a1c74d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1cbb1321e97fafb1b0d8171cb3d30f0b441d27bde68c6ead062d740bf6f21097
MD5 93827a2f6114c58cc863436c3e68076d
BLAKE2b-256 85bbea03703599fbf7da5befe3878325c1dafbda488e4cffa6e34a4edfcc63e2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b2fffd8f6ab767d60c9008beccb86f0d4409d97067ddbdc74d72b49e7e4b6a1f
MD5 397afbe70812390938f08ba78c339f3a
BLAKE2b-256 47c3b15518f04141b7fdcbe200bef018e2e23eac7f0ba711c84c46e623df2786

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 896c714b556d51af743fc66d3d62811f1c108e7cd4d6ad420a54eae8e22873ba
MD5 1376b016a6d0ebed2bcd164018f6a680
BLAKE2b-256 7d2653ba07637d40239eea99d3fd7c10852445a216865e133c938cdf9f137723

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b65494a2c8b6da03c461eca8300493f1421015dff181b78a0c78da1dbb548fe8
MD5 1166eef1961403b7675ff3fe463f6cbe
BLAKE2b-256 65257777aeb213d4946faa823f0f775839b9ae953b67aac0e8775a182d5d2d04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.11.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f3e8e6c542cf95a6c8c1d12eb0b6045ba6432eeb4984e840efe19c6f8f4a583d
MD5 ffc99224c52332c024608063ca75ac03
BLAKE2b-256 622e9b96c1c8456142013d05ca164f899b6cf9621380445938dd26d3a44f1e8d

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