1. Introduction
Fully homomorphic encryption is an ideal privacy protection scheme for the cloud environment. It can compute encrypted data without a secret key, and the resulting ciphertext can be decrypted correctly. This allows the cloud server to complete the processing of the data without disclosing sensitive information, while protecting the users’ data and privacy security and making full use of the cloud server’s computing power. At present, fully homomorphic encryption technology has been widely used in deep learning [
1,
2], secure multiparty computation [
3,
4], and other fields. The first fully homomorphic encryption scheme was proposed by Gentry [
5], which was constructed based on the bounded distance decoding problem (BDDP) and sparse subset sum problem (SSSP) on the ideal lattice. Firstly, an encryption scheme that can perform finite degree homomorphic evaluation is constructed. Then, the noise growth is controlled using “bootstrapping” technology to achieve an arbitrary degree of homomorphic evaluation. Smart and Vercauteren [
6] proposed a variant of Gentry’s scheme [
5] SV10 with a relatively small key and ciphertext size. Then, Gentry and Halevi [
7] optimized the key generation process for SV10, but the limited condition of the finite field made the key generation algorithm very complex. The first-generation FHE (fully homomorphic encryption) scheme based on the ideal lattice has many disadvantages: (1) the complex construction; (2) the low efficiency of the encryption and decryption processes; (3) the security proof of the SSSP assumption is not sufficient. The construction of the second-generation FHE scheme is based on the LWE (learning with errors) or RLWE (ring LWE) assumption [
8,
9], whereby the security can be reduced to standard problems in the lattice without additional assumptions. In 2011, Brakerski and Vaikuntanathan [
10] first used the LWE problem to construct the BV11 scheme, which uses a re-linearization method to achieve fully homomorphic encryption, breaking the construction framework used by Gentry. In 2012, Brakerski et al. [
11] constructed the BGV12 scheme. They sorted out the re-linearization technology in the BV11 scheme and proposed the key switching technology and module switching technology schemes. They constructed a leveled FHE scheme with these technologies. Then, Brakerski [
12] constructed a scale-invariant FHE scheme using tensor product technology, which no longer requires the module switching technology to compress the scheme noise. Later, Fan et al. [
13] proposed the FV12 scheme to transplant the LWE-based Bra12 scheme to the RLWE problem. Two optimization methods were proposed to solve the problem of the low efficiency of the RLWE-based key switching technology. However, they rely on the circular security assumption without changing the key after re-linearization, which risks leaking the key. The second-generation FHE scheme is simple and efficient. However, bootstrapping technology is needed to gain an unbound number of computations for the ciphertext. The improvement of the bootstrapping process is one of the current research directions [
14,
15] because of its low efficiency. The leveled fully homomorphic encryption scheme can evaluate arbitrary polynomials homomorphically, which can meet the requirements of most applications. The research on the leveled FHE scheme mainly focuses on how to reduce the ciphertext size effectively [
16], control the noise growth after the homomorphic evaluation [
17], and explore new methods to construct the FHE scheme [
18]. The key switching technology is an important technology scheme used to control the ciphertext dimensions, and its optimization is also an important direction to improve the leveled fully homomorphic encryption scheme.
Unlike the optimization of the above fully homomorphic encryption self-construction technology, researchers have tried to make breakthroughs in parallel computing. Under the construction of the first-generation fully homomorphic scheme, Smart et al. [
19] improved the SV10 scheme. They used the polynomial CRT to construct the ‘plaintext slot’ and showed how to select parameters to achieve SIMD operations while maintaining the practicability of the key generation technology [
7]. Gentry, Halevi, and Smart [
20] implemented the homomorphic evaluation of a multi-logarithm overhead in the RLWE-based FHE scheme using the packing technology from SV11. In 2013, Brakerski et al. [
21] proposed a packing method based on the LWE assumption, which can simplify the homomorphic scheme of the data movement on the plaintext slot. However, the asymptotic efficiency is not as good as the packing method based on the RLWE with the polynomial CRT. Chen [
22] proposed a multi-bit FHE scheme with a shorter public key size based on the improvement of [
21]. Since then, researchers have proposed many methods to improve the parallel efficiency of the fully homomorphic encryption process [
23,
24].
Regarding fully homomorphic encryption, many related studies have been focused on RLWE, relying on ring polynomials. Compared to the LWE problem, RLWE has many advantages: (1) the RLWE scheme has a great algebraic structure and simple lattice cipher characteristics; (2) the polynomial product in RLWE can be realized via fast Fourier transformation [
25], and the multiplication evaluation is faster than that in LWE; (3) the batch technology based on RLWE is more efficient than the multi-bit technology based on LWE. Therefore, this paper studies how to improve the efficiency and security of fully homomorphic encryption schemes based on RLWE.
The key switching technology is proposed to solve the problem of dimension expansion of the ciphertext after homomorphic evaluation, especially after homomorphic multiplication. Its essence is to encrypt the old key with a new key as the evaluation key, which is used as auxiliary information to convert the long ciphertext under the old key into the short ciphertext under the new key. The key replacement is performed to avoid the circular security assumption. The circular security assumption is that it is safe to encrypt the leveled FHE secret key under its public key. Some problems arise when encryption schemes rely on the circular security assumption. On the one hand, to design a scheme that satisfies the circular security, it is necessary to follow a specific structure that will make the scheme complex. On the other hand, the existing schemes [
26,
27] that can satisfy the circular security assumption have problems with noncompact ciphertexts and low encryption and decryption efficiency rates.
The key switching technology based on LWE compresses the noise introduced from the binary expansion, which is more complex for polynomials. The scheme based on RLWE achieves the compression of the ciphertext dimension using re-linearization technology. The technology also requires the evaluation key to help implement ciphertext updates, but the difference is that the key is not changed after re-linearization. The evaluation key is neither an RLWE instance nor a real encryption of the key, but rather a masking version with noise added. The scheme relies on the weak circular security assumption; that is, the scheme is still secure when the adversary obtains the evaluation key, although the security requires more proof.
Our Contribution. We first propose that the secret key can be restricted to sampling from the error distribution on the ring via a transformation. This error distribution can be replaced by a smaller distribution with the variable parameter to make smaller. Since the essence of the evaluation key is the encrypted secret key, selecting the key from the new distribution reduces the noise of the scheme and the size of the evaluation key. Second, we propose a new key switching technology to use the method of “modulus scaling” to reduce the introduced noise, which is simple and efficient. Our key switching technology is as efficient in the RLWE-based scheme as in the LWE-based scheme, without depending on the circular security assumption. Specifically, we enlarge the modulus to accommodate the large noise generated by the process and finally reduce the modulus and noise without affecting the ciphertext update. Changing the key after each multiplication means that the leveled FHE scheme that can evaluate the L-leveled arithmetic circuit needs L keys, which will sacrifice the efficiency.
To further improve the efficiency of the leveled fully homomorphic encryption scheme based on RLWE, we also consider using batch technology. The polynomial Chinese remainder theorem is used to package multiple plaintexts into a ciphertext to improve the utilization of space and computing resources. Finally, we obtain a batch-leveled fully homomorphic encryption scheme with the shorter key without a circular security assumption. Our parameter size is better than the MB18 [
28] scheme with the same batch technology.
Organization. The second chapter describes the notation and some basic definitions we need to use. The third chapter firstly proves that the secret key can be selected from a small noise distribution, and the security of the scheme is not affected. Then, the basic encryption scheme and the optimized key switching technology are described in detail. We also give the correctness and security proof. The fourth chapter describes how to construct a batch scheme by combining our key switching technology and the packing technology based on the polynomial CRT. The correctness and security proof of the scheme are given. The fifth chapter presents the parameter setting of the scheme and the parameter comparison of other schemes. The sixth chapter provides a summary.
2. Preliminaries
Notation. In the construction of the scheme, we will use a polynomial ring , where is an irreducible polynomial with the degree . Let . The elements in a polynomial ring are represented in lowercase, and the polynomial vectors are represented in bold lowercase. For example, the coefficient of element is represented by ; that is, . The infinity norm of polynomial ’s coefficient vector is defined as , and the -Norm is defined as . The expansion factor of is defined as . When is the power of 2, then . Let be an integer. Let denote the set of integers . For , we use to represent the unique integer in . For , the notation denotes the coefficient modulus of polynomial . Here, represents an integer set ; denotes the random uniform sampling of from distribution . All logarithms are based on 2. The tensor product of two vectors composed of polynomials with the same dimension is denoted as , and the inner product of the two tensor products is denoted as:
decomposes vector into its bit representation. Namely, with all outputs .
2.1. RLWE
Lyubashevsky, Peikert, and Regev [
29] introduced the ring learning with errors problem.
Definition 1 (Decision RLWE). For security parameter , let , where has a power of 2. For , let and . Let be a distribution over . The problem is used to distinguish the following two distributions: the first distribution and the second distribution , where with , , . The assumption is that the problem is difficult.
The RLWE problem is a variant of the LWE problem. DRLWE is a decision version of RLWE. In the worst case, the shortest vector problem (SVP) can be reduced to RLWE.
Theorem 1. Let be the power of 2, and ring , where , the prime integer , and . There is an efficiently samplable distribution , which can output elements of with a length at most with overwhelming probability, such that if there exists an efficient algorithm to solve the problem, then there is an efficient quantum algorithm to solve is the approximate worst-case SVP problem for ideal lattices over .
Here, we define the B-bounded distribution as a distribution from sampling size not exceeding .
Definition 2 (Polynomial B-Bounded Distribution). Sample , , then the distribution on the polynomial is B-bounded, denoted as .
2.2. A Generic Transformation
The binary LWE assumption given by Brakerski et al. [
30] is that the original dimension
is increased to
to maintain the same security level when the key is selected from
. In this section, we prove that the key
can be selected from
, and it is safe without changing the dimensions of the key.
In the following, we prove that through a transformation , the sample of distribution can be mapped to the distribution . Therefore, can be limited to be sampled from the error distribution rather than uniformly sampled in , without any security problems.
Lemma 1. For the modulus , there is an arbitrary and error distribution . There is an absolute advantage of the polynomial time transformation , which maps to , where , and maps to itself.
Proof. The transformation is allowed to access the distribution over the set , where the distribution is or there is a uniform distribution . The following involves two steps to prove the above lemma.
- (1)
Transform obtains the sample by sampling at random from the distribution . When is , the sample satisfies , where .
- (2)
The samples selected from distribution are transformed into a different distribution. The additional samples are selected from . The samples are transformed to by transform , where , .
Since
and
,
is uniform. If the distribution
is uniformly distributed
, because
and
are uniform, the sample
belongs to
. It holds that the transformation maps the distribution
to itself; if the distribution
is
, then
,
, so it holds that:
Therefore,
is selected from distribution
. The transformation maps the distribution
to the distribution
. As such, Lemma 1 is proved. □
Lemma 2. ([
31]).
For , we consider m-th cyclotomic polynomials of degree. Then, for any , the fraction of reversible elements in is at least .
According to Lemma 2, the probability of selecting reversible elements from is large, so the probability of selecting samples satisfying the distribution from the distribution is large. Therefore, according to Lemma 1, can be sampled from the error distribution χ.
Theorem 2. ([
31]).
Let be the m-th cyclotomic number field with dimension and let be its integer ring. Let . Let , be a prime integer of a polynomial bounded by so that . Then, there will be a quantum reduction in the polynomial time from , the approximate SIVP (or SVP), on the ideal lattice of to . Alternatively, for the arbitrary , we can replace ), the approximate SIVP (or SVP), by solving the problem of the given samples, where .
It is enough to know that
and
are the Gaussian distributions. See [
32] for specific definitions. In the second reduction in Theorem 2, the DLWE of the fixed spherical error distribution
can be used to replace the distribution of the error distribution in the lattice reduction.
is a distribution affected by parameters. When the number of samples
is small, this is desirable in applications. The reduction in both leads to essentially the same error parameters. We prove that the key
can be selected from the error distribution
. We use the error distribution
instead of the distribution
so that
can be sampled from the error distribution
, meaning the security is unchanged. When the sample number
is small enough, the error distribution
is limited to be small enough that
, with an overwhelming probability.
2.3. Packing
This section introduces the batch technology that we will use, the packing technology of the polynomial Chinese remainder theorem, so that each ciphertext can correspond to multiple independent plaintexts and improve the encryption efficiency.
Definition 3 (Polynomial Chinese Remainder Theorem) [
20]
). Let be pairwise coprime polynomials. For arbitrary n polynomials , there is a unique polynomial , such that and , where ,.
Our scheme is based on the algebraic structure . In practical applications, is generally set as the cyclotomic polynomial with degree , while represents the Euler function. The cyclotomic polynomial can be decomposed into factors with degree under module 2, namely , which satisfies and . represents the finite field. According to the polynomial CRT in Definition 3, there is the following isomorphism relationship:
Namely, the elements on
have a mapping relationship with
elements in
. If we set
, it holds that:
where
. The mapping of
is isomorphic from
to
and the mapping of
is isomorphic from
to
.
Here, we set polynomial vectors , and according to the above isomorphism relationship we get:
3. Building Block
3.1. Basic RLWE-Based Encryption
In
Section 2.2, we proved that there is a transformation that means that the secret key
is selected from
rather than
with an overwhelming probability, which does not affect the security of the scheme. This will be our optimization approach to make the scheme have less initial noise. Because the evaluation key generated by the key switching contains the private key, it will be also reduced. Although the FV12 [
13] scheme proposes that the private key can be selected from
, the Hamming weight of the secret key is limited without further proof. The following describes our basic encryption scheme, which is a somewhat homomorphic encryption scheme. Here,
is a prime numberand
is the error distribution on
. The basic encryption scheme is defined as follows:
Sample . Output .
Input . Sample , , and then compute . Output .
To encrypt a message . Set , , sample , , . Compute , . Output .
Input . Compute .
Security. The semantic security of the cryptosystem follows from the RLWE assumption by noting that (,) is pseudorandom, meaning the ciphertext is indistinguishable from one that carries no information on the message.
To prove that the decryption is correct for properly encrypted ciphertexts, we prove the following lemma.
Lemma 3. Using the notation of the above encryption scheme and assuming that , it holds that:with . This means that for , the decryption work is correct. Proof. By the definition of module
:
Since the error term is small enough, we get . Since and , we get and get the bound term above .
According to the definition of module , . Then, , where . To round correctly, we need . □
3.2. Homomorphic Properties of Basic Encryption
Homomorphic addition:
Let
,
be the ciphertexts encrypted under
. According to Lemma 3, we get
,
. It holds that:
where
and
, with
. Let
and
. Here,
is the bound of the original noise term, i.e.,
,
. We get Lemma 4.
Lemma 4. Let and , be the ciphertexts encrypted under . Then:where. The addition decryption is correct when.
Homomorphic multiplication:
Let , be the ciphertexts encrypted under and be a multiplicative ciphertext corresponding to , . To preserve the homomorphism of the multiplication, the following structure is needed:
The tensor product is used to implement ciphertext multiplication to keep the structure divided by
. Therefore, we define
and the secret key should be
. We will discuss how to use our new key switching technology to replace the keys after homomorphic multiplication in
Section 3.3. Here, we continue to discuss how the ciphertext multiplication obtains homomorphism.
Set with . Let and. Using the properties of tensor product, we get:
According to Equation (1), we get:
It is easy to get and , where.
Plugging Equation (3) into Equation (2), we get:
where
and
,
.
Let , and , so that we get Lemma 5.
Lemma 5. Let , be the ciphertexts encrypted under . Set , . It follows that:
where. The multiplication decryption is correct when .
3.3. Optimizing the Key Switching
The key switching technology was first proposed in the BGV [
11] scheme, which is usually used after a homomorphic evaluation of the ciphertext to solve the problem of the dimensions of the ciphertext expanding after the tensor product. This technology converts the long ciphertext that can be decrypted by the key
into a short ciphertext
that can be decrypted by another key
. Some form of a key
is encrypted under the key
as a hint, which is called the evaluation key, to complete this transformation. The noise introduced in the conversion process is compressed using BitDecomp technology.
BitDecomp has low efficiency in the binary expansion of polynomials. Therefore, the FHE scheme based on RLWE will not transplant the key switching technology based on LWE into RLWE. The re-linearization technology is used to compress the ciphertext dimensions without changing the key. With the re-linearization technology, it is also necessary to use the evaluation key to assist in the completion of the ciphertext compression. However, this evaluation key is a masking version containing the secret key, which is neither a real sample of the RLWE distribution nor a real encryption method. The scheme relies on a weak circular security assumption that the scheme is still secure even if the adversary obtains the evaluation key, which is not strictly proven. Moreover, there are problems that the size of the key is inversely proportional to the noise introduced by the re-linearization process, and the re-linearization process requires multiple multiplication evaluations.
In the following, we propose a new key switching technology based on RLWE, which does not need to use the BitDecomp technology, meaning we can replace the key to avoid the circular security assumption. We use the ‘modulus scaling’ method to reduce the noise using a large modulus. There is some performance loss due to the security enhancement, but our approach has more advantages during storage. Since we have proven in
Section 2.2 that the key
can be selected with a small noise distribution, we can further reduce the size of our evaluation key.
Our key switching method includes two processes. First, inputs two keys and a large integer , and the output key encrypts the key by times as the evaluation key . The modulus of the key is also amplified to accommodate additional noise. inputs the evaluation key and the ciphertext encrypted under the key and outputs the new ciphertext encrypted under the key . The ciphertext and the ciphertext are encrypted for the same plaintext message with the same modulus.
- -
Input two keys and a large integer . Let . Uniformly sample a matrix composed of polynomials and an error vector , where is the noise distribution over . The output is a matrix of polynomials.
- -
To switch a ciphertext under a secret key to , output:
To ensure the security, the variance of
cannot be simply taken as the variance of
, otherwise it will lead to great security losses. In
Section 5, we prove that if for some real number
, written as
, and suppose
, we need
, where
is a constant, e.g.,
. The correctness and security are as shown below.
Lemma 6 (Correctness). Set, , as arbitrary vectors of polynomials. LetLet . Then:where.
Proof. Let and . According to the definition:
Lemma 6 is proven. According to Lemma 6, we can choose p to minimize the error so that it is less than the error of the multiplication. Then, we must choose when is small and does not depend on . □
Lemma 7 (Security). Let be the arbitrary vectors of polynomials. If and, then is computationally indistinguishable on, assuming thatholds.
Proof. According to the key switching process, , , where is a uniform matrix, . Since each element of is the ciphertext of the RE encryption scheme, is indistinguishable from the uniform distribution . Therefore, is computationally indistinguishable from the uniform distribution on and Lemma 7 is proven. □
5. Parameter Setting and Efficiency Analysis
The batch scheme in this paper is mainly based on the RLWE problem, and the difficulty of the RLWE problem is analyzed according to [
26].
Let denote the modulus and represent the degree of polynomial ring , then let denote the variance of the probability distribution .
Definition 4. ([
9])
. Let an -dimensional lattice based on B have a factor satisfying , where is the shortest vector of , then is called the Hermite root factor. Theorem 4. ([
9])
Given , the time required to reduce the lattice basis with the Hermite factor mainly depends on Theorem 5. ([
9]).
For a Hermite factor , the length of the shortest vector is computed to be . The base time is about , where , and is the advantage in distinguishing attacks. According to the above theorem, it can be quickly deduced that for a fixed and a fixed security level, as long as is selected, an effective parameter pair can be transformed into another effective parameter pair , where is the arbitrary real number. During key switching, also uses this bound.
To obtain the parameters that guarantee that the homomorphism scheme of a circuit with depth can be executed, we choose the degree and then calculate the effective value of . Let , then the distribution can be considered bounded. According to Theorem 3, the maximum multiplication depth that can handle satisfies:
In the above inequality, we assume that the noise introduced by key switching is less than that after the first multiplication. Therefore, we can get:
According to Theorem 5, if we set the security level at
, then we can set the time as
. Then, the minimum
can be obtained as
. Assuming
, we obtain
,
. If we let
, we get
. To ensure that the circuit with depth
can be executed, the sizes of
and module
at different circuit depths are shown in
Table 1.
Next, we compare our batch FHE scheme with the FV12 [
13] and MB18 [
28] schemes. The comparison shows that there is obvious optimization. In
Table 2, all parameter sizes are in bits.
Compared with the FV12 scheme, since we do not rely on the circular security assumption, the scheme requires evaluation keys for the circuit depth . The evaluation key size of our scheme is slightly larger than that of the FV12 scheme, but we can encrypt more plaintext bits at a time, making it more secure. Compared with the MB18 scheme (, is used to reduce noise), the number of encrypted plaintext bits is the same, but the size of the secret key and the evaluation key in our scheme is better.