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 require a public key and a secret key, respectively. The public key is generated from the 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()
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()
public_key = engine.create_public_key(secret_key)

data1 = [1, 2, 3]
encrypted1 = engine.encrypt(data1, public_key)

data2 = [4, 5, 6]
encrypted2 = engine.encrypt(data2, public_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()
public_key = engine.create_public_key(secret_key)
relinearization_key = engine.create_relinearization_key(secret_key)

data1 = [1, 2, 3]
encrypted1 = engine.encrypt(data1, public_key)

data2 = [4, 5, 6]
encrypted2 = engine.encrypt(data2, public_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.2.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.2.0-cp313-cp313-manylinux_2_34_x86_64.whl (490.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.2.0-cp313-cp313-macosx_11_0_x86_64.whl (421.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.2.0-cp313-cp313-macosx_11_0_arm64.whl (369.4 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (490.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.2.0-cp312-cp312-macosx_11_0_x86_64.whl (420.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.2.0-cp312-cp312-macosx_11_0_arm64.whl (368.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.2.0-cp311-cp311-manylinux_2_34_x86_64.whl (488.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.2.0-cp311-cp311-macosx_11_0_x86_64.whl (422.3 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.2.0-cp311-cp311-macosx_11_0_arm64.whl (369.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.2.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.2.0-cp310-cp310-manylinux_2_34_x86_64.whl (487.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.2.0-cp310-cp310-macosx_11_0_x86_64.whl (419.9 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.2.0-cp310-cp310-macosx_11_0_arm64.whl (368.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

desilofhe-1.2.0-cp39-cp39-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9musllinux: musl 1.2+ x86-64

desilofhe-1.2.0-cp39-cp39-manylinux_2_34_x86_64.whl (487.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

desilofhe-1.2.0-cp39-cp39-macosx_11_0_x86_64.whl (420.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

desilofhe-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (368.4 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ee8737e651a9bdcad2b75fa363663c0da279d04a31badebbe5bec693000b907a
MD5 f0bccab06e88ab7e5ebb186b3402ab2a
BLAKE2b-256 8d0850ffb07d343607d7e85ce2613a7bacd41a89b302e79b8cd7cedd895d38b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5de5e25dfe30f2c7624cf0f5b71210390d091a41df8afc4aebfe3c153829b9e1
MD5 0fa6b79e0c4397540da208028e06d625
BLAKE2b-256 9043bc82fddb8fa16e27f510ff0ade8785d03ecc8536ebac8c50938b6b089507

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4d31077b37058f23ecf5f7607db3fe9a798ee5f92b7c340e3e60da4ddb4f04fb
MD5 8b3de70a5a21ef2166fde0d914b73744
BLAKE2b-256 a47a5b7552114edf8832a09b21c81ef56dc1d9b311e825ea4cdf0cc2cb169815

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d7c5c545337383da90876678abe3c54428380c9d16877e236b10ae70bbca2d9
MD5 051996d77ec90127d05fd17e66670c6f
BLAKE2b-256 34079db0f9241f18526e2db811f0ce14f1156d7400d8c2695d7066a06a94af6d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7d64e36a2ad7d375a95875bc2bea6992c0aea02a9083b3c0d8ac0fa75389acd6
MD5 8b470ff5d60f6cf7e0e0dad0f5d77990
BLAKE2b-256 17777e99e27c301c410f560c30ea5449098d091d7f49f7ef5d35ccef4900e29c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f6e7cac9996542ebcc39bdad89742295a7edc55d9c508a4d372c0287b4ce6d5b
MD5 7740f908b7b7a2a2f8de9fe83cf0bb58
BLAKE2b-256 687890efa228e8e1769c0abc5d9632af5b1518e457c5c639312e0bfc09f774e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0bc4375237b695504f2338f60ccadcf49db0d09372aad813f7cdf38473a69d35
MD5 e0e0c1c242b45341210c6d61d508caca
BLAKE2b-256 8d0b0ce4ec9b2ad42117f28feb0b7d85fdeace740b389339f49d62ab73382499

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43fe91cac820b65fabdf47247070f90b6d69c1d968503445dd9ccc11e5cd8a63
MD5 f22ab1d857f7a26e9034204b96a9d6eb
BLAKE2b-256 95e77171d695096588676964dcab99cb68d70bed09f61e2734be0be1d6b13b99

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 600fc2c2866e6dc571b03158b3e58f76fca846a01c09cd1930d2c87b7606f393
MD5 7675dc5f5c1b857809736af4dc18709d
BLAKE2b-256 1c3aacb7fefb5de13037c421cb5caeee9b9b37a8894ffb1a7a631e27d755ed0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 39e0782fb62b8554a6def1d51c02cdcab5f880614a37cda1b5b454080a7e4571
MD5 b2a42dd6cac622c0b062cef607c9bbfc
BLAKE2b-256 c9ed5a3b8d99026b6535f8402912c0a3b255272be230a986e252fa044f609118

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 6102eb1b2a5ea506a9fcfa90482bd20661609c41fa2b8ca75c9118c3c9aba847
MD5 a505b6d5aa6050e895a5a390bd8df69c
BLAKE2b-256 567366e99aacb2a06433947b1323cc9dacb3b0c5fc8fa3a5d3b9d150eeb518d1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6aa2cb6ddc369b2b92df93f1294ba30ab4c2a93955238264100dc862631e9448
MD5 baee4bc7fb91f1c8bac6d2544d7add4d
BLAKE2b-256 39aab760edfdaf2697de4b8823f4db6aa6a2c015107f28e3d678735a96130ef4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 59fbe54a5ddbd7ed975e053fa0d3d7ab253f04ae9014b203cfa08e60803cb98d
MD5 18fbbc3528a7eab4cd645ce44bb2da8c
BLAKE2b-256 4f2727e70fc28443435eef1f78f1e5d12f28b68f786165868946a215e6b67862

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 05e4569234c01798fffe5e5ec0dbee1ea311ee7dbcc2950aa33c3c42a8530ad1
MD5 35b160e0b0d97899187b203a08e1023d
BLAKE2b-256 887105f8c224b5b8c7117cec55dca21c3cb78686c8c452f64469c28f4c023c2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 df18fb819328212b8f70d2f26ded99e892f860c07938f32dada703e482237cd1
MD5 23f2f13d8614c23ed985acdcfecb0dc2
BLAKE2b-256 a6cdd45a6c9d93fa8052372dffbaba6e74c0f472ceca24111eb6c5b80c6f24b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 102a6cfb948814b6b932141e5e0c60d582ae47a2d0cd2533e7d8573708ea36c1
MD5 878a91c48c5504aec25cdca1d05d19c1
BLAKE2b-256 54733124a3220045ba21e275516fffcc13bd9dbf6a02031ceed7abfc63eeecaa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 356747d1421865be6884be96048112c29cd2a4ad2203f5544cc6900e54e07b57
MD5 492421971d235d2915788c18014acf78
BLAKE2b-256 5c895a5d7642c8935ada36f1a99677ac5900ce0536ced03524f87fc7efca3235

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 5bf373faf5dc58cfd5be390cb29ad9b3f4e7d2f3d8ffc2965915fda76331a853
MD5 d18e7285a2a37ed23728a7626330bf14
BLAKE2b-256 79546f43b3d2a60d7c3e272de406b913b98d26c3f17086b123095d355e6fcdbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e48adddc5c9358f0612027bda2a668bb78ecd5b8c17873bba7c21a2e7337025e
MD5 cf82089e66f3365ce65681e523052ac2
BLAKE2b-256 5736378569c0b89ab569ee22d9be89ba9cabb54c1a123a5e651261a966fd4820

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 00b81acdf9c2e9a279771d9871629c9716f311332790d00999b7a61a965d407f
MD5 6bd1cd3d47e0954b6f49a5ab7229fad0
BLAKE2b-256 47a784d5658f4a1d8b2ecf2c8779cdcc0c40675b7bd7aef0ae3f78f0d561e7db

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