Data processing method of torus fully homomorphic encryption algorithm based on integer bootstrapping
Through the toroidal full-homomorphic encryption algorithm based on integer bootstrap, the problem of inefficient in integer data processing in the existing technology is solved, and efficient bootstrap and nonlinear functions for integer-level data are realized Operations improve computational efficiency and reduce complexity.
Patent Information
- Application Number
- CN202311686527.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2043-12-11
AI Technical Summary
The existing toroidal full homomorphic encryption scheme is inefficient when processing integer data, has high computational cost, and is difficult to implement efficient bootstrap algorithms. Especially in nonlinear operations, complex circuits and higher-order polynomials are required to construct complex circuits and higher-order polynomials, resulting in computational efficiency. Low.
A torus full homomorphic encryption algorithm based on integer bootstrap is proposed, which supports efficient bootstrap algorithm for integer-level data. Through key generation, encryption, evaluation and decryption algorithms, the operation process is simplified, the method complexity is reduced, and the integers are realized. Efficient calculation of level data. The specific implementation includes key generation algorithm, encryption algorithm, evaluation algorithm and decryption algorithm, and uses integer bootstrap algorithm and key conversion algorithm to support nonlinear operations such as ReLU and Max functions.
It directly supports nonlinear function operations of integer-level data, simplifies the operation process, reduces the calculation time, and has no correlation with data accuracy, improves the calculation efficiency, and reduces the calculation cost.
Smart Images

Figure CN117857008B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data security and data processing, and specifically relates to a data processing method of a torus fully homomorphic encryption algorithm based on integer bootstrapping. Background Art
[0002] The idea of homomorphic encryption can be traced back to 1978. It refers to performing homomorphic operations on homomorphically encrypted data to obtain an output. When this output is decrypted, the result is the same as the output obtained by processing the unencrypted original data in the same way. This process can be simply understood as homomorphic encryption can be operated under ciphertext. This property makes homomorphic encryption very suitable for privacy protection in cloud computing mode. Applying homomorphic encryption in cloud computing mode can separate data processing rights from data ownership. The client owns the data ownership and the cloud server owns the data processing rights. The client encrypts the local private data and uploads it to the cloud server. The cloud server can perform large-scale operations on the ciphertext and send the ciphertext operation results back to the client. The client can obtain the result of the operation after decryption. In this way, the client can prevent the leakage of private data while utilizing the computing power of the cloud server.
[0003] Fully homomorphic encryption refers to an encryption scheme that can perform additive homomorphic encryption and multiplicative homomorphic encryption. Torus fully homomorphic encryption is currently the most commonly used and fastest fully homomorphic encryption scheme. It expands the message space to the torus and can perform homomorphic gate operations on Boolean data. However, there are also corresponding defects: on the one hand, since the torus fully homomorphic encryption scheme only supports homomorphic operations on bit-level Boolean data, integer data needs to be encoded into multiple bits and operated bit by bit, and each operation requires a bootstrap algorithm, which is very time-consuming; on the other hand, in order to ensure security and prevent decryption by malicious adversaries, the torus fully homomorphic encryption scheme introduces probabilistic noise during encryption, which causes the noise to increase sharply in the evaluation function, resulting in decryption failure.
[0004] In the prior art, a researcher has proposed a Boolean-level torus fully homomorphic encryption scheme, which is a torus-based fully homomorphic encryption scheme that performs gate operations on Boolean-level data and can bootstrap while performing gate operations; although the scheme can implement nonlinear operations such as ReLU and Max through gate operations, it can only support Boolean-level data, and integer-level data needs to be encoded into bit strings for bit-by-bit homomorphic operations, which is inefficient; and when implementing nonlinear operations such as ReLU and Max through gate operations, it is necessary to construct complex circuits to implement them, which has low computational efficiency. Another Cheon-Kim-Kim-Song scheme (CKKS for short) is a fully homomorphic encryption scheme that can perform homomorphic approximate calculations, supporting homomorphic operations of floating-point addition and multiplication for real or complex numbers, and the calculation results obtained are approximate values; although the CKKS scheme can support integer data operations, for nonlinear operations such as ReLU and Max, the scheme needs to perform homomorphic approximate calculations by constructing linear polynomials, and in order to ensure the accuracy after approximation, it is often necessary to construct high-order polynomials, which greatly increases the computational cost. Summary of the invention
[0005] In view of the problems of low efficiency and high computational cost in existing torus fully homomorphic encryption schemes, the present invention provides a data processing method for a torus fully homomorphic encryption algorithm based on integer bootstrapping, which expands the supported data types from Boolean level to integer level, realizes an efficient bootstrapping algorithm for integer-level data, reduces the complexity of the method, simplifies the calculation process, and greatly improves the calculation efficiency.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] On the one hand, a data processing method of a torus fully homomorphic encryption algorithm based on integer bootstrapping is provided, wherein the torus fully homomorphic encryption algorithm based on integer bootstrapping includes a key generation algorithm, an encryption algorithm, an evaluation algorithm and a decryption algorithm; the plaintext space of the torus fully homomorphic encryption algorithm based on integer bootstrapping is is the data accuracy, is a set of natural numbers; its ciphertext space is a and b are two components of the ciphertext, n represents the dimension of a, is a torus consisting of real numbers between 0 and 1;
[0008] The data processing method comprises the following steps:
[0009] The client calls the key generation algorithm KeyGen(1 λ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; the dimensions of the own key sk, bootstrap key bk and conversion key ks are all n;
[0010] The client calls the encryption algorithm Enc(m,sk) and uses its own key sk to perform an encryption operation on the plaintext data m∈{-B,...,B-1}, and obtains the ciphertext c and transmits it to the cloud server; the plaintext data includes Boolean-level plaintext data and integer-level plaintext data;
[0011] The cloud server executes the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, bootstrap key bk and conversion key ks provided by the client, obtains the evaluation result c' in the ciphertext state and sends it back to the client; the evaluation algorithm includes an integer bootstrap algorithm and a key conversion algorithm; the evaluation function f provided by the client includes a nonlinear evaluation function and a linear evaluation function; the client calls the decryption algorithm Dec(c',sk) according to its own key sk to decrypt the evaluation result c' in the ciphertext state and obtains the evaluation result of the plaintext data.
[0012] As a preferred technical solution, the encryption operation is specifically:
[0013] Take a random noise e and a random mask from a Gaussian distribution Return the ciphertext c = (a, b), satisfying b = sk·a+m / 2B+e;
[0014] The decryption operation is specifically as follows:
[0015] Through 2B(b-sk·a), we get 2Be+f(m), and then decrypt it by rounding up and down to get the corresponding plaintext f(m), that is,
[0016] As a preferred technical solution, the evaluation algorithm Eval(c,bk,ks,f) first passes the large noise ciphertext c of the plaintext data m, the bootstrap key bk, the dimension parameter N and the evaluation function f into the integer bootstrap algorithm to obtain the small noise ciphertext c'; then executes the conversion algorithm on the small noise ciphertext c' according to the conversion key, and converts the key of the small noise ciphertext c' into sk.
[0017] As a preferred technical solution, the specific implementation of the integer bootstrap algorithm is:
[0018] According to the evaluation function f, initialize the polynomial testv=μ0+μ1X in 2N space -1 +μ2X -2 +…+μ N-1 X-(N-1) =μ0-μ N-1 X-μ N-2 X 2 -…-μ1X N-1 ∈T N [X], N is the polynomial dimension parameter; {μ0,…,μ N-1} is the coefficient set of the initialization polynomial, satisfying μ j×i =f(i),j={0,…,N / B},i={0,…,B-1};
[0019] Treat the 2N space as 2N slots connected end to end and divide the 2N slots into 2B parts;
[0020] Put all slots in the kth part into f(k). Due to the non-negativity of the polynomial, put all slots in the k+Bth part into -f(k), k = {0, B-1}, f(k) is the output of the evaluation function f when the input is k;
[0021] Plaintext rotation: Logically shift the polynomial coefficients left by b bits to obtain the plaintext rotated polynomial ACC. The plaintext rotation formula is: ACC = (0, testv) · X b ;
[0022] Ciphertext rotation: According to the polynomial ACC after plaintext rotation and the bootstrap key bk, the ciphertext is rotated using the outer product operation to obtain the polynomial ACC1 after ciphertext rotation; the input of the outer product operation is two ciphertexts C m1 , C m2 , the output is ciphertext C m1×m2 ; The ciphertext rotation formula is: Among them, h is the ciphertext of 1; a i is the i-th component in the ciphertext a; Indicates to shift the polynomial logic by -a i bit, i.e. logical right shift a i Position; bk i is the i-th component of the bootstrap key bk; is the outer product; the ciphertext rotation is repeated n times, and after each rotation, the polynomial ACC1 is assigned to the polynomial ACC, where n is the dimension of a and the bootstrap key bk in the ciphertext;
[0023] The constant term coefficients of the polynomial ACC1 after the ciphertext rotation are extracted, and the extracted constant term coefficients ciphertext is output.
[0024] As a preferred technical solution, the evaluation algorithm implements multiple basic nonlinear operation algorithms on the integer bootstrap algorithm; the basic nonlinear operation algorithms include the Sign operation algorithm, the Iden operation algorithm, the EqalConst operation algorithm and the MultBin operation algorithm;
[0025] The input of the Sign algorithm is a large noise ciphertext Cm in , Cm in Indicates that it is plain text m in The ciphertext, m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying when m in ∈{-B+1,...,-1} when m out =-1, when m in ∈{-B,0} when m out =0, when m in ∈{1,...,B-1} when m out =1;m out is the small noise ciphertext Cm out The plain text of
[0026] The input of the Iden algorithm is a large noise ciphertext Cm in , the output is a small noise ciphertext Cm out , satisfying m out =m in ;
[0027] The input of the EqalConst algorithm is a large noise ciphertext Cm1 and a plaintext m2, where m1, m2∈{-B,...,B-1}, and m2 is generated by the cloud server itself. The output is a small noise ciphertext Cm out , when m1=m2, m out = -B, otherwise m out =0;
[0028] The input of the MultBin algorithm is a large noise ciphertext Cm int and Cm bin , m int ∈{-B,...,B-1} represents the large noise ciphertext Cm int The plaintext data, m bin ∈{-B,0} is the large noise ciphertext Cm bin The plaintext data is output as a small noise ciphertext Cm out , satisfying when m bin =-B when m out =m int , otherwise m out =0.
[0029] As a preferred technical solution, the specific implementation process of the Sign operation algorithm is:
[0030] Design a nonlinear evaluation function f sign(x), when x∈{1,...,B-1} sign (x)=1, when x=0, f sign (x) = 0;
[0031] The large noise ciphertext Cm in and the nonlinear evaluation function f sign (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out ;
[0032] The specific implementation process of the Iden operation algorithm is as follows:
[0033] Design a nonlinear evaluation function f iden (x), when x∈{-B,...,B-1} iden (x) = x;
[0034] The large noise ciphertext Cm in and the nonlinear evaluation function f iden (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out ;
[0035] The specific implementation process of the EqalConst operation algorithm is as follows:
[0036] Design a nonlinear evaluation function f eqal (x), when x = 0, f eqal (x)=-B, otherwise f eqal (x) = 0;
[0037] Generate a ciphertext (0,m2 / 2B) for m2 and obtain ciphertext C tmp =Cm1-(0,m2 / 2B);
[0038] The ciphertext C tmp and the nonlinear evaluation function f eqal (x) is passed into the integer bootstrap algorithm and outputs a small noise ciphertext Cm out ;
[0039] The specific implementation process of the MultBin operation algorithm is as follows:
[0040] Design a nonlinear evaluation function f half (x), when x is an even number, f half (x) = x / 2, otherwise f half (x) = -(x+1) / 2 - (B-1) / 2;
[0041] Generate ciphertext C tmp1 =Cm int +Cm bin +(0,-B / 2B); ciphertext Ctmp1 Input Iden operation algorithm output ciphertext C tmp2 ;
[0042] Generate ciphertext C tmp3 =Cm int +C tmp2 ; The ciphertext C tmp3 and the nonlinear evaluation function f half (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out .
[0043] As a preferred technical solution, the nonlinear evaluation function includes a Sign operation function, an Iden operation function, an EqalConst operation function, a MultBin operation function, a ReLU operation function and a Max operation function; wherein the Sign operation function, the Iden operation function, the EqalConst operation function and the MultBin operation function are directly implemented by calling the corresponding basic nonlinear operation algorithm;
[0044] The ReLU operation function and the Max operation function are implemented by combining the basic nonlinear operation algorithm;
[0045] The input of the ReLU operation function is a large noise ciphertext Cm in , m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying m out =f relu (m in ), when m in >0 hours out =m in , otherwise m out =0; the specific implementation process of the ReLU operation function is:
[0046] Call the Sign algorithm and the Iden algorithm to respectively process the ciphertext Cm in Execute the operation and get the ciphertext C tmp1 and ciphertext C tmp2 ;
[0047] For ciphertext C tmp1 Execute the EqalConst algorithm with plaintext data 1 to obtain ciphertext C tmp3 ;
[0048] The ciphertext C tmp2 and C tmp3 Input the MultBin algorithm and output a small noise ciphertext Cm out ;
[0049] The input of the Max operation function is a large noise ciphertext pair (Cm x ,Cm y ), (m x ,m y )∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying m out =f max (m x ,m y ), when m x ≥m y Time out =m x , otherwise m out =m y ; The specific implementation process of the Max operation function is:
[0050] Generate ciphertext C tmp1 =Cm x -Cm y , for Cm y Generate ciphertext C(-m y );
[0051] For ciphertext C tmp1 Execute the Sign operation algorithm to obtain the ciphertext C tmp2 ;
[0052] The ciphertext C tmp2 The plaintext data 1 is input into the EqalConst algorithm to obtain the ciphertext C tmp3 ;
[0053] The ciphertext C tmp2 The plaintext data -1 is input into the EqalConst algorithm to obtain the ciphertext C tmp4 ;
[0054] For the ciphertext Cm x and C(-m y ) respectively execute the Iden operation algorithm to obtain the ciphertext C tmp5 and ciphertext C tmp6 ;
[0055] Call the MultBin algorithm to perform the ciphertext C tmp3 and C tmp5 Perform the operation to get the ciphertext C tmp7 ; Call the MultBin algorithm to perform the ciphertext C tmp4 and C tmp6 Perform the operation to get the ciphertext C tmp8 ;
[0056] The ciphertext C tmp7 With ciphertext C tmp8Add together to get a small noise ciphertext Cm out .
[0057] On the other hand, a data processing system of a torus fully homomorphic encryption algorithm based on integer bootstrapping is provided, which is applied to the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping, and the system includes a key generation module, an encryption transmission module, an evaluation execution module and a decryption transmission module;
[0058] The key generation module is used by the client to call the key generation algorithm KeyGen(1 λ ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; the dimensions of the own key sk, bootstrap key bk and conversion key ks are all n;
[0059] The encryption transmission module is used for the client to call the encryption algorithm Enc(m,sk) and use its own key sk to perform encryption operation on the plaintext data m∈{-B,...,B-1}, and obtain the ciphertext c and transmit it to the cloud server; the plaintext data includes Boolean plaintext data and integer plaintext data;
[0060] The evaluation execution module is used for the cloud server to execute the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, the bootstrap key bk and the conversion key ks provided by the client, and obtain the evaluation result c' in the ciphertext state and send it back to the client; the evaluation algorithm includes an integer bootstrap algorithm and a key conversion algorithm; the evaluation function f provided by the client includes a nonlinear evaluation function and a linear evaluation function;
[0061] The decryption transmission module is used for the client to call the decryption algorithm Dec(c',sk) according to its own key sk to perform a decryption operation on the evaluation result c' in the ciphertext state to obtain the evaluation result of the plaintext data.
[0062] Another aspect provides an electronic device, comprising:
[0063] at least one processor; and a memory in communication with the at least one processor; wherein,
[0064] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping.
[0065] On the other hand, a computer-readable storage medium is provided, which stores a program. When the program is executed by a processor, it implements the data processing method of the above-mentioned torus fully homomorphic encryption algorithm based on integer bootstrapping.
[0066] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0067] 1. The fully homomorphic encryption algorithm based on integer bootstrapping proposed by the present invention directly supports integer-level data, and the operation is simple: the nonlinear function ReLU function and the comparison function Max function designed by the present invention that support integer data use integer bootstrapping instead of the bootstrapping algorithm that only supports Boolean data in the prior art. Therefore, in the operation process of the ReLU function and the Max function, the operation process is simplified and the calculation time is reduced.
[0068] 2. The computational complexity is independent of data precision: the nonlinear function ReLU function and the comparison function Max function designed by the present invention that support integer data no longer need to encode the integer data or perform bit-by-bit operations on the data during the computation process, that is, the computational complexity no longer depends on the data precision and is independent of the data precision, thereby improving the computational efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0069] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0070] Figure 1 This is a flowchart of a data processing method of a torus fully homomorphic encryption algorithm based on integer bootstrapping in an embodiment of the present invention.
[0071] Figure 2 A torus diagram of an existing torus fully homomorphic encryption scheme in an embodiment of the present invention.
[0072] Figure 3 Schematic diagram of the noise of the existing torus fully homomorphic encryption scheme in an embodiment of the present invention.
[0073] Figure 4 Schematic diagram of the operation of the integer bootstrap algorithm in an embodiment of the present invention.
[0074] Figure 5 It is a structural diagram of the data processing system of the torus fully homomorphic encryption algorithm based on integer bootstrapping in an embodiment of the present invention.
[0075] Figure 6 Schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0076] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0077] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.
[0078] First, the technology mentioned in this application is used to explain, wherein:
[0079] Homomorphic encryption: An encryption method that allows homomorphic operations to be performed on homomorphically encrypted data to produce an output that, when decrypted, is identical to the output obtained by processing the original, unencrypted data using the same method.
[0080] Fully homomorphic encryption: an encryption method that can satisfy both additive homomorphic encryption and multiplicative homomorphic encryption.
[0081] Bootstrapping: The most critical and time-consuming algorithm in the fully homomorphic encryption method can reduce the noise of the ciphertext in the encrypted state and ensure that the decryption results of the ciphertext after noise reduction are the same as those before noise reduction.
[0082] Torus fully homomorphic encryption: A torus-based fully homomorphic encryption method that performs gate operations on Boolean-level data and can bootstrap while performing gate operations. It is currently the fastest fully homomorphic encryption method.
[0083] Plaintext space, ciphertext space: the value range of plaintext, the value range of ciphertext.
[0084] like Figure 1 As shown, this embodiment provides a data processing method of a torus fully homomorphic encryption algorithm based on integer bootstrapping, comprising the following steps:
[0085] The client calls the key generation algorithm KeyGen(1 λ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; wherein the dimensions of its own key sk, bootstrap key bk and conversion key ks are all n;
[0086] The client calls the encryption algorithm Enc(m,sk) and uses its own key sk to encrypt the plaintext data m∈{-B,...,B-1}, and obtains the ciphertext c, which is transmitted to the cloud server; the plaintext data includes Boolean-level plaintext data and integer-level plaintext data;
[0087] The cloud server executes the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, bootstrap key bk and conversion key ks provided by the client, obtains the evaluation result c' in the ciphertext state and sends it back to the client; the evaluation algorithm includes the integer bootstrap algorithm and the key conversion algorithm; the evaluation function f provided by the client includes the nonlinear evaluation function and the linear evaluation function;
[0088] The client calls the decryption algorithm Dec(c',sk) according to its own key sk to decrypt the evaluation result c' in the ciphertext state and obtain the evaluation result of the plaintext data.
[0089] In the prior art, fully homomorphic encryption is only performed on Boolean data, while this application realizes fully homomorphic encryption of integer-level plaintext data by expanding the supported data types from Boolean level to integer level, so Boolean data will not be described in detail in this application. In this embodiment, integer-level plaintext data 6 is used as an example to illustrate. First, the client calls the key generation algorithm to obtain its own key sk, bootstrap key bk and conversion key ks; then the client encrypts the integer-level plaintext data 6, generates its ciphertext and sends it to the cloud server. The cloud server executes an evaluation algorithm on the ciphertext of 6 according to the evaluation function f, the bootstrap key bk and the conversion key ks, and sends the evaluation result in ciphertext form back to the client. The client decrypts the ciphertext evaluation result according to its own key sk to obtain the evaluated result f(6) of the plaintext data 6.
[0090] In the existing technology, torus fully homomorphic encryption is currently the most commonly used and fastest fully homomorphic encryption scheme; torus fully homomorphic encryption expands the message space to the torus and can perform gate operations on Boolean data in a homomorphic manner. A torus refers to any real number between 0 and 1, represented by the symbol express. Figure 2 The ciphertext in the torus fully homomorphic encryption is shown. 1 / 8 represents the ciphertext of 1 and -1 / 8 represents the ciphertext of 0. In the torus fully homomorphic encryption scheme, the plaintext space is The ciphertext space is n represents the dimension. It is worth noting that since the existing torus fully homomorphic encryption scheme only supports homomorphic operations on bit-level Boolean data, integer-level plaintext data needs to be encoded into multiple bits and operated bit by bit. During the operation, in order to ensure security and prevent decryption by malicious adversaries, probabilistic noise is included in the ciphertext. Because of the noise, Figure 2 The ciphertext of 1 shown is not a clear value, but a range. And because noise is introduced in the encryption step, the noise will increase sharply in the evaluation function, resulting in decryption failure. Figure 3 The noise problem of the torus fully homomorphic encryption scheme is demonstrated, where Figure 3 On the left is the circuit diagram of the evaluation function under plaintext, and the numbers in the diamonds represent the plaintext; Figure 3 On the right is the circuit diagram of the evaluation function under the ciphertext. The circle represents the ciphertext after the plaintext is encrypted, and the blurriness of the number in the circle represents the noise level. Assume that the plaintext inside can be seen through the ciphertext, that is, the plaintext can be clearly seen in the figure on the right at the beginning, because the noise is very small at the beginning, but after each circuit operation, the ciphertext noise will increase, and the plaintext in the circle will become more blurred; after a certain number of circuit calculations, the plaintext in the last few circles has become very blurred and the plaintext inside cannot be distinguished, that is, the original plaintext cannot be restored when decrypting these ciphertexts, resulting in decryption failure. In order to solve the noise problem, the existing torus fully homomorphic encryption scheme introduces a bootstrap algorithm in the evaluation function to reduce the ciphertext noise; however, it only performs homomorphic gate operations on Boolean data, and needs to construct complex, high-order polynomials when performing nonlinear operations, which greatly increases the computational cost and reduces the computational efficiency.
[0091] Based on the above problems, the present invention designs a torus fully homomorphic encryption algorithm that supports integer bootstrapping, and its plaintext space is is the data accuracy, is a set of natural numbers; its ciphertext space is a and b are two components of the ciphertext, n represents the dimension of a, is a torus consisting of real numbers between 0 and 1. The integer bootstrapped torus fully homomorphic encryption algorithm includes a key generation algorithm, an encryption algorithm, an evaluation algorithm, and a decryption algorithm, among which:
[0092] Key generation algorithm KeyGen(1 λ ): Input security parameter λ to generate its own key sk, bootstrap key bk (Bootstrapping key) and key-switching key ks (Key-switching key).
[0093] Encryption algorithm Enc(m,sk): Input plaintext data m and its own key sk, encrypt to get ciphertext c. Specifically, the operation of the encryption algorithm is: take a random noise e and a random mask from the Gaussian distribution Return the ciphertext c = (a, b), satisfying b = sk·a+m / 2B+e.
[0094] Decryption algorithm Dec(c',sk): Input the plaintext data m, the evaluation result c' in the ciphertext state after the evaluation algorithm and its own key sk, and output the plaintext f(m) of the evaluation result c'; the operation of the decryption algorithm is as follows: 2Be+f(m) is obtained by 2B(b-sk·a), and then the corresponding plaintext f(m) is obtained by rounding up and down, that is,
[0095] Evaluation algorithm Eval(c,bk,ks,f): inputs ciphertext c, bootstrap key bk, conversion key ks and evaluation function f, and outputs evaluation result c' of ciphertext c, where ciphertext c is the ciphertext of plaintext data m, and ciphertext c' is the ciphertext of ciphertext c after evaluation by the evaluation algorithm.
[0096] Furthermore, after the ciphertext is transmitted to the cloud server, the evaluation algorithm Eval(c,bk,ks,f) is executed: first, the large noise ciphertext c of the plaintext data m, the bootstrap key bk, the dimension parameter N and the evaluation function f are passed into the integer bootstrap algorithm to obtain the small noise ciphertext c'; then the conversion algorithm is executed on the small noise ciphertext c' according to the conversion key, and the key of the small noise ciphertext c' is converted into sk.
[0097] In the present invention, the evaluation algorithm includes two sub-algorithms: an integer bootstrapping algorithm and a key conversion algorithm, wherein the integer bootstrapping algorithm is the core of the torus fully homomorphic encryption algorithm supporting integer bootstrapping designed by the present invention.
[0098] The specific implementation process of the integer bootstrap algorithm designed in the present invention is:
[0099] According to the evaluation function f, initialize the polynomial testv=μ0+μ1X in the space of 2N -1 +μ2X -2 +…+μ N-1 X -(N-1) =μ0-μ N-1 X-μ N-2 X 2 -…-μ1X N-1 ∈T N [X], N is the polynomial dimension parameter; {μ0,…,μ N-1} is the coefficient set of the initialization polynomial, satisfying μ j×i =f(i),j={0,…,N / B},i={0,…,B-1};
[0100] When operating a polynomial of dimension N in a 2N space, the 2N space can be understood as 2N slots connected end to end. Since the plaintext m∈{-B,...,B-1}, the 2N slots can be divided into 2B parts;
[0101] Put all slots in the kth part into f(k). Due to the non-negativity of the polynomial, put all slots in the k+Bth part into -f(k), k = {0, B-1}, f(k) is the output of the evaluation function f when the input is k; Figure 4 As shown, when B=5, the 2N slots are divided into 2×5 parts, that is, k=0,1,2,3,4; then all the slots in the 0th part are placed in f(0), ..., all the slots in the 4th part are placed in f(4), all the slots in the 0+5th part are placed in -f(0), ..., all the slots in the 4+5th part are placed in -f(4).
[0102] Plaintext rotation: Logically shift the polynomial coefficients to the left by b positions. At this time, the polynomial coefficients are ciphertext, and the polynomial ACC after plaintext rotation is obtained. The plaintext rotation formula is: ACC = (0, testv) · X b ;
[0103] Ciphertext rotation: According to the polynomial ACC after plaintext rotation and the bootstrap key bk, the ciphertext is rotated using the outer product operation to obtain the polynomial ACC1 after ciphertext rotation; the input of the outer product operation is two ciphertexts C m1 , C m2 , the output is ciphertext C m1×m2 ; The ciphertext rotation formula is: Among them, h is the ciphertext of 1; a i is the i-th component in the ciphertext a; Indicates to shift the polynomial logic by -a i bit, i.e. logical right shift a i Position; bk i is the i-th component of the bootstrap key bk; is the outer product; the ciphertext rotation is repeated n times, and the polynomial ACC1 is assigned to the polynomial ACC after each rotation. When the ciphertext rotation is performed next time, the updated polynomial ACC will continue to perform the operation on the right side of the equation, and n is the dimension of a and the bootstrap key bk in the ciphertext;
[0104] The constant term coefficients of the polynomial ACC1 after the ciphertext rotation are extracted, and the extracted constant term coefficients ciphertext is output.
[0105] When the input of the integer bootstrap algorithm is the ciphertext of integer type data, the plaintext rotation and ciphertext rotation steps ensure that the polynomial constant term after rotation is f(m), and since the ciphertext in the polynomial coefficient is a small noise ciphertext, the output ciphertext is the ciphertext of f(m) with small noise, that is, the integer bootstrap algorithm can homomorphically complete the evaluation function f for the ciphertext of integer-level plaintext data in the ciphertext state while reducing the ciphertext noise.
[0106] Furthermore, the evaluation algorithm in this application implements a linear operation algorithm and multiple basic nonlinear operation algorithms based on the integer bootstrap algorithm. The linear operation algorithm in this application is consistent with the linear operation algorithm in the bootstrap algorithm that only supports Boolean data in the prior art, so it will not be repeated. The focus of this application is on the nonlinear operation algorithm, including the Sign operation algorithm, the Iden operation algorithm, the EqalConst operation algorithm and the MultBin operation algorithm, where:
[0107] 1)Sign operation algorithm:
[0108] The input of the Sign operation algorithm is a large noise ciphertext Cm in , Cm in It means m in The ciphertext, m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying when m in ∈{-B+1,...,-1} when m out =-1, when m in ∈{-B,0} when m out =0, when m in ∈{1,...,B-1} when m out =1;m out is the small noise ciphertext Cm out The plain text.
[0109] The specific implementation process of the Sign operation algorithm is as follows:
[0110] Design a nonlinear evaluation function f sign (x), when x∈{1,...,B-1} sign (x)=1, when x=0, f sign (x) = 0;
[0111] The large noise ciphertext Cm in and the nonlinear evaluation function f sign (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out ;
[0112] 2) Iden calculation algorithm:
[0113] The input of the Iden algorithm is a large noise ciphertext Cm in , the output is a small noise ciphertext Cm out , satisfying m out =m in ;
[0114] The specific implementation process of the Iden operation algorithm is as follows:
[0115] Design a nonlinear evaluation function f iden (x), when x∈{-B,...,B-1} iden (x) = x;
[0116] The large noise ciphertext Cm in and the nonlinear evaluation function f iden (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out ;
[0117] 3) EqalConst calculation algorithm:
[0118] The input of the EqalConst algorithm is a large noise ciphertext Cm1 and a plaintext m2, where m1, m2∈{-B,...,B-1}, and m2 is generated by the cloud server itself. The output is a small noise ciphertext Cm out , when m1=m2, m out = -B, otherwise m out =0;
[0119] The specific implementation process of the EqalConst operation algorithm is as follows:
[0120] Design a nonlinear evaluation function f eqal (x), when x = 0, f eqal (x)=-B, otherwise f eqal (x) = 0;
[0121] Generate a ciphertext (0,m2 / 2B) for m2 and obtain ciphertext C tmp =Cm1-(0,m2 / 2B);
[0122] The ciphertext C tmp and the nonlinear evaluation function f eqal (x) is passed into the integer bootstrap algorithm and outputs a small noise ciphertext Cm out ;
[0123] 4) MultBin calculation algorithm:
[0124] The input of the MultBin algorithm is a large noise ciphertext Cm int and Cm bin , mint ∈{-B,...,B-1} represents the large noise ciphertext Cm int The plaintext data, m bin ∈{B,0} is the large noise ciphertext Cm bin The plaintext data is output as a small noise ciphertext Cm out , satisfying when m bin =-B when m out =m int , otherwise m out =0;
[0125] The specific implementation process of the MultBin algorithm is as follows:
[0126] Design a nonlinear evaluation function f half (x), when x is an even number, f half (x) = x / 2, otherwise f half (x) = -(x+1) / 2 - (B-1) / 2;
[0127] Generate ciphertext C tmp1 =Cm int +Cm bin +(0,-B / 2B); ciphertext C tmp1 Input Iden operation algorithm output ciphertext C tmp2 ;
[0128] Generate ciphertext C tmp3 =Cm int +C tmp2 ; The ciphertext C tmp3 and the nonlinear evaluation function f half (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out .
[0129] Furthermore, the evaluation function f provided by the client includes a linear evaluation function and a nonlinear evaluation function; wherein the linear evaluation function includes addition and subtraction functions, multiplication and division functions, and negation functions, etc.; similarly, it is consistent with the implementation method of the prior art; the present application is directed to the nonlinear evaluation function of integer-level data, including the Sign operation function, the Iden operation function, the EqalConst operation function, the MultBin operation function, the ReLU operation function, and the Max operation function; wherein the Sign operation function, the Iden operation function, the EqalConst operation function, and the MultBin operation function are directly implemented by calling the corresponding basic nonlinear operation algorithm; and the ReLU operation function and the Max operation function require the combination of the basic nonlinear operation algorithm to be implemented, specifically:
[0130] 1) ReLU operation function:
[0131] ReLU operation function f relu The input of (x) is a large noise ciphertext Cm in , m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying m out =f relu (m in ), when m in >0 hours out =m in , otherwise m out =0;
[0132] The specific implementation process of the ReLU operation function is:
[0133] Call the Sign algorithm and the Iden algorithm to respectively process the ciphertext Cm in Execute the operation and get the ciphertext C tmp1 and ciphertext C tmp2 ;
[0134] For ciphertext C tmp1 Execute the EqalConst algorithm with plaintext data 1 to obtain ciphertext C tmp3 ;
[0135] The ciphertext C tmp2 and C tmp3 Input the MultBin algorithm and output a small noise ciphertext Cm out ;
[0136] The following is a brief analysis of the correctness of the ReLU operation function. in >0, C tmp1 The ciphertext is 1, C tmp2 is m in The ciphertext, C tmp3 is the ciphertext of B; then, for C tmp3 and C tmp2 Perform the MultBin operation algorithm to obtain the ciphertext C tmp3 is m in The ciphertext satisfies f relu Definition of (x). in The same applies when ≤0.
[0137] 2)Max operation function:
[0138] The input of the Max operation function is a large noise ciphertext pair (Cm x ,Cm y ), (m x ,m y )∈{-B,...,B-1}, the output is a small noise ciphertext Cm out, satisfying m out =f max (m x ,m y ), when m x ≥m y Time out =m x , otherwise m out =m y ;
[0139] The specific implementation process of the Max operation function is:
[0140] Generate ciphertext C tmp1 =Cm x -Cm y , for Cm y Generate ciphertext C(-m y );
[0141] For ciphertext C tmp1 Execute the Sign operation algorithm to obtain the ciphertext C tmp2 ;
[0142] The ciphertext C tmp2 The plaintext data 1 is input into the EqalConst algorithm to obtain the ciphertext C tmp3 ;
[0143] The ciphertext C tmp2 The plaintext data -1 is input into the EqalConst algorithm to obtain the ciphertext C tmp4 ;
[0144] For the ciphertext Cm x and C(-m y ) respectively execute the Iden operation algorithm to obtain the ciphertext C tmp5 and ciphertext C tmp6 ;
[0145] Call the MultBin algorithm to perform the ciphertext C tmp3 and C tmp5 Perform the operation to get the ciphertext C tmp7 ; Call the MultBin algorithm to perform the ciphertext C tmp4 and C tmp6 Perform the operation to get the ciphertext C tmp8 ;
[0146] The ciphertext C tmp7 With ciphertext C tmp8 Add together to get a small noise ciphertext Cm out .
[0147] The following is a brief analysis of the correctness of the Max operation function. x >m y When Ctmp1 The ciphertext is a positive number, C tmp2 The ciphertext is 1, C tmp3 is the ciphertext of B, C tmp4 The ciphertext is 0, C tmp5 is m x The ciphertext, C tmp6 -m y ciphertext; then, for C tmp3 and C tmp5 Perform the MultBin operation algorithm to obtain the ciphertext C tmp7 is m x The ciphertext of C tmp4 and C tmp6 Perform the MultBin operation algorithm to obtain the ciphertext C tmp8 The ciphertext is 0; finally, C tmp7 With C tmp8 Add together and get Cm out is m x The ciphertext satisfies f max Definition of m x ≤m y The same applies to time.
[0148] In summary, the torus fully homomorphic encryption algorithm supporting integer bootstrapping proposed by the present invention realizes the bootstrapping algorithm supporting integer-level data by extending Boolean-level data to integer-level data and redesigning the bootstrapping algorithm, thereby greatly improving the computational efficiency. At the same time, it supports the operation of nonlinear functions of integer-level data, reducing the complexity of the scheme.
[0149] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.
[0150] Based on the same idea as the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping in the above-mentioned embodiment, the present invention also provides a data processing system of the torus fully homomorphic encryption algorithm based on integer bootstrapping, which can be used to execute the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping. For ease of explanation, in the structural schematic diagram of the embodiment of the data processing system of the torus fully homomorphic encryption algorithm based on integer bootstrapping, only the parts related to the embodiment of the present invention are shown. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than the illustrated structure, or combine certain components, or arrange the components differently.
[0151] like Figure 5As shown, another embodiment of the present invention provides a data processing system 500 of a torus fully homomorphic encryption algorithm based on integer bootstrapping, including a key generation module 501, an encryption transmission module 502, an evaluation execution module 503 and a decryption transmission module 504;
[0152] The key generation module 501 is used by the client to call the key generation algorithm KeyGen(1 λ ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; wherein the dimensions of its own key sk, bootstrap key bk and conversion key ks are all n;
[0153] The encryption transmission module 502 is used for the client to call the encryption algorithm Enc(m,sk) and use its own key sk to perform encryption operation on the plaintext data m∈{-B,...,B-1}, and obtain the ciphertext c to transmit to the cloud server; the plaintext data includes Boolean level plaintext data and integer level plaintext data;
[0154] The evaluation execution module 503 is used for the cloud server to execute the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, the bootstrap key bk and the conversion key ks provided by the client, and obtain the evaluation result c' in the ciphertext state and send it back to the client; the evaluation algorithm includes the integer bootstrap algorithm and the key conversion algorithm; the evaluation function f provided by the client includes the nonlinear evaluation function and the linear evaluation function;
[0155] The decryption transmission module 504 is used for the client to call the decryption algorithm Dec(c',sk) according to its own key sk to perform a decryption operation on the evaluation result c' in the ciphertext state to obtain the evaluation result of the plaintext data.
[0156] It should be noted that the data processing system of the torus fully homomorphic encryption algorithm based on integer bootstrapping of the present invention corresponds one to one with the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping of the present invention. The technical features and beneficial effects described in the embodiment of the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping are applicable to the embodiment of the data processing system of the torus fully homomorphic encryption algorithm based on integer bootstrapping. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. It is hereby declared.
[0157] In addition, in the implementation of the data processing system based on the integer bootstrap torus fully homomorphic encryption algorithm in the above-mentioned embodiment, the logical division of each program module is only an example. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, for example, for the convenience of corresponding hardware configuration requirements or software implementation. That is, the internal structure of the data processing system based on the integer bootstrap torus fully homomorphic encryption algorithm is divided into different program modules to complete all or part of the functions described above.
[0158] like Figure 6 As shown, in one embodiment, an electronic device is provided for implementing a data processing method of a torus fully homomorphic encryption algorithm based on integer bootstrapping, wherein the electronic device 600 may include a first processor 601, a first memory 602 and a bus, and may also include a computer program stored in the first memory 602 and executable on the first processor 601, such as a data processing program 603 of a torus fully homomorphic encryption algorithm based on integer bootstrapping.
[0159] Among them, the first memory 602 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 602 can be an internal storage unit of the electronic device 600, such as a mobile hard disk of the electronic device 600. In other embodiments, the first memory 602 can also be an external storage device of the electronic device 600, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 600. Further, the first memory 602 can also include both an internal storage unit of the electronic device 600 and an external storage device. The first memory 602 can not only be used to store application software and various types of data installed in the electronic device 600, such as the code of the data processing program 603 of the torus fully homomorphic encryption algorithm based on integer bootstrapping, but also can be used to temporarily store data that has been output or is to be output.
[0160] In some embodiments, the first processor 601 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The first processor 601 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the first memory 602 (for example, data processing programs of torus fully homomorphic encryption algorithms based on integer bootstrapping, etc.), and calls data stored in the first memory 602 to execute various functions of the electronic device 600 and process data.
[0161] Figure 6 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 6 The structure shown does not constitute a limitation on the electronic device 600 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0162] The data processing program 603 of the torus fully homomorphic encryption algorithm based on integer bootstrapping stored in the first memory 602 in the electronic device 600 is a combination of multiple instructions. When running in the first processor 601, it can achieve:
[0163] The client calls the key generation algorithm KeyGen(1 λ ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; wherein the dimensions of its own key sk, bootstrap key bk and conversion key ks are all n;
[0164] The client calls the encryption algorithm Enc(m,sk) and uses its own key sk to encrypt the plaintext data m∈{-B,...,B-1}, and obtains the ciphertext c, which is transmitted to the cloud server; the plaintext data includes Boolean-level plaintext data and integer-level plaintext data;
[0165] The cloud server executes the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, bootstrap key bk and conversion key ks provided by the client, obtains the evaluation result c' in the ciphertext state and sends it back to the client; wherein the evaluation algorithm includes the integer bootstrap algorithm and the key conversion algorithm; the evaluation function f provided by the client includes the nonlinear evaluation function and the linear evaluation function;
[0166] The client calls the decryption algorithm Dec(c',sk) according to its own key sk to decrypt the evaluation result c' in the ciphertext state and obtain the evaluation result of the plaintext data.
[0167] Furthermore, if the module / unit integrated in the electronic device 600 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0168] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory.
[0169] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0170] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A data processing method based on an integer-bootstrapped torus fully homomorphic encryption algorithm, wherein the integer-bootstrapped torus fully homomorphic encryption algorithm includes a key generation algorithm, an encryption algorithm, an evaluation algorithm, and a decryption algorithm, and is characterized in that: The plaintext space of the integer bootstrapped torus fully homomorphic encryption algorithm is is the data accuracy, is a set of natural numbers; its ciphertext space is a and b are two components of the ciphertext, n represents the dimension of a, is a torus consisting of real numbers between 0 and 1; The data processing method comprises the following steps: The client calls the key generation algorithm KeyGen(1 λ ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; the dimensions of the own key sk, bootstrap key bk and conversion key ks are all n; The client calls the encryption algorithm Enc(m,sk) and uses its own key sk to perform an encryption operation on the plaintext data m∈{-B,...,B-1}, and obtains the ciphertext c and transmits it to the cloud server; the plaintext data includes Boolean-level plaintext data and integer-level plaintext data; The cloud server executes the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, the bootstrap key bk and the conversion key ks provided by the client, obtains the evaluation result c' in the ciphertext state and sends it back to the client; the evaluation algorithm includes an integer bootstrap algorithm and a key conversion algorithm; the evaluation function f provided by the client includes a nonlinear evaluation function and a linear evaluation function; The client calls the decryption algorithm Dec(c',sk) based on its own key sk to decrypt the evaluation result c' in the ciphertext state and obtain the evaluation result of the plaintext data; The evaluation algorithm Eval(c,bk,ks,f) firstly passes the large noise ciphertext c of the plaintext data m, the bootstrap key bk, the dimension parameter N and the evaluation function f into the integer bootstrap algorithm to obtain the small noise ciphertext c'; Then, the conversion algorithm is performed on the small noise ciphertext c' according to the conversion key, and the key of the small noise ciphertext c' is converted into sk; The specific implementation of the integer bootstrap algorithm is: According to the evaluation function f, initialize the polynomial testv=μ0+μ1X in 2N space -1 +μ2X -2 +…+μ N-1 X -(N-1) =μ0-μ N-1 X-μ N-2 X 2 -…-μ1X N-1 ∈T N [X], N is the polynomial dimension parameter; {μ0,…,μ N-1 } is the coefficient set of the initialization polynomial, satisfying μ j×i =f(i),j={0,…,N / B},i={0,…,B-1}; Treat the 2N space as 2N slots connected end to end and divide the 2N slots into 2B parts; Put all slots in the kth part into f(k). Due to the non-negativity of the polynomial, put all slots in the k+Bth part into -f(k), k = {0, B-1}, f(k) is the output of the evaluation function f when the input is k; Plaintext rotation: Logically shift the polynomial coefficients left by b bits to obtain the plaintext rotated polynomial ACC. The plaintext rotation formula is: ACC = (0, testv) · X b ; Ciphertext rotation: According to the polynomial ACC after plaintext rotation and the bootstrap key bk, the ciphertext is rotated using the outer product operation to obtain the polynomial ACC1 after ciphertext rotation; the input of the outer product operation is two ciphertexts C m1 , C m2 , the output is ciphertext C m1×m2 ; The ciphertext rotation formula is: Among them, h is the ciphertext of 1; a i is the i-th component in the ciphertext a; Indicates to shift the polynomial logic by -a i bit, i.e. logical right shift a i Position; bk i is the i-th component of the bootstrap key bk; is the outer product; the ciphertext rotation is repeated n times, and after each rotation, the polynomial ACC1 is assigned to the polynomial ACC, where n is the dimension of a and the bootstrap key bk in the ciphertext; Extract the constant term coefficients of the polynomial ACC1 after the ciphertext rotation, and output the extracted constant term coefficients ciphertext; The evaluation algorithm implements multiple basic nonlinear operation algorithms on the integer bootstrap algorithm; the basic nonlinear operation algorithms include the Sign operation algorithm, the Iden operation algorithm, the EqalConst operation algorithm and the MultBin operation algorithm; The input of the Sign algorithm is a large noise ciphertext Cm in , Cm in Indicates that it is plain text m in The ciphertext, m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying when m in ∈{-B+1,...,-1} when m out = -1, when m in ∈{-B,0} when m out =0, when m in ∈{1,...,B-1} when m out =1;m out is the small noise ciphertext Cm out The plain text of The input of the Iden algorithm is a large noise ciphertext Cm in , the output is a small noise ciphertext Cm out , satisfying m out =m in ; The input of the EqalConst algorithm is a large noise ciphertext Cm1 and a plaintext m2, where m1, m2∈{-B,...,B-1}, and m2 is generated by the cloud server itself. The output is a small noise ciphertext Cm out , when m1=m2, m out = -B, otherwise m out =0; The input of the MultBin algorithm is a large noise ciphertext Cm int and Cm bin , m int ∈{-B,...,B-1} represents the large noise ciphertext Cm int The plaintext data, m bin ∈{-B,0} is the large noise ciphertext Cm bin The plaintext data is output as a small noise ciphertext Cm out , satisfying when m bin =-B when m out =m int , otherwise m out =0.
2. The data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping according to claim 1 is characterized in that: The encryption operation is specifically as follows: Take a random noise e and a random mask from a Gaussian distribution Return the ciphertext c = (a, b), satisfying b = sk·a+m / 2B+e; The decryption operation is specifically as follows: Through 2B(b-sk·a), we get 2Be+f(m), and then decrypt it by rounding up and down to get the corresponding plaintext f(m), that is, 3. The data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping according to claim 1 is characterized in that: The specific implementation process of the Sign operation algorithm is as follows: Design a nonlinear evaluation function f sign (x), when x∈{1,...,B-1} sign (x)=1, when x=0, f sign (x) = 0; The large noise ciphertext Cm in and the nonlinear evaluation function f sign (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out ; The specific implementation process of the Iden operation algorithm is as follows: Design a nonlinear evaluation function f iden (x), when x∈{-B,...,B-1} iden (x) = x; The large noise ciphertext Cm in and the nonlinear evaluation function f iden (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out ; The specific implementation process of the EqalConst operation algorithm is as follows: Design a nonlinear evaluation function f eqal (x), when x = 0, f eqal (x)=-B, otherwise f eqal (x) = 0; Generate a ciphertext (0,m2 / 2B) for m2 and obtain ciphertext C tmp =Cm1-(0,m2 / 2B); The ciphertext C tmp and the nonlinear evaluation function f eqal (x) is passed into the integer bootstrap algorithm and outputs a small noise ciphertext Cm out ; The specific implementation process of the MultBin operation algorithm is as follows: Design a nonlinear evaluation function f half (x), when x is an even number, f half (x) = x / 2, otherwise f half (x) = -(x+1) / 2 - (B-1) / 2; Generate ciphertext C tmp1 =Cm int +Cm bin +(0,-B / 2B); ciphertext C tmp1 Input Iden operation algorithm output ciphertext C tmp2 ; Generate ciphertext C tmp3 =Cm int +C tmp2 ; The ciphertext C tmp3 and the nonlinear evaluation function f half (x) is passed into the integer bootstrap algorithm, and the output is a small noise ciphertext Cm out .
4. The data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping according to claim 1 is characterized in that: The nonlinear evaluation function includes a Sign operation function, an Iden operation function, an EqalConst operation function, a MultBin operation function, a ReLU operation function and a Max operation function; wherein the Sign operation function, the Iden operation function, the EqalConst operation function and the MultBin operation function are directly implemented by calling corresponding basic nonlinear operation algorithms; The ReLU operation function and the Max operation function are implemented by combining the basic nonlinear operation algorithm; The input of the ReLU operation function is a large noise ciphertext Cm in , m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying m out =f relu (m in ), when m in >0 hours out =m in , otherwise m out =0; the specific implementation process of the ReLU operation function is: Call the Sign algorithm and the Iden algorithm to respectively process the ciphertext Cm in Execute the operation and get the ciphertext C tmp1 and ciphertext C tmp2 ; For ciphertext C tmp1 Execute the EqalConst algorithm with plaintext data 1 to obtain ciphertext C tmp3 ; The ciphertext C tmp2 and C tmp3 Input the MultBin algorithm and output a small noise ciphertext Cm out ; The input of the Max operation function is a large noise ciphertext pair (Cm x ,Cm y ), (m x ,m y )∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying m out =f max (m x ,m y ), when m x ≥m y Time out =m x , otherwise m out =m y ; The specific implementation process of the Max operation function is: Generate ciphertext C tmp1 =Cm x -Cm y , for Cm y Generate ciphertext C(-m y ); For ciphertext C tmp1 Execute the Sign operation algorithm to obtain the ciphertext C tmp2 ; The ciphertext C tmp2 The plaintext data 1 is input into the EqalConst algorithm to obtain the ciphertext C tmp3 ; The ciphertext C tmp2 The plaintext data -1 is input into the EqalConst algorithm to obtain the ciphertext C tmp4 ; For the ciphertext Cm x and C(-m y ) respectively execute the Iden operation algorithm to obtain the ciphertext C tmp5 and ciphertext C tmp6 ; Call the MultBin algorithm to perform the ciphertext C tmp3 and C tmp5 Perform the operation to get the ciphertext C tmp7 ; Call the MultBin algorithm to perform the ciphertext C tmp4 and C tmp6 Perform the operation to get the ciphertext C tmp8 ; The ciphertext C tmp7 With ciphertext C tmp8 Add together to get a small noise ciphertext Cm out .
5. A data processing system based on a torus fully homomorphic encryption algorithm based on integer bootstrapping, characterized in that: The data processing method for the torus fully homomorphic encryption algorithm based on integer bootstrapping as claimed in claim 1, wherein the system comprises a key generation module, an encryption transmission module, an evaluation execution module and a decryption transmission module; The key generation module is used by the client to call the key generation algorithm KeyGen(1 λ ), generate its own key sk, bootstrap key bk and conversion key ks, and send the bootstrap key bk and conversion key ks to the cloud server, and save its own key sk locally; the dimensions of the own key sk, bootstrap key bk and conversion key ks are all n; The encryption transmission module is used for the client to call the encryption algorithm Enc(m,sk) and use its own key sk to perform encryption operation on the plaintext data m∈{-B,...,B-1}, and obtain the ciphertext c and transmit it to the cloud server; the plaintext data includes Boolean plaintext data and integer plaintext data; The evaluation execution module is used for the cloud server to execute the evaluation algorithm Eval(c,bk,ks,f) on the ciphertext c according to the evaluation function f, the bootstrap key bk and the conversion key ks provided by the client, and obtain the evaluation result c' in the ciphertext state and send it back to the client; the evaluation algorithm includes an integer bootstrap algorithm and a key conversion algorithm; the evaluation function f provided by the client includes a nonlinear evaluation function and a linear evaluation function; The decryption transmission module is used for the client to call the decryption algorithm Dec(c',sk) according to its own key sk to decrypt the evaluation result c' in the ciphertext state to obtain the evaluation result of the plaintext data; The evaluation algorithm Eval(c,bk,ks,f) firstly passes the large noise ciphertext c of the plaintext data m, the bootstrap key bk, the dimension parameter N and the evaluation function f into the integer bootstrap algorithm to obtain the small noise ciphertext c'; Then, the conversion algorithm is performed on the small noise ciphertext c' according to the conversion key, and the key of the small noise ciphertext c' is converted into sk; The specific implementation of the integer bootstrap algorithm is: According to the evaluation function f, initialize the polynomial testv=μ0+μ1X in 2N space -1 +μ2X -2 +…+μ N-1 X -(N-1) =μ0-μ N-1 X-μ N-2 X 2 -…-μ1X N-1 ∈T N [X], N is the polynomial dimension parameter; {μ0,…,μ N-1 } is the coefficient set of the initialization polynomial, satisfying μ j×i =f(i),j={0,…,N / B},i={0,…,B-1}; Treat the 2N space as 2N slots connected end to end and divide the 2N slots into 2B parts; Put all slots in the kth part into f(k). Due to the non-negativity of the polynomial, put all slots in the k+Bth part into -f(k), k = {0, B-1}, f(k) is the output of the evaluation function f when the input is k; Plaintext rotation: Logically shift the polynomial coefficients left by b bits to obtain the plaintext rotated polynomial ACC. The plaintext rotation formula is: ACC = (0, testv) · X b ; Ciphertext rotation: According to the polynomial ACC after plaintext rotation and the bootstrap key bk, the ciphertext is rotated using the outer product operation to obtain the polynomial ACC1 after ciphertext rotation; the input of the outer product operation is two ciphertexts C m1 , C m2 , the output is ciphertext C m1×m2 ; The ciphertext rotation formula is: Among them, h is the ciphertext of 1; a i is the i-th component in the ciphertext a; Indicates to shift the polynomial logic by -a i bit, i.e. logical right shift a i Position; bk i is the i-th component of the bootstrap key bk; is the outer product; the ciphertext rotation is repeated n times, and after each rotation, the polynomial ACC1 is assigned to the polynomial ACC, where n is the dimension of a and the bootstrap key bk in the ciphertext; Extract the constant term coefficients of the polynomial ACC1 after the ciphertext rotation, and output the extracted constant term coefficients ciphertext; The evaluation algorithm implements multiple basic nonlinear operation algorithms on the integer bootstrap algorithm; the basic nonlinear operation algorithms include the Sign operation algorithm, the Iden operation algorithm, the EqalConst operation algorithm and the MultBin operation algorithm; The input of the Sign algorithm is a large noise ciphertext Cm in , Cm in Indicates that it is plain text m in The ciphertext, m in ∈{-B,...,B-1}, the output is a small noise ciphertext Cm out , satisfying when m in ∈{-B+1,...,-1} when m out =-1, when m in ∈{-B,0} when m out =0, when m in ∈{1,...,B-1} when m out =1;m out is the small noise ciphertext Cm out The plain text of The input of the Iden algorithm is a large noise ciphertext Cm in , the output is a small noise ciphertext Cm out , satisfying m out =m in ; The input of the EqalConst algorithm is a large noise ciphertext Cm1 and a plaintext m2, where m1, m2∈{-B,...,B-1}, and m2 is generated by the cloud server itself. The output is a small noise ciphertext Cm out , when m1=m2, m out = -B, otherwise m out =0; The input of the MultBin algorithm is a large noise ciphertext Cm int and Cm bin , m int ∈{-B,...,B-1} represents the large noise ciphertext Cm int The plaintext data, m bin ∈{-B,0} is the large noise ciphertext Cm bin The plaintext data is output as a small noise ciphertext Cm out , satisfying when m bin =-B when m out =m int , otherwise m out =0.
6. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory in communication with the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping as described in any one of claims 1-4.
7. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the data processing method of the torus fully homomorphic encryption algorithm based on integer bootstrapping described in any one of claims 1 to 4 is implemented.
