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.8 - 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.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

[!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

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

concrete_python-2.10.0-cp312-cp312-manylinux_2_28_x86_64.whl (76.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

concrete_python-2.10.0-cp312-cp312-macosx_13_0_arm64.whl (54.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64

concrete_python-2.10.0-cp312-cp312-macosx_11_0_x86_64.whl (62.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

concrete_python-2.10.0-cp311-cp311-manylinux_2_28_x86_64.whl (76.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

concrete_python-2.10.0-cp311-cp311-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64

concrete_python-2.10.0-cp311-cp311-macosx_11_0_x86_64.whl (62.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

concrete_python-2.10.0-cp310-cp310-manylinux_2_28_x86_64.whl (76.8 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

concrete_python-2.10.0-cp310-cp310-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.10macOS 13.0+ ARM64

concrete_python-2.10.0-cp310-cp310-macosx_11_0_x86_64.whl (61.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

concrete_python-2.10.0-cp39-cp39-manylinux_2_28_x86_64.whl (76.8 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

concrete_python-2.10.0-cp39-cp39-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.9macOS 13.0+ ARM64

concrete_python-2.10.0-cp39-cp39-macosx_11_0_x86_64.whl (62.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

concrete_python-2.10.0-cp38-cp38-manylinux_2_28_x86_64.whl (76.8 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

concrete_python-2.10.0-cp38-cp38-macosx_13_0_arm64.whl (54.4 MB view details)

Uploaded CPython 3.8macOS 13.0+ ARM64

concrete_python-2.10.0-cp38-cp38-macosx_11_0_x86_64.whl (61.9 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 08ecc137f31d1572e74b7b22cd3da5bcb1fb4411fa5c166c7d048ac762ef96b4
MD5 ec8058ce764bb9debca60719e90aa109
BLAKE2b-256 05e5154f7c65c9769073798c4fede59d3ac3666b576214de413310aca0f9e3e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp312-cp312-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 ae958a1ed0e07c9d7b638276bd9dacd62e6f51b50c96f9dcbfddae7a2953c220
MD5 dd505d41bde4596b99a25377a04407bb
BLAKE2b-256 54cb47b70d139e459b402bfc78958b9ea30bd681f682c5804cea44ad2b51452a

See more details on using hashes here.

File details

Details for the file concrete_python-2.10.0-cp312-cp312-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 70bb94fd13a98a9df9b43468572fa69c62bead871332d1b5fb56a3de66a7ac21
MD5 65a44f88f81f3423873fc980170bd1ab
BLAKE2b-256 8c08f032ccd13daec220f5d60da7dd27ae6d8cbfe851570b02febab946e980b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 5801728137b86de5ff75e2f229b5e1e39a8c8d763431c78ca1c1febbc1f476e5
MD5 864057e32524f2f33a465d3e29afb708
BLAKE2b-256 e5c6b5a1ce9c2e08cd00650004a63a36fee513a36af68a584681988f00d37436

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp311-cp311-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 249a2019f7428cf799b7bbed1e1352b30adb9ee4ecd39a98133a8b72a4ae7bbc
MD5 7933d6c7ccc8d7113e297dd2f0f613bd
BLAKE2b-256 7fd4e79ce9d5dd099355702fe5c1f6e3e03f1477fcca3435b3943706e4c474fa

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 59e9c882b11b5c080527e73ee00ad51835beb9f65c4e649f0dd5f00f494b2f56
MD5 87dbebde9b7059388a55225af0239ade
BLAKE2b-256 ceb7242e4de986069524da4687ab619c5db291c6f0db622e1035c0e8f85479c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d9175a8ae13d244a6594217950861dff875971b17f0c3e17a8e777adadf4a447
MD5 fe448f88db7040eb13a0545acbc2d6f7
BLAKE2b-256 c84c137c6c6683d641e9219c13909b61325cfefa55f2a186d480275b5ff1c3b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp310-cp310-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 1503c355d02ef4ecd35f7745d00c0aaa94dd2162645cfcb4bf9a30f0d5829ecc
MD5 48162aad141a61618d6aad05f79ed7ff
BLAKE2b-256 60b50a2514470fbbeebd814fc75eb8dc5f6f7896ade204701b1cc1cea25f92d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 d43a9e60884c04994dae73e295648e437fba0221c78d08ce250e27dc2929c035
MD5 69839961346977a5763531fe8a9006c3
BLAKE2b-256 ff5402fb39132a8d70ed709376bcbeecb012f1126fa9be0fc751fe64fb3453a4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 de84d4777f7e7f8b52fa00bc015df76a504e9a8e0b0b3bf24afb73a87a9968d8
MD5 c0741589895d29bd254d2e2b7ad0b043
BLAKE2b-256 940afdc8e3a481c94dc9871885eb2d97044863f348dcb8d2448bec703c24b701

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp39-cp39-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 4d55d1c4ee2b4cfd8d46271790bb4da453778f257654b0450c41c90fd4c5a719
MD5 30967c023388d6d4ed9bca606ac59a8f
BLAKE2b-256 55c72a2ae53f3a3d5030ce9ec607186ef3cffa6acc1bc18b5e541b4f9f353f68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7411b139b1cd73982265a37171092d1487027bc8d7e56ba49917f2cc177c6eb4
MD5 9f25f12bf8a96d40220defb35d798b44
BLAKE2b-256 8158f91695d08b9b90803a493d4d70b1c173815ae3c079e3282a9f7bc2a3dc4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8b624e601cb3dfb3d8367b5953a4b127a9455c248257a8731d9f50156da85904
MD5 89f7f75d52e770b1594e086a97413f89
BLAKE2b-256 69aea6e42c3bcf11b075403c7ba314b082ccafe393106c81504c44f991a9c978

See more details on using hashes here.

File details

Details for the file concrete_python-2.10.0-cp38-cp38-macosx_13_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp38-cp38-macosx_13_0_arm64.whl
Algorithm Hash digest
SHA256 7e06abafc18b876d5c6551a1a8f2ca98ea05a864b6a4f55a92b38bfad9b983cb
MD5 1f5f7c47766f3f0671554194f42717c1
BLAKE2b-256 c6d5a7bd21e3374002d1801c61fe4979ab55a35c9cb08272708804e8f5dd2b28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.10.0-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 05f98af328df74fd659f5e2dbccf471477dfab4797ba1f70a380ad75c7ec9864
MD5 62a87224991b3ea10d44da62a866f0b0
BLAKE2b-256 9572c99fb002723f7a80ad2cd5c2d1e6a1387e457d5931d05b244480ce781ece

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