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

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

concrete_python-2.9.0-cp312-cp312-manylinux_2_28_x86_64.whl (77.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

concrete_python-2.9.0-cp312-cp312-macosx_11_0_x86_64.whl (62.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ x86-64

concrete_python-2.9.0-cp312-cp312-macosx_11_0_arm64.whl (53.9 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

concrete_python-2.9.0-cp311-cp311-manylinux_2_28_x86_64.whl (77.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

concrete_python-2.9.0-cp311-cp311-macosx_11_0_x86_64.whl (62.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

concrete_python-2.9.0-cp311-cp311-macosx_11_0_arm64.whl (53.9 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

concrete_python-2.9.0-cp310-cp310-manylinux_2_28_x86_64.whl (77.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

concrete_python-2.9.0-cp310-cp310-macosx_11_0_x86_64.whl (62.2 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

concrete_python-2.9.0-cp310-cp310-macosx_11_0_arm64.whl (53.9 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

concrete_python-2.9.0-cp39-cp39-manylinux_2_28_x86_64.whl (77.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

concrete_python-2.9.0-cp39-cp39-macosx_11_0_x86_64.whl (62.2 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

concrete_python-2.9.0-cp39-cp39-macosx_11_0_arm64.whl (53.9 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

concrete_python-2.9.0-cp38-cp38-manylinux_2_28_x86_64.whl (77.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

concrete_python-2.9.0-cp38-cp38-macosx_11_0_x86_64.whl (62.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

concrete_python-2.9.0-cp38-cp38-macosx_11_0_arm64.whl (53.9 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 601b6f2f8f343667d0e4e1f6af17b40cc75fbc1dcfac5846052f974991a32c94
MD5 ea71d667732f3d01b47562f440727dd9
BLAKE2b-256 b9cd77e5b36f9564801f46ab0ca4e59e803aaf09684ed8f760e51b5ee9534deb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp312-cp312-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 58c8e2794cf9cde9ddb7783b6ab562fae34c16b4edbe87e03c088c96e54b3d54
MD5 928ecb2540f86948021bff85be5eca23
BLAKE2b-256 4def4cd616ecc2c2f2ca84823ad061a00855c774a28ec1adbaf2fef3e73c8f45

See more details on using hashes here.

File details

Details for the file concrete_python-2.9.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 43b2a0f34da87cb5cdaa9c36adeab673cd1a63741374616bf0099f109a5e6eb6
MD5 796475c92788b4071407c0449cffdf82
BLAKE2b-256 8b54199cfccfb416fcd5aebf5c87cd2d6e836ab10fdc33dd007449d4d1371781

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 752b21a4031560cedd6ecf45a2f88769258ce96ff33188d38f7d3960596bc4d0
MD5 477945891866d46ccf13b23cae7b759b
BLAKE2b-256 169ad37e005d4a78d79150097dd80c586baf91e898154b60a1e5a1a5c6d06d14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 c578cc53b58531ea97de806fdaa179da3bf90f4595196864fec4281cf0bef19a
MD5 554a5291be80827b57174d8a08c80895
BLAKE2b-256 658fec81b7d0256a9860cbfc93dc11782285b569fd9457c0227bea470587c44b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 dbdf5fac89c62e0d35305ca799ba390df811172e81408ed5bf12843761e9afae
MD5 8a5618971cd5a79d40771f8b05816799
BLAKE2b-256 522bd0f55582bca49c4c87c8647914c9477ea04c61eb20d43b03dd4fbee658c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c08d1101a2ecaeb25c6bd6ce6f40763db1ff276de5b43f2d8057cb1efb8a6d4f
MD5 5235874485f30f052983dac5211c574f
BLAKE2b-256 c80551156849137c94c884618adcde0a9dd3c63dcce08b913c8fcda399ac103c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a78535682ae2639b18109c7ed54183eabba0f97ba5559bff32d41bfeda96cce2
MD5 586bfbf38ace7b7b5c66be131c85c257
BLAKE2b-256 679b2d427599c3d14b2fba565a05aa2ee2152259126800cd62cd1d781afce9e7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb76c9811ecdb97acf22850d12b41244d4c0b6d5319c8a69dd29964286309dcb
MD5 3f27a8cb251b517a356cf5ec6c7b42ab
BLAKE2b-256 8193920d225407904b309f5f2c007b05f824493697c83c1950621a0218f4972d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f210d39f1e67c493c0da6246b7690721ad7ec7aeeff68019aa2bee042ddf4bc3
MD5 75ca873459e95f8da8cc83d68c9d860c
BLAKE2b-256 31526ba278bccef6f82dbc61a980f1b874ee24a8223b19ced4756190b6dc431b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 7d02597f1c040e1b534686642526d8f7a2d0c046f4fbbfeed1b421b19e5fca24
MD5 e5d60fb5fa2419dbbea7c03bc69b0877
BLAKE2b-256 1cc34a89540b3e8f925a678737669c82c4de1b7883a3d9bb4de7e5bf0f0730e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 929aef7b3026208201012222428d8f895614b6b8cf26e99ff36d055252385a71
MD5 36151d419eeaf8ddd2b6b5bf6dfc5a63
BLAKE2b-256 32711048e950c7dc95a8e2d7d45230ade8c277d2025c67bd63d1bdac3d536b48

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 68d677b98924096883d2f140fc14d21dc5ee5b14aa71db59f8713f52673e7c08
MD5 d6bc200186c9fd2c4546fc491167fd34
BLAKE2b-256 51e6d269ac33ca0bc6ff88a5440a9b155d26bfc4f213d64c1d5246ecd0b56b18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a61c794f671409beb536b5e74f80ab740097b0716513350d317b1230c7b52b09
MD5 ec11ff02f6f4881a379e001565cc739e
BLAKE2b-256 fd7b4563dd3002cd834e54be9756283499425691de761f77dd251d3bc057c47b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.9.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f217d330ad47208b4ba1310fa45d0cba7b4102f46a51eb44559113b77153774a
MD5 b174f99a57d58c329ad82449dc73984d
BLAKE2b-256 87b5634754fd07029338bebcd65ad05303ec9044833f71cee2476d2542000648

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