Data general-purpose computing method and device based on full homomorphic encryption, equipment and medium

By combining the TFHE and CKKS homomorphic encryption algorithms, we have achieved efficient processing of general computations of linear and nonlinear functions on homomorphically encrypted ciphertexts. This solves the problem of insufficient processing capacity in fully homomorphic encryption cloud outsourcing solutions and improves computational accuracy and security.

CN116599648BActive Publication Date: 2025-10-24BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310805169.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2025-10-24
Estimated Expiration
2043-06-30

AI Technical Summary

Technical Problem

Current cloud outsourcing solutions based on fully homomorphic encryption find it difficult to process both linear and nonlinear functions efficiently and accurately at the same time.

Method used

User privacy data is encrypted using the TFHE homomorphic encryption algorithm, converted into CKKS ciphertext after nonlinear function calculation, and then calculated according to a preset linear function calculation strategy. This achieves the conversion between TFHE ciphertext and CKKS ciphertext and the linear function calculation, thus completing the general function calculation on the homomorphically encrypted ciphertext.

Benefits of technology

It improves the accuracy and security of encrypted conversion, can handle both linear and nonlinear functions simultaneously, and enhances the utilization of user-end computing resources and storage space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116599648B_ABST
    Figure CN116599648B_ABST
Patent Text Reader

Abstract

The application relates to a data general-purpose calculation method, device and equipment based on full homomorphic encryption and a medium, wherein the method comprises the following steps: encrypting privacy data of a user based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, performing nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext; converting all the second TFHE ciphertexts into first CKKS ciphertexts, performing calculation on the first CKKS ciphertexts according to a preset linear function calculation strategy to obtain a second CKKS ciphertext, and sending the second CKKS ciphertext to the user. Thus, the current cloud outsourcing solution based on full homomorphic encryption can efficiently and accurately process linear function and nonlinear function problems.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information security, and particularly relates to a data general-purpose computing method and device based on homomorphic encryption, equipment and medium. BACKGROUND

[0002] In the current digital era, the scale and complexity of data are increasing, and the demand for data processing and analysis is also increasing. Cloud computing is a computing model based on the Internet, which provides powerful computing, storage and data processing capabilities, enabling users to manage and process data in a flexible and efficient manner. Cloud computing eliminates the investment in traditional hardware devices and infrastructure, and users only need to pay for cloud services on demand. This enables small and medium-sized enterprises and individual users to also enjoy high-performance computing and storage resources, reducing IT costs.

[0003] Although cloud computing brings many benefits, data privacy and security issues have become a major problem for using cloud computing. Users may cause personal privacy to be leaked in the process of using cloud computing. Privacy leakage will expose users' sensitive information to the public or unauthorized personnel, including personal identity information, financial account information, medical records and personal communications. Personal privacy leakage may lead to identity theft, fraudulent activities, personal reputation damage and other problems, causing great distress and economic loss to individuals. Therefore, China has introduced a number of regulations and policies to protect citizens' data privacy. The regulations and policies make clear requirements for the collection, use, storage, processing and transmission of personal information, and stipulate penalties for illegal acts that infringe upon personal information rights and interests, to protect citizens' personal privacy data and national public security.

[0004] Privacy computing provides a secure data computing method that does not leak data during the computing process. Privacy computing takes privacy protection measures during data processing and analysis, so that users can share their personal privacy data without leaking the original data, and protect their personal sensitive data while fully utilizing the capabilities of cloud computing.

[0005] Privacy computing includes technologies such as differential privacy, trusted execution environment and secure multi-party computation. Among them, differential privacy is a technology for protecting privacy by introducing noise into data, which can randomize data while maintaining data availability, so that individual information cannot be uniquely identified; the trusted execution environment (Trusted Execution Environment, TEE) is a secure area in the hardware processor, and the data calculated in the trusted environment cannot be accessed externally, thereby ensuring that the data is not leaked during the calculation process. The algorithm of secure multi-party computation can make multiple participants cooperatively compute on the premise of not leaking private data. The algorithm of secure multi-party computation has strong security guarantee after strict theoretical demonstration, and in recent years, breakthroughs have been made in efficiency.

[0006] Homomorphic encryption is a technology in secure multi-party computation, which can perform calculation on ciphertext, mainly applicable to two-party calculation, and can be well applied to data outsourcing scenarios. Current homomorphic encryption technologies mainly include partial homomorphic encryption and full homomorphic encryption. Partial homomorphic encryption only supports some specific function calculations, has small overhead, is easy to implement, and can be used in practice; full homomorphic encryption can support arbitrary operations of a given f function, and has a large calculation overhead, and can only be used in specific situations.

[0007] Current partial homomorphic encryption algorithms mainly include BFV, BGV and CKKS. These homomorphic encryption algorithms need to set the relevant parameters of encryption in advance according to the calculation depth before calculation. Under specific encryption parameters, the algorithm can perform a certain depth of ciphertext calculation, and the result after calculation can be correctly decrypted. However, if the calculation depth exceeds the range that the encryption parameters can support, it will lead to decryption errors. Partial homomorphic encryption algorithms can use the characteristics of SIMD to encode multiple data into one ciphertext, and can efficiently process calculation tasks based on algebraic circuits. However, these algorithms are difficult to process calculation tasks based on logic circuits, and usually use methods such as polynomial approximation to process, which is difficult to meet the high-precision task scenarios.

[0008] Current full homomorphic encryption algorithms mainly include FHEW and TFHE. These homomorphic encryption algorithms can efficiently complete the bootstrap operation of a single data, thereby supporting infinite-depth calculation tasks. FHEW and TFHE can efficiently process calculation tasks based on logic circuits through programmable bootstrap, and the calculation tasks can support infinite depth. However, these algorithms have low efficiency when processing calculation tasks based on algebraic circuits.

[0009] In summary, the current cloud outsourcing solution based on full homomorphic encryption is difficult to efficiently and accurately process linear functions and nonlinear functions at the same time, and needs to be solved urgently. SUMMARY

[0010] The application provides a data general-purpose computing method, device and equipment based on fully homomorphic encryption and a medium to solve the problem that current cloud outsourcing solutions based on fully homomorphic encryption are difficult to efficiently and accurately process linear functions and nonlinear functions.

[0011] The first aspect of the application provides a data general-purpose computing method based on fully homomorphic encryption, comprising the following steps: encrypting user privacy data based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, performing nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext, converting all second TFHE ciphertexts into first CKKS ciphertexts, and performing calculation on the first CKKS ciphertexts according to a preset linear function calculation strategy to obtain a second CKKS ciphertext, and sending the second CKKS ciphertext to the user.

[0012] Optionally, in an embodiment of the application, the nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext comprises: constructing a test vector for the nonlinear function of each first TFHE ciphertext in the at least one first TFHE ciphertext; and performing a blind rotation operation on the test vector on the corresponding first TFHE ciphertext to obtain the second TFHE ciphertext corresponding to each first TFHE ciphertext.

[0013] Optionally, in an embodiment of the application, the conversion of all second TFHE ciphertexts into first CKKS ciphertexts comprises: encoding each second TFHE ciphertext to obtain a conversion vector and a conversion matrix; performing homomorphic matrix multiplication and homomorphic addition operations based on the conversion vector, the conversion matrix and a preset conversion key to obtain a first conversion result; performing a homomorphic modulo operation on the first conversion result to obtain a second conversion result; and eliminating decimal places of the second conversion result based on a preset polynomial approximation method to obtain a correction result.

[0014] Optionally, in an embodiment of the application, the mathematical expression of the preset linear function calculation strategy is:

[0015]

[0016]

[0017] wherein, m i (i = 0, 1, 2,..., l-1) is user privacy data, N is a dimension of the first CKKS ciphertext, Q is a modulus of the first CKKS ciphertext, and S is a private key.

[0018] Optionally, in an embodiment of the present application, the TFHE homomorphic encryption algorithm is used to encrypt the user's privacy data to obtain at least one first TFHE ciphertext, comprising: determining an encryption parameter satisfying a preset security condition; and encrypting the user's privacy data into the at least one first TFHE ciphertext based on the encryption parameter and a preset private key.

[0019] The second aspect embodiment of the present application provides a data general-purpose computing device based on full homomorphic encryption, comprising: a first computing module configured to encrypt user's privacy data based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, and perform nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext; a conversion module configured to convert all second TFHE ciphertexts into a first CKKS ciphertext; and a second computing module configured to perform calculation on the first CKKS ciphertext according to a preset linear function calculation strategy to obtain a second CKKS ciphertext, and send the second CKKS ciphertext to the user.

[0020] Optionally, in an embodiment of the present application, the first computing module comprises: a construction unit configured to construct a test vector for the nonlinear function of each first TFHE ciphertext in the at least one first TFHE ciphertext; and a blind rotation unit configured to perform blind rotation operation on the test vector in the corresponding first TFHE ciphertext to obtain the second TFHE ciphertext corresponding to each first TFHE ciphertext.

[0021] Optionally, in an embodiment of the present application, the conversion module comprises: an encoding unit configured to encode each second TFHE ciphertext to obtain a conversion vector and a conversion matrix; an operation unit configured to perform homomorphic matrix multiplication operation and homomorphic addition operation based on the conversion vector, the conversion matrix and a preset conversion key to obtain a first conversion result; a modulo unit configured to perform homomorphic modulo operation on the first conversion result to obtain a second conversion result; and a correction unit configured to eliminate decimal places of the second conversion result based on a preset polynomial approximation method to obtain a corrected result.

[0022] Optionally, in an embodiment of the present application, the mathematical expression of the preset linear function calculation strategy is:

[0023]

[0024]

[0025] wherein, m i (i = 0, 1, 2,..., l-1) is user privacy data, is a first CKKS ciphertext, N is a dimension of the first CKKS ciphertext, Q is a modulus of the first CKKS ciphertext, and S is a private key.

[0026] Optionally, in an embodiment of the present application, the first calculation module further includes: a parameter determination unit configured to determine an encryption parameter satisfying a preset security condition; and an encryption unit configured to encrypt the user privacy data into the at least one first TFHE ciphertext based on the encryption parameter and a preset private key.

[0027] An electronic device is provided in a third aspect of the present application, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the data general calculation method based on fully homomorphic encryption as described in the above embodiments.

[0028] A computer readable storage medium is provided in a fourth aspect of the present application, which stores a computer program executable by a processor to implement the data general calculation method based on fully homomorphic encryption as described above.

[0029] Therefore, the embodiments of the present application have the following beneficial effects:

[0030] The embodiments of the present application can encrypt the privacy data of a user into at least one first TFHE ciphertext based on the TFHE homomorphic encryption algorithm, perform nonlinear function calculation on each of the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each of the at least one first TFHE ciphertext, convert all the second TFHE ciphertexts into a first CKKS ciphertext, perform calculation on the first CKKS ciphertext according to a preset linear function calculation strategy to obtain a second CKKS ciphertext, and send the second CKKS ciphertext to the user. The present application utilizes the TFHE homomorphic encryption and the CKKS homomorphic encryption to realize the nonlinear function calculation of the TFHE ciphertext, and can complete the general function calculation on the homomorphic encryption ciphertext through the conversion of the TFHE ciphertext into the CKKS ciphertext and the linear function calculation of the CKKS ciphertext, so as to be capable of processing the linear function and the nonlinear function at the same time, improve the accuracy and security of the ciphertext conversion, and effectively improve the utilization rate of the user-side calculation resources and storage space by outsourcing the fully homomorphic encryption data to the service provider for data encryption calculation. Thus, the problem that the current cloud outsourcing solution based on fully homomorphic encryption is difficult to efficiently and accurately process the linear function and the nonlinear function at the same time is solved.

[0031] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0033] Figure 1 A flowchart of a general data computing method based on fully homomorphic encryption provided according to an embodiment of the present application;

[0034] Figure 2 A schematic diagram of the logical architecture of a general data computing method based on fully homomorphic encryption provided for one embodiment of the present application;

[0035] Figure 3 This is an example diagram of a data general computing device based on fully homomorphic encryption according to an embodiment of the present application;

[0036] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0037] Among them, 10-general data computing device based on fully homomorphic encryption, 100-first computing module, 200-conversion module, 300-second computing module, 401-memory, 402-processor, 403-communication interface. DETAILED DESCRIPTION

[0038] The following describes in detail embodiments of the present application, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

[0039] A method, device, equipment and medium for general data computation based on full homomorphic encryption are described below with reference to the accompanying drawings. To solve the problems mentioned in the background, the present application provides a method for general data computation based on full homomorphic encryption. In the method, the privacy data of a user is encrypted by a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext. A nonlinear function is calculated for each first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext. All second TFHE ciphertexts are converted into first CKKS ciphertexts, and the first CKKS ciphertexts are calculated according to a preset linear function calculation strategy to obtain second CKKS ciphertexts, which are then sent to the user. The present application uses TFHE homomorphic encryption and CKKS homomorphic encryption to realize nonlinear function calculation of TFHE ciphertexts. Through conversion of TFHE ciphertexts to CKKS ciphertexts and linear function calculation of CKKS ciphertexts, general function calculation on homomorphic encryption ciphertexts is completed, so that linear functions and nonlinear functions can be processed simultaneously, improving the accuracy and security of ciphertext conversion. In addition, the service provider performs data encryption calculation on full homomorphic encryption data in the form of outsourcing, effectively improving the utilization of user-side computing resources and storage space. Thus, the problem that current cloud outsourcing solutions based on full homomorphic encryption cannot efficiently and accurately process linear functions and nonlinear functions is solved.

[0040] To better understand the execution logic of the method for general data computation based on full homomorphic encryption of the present application, the logic architecture of the present application is briefly summarized and described as follows:

[0041] The logic architecture of the present application mainly includes two subjects, i.e., a user and a service provider. The user has private data and does not want to disclose the data to others, while the user wants to perform some calculations on the data with external computing power. The service provider is a cloud computing provider with strong computing power, usually having more computing devices and larger storage space, and can provide data outsourcing calculation services.

[0042] Specifically, Figure 1 A flowchart of the method for general data computation based on full homomorphic encryption provided by the present application is shown in FIG. 1.

[0043] As shown in FIG. 1, the method for general data computation based on full homomorphic encryption includes the following steps: Figure 1

[0044] ​In step S101, the privacy data of the user is encrypted based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, and a nonlinear function calculation is performed on each of the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each of the at least one first TFHE ciphertext.

[0045] In an embodiment of the present application, the user can outsource the privacy data after the TFHE fully homomorphic encryption to the service provider, and the service provider can fully utilize the programmable bootstrap of the TFHE fully homomorphic encryption method to perform nonlinear function calculation of any depth on the encrypted data.

[0046] Optionally, in an embodiment of the present application, the privacy data of the user is encrypted based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, including: determining an encryption parameter satisfying a preset security condition; and encrypting the privacy data of the user into the at least one first TFHE ciphertext based on the encryption parameter and a preset private key.

[0047] In an embodiment of the present application, the user can use the TFHE fully homomorphic encryption algorithm to encrypt the privacy data into a ciphertext.

[0048] Specifically, the user can first determine a set of encryption parameters (n, p, q) satisfying a specific security, and generate a private key s, and encrypt the privacy data m into a TFHE ciphertext encrypted using the private key s based on the following formula:

[0049]

[0050] wherein n is the dimension of the TFHE ciphertext, p is a plaintext modulus, q is a ciphertext modulus, is a random number, e is a noise selected from a certain noise distribution χ nosie , and r is a noise. is a scaling parameter for protecting the least significant bits.

[0051] In addition to the above TFHE ciphertext data, in an embodiment of the present application, the user also needs to send some auxiliary calculation keys, such as bootstrap keys and conversion keys, to the service provider, wherein the auxiliary keys are all fully homomorphic ciphertexts in a certain format, and the service provider can assist in calculating the ciphertexts to avoid leaking the user keys and plaintext information.

[0052] Therefore, by using the fully homomorphic encryption technology, the embodiments of the present application not only avoid the leakage of information in the data outsourcing scenario, but also effectively protect the user privacy, and provide safe and reliable data support for the subsequent linear function operation and nonlinear function operation of the data.

[0053] Optionally, in an embodiment of the present application, the non-linear function calculation is performed on each of the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each of the at least one first TFHE ciphertext, including: constructing a test vector for the non-linear function of each of the at least one first TFHE ciphertext; and performing a blind rotation operation on the test vector on the corresponding first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each of the at least one first TFHE ciphertext.

[0054] It should be noted that after the service provider receives the encrypted data (ct0, ct1,...ct n-1 ) and the bootstrap key BK of the user, and the ciphertext conversion key CK, the embodiments of the present application can perform non-linear function calculation on the ciphertext using the programmable bootstrap algorithm of the TFHE ciphertext.

[0055] Specifically, if the service party needs to calculate a certain non-linear function F(x) on the ciphertext, a test vector TV = RLWE(F(0), F(0),..., F(k-1)) needs to be constructed according to the non-linear function first; and then a blind rotation operation is performed on the TFHE ciphertext.

[0056] For example, for a TFHE encrypted ciphertext The service provider can calculate x b+as TV, so as to rotate the test vector to the position of the corresponding encrypted plaintext, and then extract the plaintext to obtain the calculated ciphertext

[0057] It can be understood that the embodiments of the present application encrypt the private data into TFHE ciphertext by the user and send it to the service provider, and the service provider uses the programmable bootstrap method of the TFHE ciphertext, so that the calculation of any non-linear function can be performed, such as the non-linear function calculation (AND, OR, NAND) based on the Boolean circuit, and the lookup table is also constructed for calculation, thereby improving the efficiency and accuracy of the non-linear function calculation of the TFHE ciphertext.

[0058] In step S102, all the second TFHE ciphertexts are converted into first CKKS ciphertexts.

[0059] After the service provider performs the non-linear function calculation on the TFHE ciphertext, further, the embodiments of the present application can convert the TFHE homomorphic ciphertext into a high-precision CKKS ciphertext without losing the precision of the ciphertext.

[0060] Optionally, in an embodiment of the present application, converting all second TFHE ciphertexts into first CKKS ciphertexts comprises: encoding each second TFHE ciphertext to obtain a conversion vector and a conversion matrix; performing homomorphic matrix multiplication and homomorphic addition operations based on the conversion vector, the conversion matrix, and a preset conversion key to obtain a first conversion result; performing a homomorphic modulo operation on the first conversion result to obtain a second conversion result; and eliminating decimal places of the second conversion result based on a preset polynomial approximation method to obtain a correction result. It should be noted that after the service provider calculates the nonlinear function on the TFHE ciphertext, the embodiments of the present application need to convert the l TFHE ciphertexts into CKKS ciphertexts, and the ciphertext conversion process performs a bootstrap operation once. The specific process of the ciphertext conversion process is as follows:

[0061] 1. The service provider encodes the l TFHE ciphertexts that need to be converted into a vector b and a matrix A:

[0062] b=(b0,b1,...,b l-1 )

[0063]

[0064] 2. The service provider performs homomorphic matrix multiplication by means of the conversion key sent by the user before, that is, calculates and then performs homomorphic addition operation to obtain That is, it is equivalent to calculating the decryption function on the ciphertext.

[0065] 3. The service side needs to perform a modulo operation on the homomorphism to obtain

[0066] As (As+b mod q)=(m0,m1,...m l-1 )+e, the service provider can obtain the ciphertext encrypted using CKKS However, the noise generated by the current homomorphic linear calculation and homomorphic modulo operation is large, and the precision of the ciphertext is also large, which leads to low precision of the current ciphertext conversion and is difficult to meet the needs of high-precision scenarios.

[0067] Therefore, after the ciphertext conversion, the embodiments of the present application can perform a correction calculation once to update the conversion precision by the following formula:

[0068]

[0069] Wherein, the function G is a rounding function approximated by a polynomial approximation method such as Remiz algorithm, and satisfies the following formula:

[0070] |G((m0,m1,...,m l-1 ​)+e)-(m0,m1,...,m l-1 )|<e

[0071] Therefore, the embodiments of the present application can eliminate the noise of the decimal places of the ciphertext converted before by polynomial approximation and the like, so as to support higher precision (up to 16 bits or more), effectively improve the precision of the ciphertext conversion, and form more accurate ciphertext.

[0072] In step S103, the first CKKS ciphertext is calculated according to the preset linear function calculation strategy to obtain a second CKKS ciphertext, and the second CKKS ciphertext is sent to the user.

[0073] After the nonlinear function calculation of the TFHE ciphertext and the conversion into the high-precision CKKS ciphertext, further, the embodiments of the present application can also realize the efficient linear function calculation of data by using the CKKS ciphertext, so as to efficiently complete the general function calculation on the homomorphic encryption ciphertext, and the calculation result is encrypted and sent to the user.

[0074] Optionally, in an embodiment of the present application, the mathematical expression of the preset linear function calculation strategy is:

[0075]

[0076]

[0077] wherein, m i (i=0, 1, 2,..., l-1) is the user privacy data, is the first CKKS ciphertext, N is the dimension of the first CKKS ciphertext, Q is the modulus of the first CKKS ciphertext, and S is the private key.

[0078] After the high-precision ciphertext conversion, the service provider can obtain the high-precision encrypted CKKS ciphertext Further, the embodiments of the present application can perform linear function calculation on the CKKS ciphertext.

[0079] Since the CKKS ciphertext can encode multiple data into one ciphertext, one ciphertext addition or ciphertext multiplication operation can calculate multiple data at the same time, which has good SIMD characteristics and high efficiency in processing linear function calculation. The linear function calculation in the embodiments of the present application is mainly realized by the addition and multiplication of the ciphertext on CKKS, as shown in the following formula:

[0080]

[0081]

[0082] Thus, the embodiments of the present application are based on CKKS ciphertexts in processing linear function calculation, which are more efficient and accurate, thereby combining the superiority of TFHE ciphertexts in processing nonlinear functions and CKKS ciphertexts in processing linear functions, to achieve efficient calculation of general data of homomorphic encryption data.

[0083] After the service provider completes the nonlinear calculation, the ciphertext is converted, and the linear function calculation is performed on the encrypted data. After the linear calculation, the CKKS ciphertexts calculated by the embodiments of the present application can be sent to the user, and the user can decrypt using the private key to obtain the results of the linear function calculation and the nonlinear function calculation.

[0084] In summary, the TFHE homomorphic encryption algorithm and the CKKS homomorphic encryption algorithm in the embodiments of the present application are based on LWE difficult problems and RLWE difficult problems, respectively. Both algorithms have strong difficult problems as security guarantees, and have high security. Compared with other data outsourcing solutions, the security of the TFHE homomorphic encryption algorithm and the CKKS homomorphic encryption algorithm in the embodiments of the present application can be proven.

[0085] According to the data general calculation method based on full homomorphic encryption proposed in the embodiments of the present application, the user outsources the data to the service provider after encrypting the data using full homomorphic encryption. The service provider can perform nonlinear function calculation on the encrypted data. After completing the nonlinear calculation, high-precision ciphertext conversion can be performed, and efficient linear function calculation can be realized according to the CKKS ciphertexts, to complete high-precision general function calculation on homomorphic encryption ciphertexts. After completing the linear calculation, the calculation results are returned to the user, so that linear functions and nonlinear functions can be processed at the same time, the precision and security of the ciphertext conversion are improved, and the utilization rate of the user's computing resources and storage space is effectively improved through the service provider for data encryption calculation of full homomorphic encryption data in the form of outsourcing.

[0086] Secondly, the data general calculation device based on full homomorphic encryption proposed in the embodiments of the present application is described with reference to the accompanying drawings.

[0087] Figure 3 is a block schematic diagram of the data general calculation device based on full homomorphic encryption in the embodiments of the present application.

[0088] As shown in Figure 3 The data general calculation device based on full homomorphic encryption 10 includes a first calculation module 100, a conversion module 200, and a second calculation module 300.

[0089] The first calculation module 100 is configured to encrypt privacy data of a user based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, and perform nonlinear function calculation on each of the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each of the at least one first TFHE ciphertext.

[0090] The conversion module 200 is configured to convert all the second TFHE ciphertexts into first CKKS ciphertexts.

[0091] The second calculation module 300 is configured to perform calculation on the first CKKS ciphertexts according to a preset linear function calculation strategy to obtain second CKKS ciphertexts, and send the second CKKS ciphertexts to the user.

[0092] Optionally, in an embodiment of the present application, the first calculation module 100 comprises a construction unit and a blind rotation unit.

[0093] The construction unit is configured to construct a test vector for the nonlinear function of each of the at least one first TFHE ciphertext.

[0094] The blind rotation unit is configured to perform blind rotation operation on the test vector on the corresponding first TFHE ciphertext to obtain the second TFHE ciphertext corresponding to each of the at least one first TFHE ciphertext.

[0095] Optionally, in an embodiment of the present application, the conversion module 200 comprises an encoding unit, an operation unit, a modulo unit and a correction unit.

[0096] The encoding unit is configured to encode each of the second TFHE ciphertexts to obtain a conversion vector and a conversion matrix.

[0097] The operation unit is configured to perform homomorphic matrix multiplication operation and homomorphic addition operation based on the conversion vector, the conversion matrix and a preset conversion key to obtain a first conversion result.

[0098] The modulo unit is configured to perform homomorphic modulo operation on the first conversion result to obtain a second conversion result.

[0099] The correction unit is configured to eliminate decimal places of the second conversion result based on a preset polynomial approximation method to obtain a correction result.

[0100] Optionally, in an embodiment of the present application, a mathematical expression of the preset linear function calculation strategy is as follows:

[0101]

[0102]

[0103] m i(i = 0, 1, 2,..., l-1) is user privacy data, is a first CKKS ciphertext, N is a dimension of the first CKKS ciphertext, Q is a modulus of the first CKKS ciphertext, and S is a private key.

[0104] Optionally, in an embodiment of the present application, the first calculation module 100 further comprises a parameter determination unit and an encryption unit.

[0105] The parameter determination unit is configured to determine an encryption parameter satisfying a preset security condition.

[0106] The encryption unit is configured to encrypt the user privacy data into at least one first TFHE ciphertext based on the encryption parameter and a preset private key.

[0107] It should be noted that the foregoing explanation and description of the embodiment of the data general calculation method based on homomorphic encryption also apply to the embodiment of the data general calculation device based on homomorphic encryption, which will not be described here again.

[0108] The data general calculation device based on homomorphic encryption provided by the embodiment of the present application can perform nonlinear function calculation on encrypted data by outsourcing the data encrypted by a user to a service provider, perform ciphertext conversion after completing the nonlinear calculation, and perform linear function calculation on the encrypted data, return the calculation result to the user after completing the linear calculation, so as to simultaneously process linear functions and nonlinear functions, improve the precision and security of ciphertext conversion, and effectively improve the utilization rate of user-side computing resources and storage space by outsourcing the homomorphic encryption data to the service provider for data encryption calculation.

[0109] Figure 4 The structure schematic diagram of the electronic device provided by the embodiment of the present application is shown in FIG. 4. The electronic device can include:

[0110] The memory 401, the processor 402, and the computer program stored in the memory 401 and executable on the processor 402.

[0111] The processor 402 implements the data general calculation method based on homomorphic encryption provided in the foregoing embodiments when executing the program.

[0112] Further, the electronic device further includes:

[0113] The communication interface 403 is configured to communicate between the memory 401 and the processor 402.

[0114] The memory 401 is configured to store the computer program executable on the processor 402.

[0115] The memory 401 can include a high-speed RAM memory, and can also include a non-volatile memory, for example, at least one disk memory.

[0116] If the memory 401, the processor 402 and the communication interface 403 are implemented independently, the communication interface 403, the memory 401 and the processor 402 can be connected to each other through a bus and complete communication between each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For convenience of representation, Figure 4 In the figure, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0117] Optionally, in a specific implementation, if the memory 401, the processor 402 and the communication interface 403 are integrated on a chip, the memory 401, the processor 402 and the communication interface 403 can complete communication between each other through an internal interface.

[0118] The processor 402 can be a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0119] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement the above-mentioned full homomorphic encryption based data general-purpose computing method.

[0120] In the description of the application, reference to "one embodiment", "some embodiments", "an example", "a specific example", or "some examples" means that a particular feature, structure, material, or characteristic being described is included in at least one embodiment or example of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment or example. Furthermore, the described specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples. In addition, the usage of "N" means at least two, for example, two, three or the like, unless explicitly stated otherwise.

[0121] Furthermore, the terms "first", "second", or the like, are used merely as a designation of certain elements or features, and do not imply or connote relative importance or a specific order of categorization of the indicated features. Accordingly, features described as "first" or "second" can be explicitly or implicitly included in at least one of the features. In the description of the application, the term "N" means at least two, for example, two, three, etc., unless explicitly stated otherwise.

[0122] Any process or method descriptions or blocks in flow charts or otherwise described herein represent embodiments which can be managed as one or more modules, segments, or portions of code which include one or more executable instructions for implementing specific logic functions or steps, and alternate implementations are possible. In some embodiments, the processes and methods described can be executed by one or more apparatuses or devices, either directly or after conversion to another language. Alternate implementations are possible.

[0123] The logic and / or steps represented in the flowcharts and / or described herein, for example, can be considered as a sequence of instructions to implement logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, apparatus, or device, such as a computer-based system, processor- based system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable medium can be a computer- readable storage medium or a computer-readable signal medium. The computer- readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires (electrical connections), a portable computer diskette (a magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, and a portable compact disc read-only memory (CDROM). In addition, the computer-readable medium can even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via, for example, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.

[0124] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, the N steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. If implemented in hardware and in another embodiment, any of the following technologies, known in the art, or their combinations can be used: discrete logic circuitry having logic gates for implementing logic functions on data signals, application specific integrated circuits having appropriate combinational logic gates, programmable gate arrays (PGA), field programmable gate arrays (FPGA), etc.

[0125] Those skilled in the art can understand that all or part of the steps carried out by the above-mentioned embodiments can be completed by programs instructing related hardware, and the programs can be stored in a computer-readable storage medium. When the programs are executed, one or a combination of the steps of the method embodiments is included.

[0126] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing module, or each of the units can be physically present separately, or two or more units can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer readable storage medium.

[0127] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present application, and those skilled in the art can make changes, modifications, replacements and variations to the above embodiments within the scope of the present application.

Claims

1. A method for data general-purpose computing based on homomorphic encryption, characterized by, The method comprises the following steps: encrypting privacy data of a user based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, performing nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext; converting all second TFHE ciphertexts into first CKKS ciphertexts, and performing calculation on the first CKKS ciphertexts according to a preset linear function calculation strategy to obtain a second CKKS ciphertext, and sending the second CKKS ciphertext to the user; wherein the performing nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext comprises: constructing a test vector for the nonlinear function of each first TFHE ciphertext in the at least one first TFHE ciphertext; performing blind rotation operation on the test vector on the corresponding first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext; the converting all second TFHE ciphertexts into first CKKS ciphertexts comprises: encoding each second TFHE ciphertext to obtain a conversion vector and a conversion matrix; performing homomorphic matrix multiplication operation and homomorphic addition operation based on the conversion vector, the conversion matrix and a preset conversion key to obtain a first conversion result; performing homomorphic modulo operation on the first conversion result to obtain a second conversion result; eliminating decimal places of the second conversion result based on a preset polynomial approximation method to obtain a correction result.

2. The method of claim 1, wherein, a mathematical expression of the preset linear function calculation strategy is: wherein m i is user private data, i= 0, 1, 2,..., l -1, is a first CKKS ciphertext, N is a dimension of the first CKKS ciphertext, Q is a modulus of the first CKKS ciphertext, and S is a private key.

3. The method of claim 1, wherein, the encrypting privacy data of a user based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext comprises: determining an encryption parameter satisfying a preset security condition; encrypting user privacy data into the at least one first TFHE ciphertext based on the encryption parameter and a preset private key.

4. A data general-purpose computing device based on homomorphic encryption, characterized by, comprise: a first calculation module configured to encrypt privacy data of a user based on a TFHE homomorphic encryption algorithm to obtain at least one first TFHE ciphertext, perform nonlinear function calculation on each first TFHE ciphertext in the at least one first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext; a conversion module configured to convert all second TFHE ciphertexts into first CKKS ciphertexts, and a second calculation module configured to perform calculation on the first CKKS ciphertexts according to a preset linear function calculation strategy to obtain a second CKKS ciphertext, and send the second CKKS ciphertext to the user; wherein the first calculation module comprises: a construction unit configured to construct a test vector for the nonlinear function of each first TFHE ciphertext in the at least one first TFHE ciphertext; a blind rotation unit configured to perform blind rotation operation on the test vector on the corresponding first TFHE ciphertext to obtain a second TFHE ciphertext corresponding to each first TFHE ciphertext; wherein the conversion module comprises: An encoding unit is configured to encode each second TFHE ciphertext to obtain a conversion vector and a conversion matrix; An operation unit is configured to perform homomorphic matrix multiplication and homomorphic addition based on the conversion vector, the conversion matrix and a preset conversion key to obtain a first conversion result; A modulo unit is configured to perform homomorphic modulo operation on the first conversion result to obtain a second conversion result; A correction unit is configured to eliminate decimal places of the second conversion result based on a preset polynomial approximation method to obtain a correction result.

5. The apparatus of claim 4, wherein, A mathematical expression of the preset linear function calculation strategy is: wherein m i is user private data, i= 0, 1, 2,..., l -1, is a first CKKS ciphertext, N is a dimension of the first CKKS ciphertext, Q is a modulus of the first CKKS ciphertext, and S is a private key.

6. The apparatus of claim 4, wherein, The first calculation module further includes: A parameter determination unit is configured to determine an encryption parameter satisfying a preset security condition; An encryption unit is configured to encrypt user privacy data into the at least one first TFHE ciphertext based on the encryption parameter and a preset private key.

7. An electronic device, comprising: A computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the full homomorphic encryption based data general calculation method according to any one of claims 1-3. The program is executed by the processor to implement the full homomorphic encryption based data general calculation method according to any one of claims 1-3.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Multi-party privacy protection machine learning method based on homomorphic encryption and trusted hardware

    CN113553610A

  • Database privacy protection and query method and device based on fully homomorphic encryption

    CN116089692A