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.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.5.0-cp313-cp313-manylinux_2_34_x86_64.whl (583.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.5.0-cp313-cp313-macosx_11_0_x86_64.whl (483.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.5.0-cp313-cp313-macosx_11_0_arm64.whl (426.2 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.5.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.5.0-cp312-cp312-manylinux_2_34_x86_64.whl (583.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.5.0-cp312-cp312-macosx_11_0_x86_64.whl (482.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.5.0-cp312-cp312-macosx_11_0_arm64.whl (425.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.5.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.5.0-cp311-cp311-manylinux_2_34_x86_64.whl (581.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.5.0-cp311-cp311-macosx_11_0_x86_64.whl (482.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.5.0-cp311-cp311-macosx_11_0_arm64.whl (425.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.5.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.5.0-cp310-cp310-manylinux_2_34_x86_64.whl (580.3 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.5.0-cp310-cp310-macosx_11_0_x86_64.whl (480.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.5.0-cp310-cp310-macosx_11_0_arm64.whl (424.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

desilofhe-1.5.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.5.0-cp39-cp39-manylinux_2_34_x86_64.whl (580.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.5.0-cp39-cp39-macosx_11_0_x86_64.whl (480.0 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.5.0-cp39-cp39-macosx_11_0_arm64.whl (424.2 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9f8145a3742003a565627442cbc7f17f7a51a285a29d9ae10fc277d62df0560e
MD5 6f800aa7b71e6e14807d1892f5b78402
BLAKE2b-256 8c42ad28b66e39bcb22f29e1e206817415dad6f7057d0defcbeb1f3566aa64db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ff3cda461e2a40dd21205e1070528c139e160ca540ce42f4e518ded98f7ea72d
MD5 c0d916b59feda023ee0dc91200f71dec
BLAKE2b-256 25bcfcd6a5fe41a52b0a0896a5ed26324a0a72cf3db5b5c6495f16fc32a2e4be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 615b3a2a19b3f1ddee1db301561c9bf083806514e006d1f2cc3fbc5542fcd0c0
MD5 0e953ed0aa279e5780fbc1bc0be843f3
BLAKE2b-256 4ef11cc1d84eb2290062e8c8f83316217dfb601f4fa5d71792f13940839be964

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6d73b313b2b176df0ed3c0c9bd06892c84233f309cd8a39a79c10c0af900d4af
MD5 2668f27961c58cd8e31f7d2a4df9456d
BLAKE2b-256 b4f4555d2e8b79406241271345e5c7424a28c4d954b97d921093f717e00de44a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 d49dc55efbd1a5fb41714557a8c23e90947ffdd3e32ac56d602f642ae3b5e630
MD5 408652ac6d2dd26bec5167067f145a4c
BLAKE2b-256 aaebaf27beb8038674794a5f04f1c862af1ac4741141dfe8d0226a81a0d77c27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 7eed4d5e14f024270c6e3880b225017cea2099afb17a47b0b4f90ddddfc378f0
MD5 084248d6e00bcb331f171423507f4695
BLAKE2b-256 93e2b89df0b4e4c00a0a1c6df92d6e3f2dc0559212908f0f095be0ca4e32e8c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a8f0388f898e5d68e5b7642a1415954b30ed2265fd692f024b4029959fc86e1d
MD5 55daf3b8a7c5c498d2b45b2d30bd3708
BLAKE2b-256 13a77e96b8a2fba9e706321bcbdf95307c9d83317f2f2ce76f6ff9f83a6675fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fd7c7150785bfb8223b30d5d26b4b9b4742bc25d76f9c3606db6881540e85ce9
MD5 5dac95210abbee1f222e7ad1115467ac
BLAKE2b-256 f5542fddc46b7dd077e70b8401a47038b669de9997bb33b5054e2ead470b4ee6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 b803b3545128d04e9af103bdb04f0d7a32affd126b9f17d5ed96a3e3f455e438
MD5 a196ea7f4a95ca9f5194d1b7b51bbaf6
BLAKE2b-256 eeaffc25443422256b86afaf648ec4dcb332f153f069a508b49784ebeea6547c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 067de25c3c9cb24dec649f63abdebc143ad710c0c1649ae939c65965ad417f0e
MD5 d505ea16953de302f954d27a8a8952dd
BLAKE2b-256 af144ccf2b0fab8fa5f8904c45fc00e6ad680dfccf0e9814fb6ead3849e452fd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9fc26e76f1b114425734a43acdd1bc1d0373baf14d3d2f0f5d504f30adf3580b
MD5 92638f41db760cce5778a93a804aaa0a
BLAKE2b-256 7ca848057a60363d8950a256e5316b855bf8feb8fe8628e6e519263909d209fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a4bda9598e7257914c5354bc1fd2bfe561c71a3595a4b97174580d6a3e51cd35
MD5 2006d0c7cc4485753d7ef6e837600a4a
BLAKE2b-256 ccb56574deb92bb5ba707332d839bf299d481cbaa9395735d85381d99ecc5f30

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 6ab2e8570e798299ecabc9f773d832de74d43c570c611e0bafd9b133788a92fd
MD5 13d7253ea5a73c7aba21449cb792019f
BLAKE2b-256 1a0894a927f44edcf53613a9a3ba83b1f755f6aaffe3d102e9796a135d4b0140

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 e5fd0f00ae589ac2bf70035509a921dd7334267b161e0ed2e4d9fb337a41db83
MD5 fbc9a8b1f213d935fbc3e9254fc421c4
BLAKE2b-256 accf7224430885e945e8216c3d043ae78f6e8f9aef711e7d5e387f050a8b109f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 03330e356dfc1255910cf2eded99481c58d1ecaaad5babfad188b3824c466914
MD5 da04fe6276018a18bfef9cfc5697341d
BLAKE2b-256 6c0944865062f74be186609eb77f17c5713fbb862b668366b660bd048a5aead8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0449b47848e74ded767513f0b69534e8718e067b5bb23997c466a67d4f9da27e
MD5 119d58f7034cfd84b0e0228b5337185f
BLAKE2b-256 2955dbb3d6983bae76e534299d7002da5e627cf64d43766c548f04b0d205c7c2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1a43956dae34fdc38a28f41155d55dd6fce4ad0f8b67313c62c7f539a6873b02
MD5 b40979eb16b026b3ce5fe56444985b8f
BLAKE2b-256 d8f0c6edd3c9bfbbe2e6420da08cb5daa2847da35e7f5825ecc9b3a342b8ccef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0a31eaeb5725d64b7f8c2b92e5b6391ab636ae8849a2f2a06dcb98586b1664f3
MD5 80e127bddf8aee80ff27314ecc5d1fcf
BLAKE2b-256 71a68112508740a9501844f6264235f6e447a21492004febd8148ae7561e378a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c827f28d3eaad52bf49d8e173ad49db62c9f2311cf10f82314465f59cd5fa923
MD5 21554ddbdc88dc6e6f6dacd3702ddfc1
BLAKE2b-256 7705c4a34f25a7404f8ae04b35c5e2b345413cc98fede4dba666131fd674ee73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.5.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a1cd29842fbf366c67310fd7bc84a6f3a0fc285ec361079f48b4120ccbd588e9
MD5 599a414e6df4a95882d604b6088e03f0
BLAKE2b-256 624f642ebf0c190548a6f3ab2646f5c349aebeadce56fa81074d781ed814f9b1

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