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

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

desilofhe-1.14.0-cp314-cp314-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

desilofhe-1.14.0-cp314-cp314-macosx_11_0_x86_64.whl (875.8 kB view details)

Uploaded CPython 3.14macOS 11.0+ x86-64

desilofhe-1.14.0-cp314-cp314-macosx_11_0_arm64.whl (776.7 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

desilofhe-1.14.0-cp313-cp313-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

desilofhe-1.14.0-cp313-cp313-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

desilofhe-1.14.0-cp313-cp313-macosx_11_0_x86_64.whl (875.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ x86-64

desilofhe-1.14.0-cp313-cp313-macosx_11_0_arm64.whl (776.7 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

desilofhe-1.14.0-cp312-cp312-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

desilofhe-1.14.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

desilofhe-1.14.0-cp312-cp312-macosx_11_0_x86_64.whl (875.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

desilofhe-1.14.0-cp312-cp312-macosx_11_0_arm64.whl (776.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

desilofhe-1.14.0-cp311-cp311-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

desilofhe-1.14.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

desilofhe-1.14.0-cp311-cp311-macosx_11_0_x86_64.whl (874.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

desilofhe-1.14.0-cp311-cp311-macosx_11_0_arm64.whl (774.8 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

desilofhe-1.14.0-cp310-cp310-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

desilofhe-1.14.0-cp310-cp310-manylinux_2_34_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

desilofhe-1.14.0-cp310-cp310-macosx_11_0_x86_64.whl (871.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

desilofhe-1.14.0-cp310-cp310-macosx_11_0_arm64.whl (773.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 edb8d1473b7a11c734992558dce5e61e62d09e5fb96a9ac27f8fc63269e1481e
MD5 0c21c8ae15003f23ce1f6d49d12ca4ea
BLAKE2b-256 bff4342046d08b3cf51e6ec9642a22b1e4931d35f3e6dc98dedead569fd4a151

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp314-cp314-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d70b87fde9731299fc7276be4e8c47c0e5eb37ff62c5373cb714e188934c41ab
MD5 55ade81068d13efa509bf07a1e7ec145
BLAKE2b-256 d1f7856b307cc538933a7422689aeb39f35ffba8571a3bb0a4eaf888798f79a8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp314-cp314-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 952a02917d24ac05fce79c8fc69bb3aa62d29854a6240354d5a0a1adf28a71d0
MD5 7cc982a490085737f67cd9bfcf2c84a4
BLAKE2b-256 d6a7b012f58b8cae1b392cf37461245f7a6ff877012a6f680ddec3f1ec25cfa1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f618fdaba97a5267d13d6540d4758ca6c576d620245bb5158ac96528e05e1cb6
MD5 e4df5f47c87c3e22af813ee3d229d86c
BLAKE2b-256 0abb0557b874af4c334d0c55566332e8d70693783c98a2965b5824b7473dea0f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f97faf7b055e5dc67ff2c5a0c75855b4ee2188f88ba73268a3d73879682a17aa
MD5 65967b8d329a21a4dd84f481f3cf0461
BLAKE2b-256 5890c11796713dffc60ee21cc558888c931242e9057162dc571440034e9463f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 d4b7d2c56b44597c16b1e5e6687ac6ce279a09d767def87073b6a70769d3f45b
MD5 1b0e18e3e03ce1807acb56c0d245cd24
BLAKE2b-256 44de48d5b20bcc8bdc5a6980efd19a899783150d2d4d82a159d0e21e2a68f86a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp313-cp313-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 51c78a5f7bd3753d24d410d92951c78591ff290a8166d831cab9e460caed574b
MD5 97a6862c161f56e26611f5fe7a6fb5c1
BLAKE2b-256 7a3d9538bc911659aa7002335a0ca8610d2d6f0619af96d6de479808beb7b4da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 26ea193aaaafd26de237bec613c332f39d9af4d4bc07ee1c6d59804a3c6184e5
MD5 7b77e5872c49a7d5c79da3387f5cf480
BLAKE2b-256 99b6688e8a886ffcc4fe6308fc3b6a470a761cf1099c4def28f2bb35044630fc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0c07f5209a267c6ee5da27294814b0c5b66549c05a319bf48dd76a73b44bf4ab
MD5 c2b772be809d3f76239fd7c70e683174
BLAKE2b-256 5896ce3bd92d4a04d40e10fe0acefa1e4f91b43f785fd10622aa1fdb1d45f606

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 cc4bb81ce6d04418cea452892344b145ac36a642f25f8baff08222ef27451dde
MD5 1d1f0a3326608e2aa48a830c34c507ed
BLAKE2b-256 8e396435f8808461f2309e2fa4920c1a9ec3b979328f80fa28d24f6667da023f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 1549a62a102b53f751eae022df89258a8081bcff06247b1c6e9d7c25a0692a7b
MD5 003c6da1361ea9d635c26bdffd4eb2ff
BLAKE2b-256 35af8e82e329a85a5bf88508e80892bb5908136257eaeacd96c5df40c1dd089b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 53c77077c713439639849ca6e0b4080f6a2957268ca582f902d390a1cb76c361
MD5 8f363bf5e31f17b02d8c65612564d936
BLAKE2b-256 0c7387961b7c89aa37fc8ba49bccfbb2f6fd69a3f8282e4f7a26ad156a7ebf36

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2f513492224ac64d3bdf11ebc6c4d0aef7c8bead89a4d4e30d752d9c9919566a
MD5 05ea197692bad72265c40cec2f370e58
BLAKE2b-256 f80ac3917f8c3eab548051e8d308efe674983422a39dcac6bf54b15d4e8e4ea7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 be99017b9ee04c089c70f4efae2398912721d0ad1e85799b2b7a411ae407f741
MD5 dc83c61ee4c65bf7e6d79a1fe337df04
BLAKE2b-256 66428531560b36ab8915f4fb4f611fee7221d8d40e391cccc2362ec6f0f8ff5a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 4135b89aa8a9b5e18cb02cfc5d6e26a8c70c46fd8629b62606b3f81c850a7999
MD5 1853577d2f1f7a46e5f23d44c431b158
BLAKE2b-256 72d721988503d06dfca6dc68035c375052ce011bc0a8268e7cb7547a011ee4a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e60de03a0130be842d9bf7c645c3ade26e3f799a8df55ec0bb940fbddee9a06d
MD5 1b56e0edb4a90553447b0a6a73c98300
BLAKE2b-256 3f057f203ea51e84988c3c74859840e00094d39cbeed20a6a9193dff6127fe95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 63fd5486a769d9e9dcb58d03538d6eeca66e25f8abf0afe532f666e11ac1d575
MD5 2f9b732c79442d74d70347fa5320e478
BLAKE2b-256 2dfcff8b3a950d6a132ceeb94fda0872eaba05f7c7221880dec2ceada4326373

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 c0e89195bb33284d1541bcc1cf89b962045b4c13468c8aad22a2aed392a3776c
MD5 87510ac50a1ca1d5dd8c820d337aae5a
BLAKE2b-256 b7c7e2b54e6ef14a04254729e17e1701bb1c99a9a94a2be6d1e45d2328f4e91b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 800d874ea7df5459b3b7f23c9d7b5dc0624a4f326dcf82aba9cbd876f3fa0c07
MD5 8e41d186732843d6ed125e4ca5dc6b47
BLAKE2b-256 fb813cc8928b016a5a763bb83b3f6979f9f13bad6231fc70a73847562af21844

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for desilofhe-1.14.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ec9ee1e1f7eac679c309e3dc0e98aec571ae0926dbba9783c5a30e9bac46da00
MD5 50b3d4ad3822c00ac09ae8699c1c805b
BLAKE2b-256 c36af8be72ebf59a6149a1d02800de8559f668746fde3933f14fc64e05268546

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