FHE/Zama: The Future of Encryption

In short
  • Cryptography is everywhere, yet often unseen; a reminder of symmetric and asymmetric keys.
  • Current limitation: data must be decrypted to be processed.
  • FHE (Fully Homomorphic Encryption) allows calculations to be performed directly on encrypted data.
  • Zama, a French startup founded by Pascal Paillier, and its HTTPZ ambition.

Introduction

Some technologies are revolutionary yet completely unknown to the general public.

Often, we use remarkable scientific achievements, particularly in mathematics, in our daily lives without even realizing it.

For example, today, the internet would not be what it is without the use of cryptography. If you can buy goods and services online, access your bank accounts, or send sensitive information, it's thanks to the many encryption protocols available. They have evolved over time and, under certain conditions, allow us to protect ourselves when exchanging data on the web.

I am far from being an expert on this subject, but I will try to summarize some of the methods currently used in order to introduce you to FHE (Fully Homomorphic Encryption) and the French startup Zama.

A small disclaimer: it is possible that I may misrepresent certain concepts, or even be wrong in my explanation. Please be understanding, and if there are any real errors, please do not hesitate to contact me and share your insights; I would be happy to improve the article if necessary.

Principles of Keys

Principle of keys

Click the image to enlarge.

To address the problem of information encryption, we often talk about encryption keys. These are secret values (often a sequence of bits, or a password derived from a sequence of bits) that serve to:

  • encrypt data (making it unreadable to those not involved in the exchange).
  • decrypt this data (making it readable again for those involved in the exchange. And please, let's stop saying 'decrypter'.)

Symmetric Keys

One of the simplest forms of cryptography that uses a key is the use of so-called symmetric keys.

Symmetric key

Click the image to enlarge.

The goal is to encrypt and decrypt data using the same key. This key must be defined between the parties involved in an exchange and must be kept secret by them.

Let's take, as an example, the famous characters Alice and Bob, who are found in most explanations of encryption.

Alice and Bob want to exchange information that only they can encrypt and decrypt.

They then define a key, and Bob encrypts his message with this key and sends the information to Alice. Since Alice knows the key, she decrypts the message and then writes a response, which she sends back to Bob after first encrypting it with the same key.

This is basic, effective, fast, and easy to implement.

This is what is used today by algorithms such as AES-256, which can be found in file encryption solutions like VeraCrypt and Bitlocker...

The problem remains the exchange of this key. All participants in the conversation must exchange the key at least once, and if it is intercepted or recovered by a malicious actor (often called Eve in demonstrations), all protection collapses.

This is known as a Man In The Middle attack.

This is the problem of the initial secret, which is particularly problematic if Alice and Bob are far apart from each other.

Demo - Symmetric Encryption

Alice wants to send a secret message to Bob. They use symmetric encryption, but they must first exchange a secret key...

This key must be shared between Alice and Bob
If enabled, Eve captures the key during the initial exchange between Alice and Bob

Asymmetric Keys

That's why other mechanisms emerged, which are called asymmetric keys.

Asymmetric Keys

Click the image to enlarge.

It was from 1970, thanks to inventions such as the RSA algorithm and the key exchange protocol Diffie-Hellman, that asymmetric encryption emerged. This type of encryption uses a pair of distinct keys:

  • A public key to be shared freely
  • A private key to be kept secret.

The two are mathematically linked, but it is impossible to recover the private key from the public key, at least for now and subject to sufficient key length…

If we go back to the principle of Alice and Bob:

Each person generates their own pair of private/public keys, and each sends the other their public key.

This public key can only be used to encrypt data intended for its original owner.

The data encrypted in this way can only be decrypted using the private key that was generated at the same time as the public key.

Bob can therefore encrypt his message with Alice's public key, and only Alice will be able to decrypt this message using her private key.

Thus, only the public key needs to be exchanged, and its interception by a malicious actor gives them no possibility of decrypting a message without obtaining the private keys that remain with their original owners.

Asymmetric keys therefore have many advantages.

  • No need to exchange a secret key beforehand.
  • It allows authentication (digital signature).
  • It relies on very difficult mathematical problems (RSA, ECC).

However, asymmetric encryption is more computationally intensive than symmetric encryption. Fortunately, our current computing equipment is powerful enough to handle the load… with the disadvantage of having to use increasingly large key sizes as hardware evolves.

The goal is to prevent the associated mathematical principles from becoming obsolete, which could compromise the security of encryption algorithms using keys that are too small and might be discovered after many calculations. (Advantage: adding bits exponentially increases the difficulty of breaking the key... but also the power required to manipulate it).

Therefore, it is now recommended to use at least 2048-bit keys, or even 4096-bit keys (for very sensitive data).

Also, pay attention to the criticality of its private key. If it does not need to be shared, it is crucial to protect it adequately and ensure that it is not accessible to everyone. This means that you should not disclose your private key from one device to another, for example, by email, and you should not store it in the root directory of your web server.

This principle of asymmetric keys is at the heart of our current internet and the famous HTTPS with its associated certificates.

You will find this mechanism in protocols such as TLS.

Secure messaging applications like Signal also use this type of principle.

I would also like to clarify the differences between SSL, TLS, and HTTPS, which are often confused.

Term Means Main role
SSL Secure Sockets Layer An old network communication encryption protocol (deprecated today).
TLS Transport Layer Security The modern and secure version of SSL (at least version 1.2 should be used today, with version 1.3 recommended).
HTTPS HyperText Transfer Protocol Secure The HTTP protocol using TLS/SSL to encrypt web traffic

The Problem with Current Encryption Methods

Whether it is a symmetric or asymmetric key, all current uses face the same problem: you cannot perform operations on encrypted data.

In the case of Alice and Bob, this is not really a concern, but in everyday life, it can become annoying.

This is one of the reasons behind data leaks and other losses of personal information that are often reported... and which cyber marketing companies are eager to exploit to encourage you to purchase audit services or new revolutionary products...

If, when using a service (such as online shopping), your communication with the servers of the company you are contacting is well encrypted, your data is often in plain text once decrypted on the remote server.

Let's take a basic example. You need to prove your age to access a sensitive service (without any inappropriate implications):

  1. You enter your age on the website's page.
  2. The data is encrypted on your computer (using the server's public key) and sent to the remote server.

  3. Once on the server, the information is decrypted (using the server's private key).
  4. Your age is compared to a reference value to determine if you are authorized to access the service.
  5. The response is encrypted on the server (using your public key) and sent back to you.
  6. You then decrypt the response on your computer (using your private key).

Problem: Imagine that the server with which you shared your age has been compromised. In this case, when the data was decrypted on its side, your age could have been retrieved by a malicious actor. Even without being compromised, the server may also retain the data without your consent, and this data could later be stolen or used for other purposes.

In my example, the consequences are not very serious, but imagine encountering the same issue with medical or banking data, for example.

This is the core difficulty. Most often, your data needs to be processed in some way, and to do this, it must be decrypted. It can therefore potentially be accessed by an attacker who has managed to infiltrate the system you are communicating with.

Demo - Asymmetric Encryption (RSA)

Alice wants to send a confidential message to Bob. With asymmetric encryption, Bob generates two keys: a public key (that anyone can know) and a private key (that he keeps secret).

If enabled, the hacker infects Bob's machine with malware and steals the decrypted data

FHE (Fully Homomorphic Encryption)

And that's where FHE (Fully Homomorphic Encryption) or fully homomorphic encryption comes in.

FHE

Click the image to enlarge.

It is a form of encryption that allows computations to be performed on encrypted data without ever having to decrypt it.

Let's take another basic example.

We want to encrypt two sensitive pieces of data, such as the numbers 5 and 7, using a private key.

We send the encrypted data to a third-party server so that it can perform an operation on this data, for example, addition.

The server retrieves the data but does not decrypt it. It performs the operation on the encrypted data and returns the result, which remains in its encrypted form. Even the server doesn't know the result; it only has its encrypted form in memory.

On the our end, we receive the result and decrypt it using the key that was used for encryption: we obtain 12. I encourage you to understand the principle in the demo below

Note: This demo is a simulation of FHE and is only intended to illustrate the concept of homomorphic encryption.
Demo - Addition with Homomorphic Encryption
Enter between -100 and 100
Enter between -100 and 100
Your password

My example is basic and not very useful; it is primarily educational.

A Concrete Example Using AI and the Supply Chain

But now imagine that you want to take advantage of an AI in the cloud with enormous computing power. You would like to train this AI with your data, for example, your company's data (your customers, your contracts, etc.), but the AI service you have chosen is not European, and you are concerned that your data may be misused despite the contract signed with your partner, which guarantees you complete sovereignty over your data...

Well, with FHE, this would be possible. You would send your encrypted data using your own key, and the AI could train on it without having to decrypt it. On your end, you could then implement the AI's responses in your applications by decrypting them with your private key.

At no point does your cloud provider handle your data in plaintext, and therefore is unable to use it for any purpose other than the one you intend.

Similarly, if it were to be hacked, you would not be concerned; the data recovered by the hacker could not be exploited without your key.

In cybersecurity, we often talk about supply chain attacks (supply chain), where an attacker targets a victim by exploiting one of their partners. FHE limits this risk.

Quantum Ready

Another advantage of FHE is its resistance to quantum computers.

Previously, I said that in the use of an asymmetric key system, it is not possible to recover a private key from a public key… and well, that's exactly what a quantum computer could do... At least, not yet, because the few quantum computers, which are more like prototypes than finished products, are not powerful enough to process our current key sizes.

According to some, we shouldn't wait too long for the "quantum leap" to occur.

The American organization NIST (National Institute of Standards and Technology), which plays a global role in standardizing encryption algorithms (it validated AES and SHA, for example), has officially recommended transitioning to quantum-resistant algorithms as early as 2035.

FHE is already ready for this.

Problems with FHE

But not everything is rosy with FHE.

In fact, some of the principles behind FHE have been known since 1978, with RSA, which allows a partially homomorphic form, meaning that you can apply certain operations on encrypted data, but in a very limited and inefficient way.

FHE, as mentioned today, was first implemented in 2009 by Craig Gentry, a researcher at IBM. The problem is that it was extraordinarily slow (several hours for a simple addition), but the proof of concept was there.

This is the starting point for all modern research on FHE.

Since then, more efficient schemes have emerged. Many well-known companies (IBM, Google, Microsoft, etc.) are actively working on this topic, but the implementation and use of FHE remain complex. They require both highly specialized human skills and significant hardware resources.

Zama

Fortunately, a small revolution arrived in 2020, and it's French.

It is the startup Zama.

Zama logo

Click the image to enlarge.

It was founded by Pascal Paillier, who previously developed an initial homomorphic addition solution in 1999, and Rand Hindi, a French entrepreneur with a doctorate in bioinformatics.

Founder of Zama

Click the image to enlarge.

Zama relies on a modern approach to implementing Fully Homomorphic Encryption (FHE): TFHE (Torus Fully Homomorphic Encryption). This model, introduced in 2018, has been optimized for fast logical operations (booleans, bits, integers).

While TFHE remains complex, Zama has achieved the remarkable feat of providing an Open Source Rust library and offering an FHE compiler for Python, Concrete.

These libraries make using FHE circuits much simpler by abstracting away all the complicated mathematical principles, allowing for ready-to-use applications.

Available products from Zama

Click the image to enlarge.

Therefore, Zama is truly leading a revolution. It's a significant paradigm shift.

Previously, a doctorate in cryptography was required to utilize FHE. Thanks to Zama, a Python developer can now demonstrate its use in 5 minutes... especially if they use AI for assistance.

You can try installing the Concrete Python package. However, you must do so under Linux, as the code is not yet compatible with Windows. If necessary, you can use WSL (Windows Subsystem for Linux).

pip install concrete-python
Installation of the Zama Python library

Click the image to enlarge.

Here's some purely educational code that uses Zama's technology to perform a homomorphic addition:

  
# Exemple d'addition FHE avec Concrete de Zama
# Ce code nécessite : pip install concrete-python

from concrete import fhe
import numpy as np

# Étape 1 : Définir la fonction à compiler en circuit FHE
@fhe.compiler({"x": "encrypted", "y": "encrypted"})
def add_encrypted(x, y):
    """
    Fonction qui additionne deux nombres.
    Cette fonction sera compilée en circuit FHE permettant
    l'addition sur données chiffrées.
    """
    return x + y

# Étape 2 : Définir un jeu de données d'entraînement
inputset = [
    (np.int64(i), np.int64(j)) 
    for i in range(0, 50) 
    for j in range(0, 50)
]

# Étape 3 : Compiler le circuit FHE
print("🔧 Compilation du circuit FHE...")
circuit = add_encrypted.compile(inputset)
print("✓ Circuit compilé avec succès !")

# Étape 4 : Générer les clés de chiffrement
print("🔑 Génération des clés...")
circuit.keygen()
print("✓ Clés générées !")

# Étape 5 : Définir nos valeurs en clair
a = np.int64(5)
b = np.int64(7)
print(f"\n📝 Valeurs en clair : {a} + {b}")

# Étape 6 : Chiffrer les valeurs
# CORRECTION : encrypt() prend TOUS les arguments de la fonction
print("🔒 Chiffrement des données...")
encrypted_args = circuit.encrypt(a, b)
print("✓ Données chiffrées !")

# Étape 7 : Effectuer l'addition sur les données CHIFFRÉES
print("⚙️  Calcul sur données chiffrées...")
encrypted_result = circuit.run(encrypted_args)
print("✓ Addition effectuée sur données chiffrées !")

# Étape 8 : Déchiffrer le résultat
print("🔓 Déchiffrement du résultat...")
decrypted_result = circuit.decrypt(encrypted_result)
print(f"✓ Résultat déchiffré : {decrypted_result}")

# Vérification
expected = a + b
print(f"\n✅ Vérification : {a} + {b} = {decrypted_result}")
print(f"✅ Résultat correct : {decrypted_result == expected}")
Testing the application

Click the image to enlarge.

FHE is becoming truly usable, even though implementations are still relatively few due to the need to democratize its use and, above all, because of the computational power still required to fully utilize it.

But the needs are there: encrypted machine learning, secure statistics, confidential finance. And many more.

Blockchain and web3 were among the first ecosystems to experiment with large-scale FHE implementation. Zama is also fully involved at this level.

Indeed, Zama aims to make computational privacy compatible with the transparency often displayed in public blockchains.

For example, Bitcoin or Ethereum make their transactions transparent, verifiable, and immutable.

This is how they guarantee trust without intermediaries, one of the cornerstones of web3.

However, in some cases (finance, healthcare, identity, AI), users want to prove that an operation is correct without revealing the underlying data.

This is exactly the role of fully homomorphic encryption (FHE), and this is where Zama enables simple FHE implementation.

It is important to note that other mechanisms exist, such as ZK-SNARKs or zero-knowledge proofs. These are different mathematical principles that allow you to prove something without having to reveal the proof. Imagine playing "Where's Waldo" and being able to demonstrate that you knew where he was in the image, without having to point him out.

But this is another topic that I will not detail here. Just know that FHE and zk-SNARKs can complement each other. FHE remains a more general and expressive approach.

We can then imagine confidential blockchains, where the network executes encrypted transactions, but where the results remain consistent and publicly verifiable.

Illustration of FHE in a blockchain

Click the image to enlarge.

Zama is also developing an FHE Virtual Machine (FHE VM). A virtual machine compatible with Ethereum that can execute smart contracts on encrypted data.

Thanks to its open-source vision and developer-focused approach, Zama could succeed in making FHE usable on a very large scale and could transform our current internet for greater sovereignty and security.

Furthermore, the company is not afraid to promote its ideal of transitioning from the HTTPS protocol to the HTTPZ protocol, where everything would be encrypted end-to-end, without fearing advances in quantum technology or failures in systems involved in data processing.

The question now is whether they will succeed. In any case, we can be proud to have this type of company in our country. We can only hope that it does not end up in the hands of a GAFAM and that FHE fulfills its promises.