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 --extra-index-url https://pypi.zama.ai.

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

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.7.0-cp311-cp311-manylinux_2_28_x86_64.whl (72.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

concrete_python-2.7.0-cp311-cp311-macosx_11_0_x86_64.whl (58.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ x86-64

concrete_python-2.7.0-cp311-cp311-macosx_11_0_arm64.whl (50.4 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

concrete_python-2.7.0-cp310-cp310-manylinux_2_28_x86_64.whl (72.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

concrete_python-2.7.0-cp310-cp310-macosx_11_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ x86-64

concrete_python-2.7.0-cp310-cp310-macosx_11_0_arm64.whl (50.4 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

concrete_python-2.7.0-cp39-cp39-manylinux_2_28_x86_64.whl (72.5 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

concrete_python-2.7.0-cp39-cp39-macosx_11_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ x86-64

concrete_python-2.7.0-cp39-cp39-macosx_11_0_arm64.whl (50.4 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

concrete_python-2.7.0-cp38-cp38-manylinux_2_28_x86_64.whl (72.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

concrete_python-2.7.0-cp38-cp38-macosx_11_0_x86_64.whl (58.3 MB view details)

Uploaded CPython 3.8macOS 11.0+ x86-64

concrete_python-2.7.0-cp38-cp38-macosx_11_0_arm64.whl (50.4 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f770d473f51d5378869f351df50d63ceb5668d2743755ca1dac6be009948af80
MD5 19ccafc002bf893da8e4af6c270ff0a7
BLAKE2b-256 28d59ce591db085d87c48730d163f5dca6c938ae2bc37679c6c7d2a2f7220c27

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp311-cp311-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 ae7d70af82cb22938b2f3b3c3fea5dff840c0084cf5150d4cc272c9afd652d0b
MD5 65cc4c756c10929b3419357139cf7614
BLAKE2b-256 39d4b31bd777b4af28734e5d45232c9a05381c4caa98c172a6b6bcab0adb318b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61c1c50388057e59123d9a66697c944be88220c01f936d98f8741970e6455387
MD5 7a36115ac91da96ed11c777e82dc81b1
BLAKE2b-256 2f45aebec8ceb47a99bcaec72a16a21a758cd322ae9016023ce28edc6fab30b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d28f4a6b74ec752214f544589ea5e0095c51f31feb961ce04c9161aed7fe0fd3
MD5 c762507e3dbc505b96ab38a80dc55169
BLAKE2b-256 98d126b8f2fe155a1b62b9e794d6862fa025fcc35db20a942f786760717cb34b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 5fff285dda24eaacbde0b81efa658b191920958933fb1c01aa001fa04464435a
MD5 71cd127b181b575770c18bc88d695512
BLAKE2b-256 14d8a96815f17cab9a5a2add823d871608c8fbac03b70c66a7abf3935a594fd2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05efb76ec4e6b6922bfb1b45ffb0ea89d6d01349a39e99c70f76f267876779c7
MD5 fd15392918b0f4660966712b65cdc9ea
BLAKE2b-256 0e0ed2d83a187d0727c5a5a8181ac64c688a26e3f837bdd491db06e5e2b8f847

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ac729b747a444d6efb0c13012a48902a471e920b8f0af3dfb03b057387d727f8
MD5 f0b5250aec0e52ac6f64439e39c5b7e9
BLAKE2b-256 a356831da62b3088b91b9a41fa0bd545bd133277e7fa25d0156247de26749148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 a836384147b996870dfc18f5ce2bb14c013a1d6b7a9ac27c71767f18d829247a
MD5 340be55ebf0bd4a2c22b39ed9ae1fae0
BLAKE2b-256 a3ae557025ef74958f5f061a8655d9cd080a3af2f38a2152e06b18c5b5db0859

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ed13b050ce4c5e80105e34e848ec4da63ae9a2b257f53199f7bc5638c907136d
MD5 7bbe9d11126dd867f4e3f4fefaf44685
BLAKE2b-256 26122b706c2b7eaf761b8760059ca57209bd1cf2ee7f56b80159dd84c48252af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ec7b911fc5c546b73d62a07150fdbafd819d94972749c63ce746eba820fc4292
MD5 43d8a5b1ab7782a27d49acbcabc25f3c
BLAKE2b-256 7bd9feab42f4df526f231dfb062c65fcd4af7c6df2e8b22acfac317b730c23f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 0d6f7c28529f4a83ce373b76839779a0be3c8a7c7069f8bd3f2235b84049266e
MD5 32caf41fc7b1bad64fe419146cfa19a3
BLAKE2b-256 98f19b70bc979b1721d1e362407034a87f4dcbff46e209f2b907030a0f2d41cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for concrete_python-2.7.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 61721b517f35294d14edd41a5afe905ad72d2a5bbcf540ead374522ee2f4a605
MD5 4e9b81dcfbc6f0afb4e611695fcc8be0
BLAKE2b-256 80412094d1b345270d71209168c03668b0b4eeb9dad0d2861cc890acbeb98358

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