Develop Fast
Homomorphic
Applications Easily

Zama enables web2 and web3
developers to use FHE without
having to learn cryptography.

Start Codingor learn more about End to End encryption
Concrete ML is now available. Click here to access.
Concrete ML is now available. Click here to access.
Concrete ML is now available. Click here to access.

Homomorphic encryption enables applications to run privately by processing data blindly.

How it Works
01

Write python code, run it on encrypted data

Zama's Concrete Framework enables data scientists to build models that run on encrypted data, without learning cryptography. Just write Python code and Concrete will convert it to an homomorphic equivalent!


import concrete.numpy as hnp

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

inputset = [(2, 3), (0, 0), (1, 6), (7, 7), (7, 1), (3, 2), (6, 1), (1, 7), (4, 5), (5, 4)]
compiler = hnp.NPFHECompiler(add, {"x": "encrypted", "y": "encrypted"})

print(f"Compiling...")
circuit = compiler.compile_on_inputset(inputset)

examples = [(3, 4), (1, 2), (7, 7), (0, 0)]
for example in examples:
    result = circuit.run(*example)
    print(f"Evaluation of {' + '.join(map(str, example))} homomorphically = {result}")
  
Copy
02

Use low-level FHE operators to fine-tune execution

Cryptographers looking to manipulate FHE operators directly can do so using Concrete’s low-level library. Built in Rust using a highly modual architecture, it makes extending Concrete safe and easy.

Copy

use concrete::*;

fn main() -> Result<(), CryptoAPIError> {

    // generate a secret key
    let secret_key = LWESecretKey::new(&LWE128_630);

    // the two values to add
    let m1 = 8.2;
    let m2 = 5.6;

    // Encode in [0, 10[ with 8 bits of precision and 1 bit of padding
    let encoder = Encoder::new(0., 10., 8, 1)?;

    // encrypt plaintexts
    let mut c1 = LWE::encode_encrypt(&secret_key, m1, &encoder)?;
    let c2 = LWE::encode_encrypt(&secret_key, m2, &encoder)?;

    // add the two ciphertexts homomorphically, and store in c1
    c1.add_with_padding_inplace(&c2)?;

    // decrypt and decode the result
    let m3 = c1.decrypt_decode(&secret_key)?;

    // print the result and compare to non-FHE addition
    println!("Real: {}, FHE: {}", m1 + m2, m3);

    Ok(())
}
03

Write python code, run it on encrypted data

Data scientists looking to run their models on encrypted data can now do so without learning cryptography. Just build your model using Numpy. Concrete will convert it to an optimized FHE executable!

<script>


var tricksWord = document.getElementsByClassName("tricks");
for (var i = 0; i < tricksWord.length; i++) {

var wordWrap = tricksWord.item(i);
wordWrap.innerHTML = wordWrap.innerHTML.replace(/(^|<\/?[^>]+>|\s)([^\s<]+)/g, 
'$1$2');

}

var tricksLetter = document.getElementsByClassName("tricksword");
for (var i = 0; i < tricksLetter.length; i++) {

   var letterWrap = tricksLetter.item(i);
   letterWrap.innerHTML = letterWrap.textContent.replace(/\S/g, "$&");

}
  
</script>
Copy