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). Built on TFHE technology and leveraging LLVM, Concrete makes writing FHE programs accessible to developers without deep cryptography expertise.

Key Features

  • 🚀 Simple Python API for FHE operations
  • 🔒 Built-in security guarantees
  • ⚡ GPU acceleration support
  • 🛠 Automatic parameter selection
  • 📊 Built-in performance analysis tools
  • 🔄 Seamless integration with existing Python code

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

System Requirements

  • Python 3.9 - 3.12
  • 8GB RAM minimum (16GB recommended)
  • x86_64 or ARM64 processor

Installation

We provide multiple installation methods to suit your needs:

1. PyPI Installation (Recommended)

For CPU-only version:

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

For GPU-accelerated version:

pip install -U pip wheel setuptools
pip install concrete-python --index-url https://pypi.zama.ai/gpu

2. Docker Installation

# CPU version
docker pull zamafhe/concrete-python:v2.0.0

# GPU version
docker pull zamafhe/concrete-python:v2.0.0-gpu

Version Matrix

Concrete Version Python Version CUDA Support
2.11.0 3.9 - 3.12 ≥ 11.8
2.0.0 3.8 - 3.12 ≥ 11.8
1.1.0 3.8 - 3.10 ≥ 11.7

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

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

If you're not sure about the file name format, learn more about wheel file names.

concrete_python-2.11.0-cp312-cp312-manylinux_2_28_x86_64.whl (71.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

concrete_python-2.11.0-cp312-cp312-macosx_13_0_x86_64.whl (56.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

concrete_python-2.11.0-cp312-cp312-macosx_13_0_arm64.whl (48.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

concrete_python-2.11.0-cp311-cp311-manylinux_2_28_x86_64.whl (71.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

concrete_python-2.11.0-cp311-cp311-macosx_13_0_x86_64.whl (56.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

concrete_python-2.11.0-cp311-cp311-macosx_13_0_arm64.whl (48.2 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

concrete_python-2.11.0-cp310-cp310-manylinux_2_28_x86_64.whl (71.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

concrete_python-2.11.0-cp310-cp310-macosx_13_0_x86_64.whl (56.2 MB view details)

Uploaded CPython 3.10macOS 13.0+ x86-64

concrete_python-2.11.0-cp310-cp310-macosx_13_0_arm64.whl (48.2 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

concrete_python-2.11.0-cp39-cp39-manylinux_2_28_x86_64.whl (71.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

concrete_python-2.11.0-cp39-cp39-macosx_13_0_x86_64.whl (56.2 MB view details)

Uploaded CPython 3.9macOS 13.0+ x86-64

concrete_python-2.11.0-cp39-cp39-macosx_13_0_arm64.whl (48.2 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

File details

Details for the file concrete_python-2.11.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b3b3f995701fb290c2db40280f189a7ed634b49ccc96d6fde4b58b221310c759
MD5 de72ddcb402d7f14e22c8b524f54b322
BLAKE2b-256 051b9b00b79b35dc4c1caf3d2d8239d662b2f2fa76171f3ea33ca6d155039bc8

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 cc7a7a7427864f35fb8f0e5a8ddf47b9e24dab754e6ff8e3d43b95b73dadb665
MD5 b4f62f12310bc42766c8ddd9ba502891
BLAKE2b-256 467c0cb7efd4004afeed65b50e411c4edf4cb9df2285f9289d2e12fed4956069

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp312-cp312-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 6bb50e2463a9bc10eea52844f0f1c1b421f10ae8ae393c93c20d374696d05c41
MD5 bcd666926cc7e195b543a40d8a921bf6
BLAKE2b-256 9503104b7bf9f5a2660da5d8cde7a4bf8d6118b2d4a849aacaa94070adeefa60

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9afe72a59b4130bff18288857547f64c0f76b31666cd05c7f25634f81f915867
MD5 4ee594dac33c16ab4199c30596522c7e
BLAKE2b-256 56c540478ce0dd33ddd8f5e09d60411192b17955e28e78f7b78ad8b12dc26d11

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 efd54e114e3e835c67668a6a33cf46267a842af0d8432c2a31eb29fffd30a400
MD5 5f19d42eeeb1759f632bfd2bbf32a8ab
BLAKE2b-256 07ee2d57bf6ecc5f56960d0549ca6291e45ffadf9dce3b39152ca4b98c10bf1f

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp311-cp311-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ecbe0b71e1bcc5d126c4784e64febfd7e2545cd51f47f5706d95dde6e7363280
MD5 7c063c0042d3515435361afb85d5f4b2
BLAKE2b-256 238775b680c10d23da234405d4e50fb03ffd11a32a9447445a1ba6a443b3cf74

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 88cdf23bf7bf20d9f3247ad0ff5dc4acb9ac928326bfaa4bee1f5bbe94866588
MD5 265641bed3153274bc690644ec2d7222
BLAKE2b-256 f6362828094d172f091cc044207995f83e16133510bd1d9ef98941548fb6f25a

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp310-cp310-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp310-cp310-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 99a9ba2fe1dac2f4f1e52ddbb2741d0a30936f0671f3be36585ecac79f744697
MD5 369720ef8cf9ad08e6524fc7ea76e251
BLAKE2b-256 5cd955401f4d3704a025c1d621047ad90c8e11b7a2f805ba4a608bf3b57b5e20

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp310-cp310-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7eea0d3027c8ea114790e11fe7bc2e061dd1064ba5c44507a2944b3ede296077
MD5 c26df09e0f15c72d5fb3665cdb1f0d34
BLAKE2b-256 22fed59a0b69fbe77429365463feed1bab70b01e5ddafad82819ae4daa59a883

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5f0d02e4f57a48b03f7a983cb0ed8fba77dc7f83783270b2c8ae6524da41d103
MD5 4b6aa2ee38fb13be8da51ecac354a9a4
BLAKE2b-256 7ecad06e63573a8b9e8d0ef0666a35b466704a6528d5d53fdaecfc76f64afdb5

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp39-cp39-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp39-cp39-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 dcc916a8af837c09a295467ba68ed08486a9468b1cb0a3dbcb5a983b960fc9dd
MD5 94b714974d3924dbd0ef3ebcf06a950f
BLAKE2b-256 ec294c3e3eed15653de218bd2e655618b689893bc80e046b45896a4ddf733024

See more details on using hashes here.

File details

Details for the file concrete_python-2.11.0-cp39-cp39-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.11.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 f919ffd758987e4e3f3725fe432183bd57d60a0e69e99221b28eddf1ee229f27
MD5 4e7d4130dd119efbc05896506a5e7324
BLAKE2b-256 975bcb100a5c3a5ab73919397cf96be1a8f23807beec6b6bf1f4ba72eb1b1c23

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