Skip to main content

A state-of-the-art homomorphic encryption framework

Project description

Zama Concrete


📒 Documentation | 💛 Community support | 📚 FHE resources by Zama

SLSA 3

About

What is Concrete

Concrete is an open-source FHE Compiler that simplifies the use of fully homomorphic encryption (FHE). Concrete framework contains a TFHE Compiler based on LLVM, making writing FHE programs an easy task for developers.

Fully Homomorphic Encryption (FHE) enables performing computations on encrypted data directly without the need to decrypt it first. FHE allows developers to build services that ensure privacy for all users. FHE is also an excellent solution against data breaches as everything is performed on encrypted data. Even if the server is compromised, no sensitive data will be leaked.

Concrete is a versatile library that can be used for a variety of purposes. For instance, Concrete ML is built on top of Concrete to simplify Machine-Learning oriented use cases.

Table of Contents

Getting Started

Installation

Depending on your OS, Concrete may be installed with Docker or with pip:

OS / HW Available on Docker Available on PyPI
Linux Yes Yes
Windows Yes No
Windows Subsystem for Linux Yes Yes
macOS 11+ (Intel) Yes Yes
macOS 11+ (Apple Silicon: M1, M2, etc.) Coming soon Yes

Pip

The preferred way to install Concrete is through PyPI:

pip install -U pip wheel setuptools
pip install concrete-python

Note: Not all versions are available on PyPI. If you need a version that is not on PyPI (including nightly releases), you can install it from our package index by adding --index-url https://pypi.zama.ai/cpu.

Note: Wheels with GPU support are not on PyPI. You can install it from our package index by adding --index-url https://pypi.zama.ai/gpu, more information on GPU wheels here.

Docker

You can get the concrete-python docker image by pulling the latest docker image:

docker pull zamafhe/concrete-python:v2.0.0

Find more detailed installation instructions in this part of the documentation

↑ Back to top

A simple example

To compute on encrypted data, you first need to define the function you want to compute, then compile it into a Concrete Circuit, which you can use to perform homomorphic evaluation. Here is the full example:

from concrete import fhe

def add(x, y):
    return x + y

compiler = fhe.Compiler(add, {"x": "encrypted", "y": "encrypted"})

inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1), (3, 2), (6, 1), (1, 7), (4, 5), (5, 4)]

print(f"Compilation...")
circuit = compiler.compile(inputset)

print(f"Key generation...")
circuit.keygen()

print(f"Homomorphic evaluation...")
encrypted_x, encrypted_y = circuit.encrypt(2, 6)
encrypted_result = circuit.run(encrypted_x, encrypted_y)
result = circuit.decrypt(encrypted_result)

assert result == add(2, 6)

This example is explained in more detail in this part of the documentation.

↑ Back to top

[!Note] Zama 5-Question Developer Survey

We want to hear from you! Take 1 minute to share your thoughts and helping us enhance our documentation and libraries. 👉 Click here to participate.

Resources

Concrete deep dive

Tutorials

Explore more useful resources in Concrete tutorials and Awesome Zama repo. If you have built awesome projects using Concrete, please let us know and we will be happy to showcase them here!

Documentation

Full, comprehensive documentation is available at https://docs.zama.ai/concrete.

↑ Back to top

Working with Concrete

Citations

To cite Concrete in academic papers, please use the following entry:

@Misc{Concrete,
  title={{Concrete: TFHE Compiler that converts python programs into FHE equivalent}},
  author={Zama},
  year={2022},
  note={\url{https://github.com/zama-ai/concrete}},
}

Contributing

There are two ways to contribute to Concrete. You can:

  • Open issues to report bugs and typos, or to suggest new ideas
  • Request to become an official contributor by emailing hello@zama.ai.

Becoming an approved contributor involves signing our Contributor License Agreement (CLA). Only approved contributors can send pull requests (PRs), so get in touch before you do!

Additionally, you can contribute to advancing the FHE space with Zama by participating in our Bounty Program and Grant Programs!

License

This software is distributed under the BSD-3-Clause-Clear license. Read this for more details.

FAQ

Is Zama’s technology free to use?

Zama’s libraries are free to use under the BSD 3-Clause Clear license only for development, research, prototyping, and experimentation purposes. However, for any commercial use of Zama's open source code, companies must purchase Zama’s commercial patent license.

Everything we do is open source and we are very transparent on what it means for our users, you can read more about how we monetize our open source products at Zama in this blog post.

What do I need to do if I want to use Zama’s technology for commercial purposes?

To commercially use Zama’s technology you need to be granted Zama’s patent license. Please contact us at hello@zama.ai for more information.

Do you file IP on your technology?

Yes, all Zama’s technologies are patented.

Can you customize a solution for my specific use case?

We are open to collaborating and advancing the FHE space with our partners. If you have specific needs, please email us at hello@zama.ai.

↑ Back to top

Support

Support

🌟 If you find this project helpful or interesting, please consider giving it a star on GitHub! Your support helps to grow the community and motivates further development.

↑ Back to top

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

concrete_python-2.8.1-cp311-cp311-manylinux_2_28_x86_64.whl (76.2 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

concrete_python-2.8.1-cp311-cp311-macosx_11_0_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.11 macOS 11.0+ x86-64

concrete_python-2.8.1-cp311-cp311-macosx_11_0_arm64.whl (53.3 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

concrete_python-2.8.1-cp310-cp310-manylinux_2_28_x86_64.whl (76.2 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

concrete_python-2.8.1-cp310-cp310-macosx_11_0_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.10 macOS 11.0+ x86-64

concrete_python-2.8.1-cp310-cp310-macosx_11_0_arm64.whl (53.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

concrete_python-2.8.1-cp39-cp39-manylinux_2_28_x86_64.whl (76.2 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

concrete_python-2.8.1-cp39-cp39-macosx_11_0_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.9 macOS 11.0+ x86-64

concrete_python-2.8.1-cp39-cp39-macosx_11_0_arm64.whl (53.3 MB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

concrete_python-2.8.1-cp38-cp38-manylinux_2_28_x86_64.whl (76.2 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

concrete_python-2.8.1-cp38-cp38-macosx_11_0_x86_64.whl (61.6 MB view details)

Uploaded CPython 3.8 macOS 11.0+ x86-64

concrete_python-2.8.1-cp38-cp38-macosx_11_0_arm64.whl (53.3 MB view details)

Uploaded CPython 3.8 macOS 11.0+ ARM64

File details

Details for the file concrete_python-2.8.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c9ded07e6966d469add51624cd6803b640098dd9d35918b40067c8e56e15e689
MD5 81afeb5a1a2adb3a9139cb8d9f6691d9
BLAKE2b-256 31c3e349d97f230f5a3944bfd6bb90dd45b595c406e7416fac2696d6e09a9609

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp311-cp311-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 dfa5349e526611835453da0f1683538c2a07880ca0442856d514a585808a6c09
MD5 b4356a20bba34f737d0656a8de500464
BLAKE2b-256 962b818ea7092fd9d9980d2f573713e9028f6217c244df19b40a3998e7b886e7

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e32cc6dac2ff4568c02e06a4bc40879c394e1eb5778786b79547a258c31c391c
MD5 1f9bdff7ce9fb53c7a136aa4456a6d3e
BLAKE2b-256 e9eadc5e86b0c88676d6597b90702c47168a7b5b25f67a55937b9b898dce6567

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a93024b3199e30161465733dc7cb91202a6dd1fe8646ae87a9c7279e2f2fc2c1
MD5 0e8afae1cfad4daef188208c19462bd8
BLAKE2b-256 5360528e2b8245537cbd5f7ee046f1800b483c206f17cb95409810f869a019d8

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp310-cp310-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 9bba6bf4faddc260c40364cc48da98b8785625b61dbb0153dfd729a25c9ca407
MD5 b1f0a5e53e5e262af433dec8ecde2614
BLAKE2b-256 1b713e19529ef4c4d9f1373a07b4bff2bc1bc20c241e943e7da23607ae96ed1a

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1615fe4991883e378408f1a88a5df448217cbc035a72bdd141e1d01be09a3772
MD5 d42d9ebbfec6335dda065a8b3acd9180
BLAKE2b-256 7cf982e5b1d7a69b04af2b245c82cb32f80e5e8d8a93922c60167027311e1d63

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9a097af5736a9c97cc63e81febfcaa2be035a5ea76a16d7c383b531a23229fe3
MD5 1dc0c45e22775452c7877bd3ffd993d8
BLAKE2b-256 519c4e7d87c911c009669dc723079df933dd1f5836f4596cf9aa78c228e514df

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp39-cp39-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d6c5cc28c3c35e09b5123075e23a659891c913c8ef9ec8679b88a3c3b1ec1afd
MD5 9dadb72f4133cedd2205fa2e1e88be44
BLAKE2b-256 ebf7d658f3fa6518b71b8912067ac8b2ccd7107d0a684ec02f61aa7e21307b0a

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 577c06f485eb1ff115ea7196b85ac7f468fdc28ea4d6edf2caa4775e22df9839
MD5 87c7d2ccf4cdc386ed5cf9553b40a283
BLAKE2b-256 e6634de8714b3177c8f64ba02809cc8f2138921d6cd4b2d1807d59021e45cb86

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3b40f737236eb7758d3522f75324b7185a075960f51544435d94e2a2c3e309f7
MD5 23206f913fd1a0e2600b21f0515b4683
BLAKE2b-256 e1d1d2440ca542e6cbb8ec782ba2342d96181b7f1aef89c51f731720134d69c5

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp38-cp38-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 782acf5a420704323456554e48bf64b6d942c866a50adced3238db6591bdacae
MD5 b1358ef5df839660e86ad923ff92adac
BLAKE2b-256 9e3aa00e0f7d460ed9de9429988d6206510eb8d5e01fddb09e790035d4eba002

See more details on using hashes here.

File details

Details for the file concrete_python-2.8.1-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.8.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9ecc6361d404422381c0d7bcffa51aa53ed03e19f4fb5d7f99f12899b895849a
MD5 b94054be812f310e2a76d64a281edcc9
BLAKE2b-256 fffe1698c3412a763289b9ce4f100daf4e7d7759e2a0841ffd2bab7ede74fa7e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page