# CertSGN

We will briefly describe here the contributions of the article[1], in which members of the certSign research group introduced a new method for producing the following:

• Starting with an encryption scheme which is homomorphic with respect to one operation (such as multiplication), the recipe of the authors produces another encryption scheme which is now homomorphic with respect to two operations (for example, addition and multiplication).

The authors use this technique to construct examples of encryption schemes that, theoretically can handle any algebraic function on encrypted data.

The homomorphic encryption scheme CSGN, a symmetric homomorphic encryption scheme with plaintext ${\displaystyle \mathbb {F} _{2}}$ (the field with two elements) was introduced in the same article. The latter plays an essential role the architecture of a privacy-preserving contact tracing application, developed by certSign as part of the TAMEC project. [2]

The content of the article is protected under the law by two patents. [3]

A toy implementation can be found here : https://github.com/certfhe/CSGN

## Ring homomorphic encryption schemes from monoidal ones. The blueprint

Given a monoid ${\displaystyle M}$ and any commutative ring ${\displaystyle R}$ with unity, one can associate to these an algebra ${\displaystyle R[M]}$. As an ${\displaystyle R}$-module, the monoid algebra ${\displaystyle R[M]}$ is free with a basis consisting of the symbols ${\displaystyle [x]}$, where ${\displaystyle x\in M}$.

The multiplication in this algebra is defined by extending ${\displaystyle [x]\cdot [y]=[xy]}$ in an ${\displaystyle R}$-bilinear manner. Any element ${\displaystyle a\in R[M]}$ has a unique representation

${\displaystyle a=\sum _{x\in M}a_{x}[x],}$

where ${\displaystyle a_{x}=0}$ for all but finitely many ${\displaystyle x\in M}$. The product of two elements ${\displaystyle a,b\in R[M]}$ is given by

${\displaystyle ab=\sum _{x\in M}\left(\sum _{yz=x}a_{y}b_{z}\right)[x].}$

We note that the identity element with respect to multiplication is ${\displaystyle 1[e]}$, where ${\displaystyle e}$ is the identity element of ${\displaystyle M}$. If ${\displaystyle M}$ is a group then the monoid algebra described above is called a group algebra.

If ${\displaystyle M,N}$ are two monoids, a monoid homomorphism ${\displaystyle \phi :M\to N}$ induces a natural ${\displaystyle R}$-algebra homomorphism ${\displaystyle \phi _{R}:R[M]\to R[N]}$.

We also remark that for any ${\displaystyle R}$-algebra ${\displaystyle A}$, there is a natural ${\displaystyle R}$-algebra homomorphism ${\displaystyle \epsilon :R[A]\to A}$ given by

${\displaystyle \epsilon \left(\sum _{x\in R}r_{x}[x]\right)=\sum _{x\in R}r_{x}x}$.

### The patented blueprint

Let ${\displaystyle R}$ be a finite ring and let ${\displaystyle (G,H,E,D)}$ be a monoid homomorphic encryption scheme. This implies that the ciphertext ${\displaystyle G}$ and the plaintext ${\displaystyle H}$ are monoids and the decryption algorithm ${\displaystyle D:G\to H}$ is a monoid homomorphism.

Consider an efficiently computable ${\displaystyle R}$-character ${\displaystyle \chi :H\to A}$, where ${\displaystyle A}$ is a finite ${\displaystyle R}$-algebra.

As explained above, the monoid homomorphism ${\displaystyle D:G\to H}$ induces the ${\displaystyle R}$-algebra homomorphism ${\displaystyle D_{R}:R[G]\to R[H]}$. At the same time, ${\displaystyle \chi }$ induces an ${\displaystyle R}$-algebra homomorphism ${\displaystyle \chi _{R}:R[H]\to R[A]}$. The ${\displaystyle R}$-algebra homomorphism ${\displaystyle \mathrm {Dec} }$ is defined as

${\displaystyle \mathrm {Dec} =\epsilon \circ \chi _{R}\circ D_{R}:R[G]\to R[H]\to R[A]\to A}$,

defined by the formula

${\displaystyle \mathrm {Dec} \left(\sum _{g\in G}a_{g}[g]\right)=\sum _{g\in G}a_{g}\chi (D(g))}$.

Let us denote by ${\displaystyle S}$ the image of ${\displaystyle \chi }$ in ${\displaystyle A}$. For the decryption algorithm to remain secure, one needs the assumption that ${\displaystyle \chi }$ is not the trivial character, a condition that is always assumed in the blueprint.

We now describe a ring homomorphic encryption scheme with plaintext ${\displaystyle A}$ and ciphertext ${\displaystyle R[G]}$. Let ${\displaystyle S}$ be the image of ${\displaystyle \chi }$ in ${\displaystyle A}$ and fix some integer ${\displaystyle k\geq 1}$ such that the elements of the form ${\displaystyle \sum _{i=1}^{k}r_{i}s_{i}}$, with ${\displaystyle s_{i}\in S}$ is the whole ${\displaystyle R}$-algebra ${\displaystyle A}$.

• ${\displaystyle \mathrm {Enc} :}$ Consider a fixed tuple ${\displaystyle (r_{1},\dots ,r_{k})\in R^{k}}$. For a plaintext ${\displaystyle m\in A}$ consider ${\displaystyle (h_{1},\dots ,h_{k})\in H^{k}}$ such that ${\displaystyle m=\sum _{i=1}^{k}r_{i}\chi (h_{i})}$. Then
${\displaystyle \mathrm {Enc} (m)=\sum _{i=1}^{k}r_{i}[E(h_{i})]}$ .
• ${\displaystyle \mathrm {Dec} :}$ The decryption algorithm is given by
${\displaystyle \mathrm {Dec} \left(\sum _{g\in G}a_{g}[g]\right)=\sum _{g\in G}a_{g}\chi (D(g)).}$

The authors of the article prove that ${\displaystyle (R[G],R,\mathrm {Enc} ,\mathrm {Dec} )}$ is a ring homomorphic encryption scheme and the security of this scheme is the same as the security of the monoid encryption scheme ${\displaystyle (G,H,E,D)}$ that one starts with.

## A symmetric ring homomorphic encryption scheme

In this section we describe the CertSGN scheme. As ciphertext space we take ${\displaystyle G=\mathbb {F} _{2}^{n}}$, where we consider the monoid structure defined by component-wise multiplication. Basically, ${\displaystyle G}$ is the commutative monoid generated by ${\displaystyle n}$ idempotents with no other relations between these. As plaintext, we consider the monoid ${\displaystyle \mathbb {F} _{2}}$. The CertSGN scheme is defined as follows:

• Setup(${\displaystyle 1^{\lambda }}$): Choose the dimension parameter ${\displaystyle n=n(\lambda )}$ and the integers ${\displaystyle d=d(\lambda )}$, ${\displaystyle s=s(\lambda )}$ such that ${\displaystyle n=2sd}$.
• SecretKeygen: Choose a subset ${\displaystyle S}$ of ${\displaystyle \{1,2,\dots ,n\}}$ of size ${\displaystyle s}$. Set the secret key to be ${\displaystyle S}$.
• ${\displaystyle E:}$ To encrypt a bit ${\displaystyle m\in \mathbb {F} _{2}}$, choose ${\displaystyle d}$ random numbers ${\displaystyle i_{1},i_{2},\dots ,i_{d}}$ from the set ${\displaystyle \{1,2,\dots ,n\}}$ such that there are exactly ${\displaystyle m}$ of them in the secret key ${\displaystyle S}$. Set ${\displaystyle E(m)}$ to be the vector in ${\displaystyle G}$, whose components corresponding to the indices ${\displaystyle i_{1},i_{2},\dots ,i_{d}}$ are equal to ${\displaystyle 0}$ and the others are equal to ${\displaystyle 1}$.
• ${\displaystyle D}$: To decrypt a ciphertext ${\displaystyle c\in \mathbb {F} _{2}^{n}}$, set ${\displaystyle D(c)=0}$ if ${\displaystyle c}$ has at least one component equal to ${\displaystyle 0}$ corresponding to an index from ${\displaystyle S}$ and ${\displaystyle D(c)=1}$ otherwise.

Remark that if one represents the secret key as the indicator vector of ${\displaystyle S}$, namely ${\displaystyle {\overline {s}}\in \mathbb {F} _{2}^{n}}$ then the decryption algorithm ${\displaystyle D}$ can be expressed as an inner product over ${\displaystyle \mathbb {F} _{2}}$ between ${\displaystyle c}$ and ${\displaystyle {\overline {s}}}$.

One can check that the scheme ${\displaystyle (\mathbb {F} _{2}^{n},\mathbb {F} _{2},E,D)}$ described above is a monoidal encryption scheme, so one can use the recipe in the blueprint to obtain a ring homomorphic encryption scheme ${\displaystyle (\mathbb {F} _{2}[\mathbb {F} _{2}^{n}],\mathbb {F} _{2},\mathrm {Enc} ,\mathrm {D} ec)}$.

We refer to the paper [1] for a proof of the correction of this scheme and for security and efficiency analyses.

## Differences from homomorphic schemes based on LWE

In the ring homomorphic encryption scheme obtained above, we remark that the multiplication operation on fresh ciphertext is extremely efficient. It consists of only ${\displaystyle n}$ multiplications of two bits.

However, addition of ciphertexts makes the ciphertext grow. This phenomenon is exactly the opposite to the situation which appears in homomorphic schemes which are based on (R)-LWE problem. In the latter, the message is hidden using "noise", a quantity that grows upon homomorphic operations. If the noise is too large, then a message cannot be decrypted. When performing homomorphic operations on ciphertext, the noise grows linearly with the number of additions, but it grows exponentially with the multiplication depth of the circuit.

The CertSGN scheme brings huge advantages if somebody wants to homomorphically evaluate a circuit whose polynomial representation consists of a sum of few very large power monomials.

## References

1. M. Barcau and V. Pasol, Bounded Fully Homomorphic Encryption from Monoid Algebras, https://eprint.iacr.org/2018/584
2. U.S. Patent Appln. No. 14/936,097 and European Patent Appln. No. EP 15193706.7