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

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl (543.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.4.0-cp313-cp313-macosx_11_0_x86_64.whl (461.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.4.0-cp313-cp313-macosx_11_0_arm64.whl (405.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl (543.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.4.0-cp312-cp312-macosx_11_0_x86_64.whl (460.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.4.0-cp312-cp312-macosx_11_0_arm64.whl (404.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl (542.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.4.0-cp311-cp311-macosx_11_0_x86_64.whl (461.2 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.4.0-cp311-cp311-macosx_11_0_arm64.whl (404.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

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

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl (540.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.4.0-cp310-cp310-macosx_11_0_x86_64.whl (459.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.4.0-cp310-cp310-macosx_11_0_arm64.whl (402.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

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

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

desilofhe-1.4.0-cp39-cp39-manylinux_2_34_x86_64.whl (540.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.4.0-cp39-cp39-macosx_11_0_x86_64.whl (459.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.4.0-cp39-cp39-macosx_11_0_arm64.whl (402.8 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2551e3729dfde5bc67a3df726007d39be051661fe2639bef190113b71d88daf7
MD5 a20d7bfde8942aee02704e01ff4d64b1
BLAKE2b-256 6e5471f309262d071907d025901de4ed405fc53680e6f0b5898dafe02fcc7f01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 00f350dabe1a010cb8f2171166772737c492e30103fb4dd79fc6b356eee2b709
MD5 78fcaee785b3542fea1124cd52d976fc
BLAKE2b-256 74e5c00d2667ae604821914de2ea7c84680327ae2bf77cc09aa60f2452e35c85

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 b7512d268bbc9ddd3a6f97ede83ef9e899d9c455027f624166a2509d4bb887c2
MD5 2b32573feac7343a03f8450bfa041f16
BLAKE2b-256 79797aabf84d4c75d693094a1850bb2a5638c2a1973b522c313724b7e2fe2b5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b18e6946bdcf06e8369f90c95627775b633030e31332596b90aeee03aedc44f8
MD5 410688f1505abccb5edb4a7a570e77aa
BLAKE2b-256 0a0659d728cd1babb693e0874cc8ff0f7b35a3516cb1a09adecbc01591257978

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ab06c3c81350bfca50f0dd7597676d4e4094213b2f6ca4d295b83c5d95181a99
MD5 2d4e053891a9dcda029b7942cc8d2d1e
BLAKE2b-256 bdd527eea563d63286d0752b46edc20a6c7645bdd8c809c0afe56b173f383d1f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ff34d49f41d57f8f66e442bef75ba5d1bd9c222581a9de53fb57c3b7c245fb2f
MD5 b2d5ee835273d221d3dad556865b2a70
BLAKE2b-256 dd736b0bb9e09e661e14c1546865237aa925f1b3489b1295946677d5617d8036

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4c7ebbfee0acdf868b6e79b5df8acd4893ba60ef198ea8784e82132de10703f1
MD5 d55c2c2d2ea3391f6a060f8e03107816
BLAKE2b-256 e9b57f5aea0a0ee32ff199d6fefbff910eca368ddae0b2242c28e8e89899250d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bf219306d848e927207996122946df29bb3d6f5d8575e5852eafa5552cbd9d16
MD5 4fbc4436c7a24b235be742b0a8a21492
BLAKE2b-256 678c09512efead23323aeb9407cad63c670270c75e54909dc598d5eed612ec20

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5bced18db0215307ca8ca437cf88b05430aed728cac890d0819974cfa6c18b65
MD5 c25e931c3a3ca207efcb995e97e2c216
BLAKE2b-256 9dcb526837e2105d877b8b3ae51f1c1d7d57fa75b56bbabf784b463e7d5afa68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ca96f671e760fcf9da88bf49eb3295c7897247468c0d9ad8e3ca4f0020eff8c2
MD5 cc2cbfef4900a29a4d1fc1182c2d36ec
BLAKE2b-256 1bf172be4f0c8fd39532370f94d92f4f97607e0bad29447df79e2e9365c74beb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 fdada6859c932e236589fde10368ccbc59f1a48a679ea42aebbd430df294c889
MD5 5765cc354e6734715fd36452328cf8bb
BLAKE2b-256 e1e0c234c01cd76b22d0d87aa622c10601dd63e3bd1698eb576ad6dec1a094c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c062931a0078d5656087d0f2bc44eb16ed2187e94969d9086604bd54d8559f30
MD5 4e7815676cbf954c2479fe740acef54e
BLAKE2b-256 299c430fc8711686ab5af0f977fb43450dc3a45074b07fdf1caedea98e7ff924

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 e2d6669c13b86b95582c7ad0d2a6e04ab7eb39b3cde17805c32cea653c2bff3d
MD5 e8e6a38ed09ca27032143761ba0bba46
BLAKE2b-256 8bf56872658d02c6ebe6026f39fcbe2816200f9518acdf242ee4def3bfc38fb4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 29062a78b3bce5d35ba971b2b755e7451fd96b9b60597a59e2986905863513a2
MD5 135b5cb7fa88eeb8337208ab5cc89e2b
BLAKE2b-256 765db3c45e003784314e6e7c45d60aca30c3b9094b71324e035e4e1fc32601c8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c365d1785fb5b92e6eca8f5bdbf713446345724adfb5ec53fd4a4dcbefab9b0e
MD5 5748f37b5188b3795edce67c9ac796e5
BLAKE2b-256 5a64e32542eeba3d6f68ae50f02fc0f4900a0aa27eaf859d038f122f1550af19

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2186ebabb54deaf3777c242c221e8fc9c3ade6b92124ed5b0839db62829ad6f9
MD5 9f029362a968c654df56ed6840fba70d
BLAKE2b-256 cd1aa66d6e084d220eea7af63374be3b58b98af5bc2fc32046ffebe2f55f97d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 efa632564a7becf659ca19187b47d16baf9bed0a205ad0bdf22903b351d666db
MD5 a823dc078368574430c58e04d99bf66f
BLAKE2b-256 bb8f036426e922b5ffdd1b7055d62adacb5777e9f646fec7bc9b1fa5c480397d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0aca4598f7e45ecd42ef7dee727b6a50fa587d96a64d9efb6b2d922f8c4db573
MD5 15ac6c52634cb60fb04c69a29692011f
BLAKE2b-256 93605854ca10453dcdc67a081beba6fb5ee3adf194c28f1c7d5fbab757ca01b9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c782406d6e2a904f3fbe7cc78a6128da1d8e72f050de10dc10ab60037fce6638
MD5 7b9078615b0e5d63de98dda794300412
BLAKE2b-256 f2bd9b5cebe9c938319032f334d38621219843a7dd5eba0b0879491720033219

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.4.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e3cc9ec4dde3adb79c15769e044990f34f2386995268cdd4069c73a7b1c4caec
MD5 e20fdb87b91c1c0b798f3aa0b48b6668
BLAKE2b-256 2b5f4077ec0227148149eb87db1ee9b9d069e6a4fbd8ea163515bc419a4e4cb0

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