CN115622685A - Method, device and system for homomorphic encryption of private data - Google Patents

Method, device and system for homomorphic encryption of private data Download PDF

Info

Publication number
CN115622685A
CN115622685A CN202211618803.4A CN202211618803A CN115622685A CN 115622685 A CN115622685 A CN 115622685A CN 202211618803 A CN202211618803 A CN 202211618803A CN 115622685 A CN115622685 A CN 115622685A
Authority
CN
China
Prior art keywords
encryption key
target
result
encryption
private data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211618803.4A
Other languages
Chinese (zh)
Other versions
CN115622685B (en
Inventor
涂锟
王�琦
柯琪锐
陆阳
陈艳晶
张曙光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengfang Financial Technology Co ltd
Original Assignee
Chengfang Financial Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Chengfang Financial Technology Co ltd filed Critical Chengfang Financial Technology Co ltd
Priority to CN202211618803.4A priority Critical patent/CN115622685B/en
Publication of CN115622685A publication Critical patent/CN115622685A/en
Application granted granted Critical
Publication of CN115622685B publication Critical patent/CN115622685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Complex Calculations (AREA)

Abstract

The invention relates to the technical field of data processing, and provides a homomorphic encryption method, a homomorphic encryption device and a homomorphic encryption system for private data, wherein the homomorphic encryption method is used for acquiring the private data to be encrypted; determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in the graphics processor to obtain a first conversion result and a second conversion result; determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transformation result and the second transformation result; and finally, homomorphic encryption is carried out on the private data based on the encryption key and the target product result. According to the method, the security of the private data can be ensured by carrying out homomorphic encryption on the private data. Moreover, the parallel FFT is carried out by utilizing the streaming multiprocessor in the graphic processor, so that the efficiency of determining the target product result of the encryption key and the target multiplier can be greatly improved, and the homomorphic encryption efficiency of the private data can be further improved.

Description

Method, device and system for homomorphic encryption of private data
Technical Field
The invention relates to the technical field of data processing, in particular to a method, a device and a system for homomorphic encryption of private data.
Background
With the gradual and strong protection consciousness of people on private data, homomorphic encryption is used as a security technology which is widely applied, and has huge functions and practical values in the field of privacy calculation.
The core idea of homomorphic encryption is that ciphertext can be calculated, which means that ciphertext operation processing is performed on homomorphic encrypted data to obtain an output, the output is decrypted, and the obtained decryption result is the same as the output result obtained by processing unencrypted original data by the same method. In the homomorphic encryption process of the private data, a large number of multiplication operations and linear combination operations are generally required, and the process is complex, so that the encryption efficiency of the private data is greatly reduced.
Therefore, it is urgently needed to provide a privacy data homomorphic encryption method.
Disclosure of Invention
The invention provides a method, a device and a system for homomorphic encryption of private data, which are used for overcoming the defects in the prior art.
The invention provides a homomorphic encryption method for private data, which comprises the following steps:
obtaining private data to be encrypted;
determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in a graphics processor to obtain a first conversion result and a second conversion result;
determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transformation result and the second transformation result;
homomorphic encryption is performed on the private data based on the encryption key and the target product result.
According to the homomorphic encryption method for the private data, provided by the invention, the first transformation result is obtained based on the following steps:
determining the number of FFT points and the number of rounds of butterfly transformation operation in FFT based on the number of bits of the encryption key and the number of bits of the target multiplier;
representing the encryption key as a polynomial and distributing each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, based on the round, the FFT point number and the position of the polynomial coefficient distributed in each streaming multiprocessor in the polynomial, determining the twiddle factor of each butterfly transformation operation in the round, screening out a plurality of streaming multiprocessors, and based on the twiddle factor of each butterfly transformation operation in the round and the streaming multiprocessors, executing each butterfly transformation operation in the round in parallel.
According to a homomorphic encryption method for private data provided by the present invention, the determining a twiddle factor of each butterfly transform operation in any round based on the position of the polynomial coefficient distributed in the streaming multiprocessor, the FFT point number and the polynomial coefficient in the polynomial, and screening out a plurality of streaming multiprocessors includes:
determining the subscript interval of input nodes of each butterfly transformation operation in any round based on the round;
calculating the node scale after any round based on the subscript interval of the input nodes and the FFT points, and determining the twiddle factor of each butterfly transformation operation in any round based on the node scale;
and screening the streaming multiprocessors based on the input node index interval and the positions of the polynomial coefficients distributed in each streaming multiprocessor in the polynomial.
According to a homomorphic encryption method for private data provided by the invention, the determining of an encryption key and a target multiplier corresponding to the encryption key comprises the following steps:
selecting the encryption key from an encryption key set and selecting the target multiplier from a target multiplier set;
the encryption key set is constructed on the basis of odd numbers with the exponent power of 2 in the random number set generated by the quantum random number generator, and the target multiplier set is constructed on the basis of integers with the exponent power of 2 in the random number set.
According to a homomorphic encryption method for private data provided by the invention, homomorphic encryption is performed on the private data based on the encryption key and the target product result, and the homomorphic encryption method comprises the following steps:
generating a target random number based on the encryption key;
and homomorphic encrypting the privacy data based on the target random number and the target product result.
According to a homomorphic encryption method for private data provided by the present invention, the determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transformation result and the second transformation result includes:
and performing IFFT on the alternative product result to obtain the target product result.
The invention also provides a privacy data homomorphic encryption device, which comprises:
the data acquisition module is used for acquiring the private data to be encrypted;
the conversion module is used for determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in a graphics processor to obtain a first conversion result and a second conversion result;
a product module to determine a target product result of the encryption key and the target multiplier based on an alternative product result of the first transformation result and the second transformation result;
and the encryption module is used for carrying out homomorphic encryption on the privacy data based on the encryption key and the target product result.
The invention also provides a privacy data homomorphic encryption system, which comprises: quantum random number generator, figure processor and the above-mentioned privacy data homomorphic encryption device;
any two of the quantum random number generator, the graphics processor and the privacy data homomorphic encryption device are connected through interfaces;
the quantum random number generator is used for providing an encryption key and a target multiplier corresponding to the encryption key for the privacy data homomorphic encryption device;
the privacy data homomorphic encryption device is used for calling the graphics processor.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the privacy data homomorphic encryption method.
The present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of homomorphic encryption of private data as described in any one of the above.
The invention also provides a computer program product comprising a computer program which, when executed by a processor, implements a method of homomorphic encryption of private data as described in any one of the above.
The invention provides a homomorphic encryption method, a homomorphic encryption device and a homomorphic encryption system for private data, wherein the method comprises the steps of firstly obtaining the private data to be encrypted; then determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in the graphics processor to obtain a first conversion result and a second conversion result; then determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transformation result and the second transformation result; and finally, homomorphic encryption is carried out on the private data based on the encryption key and the target product result. According to the method, the security of the private data can be ensured by carrying out homomorphic encryption on the private data. Moreover, the parallel FFT is carried out by utilizing the streaming multiprocessor in the graphic processor, so that the efficiency of determining the target product result of the encryption key and the target multiplier can be greatly improved, and the homomorphic encryption efficiency of the private data can be further improved.
Drawings
In order to more clearly illustrate the present invention or the technical solutions in the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method for homomorphic encryption of private data provided by the present invention;
FIG. 2 is a diagram of a thread model and hardware architecture level mapping for a graphics processor employed in the method for homomorphic encryption of private data provided by the present invention;
FIG. 3 is a schematic diagram of an FFT transformation process of 8-point polynomial in the homomorphic encryption method for private data provided in the present invention;
FIG. 4 is a schematic structural diagram of a homomorphic encryption apparatus for private data provided by the present invention;
FIG. 5 is a schematic diagram of a homomorphic encryption system for private data according to the present invention;
FIG. 6 is a second schematic structural diagram of a privacy data homomorphic encryption system provided by the present invention;
fig. 7 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The existing homomorphic encryption method usually needs a large amount of multiplication operations and linear combination operations in the homomorphic encryption process of the private data, so that the process is complex, and the encryption efficiency of the private data is greatly reduced. Therefore, the embodiment of the invention provides a privacy data homomorphic encryption method.
Fig. 1 is a schematic flowchart of a method for homomorphic encryption of private data according to an embodiment of the present invention, as shown in fig. 1, the method includes:
s1, obtaining private data to be encrypted;
s2, determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in a graphics processor to obtain a first conversion result and a second conversion result;
s3, determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transformation result and the second transformation result;
and S4, homomorphic encryption is carried out on the privacy data based on the encryption key and the target product result.
Specifically, in the privacy data homomorphic encryption method provided in the embodiment of the present invention, an execution subject is a privacy data homomorphic encryption device, where the device may be a Central Processing Unit (CPU), and the device may be configured in a computer, the computer may be a local computer or a cloud computer, and the local computer may be a computer, a tablet, and the like, and is not limited specifically here.
Step S1 is first executed to obtain private data to be encrypted, where the private data may be data that needs to be encrypted by a user, and the private data may be decimal data. The user can be an individual, or a company, an enterprise and the like, the privacy data can be personal face feature data, identification card numbers, mobile phone numbers, bank card passwords, webpage browsing records and the like, and the privacy data can also be financial data, fund flow data, important customer information and the like of the company or the enterprise.
Then, step S2 is executed to determine an encryption key and a target multiplier corresponding to the encryption key, where both the encryption key and the target multiplier may be random numbers, and both may be generated by a quantum random number generator, which is not limited herein. The encryption key may be a large integer odd number, and the target multiplier corresponding to the encryption key may be a large integer. The large integer is a large integer of an odd number, and the large integer refers to a number whose range is beyond the range that the basic data type can represent.
A Graphics Processing Unit (GPU) is a dedicated image rendering hardware, and has good versatility and high performance for each hardware. The Thread model 21 of the GPU shown in FIG. 2 may include Grid, block, thread, and Warp. Grid, block, and Thread are three levels of Thread organization, which respectively correspond to a Device (Device), a Streaming Multiprocessor (SM), and a Unified computing Device Architecture (CUDA) Core (Core) of the hardware Architecture layer 22.
The minimum unit when the GPU is operating is Thread. Multiple threads may constitute one Block, and multiple blocks executing the same program may constitute Grid. Multiple blocks share memory (Cache), so communications between blocks can be considered as a fully connected mode.
Based on this, when the encryption key and the target multiplier are respectively subjected to parallel Fast Fourier Transform (FFT) by the SM in the GPU, the parallel butterfly transform operation of the FFT may be distributed to different SMs according to a hierarchical structure for execution, so as to improve the parallelism of the FFT. The basic idea of performing parallel FFT is to split the FFT according to iteration rounds of butterfly transformation operation, parallelize the same butterfly transformation operation in each round, then use each SM in the GPU as a computing node of parallel computation, and distribute the parallelized butterfly transformation operation to different SMs, thereby improving the parallelism of the FFT and improving the conversion efficiency.
Before parallel FFT is performed on the encryption key and the target multiplier by SM in the GPU, the encryption key and the target multiplier may be represented as polynomials, respectively, and the degree of the polynomial may be the number of bits of the encryption key and the target multiplier minus one. Further, a parallel FFT process is performed, that is, a polynomial is converted from a coefficient representation to a point value representation.
Is provided with one
Figure 343844DEST_PATH_IMAGE001
Large integer of bits
Figure 536184DEST_PATH_IMAGE002
Figure 89656DEST_PATH_IMAGE003
Can be represented as one
Figure 320917DEST_PATH_IMAGE004
The polynomial has two expression methods of coefficient expression and point value expression.
Coefficient representation:
Figure 673139DEST_PATH_IMAGE005
wherein
Figure 66074DEST_PATH_IMAGE006
is the independent variable of the number of the variable,
Figure 106843DEST_PATH_IMAGE007
as a function of the amount of the dependent variable,
Figure 610636DEST_PATH_IMAGE008
is an index of
Figure 345593DEST_PATH_IMAGE009
Independent variable of (2)
Figure 909430DEST_PATH_IMAGE006
The coefficient of the polynomial (c) of (a),
Figure 968653DEST_PATH_IMAGE010
is composed of
Figure 243514DEST_PATH_IMAGE011
One term of a polynomial of degree, a coefficient vector composed of polynomial coefficients of all terms
Figure 337372DEST_PATH_IMAGE012
Uniquely determine thisPolynomials, i.e. large integers
Figure 72110DEST_PATH_IMAGE013
. Calculating multiplication of two large integers, i.e. two, according to coefficient representation
Figure 618629DEST_PATH_IMAGE014
Multiplication by a polynomial of degree with a complexity of
Figure 231269DEST_PATH_IMAGE015
Dot value representation: a group of interpolation nodes different from each other
Figure 382896DEST_PATH_IMAGE016
Are brought into separately
Figure 288535DEST_PATH_IMAGE007
To obtain
Figure 322350DEST_PATH_IMAGE017
Value of
Figure 470172DEST_PATH_IMAGE018
Wherein
Figure 538622DEST_PATH_IMAGE019
. According to the basic theorem of algebra, one
Figure 818425DEST_PATH_IMAGE020
The sub-polynomials are present in the complex field and only
Figure 858579DEST_PATH_IMAGE021
One root, therefore one
Figure 311557DEST_PATH_IMAGE022
Of a polynomial of degree
Figure 765672DEST_PATH_IMAGE023
The polynomial is uniquely determined by a number of different value points.
FFT is a type of FFT
Figure 481956DEST_PATH_IMAGE024
Discrete Fourier Transform (DFT) algorithm that is completed in time. DFT will give the coefficient vector of the polynomial
Figure 192160DEST_PATH_IMAGE025
Is converted into
Figure 183250DEST_PATH_IMAGE026
The calculation formula is as follows:
Figure 960713DEST_PATH_IMAGE027
wherein,
Figure 379056DEST_PATH_IMAGE028
is composed of
Figure 110645DEST_PATH_IMAGE029
The root of the secondary unit is the root of the secondary unit,
Figure 639847DEST_PATH_IMAGE030
the FFT is used to convert a polynomial in a point-value representation to a coefficient representation, which is called Inverse Discrete Fourier Transform (IDFT), and is calculated by the formula:
Figure 271816DEST_PATH_IMAGE031
wherein,
Figure 625175DEST_PATH_IMAGE032
is composed of
Figure 545858DEST_PATH_IMAGE033
The root of the secondary unit is the root of the secondary unit,
Figure 144329DEST_PATH_IMAGE034
by using the periodicity, symmetry and semiidentity of the unit primitive root, a polynomial can be formed
Figure 896385DEST_PATH_IMAGE035
The polynomial sequence is divided into an even subscript term and an odd subscript term according to the subscript, and FFT is respectively carried out to obtain the polynomial sequence
Figure 152136DEST_PATH_IMAGE036
And
Figure 356852DEST_PATH_IMAGE037
then, then
Figure 696698DEST_PATH_IMAGE038
The FFT of the polynomial sequence of (a) is:
Figure 67374DEST_PATH_IMAGE039
thus, will
Figure 998421DEST_PATH_IMAGE033
FFT decomposition of a point into two
Figure 690433DEST_PATH_IMAGE040
FFT of the point
Figure 365128DEST_PATH_IMAGE041
Is 2, and the algorithm complexity is determined by such recursive decomposition
Figure 796503DEST_PATH_IMAGE042
. In the recursion process, the array is continuously split layer by layer from the top to the bottom to generate the operation result with the minimum granularity, and then the final result is formed layer by layer. An additional storage space is needed in the subscript separation process, and space complexity is improved.
From the bottom in order to reduce space complexityThe result is processed by special calculation layer by layer and returns to the top. This operation is called a butterfly (butterfly) operation, which may be a sequence of operations
Figure 367293DEST_PATH_IMAGE043
In-place conversion to
Figure 812181DEST_PATH_IMAGE044
With a spatial complexity of
Figure 523522DEST_PATH_IMAGE045
. To implement butterfly operations, the sequence subscripts need to be bit reversed (bit reverse), as follows
Figure 104676DEST_PATH_IMAGE046
. And after the original sequence elements are converted by bit reverse order, performing FFT operation layer by layer according to circulation. The temporal complexity of such an algorithm is
Figure 846367DEST_PATH_IMAGE047
Spatial complexity of
Figure 512972DEST_PATH_IMAGE048
The encryption key is subjected to parallel FFT by the SM in the GPU to obtain a first transformation result, and the target multiplier is subjected to parallel FFT by the SM in the GPU to obtain a second transformation result.
Step S3 is then executed, and the first transformation result and the second transformation result may be multiplied to obtain an alternative product result of the first transformation result and the second transformation result. Since the first transformation result can be regarded as a point-value representation of a polynomial of the encryption key and the second transformation result can be regarded as a point-value representation of a polynomial of the target multiplier, the first transformation result and the second transformation result are multiplied, i.e., dot product calculation is performed on both.
Thereafter, a target product result may be determined based on the alternative product results. Since the alternative product result is still in the form of point value representation, the coefficient representation of the alternative product result can be obtained by performing Inverse Fast Fourier Transform (IFFT) on the alternative product result, so as to obtain the target product result of the encryption key and the target multiplier, where the target product result is the product of the coefficient representation of the polynomial of the encryption key and the coefficient representation of the polynomial of the target multiplier.
And finally, executing the step S4, and carrying out homomorphic encryption on the private data through a homomorphic encryption algorithm according to the encryption key and the target product result. Homomorphic encryption algorithms may include fully homomorphic encryption algorithms, partially homomorphic encryption algorithms, and near homomorphic encryption algorithms, among others. If ciphertext data obtained by a homomorphic encryption algorithm can execute addition and multiplication operations for an unlimited number of times, the homomorphic encryption algorithm is a completely homomorphic encryption algorithm, which is referred to as a fully homomorphic encryption algorithm for short.
Taking the case of a fully homomorphic encryption scheme (DGHV) on an integer, the DGHV belongs to symmetric encryption and generally includes a key generation phase (KeyGen), an encryption algorithm (Encrypt) phase, a decryption algorithm phase (Decrypt), a homomorphic calculation phase (Evaluate), and the like.
In the key generation stage, an odd number of N bits is selected as an encryption key p according to security parameters lambda and KeyGen (lambda), and p is a large integer in order to improve algorithm security. The encryption key may be generated by a random number generator.
The encryption scheme of the encryption phase may be expressed as c = p × q +2r + m, m is the private data to be encrypted, p is the encryption key, q is the target multiplier, p × q is the target product result, p, q are both random large integers, r is the target random number, usually a small integer, which may be determined by p. The relationship of r to p can be expressed as |2r | < | p/2|. And c is an encryption result obtained by homomorphic encryption of the private data m.
In the homomorphic encryption process of the private data, homomorphic encryption can be carried out on the private data according to bits, namely m is any bit of the private data, the value space of m is {0,1}, and the value space of c, namely the ciphertext space, is an integer.
It should be noted that, the method is based on the graphics processorThe streaming multiprocessor respectively carries out parallel FFT on the encryption key and the target multiplier to obtain a first conversion result and a second conversion result, namely the encryption key and the target multiplier are respectively expressed into a polynomial by using a coefficient representation method, and the polynomial of the encryption key and the polynomial of the target multiplier are both converted into a point value representation form by using the coefficient representation form. The time complexity of the process is
Figure 25075DEST_PATH_IMAGE049
And N is the number of polynomial coefficients of the encryption key. Thereafter, an alternative product result of the first transformation result and the second transformation result is determined, i.e. a polynomial multiplication is calculated in a point representation, the time complexity of the procedure being
Figure 460736DEST_PATH_IMAGE050
. Finally, the target product result of the encryption key and the target multiplier is determined through the alternative product result, namely, the point value representation form of the alternative product result is converted into the coefficient representation form through IFFT to obtain the final target product result, and the time complexity of the process is that
Figure 373328DEST_PATH_IMAGE051
. Through the three processes described above, the total time complexity in determining the target product result of the encryption key and the target multiplier is
Figure 760185DEST_PATH_IMAGE052
. It is thus understood that, by performing parallel FFT on the encryption key and the target multiplier by a streaming multiprocessor in the graphics processor, the time complexity of determining the target product result of the encryption key and the target multiplier can be reduced to the level of determining the target product result
Figure 580373DEST_PATH_IMAGE049
In contrast, the existing scheme for determining the product result of two large integers based on the divide-and-conquer method has the time complexity up to
Figure 870540DEST_PATH_IMAGE053
Compared with the existing scheme, the homomorphic encryption method for the private data provided by the embodiment of the invention can greatly improve homomorphic encryption efficiency.
The privacy data homomorphic encryption method provided by the embodiment of the invention comprises the steps of firstly obtaining privacy data to be encrypted; then determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in the graphics processor to obtain a first conversion result and a second conversion result; then determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transformation result and the second transformation result; and finally, homomorphic encryption is carried out on the private data based on the encryption key and the target product result. According to the method, the security of the private data can be ensured by carrying out homomorphic encryption on the private data. Moreover, the parallel FFT is carried out by utilizing the streaming multiprocessor in the graphic processor, so that the efficiency of determining the target product result of the encryption key and the target multiplier can be greatly improved, and the homomorphic encryption efficiency of the private data can be further improved.
On the basis of the foregoing embodiment, in the privacy data homomorphic encryption method provided in the embodiment of the present invention, the first transformation result is obtained based on the following steps:
determining the number of FFT points and the number of rounds of butterfly-shaped transformation operation in FFT based on the number of bits of the encryption key and the number of bits of the target multiplier;
representing the encryption key as a polynomial and distributing each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, based on the round, the FFT point number and the position of the polynomial coefficient distributed in each streaming multiprocessor in the polynomial, determining the twiddle factor of each butterfly transformation operation in the round, screening out a plurality of streaming multiprocessors, and based on the twiddle factor of each butterfly transformation operation in the round and the streaming multiprocessors, executing each butterfly transformation operation in the round in parallel.
Specifically, in the embodiment of the present invention, when performing parallel FFT on an encryption key based on SM in a GPU to obtain a first transform result, the number of FFT points and the number of rounds of butterfly transform operation in FFT may be determined based on the number of bits of the encryption key and the number of bits of a target multiplier. For example, the maximum number of bits of the target product result of the encryption key and the target multiplier may be determined based on the number of bits of the encryption key and the number of bits of the target multiplier. Since the number N of FFT points needs to be 2 raised to the power of 2, the minimum value of 2 raised to the power of 2, which is greater than or equal to the maximum number of bits, may be selected as the number N of FFT points. The number of rounds of butterfly transform operation in FFT can be directly determined according to the number N of FFT points, namely
Figure 219613DEST_PATH_IMAGE054
Thereafter, the encryption key may be expressed as a polynomial having the number of terms equal to the number N of FFT points. Correspondingly, each term of the polynomial corresponds to a polynomial coefficient, and the number of the polynomial coefficients is equal to the number of terms of the polynomial.
To have
Figure 565537DEST_PATH_IMAGE055
The FFT of the point polynomial has the following characteristics:
1) The FFT process as a whole can be divided into
Figure 923837DEST_PATH_IMAGE056
Wheel butterfly operations, with each turn having
Figure 334090DEST_PATH_IMAGE057
A butterfly transform unit;
2) In each round, butterfly transformation operations among different butterfly transformation units are executed in parallel;
3) Unit root in each round of FFT
Figure 883758DEST_PATH_IMAGE058
Also known as twiddle factors. The twiddle factor of each round is
Figure 215513DEST_PATH_IMAGE059
Figure 377504DEST_PATH_IMAGE060
Wherein t refers to the scale of the node after each round of recursive decomposition, and the value is gradually halved along with the recursion round.
4) Order to
Figure 173422DEST_PATH_IMAGE061
Then is at
Figure 94324DEST_PATH_IMAGE062
Round, the input nodes of each butterfly transform unit being spaced
Figure 241271DEST_PATH_IMAGE063
Points, i.e. input node index interval of butterfly operation
Figure 675795DEST_PATH_IMAGE064
To have
Figure 795061DEST_PATH_IMAGE065
FFT of a polynomial of a point is an example, as shown in fig. 3:
1) The FFT process is divided into
Figure 420952DEST_PATH_IMAGE066
Wheel butterfly operations, with each turn having
Figure 258458DEST_PATH_IMAGE067
The butterfly transform unit, i.e., the rectangular box in fig. 3.
2) In each round, the calculation among different butterfly transformation units can be carried out in parallel;
3) In that
Figure 496672DEST_PATH_IMAGE068
Round, the round corresponding to the lowest level of the recursive decomposition, so nodesScale of production
Figure 706330DEST_PATH_IMAGE069
I.e. by
Figure 4587DEST_PATH_IMAGE070
Thus the rotation factor of the round is
Figure 329389DEST_PATH_IMAGE071
In that
Figure 636874DEST_PATH_IMAGE072
The node size of the round is 2 times of the previous round, so
Figure 963688DEST_PATH_IMAGE073
I.e. by
Figure 432846DEST_PATH_IMAGE074
Thus the rotation factor of the round is
Figure 979365DEST_PATH_IMAGE075
Figure 90541DEST_PATH_IMAGE076
In that
Figure 557948DEST_PATH_IMAGE077
Round, the round corresponding to the top-most level of the recursive decomposition, so the node size
Figure 666850DEST_PATH_IMAGE078
I.e. by
Figure 966244DEST_PATH_IMAGE079
Thus the rotation factor of the round is
Figure 848487DEST_PATH_IMAGE080
4) In that
Figure 651358DEST_PATH_IMAGE081
Round, the input nodes of each butterfly transform unit are separated
Figure 727898DEST_PATH_IMAGE082
Point, node subscript interval of
Figure 983430DEST_PATH_IMAGE083
In that
Figure 141136DEST_PATH_IMAGE084
Round, the input nodes of each butterfly transform unit are separated
Figure 798513DEST_PATH_IMAGE085
Point, node subscript interval is 2;
in that
Figure 45955DEST_PATH_IMAGE086
Round, the input nodes of each butterfly transform unit being spaced
Figure 552897DEST_PATH_IMAGE087
Point, node subscript interval 1.
In FIG. 3, the following description is made with reference to FIG. 3
Figure 12829DEST_PATH_IMAGE088
Are representations of coefficients that are polynomial coefficients,
Figure 790292DEST_PATH_IMAGE089
are point-value representations of polynomial coefficients.
Thereafter, each polynomial coefficient of the encryption key may be assigned to one streaming multiprocessor, e.g., the kth polynomial coefficient of the encryption key may be assigned to the kth streaming multiprocessor
Figure 5372DEST_PATH_IMAGE090
In (1).
Furthermore, for any round
Figure 731102DEST_PATH_IMAGE091
On any one round basis
Figure 525883DEST_PATH_IMAGE092
FFT point number N and position of polynomial coefficient distributed in each streaming multiprocessor in polynomial
Figure 626694DEST_PATH_IMAGE093
Determining the twiddle factor of each butterfly operation in any round h
Figure 215938DEST_PATH_IMAGE094
And screening out a plurality of streaming multiprocessors.
For example, a twiddle factor of each butterfly transform operation in any round h can be determined according to any round h and the number N of FFT points
Figure 697473DEST_PATH_IMAGE095
And then screening a plurality of streaming multiprocessors which can be used for carrying out each butterfly transformation operation in any round h according to the positions k of the polynomial coefficients distributed in each streaming multiprocessor in the polynomial. The number of screened streaming multiprocessors is equal to the number of butterfly transformation operations in any round h.
Finally, the twiddle factor according to each butterfly transform operation in any round h
Figure 30365DEST_PATH_IMAGE095
And a plurality of streaming multiprocessors that perform each butterfly operation in any round h in parallel. For any round h, each screened streaming multiprocessor corresponds to one butterfly conversion unit, the butterfly conversion operations of all the butterfly conversion units in any round h are executed in parallel through the corresponding streaming multiprocessor, and each streaming multiprocessor realizes execution through the corresponding Block.
In the embodiment of the invention, in each round, the screened streaming multiprocessors are combined with the twiddle factor of each butterfly conversion operation in each round to execute each butterfly conversion operation in each round in parallel, so that the execution efficiency of the butterfly conversion operation can be greatly improved, and the determination efficiency of the first conversion result is further improved.
On the basis of the foregoing embodiment, in the privacy data homomorphic encryption method provided in the embodiment of the present invention, the second transformation result is obtained based on the following steps:
determining the number of FFT points and the number of rounds of butterfly-shaped transformation operation in FFT based on the number of bits of the encryption key and the number of bits of the target multiplier;
representing the target multiplier as a polynomial and assigning each polynomial coefficient of the target multiplier to a streaming multiprocessor;
for any round, based on the round, the FFT point number and the position of the polynomial coefficient distributed in each streaming multiprocessor in the polynomial, determining the twiddle factor of each butterfly transformation operation in the round, screening out a plurality of streaming multiprocessors, and based on the twiddle factor of each butterfly transformation operation in the round and the streaming multiprocessors, executing each butterfly transformation operation in the round in parallel.
Specifically, in the embodiment of the present invention, the step of determining the second transformation result is the same as the step of determining the first transformation result in the above embodiment, and the difference is only that the encryption key is represented as a polynomial and uses the position of the polynomial coefficient in the above embodiment, but the target multiplier is represented as a polynomial and uses the position of the polynomial coefficient in the embodiment of the present invention, which is referred to the above embodiment for details, and is not described again here.
On the basis of the foregoing embodiment, the privacy data homomorphic encryption method provided in this embodiment of the present invention, where the determining, based on the arbitrary round, the FFT point number, and the position of the polynomial coefficient allocated in each streaming multiprocessor in the polynomial, a twiddle factor of each butterfly transform operation in the arbitrary round, and screening out multiple streaming multiprocessors includes:
determining the subscript interval of the input nodes of each butterfly transformation operation in any round based on the round;
calculating the node scale after any round based on the subscript interval of the input nodes and the FFT points, and determining the twiddle factor of each butterfly transformation operation in any round based on the node scale;
and screening the streaming multiprocessors based on the input node index interval and the positions of the polynomial coefficients distributed in each streaming multiprocessor in the polynomial.
Specifically, in the embodiment of the present invention, when the twiddle factor of each butterfly transform operation in any round is determined and a plurality of streaming multiprocessors are screened, the subscript interval s of the input node of each butterfly transform operation in any round h, that is, the subscript interval of the input node of each butterfly transform unit, may be determined according to any round h
Figure 720104DEST_PATH_IMAGE096
Thereafter, the node scale t after any round h can be calculated according to the index interval s of the input node and the number N of FFT points, for example, there may be
Figure 512873DEST_PATH_IMAGE097
. According to the node scale t, the twiddle factor of each butterfly transformation operation in any round h can be determined
Figure 717589DEST_PATH_IMAGE098
Finally, a plurality of streaming multiprocessors can be screened out according to the index interval t of the input nodes and the position k of the polynomial coefficient distributed in each streaming multiprocessor in the polynomial. For example, for the kth streaming multiprocessor
Figure 854172DEST_PATH_IMAGE099
The screening conditions may be
Figure 195155DEST_PATH_IMAGE100
Is ready for
Figure 890316DEST_PATH_IMAGE101
If the screening condition is satisfied, the result shows that
Figure 51170DEST_PATH_IMAGE102
Can pass through corresponding in any round h
Figure 460286DEST_PATH_IMAGE103
Executing the butterfly conversion operation of a butterfly conversion unit, and enabling all streaming multiprocessors meeting the screening condition in any round h to pass through the corresponding streaming multiprocessors
Figure 921354DEST_PATH_IMAGE104
And executing the butterfly transformation operation of each butterfly transformation unit in any round h in parallel.
On the basis of the above embodiment, the pseudo code of the parallel FFT algorithm can be expressed as:
Figure 50066DEST_PATH_IMAGE105
// will
Figure 167058DEST_PATH_IMAGE106
In (1)
Figure 645444DEST_PATH_IMAGE107
Are numbered in sequence
// input array
Figure 725133DEST_PATH_IMAGE108
Polynomial coefficients for storing encryption keys or target multipliers
// result array
Figure 997983DEST_PATH_IMAGE109
For storing the first or second conversion result
// distribution
Figure 664587DEST_PATH_IMAGE110
To
Figure 946664DEST_PATH_IMAGE111
In, distribute
Figure 87052DEST_PATH_IMAGE112
To
Figure 327540DEST_PATH_IMAGE113
In the step (1), the first step,
Figure 481441DEST_PATH_IMAGE114
is composed of
Figure 504892DEST_PATH_IMAGE115
Defined variables for assisting in computing
{
Figure 559173DEST_PATH_IMAGE116
// all
Figure 439405DEST_PATH_IMAGE117
Parallel execution
Figure 549443DEST_PATH_IMAGE118
V/fast Fourier transform, co-proceed
Figure 907743DEST_PATH_IMAGE119
Wheel
Figure 79181DEST_PATH_IMAGE120
//
Figure 67996DEST_PATH_IMAGE121
The subscript interval of the input nodes of the butterfly conversion unit of the round is expressed;
Figure 930910DEST_PATH_IMAGE122
//
Figure 591436DEST_PATH_IMAGE123
representing the node scale of the recursive decomposition corresponding to the current round;
Figure 121775DEST_PATH_IMAGE124
// this run
Figure 547071DEST_PATH_IMAGE125
Figure 897281DEST_PATH_IMAGE126
Figure 895586DEST_PATH_IMAGE127
V/screening satisfying the screening conditions in this round
Figure 14852DEST_PATH_IMAGE128
Each of
Figure 611050DEST_PATH_IMAGE129
Corresponding to one butterfly conversion unit in the round, the butterfly conversion operations of all the butterfly conversion units are executed in parallel
Figure 714135DEST_PATH_IMAGE130
Is composed of
Figure 716464DEST_PATH_IMAGE131
Bit negation of
Figure 690236DEST_PATH_IMAGE132
Is composed of
Figure 457335DEST_PATH_IMAGE133
Bit negation of
Figure 301180DEST_PATH_IMAGE134
Figure 343085DEST_PATH_IMAGE135
Figure 436943DEST_PATH_IMAGE136
Figure 171681DEST_PATH_IMAGE137
(ii) a V/storing the first or second transformation result in array B,
Figure 216735DEST_PATH_IMAGE138
is composed of
Figure 593490DEST_PATH_IMAGE139
Bit negation of
}
Time complexity analysis for parallel FFT algorithm: the parallel FFT algorithm realizes parallelization aiming at butterfly transformation operation of each iteration turn, namely the time complexity is constant
Figure 541854DEST_PATH_IMAGE140
Recurrently iterate by dichotomy
Figure 447493DEST_PATH_IMAGE141
Wheel, therefore of complexity
Figure 982773DEST_PATH_IMAGE142
On the basis of the foregoing embodiment, the method for homomorphic encryption of private data according to the embodiments of the present invention, where the determining an encryption key and a target multiplier corresponding to the encryption key includes:
selecting the encryption key from an encryption key set and selecting the target multiplier from a target multiplier set;
the encryption key set is constructed on the basis of odd numbers with the exponent power of 2 in the random number set generated by the quantum random number generator, and the target multiplier set is constructed on the basis of integers with the exponent power of 2 in the random number set.
Specifically, in the embodiment of the present invention, when the encryption key and the target multiplier corresponding to the encryption key are determined, the encryption key may be directly selected from the encryption key set, and the target multiplier may be selected from the target multiplier set. The encryption key set and the target multiplier set are both sets of random large integers.
The encryption key set can be constructed by odd numbers with the exponent power of 2 in the random number set generated by the quantum random number generator, namely, the encryption keys in the encryption key set are all odd numbers with the exponent power of 2 in the number of bits and are random numbers. The target multiplier set is constructed by an exponential power integer with the digit of 2 in a random number set generated by a quantum random number generator, namely, the target multipliers in the target multiplier set are all integers with the digit of 2 and the integers are random numbers.
It is understood that the random number set has stored therein quantum random numbers generated by a quantum random number generator. The randomness of quantum random numbers, in contrast to pseudo-random numbers, is derived from classical physical random sources that can produce completely unpredictable random sequences. The quantum random number generator adopts laser phase fluctuation as a random source, the essence of the laser phase fluctuation is from spontaneous radiation and belongs to non-deterministic quantum noise, and the measurement result conforms to Gaussian distribution and is a good quantum random source.
The quantum random number generator works independently after being electrified, and can continuously output the binary random number sequence to the outside after being electrified without depending on any external trigger signal source.
In the embodiment of the invention, odd numbers with the digit of 2 which is the exponential power can be screened out from the random number set and used as encryption keys to be stored in the encryption key set, and integers with the digit of 2 which is the exponential power can be screened out from the random number set and used as target multipliers to be stored in the target multiplier set.
In the embodiment of the invention, the encryption key can be directly read from the encryption key set in the homomorphic encryption process, the target multiplier is read from the target multiplier set, the physical true random number is generated, the random number generation efficiency is improved, and the homomorphic encryption efficiency is further improved.
On the basis of the foregoing embodiment, the method for homomorphically encrypting private data according to the embodiment of the present invention, where the homomorphically encrypting the private data based on the encryption key and the target product result includes:
generating a target random number based on the encryption key;
and homomorphic encrypting the privacy data based on the target random number and the target product result.
Specifically, in the embodiment of the present invention, when the privacy data is homomorphically encrypted by combining the encryption key and the target product result, the target random number may be generated according to the encryption key. That is, for the encryption key p, since the relationship between the target random number r and the encryption key p is |2r | < | p/2|, when the target random number r is generated, the encryption key p is needed, as long as the small integer satisfying the relationship can be used, so that the homomorphic encryption result can be correctly decrypted.
Thereafter, the private data m may be homomorphically encrypted according to the target random number r and the target product result p × q, i.e., a homomorphic encryption result c of the private data m is calculated by using the formula c = p × q +2r + m.
In the embodiment of the invention, the introduction of the target random number can further ensure the encryption effect on the private data.
On the basis of the foregoing embodiment, the method for homomorphic encrypting of private data according to an embodiment of the present invention, where the determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transformation result and the second transformation result includes:
and performing IFFT on the alternative product result to obtain the target product result.
Specifically, in the embodiment of the present invention, since the first Transform result and the second Transform result are obtained by parallel FFT, it is necessary to perform Inverse Fast Fourier Transform (IFFT) on the candidate product result of the first Transform result and the second Transform result, and further obtain the target product result of the encryption key and the target multiplier.
On the basis of the above embodiments, the embodiment of the present invention provides an example of the operation of the parallel FFT algorithm, where only the calculation of multiplication of small integers is taken as an example, but the same is used for large integers, and the acceleration effect is more obvious.
For example: by parallel FFT algorithm, computing
Figure 835323DEST_PATH_IMAGE143
31 by 24, the maximum number of bits resulting is 4, i.e.
Figure 903773DEST_PATH_IMAGE144
. For a 4-bit integer, can be expressed as
Figure 980313DEST_PATH_IMAGE145
. The polynomial coefficient expression vector for the multiplicand 31 is therefore:
Figure 999960DEST_PATH_IMAGE146
(ii) a The polynomial coefficient expression vector for multiplier 24 is:
Figure 187358DEST_PATH_IMAGE147
the parallel FFT algorithm is performed as follows:
initially:
Figure 313577DEST_PATH_IMAGE148
all blocks execute the assignment operation in parallel,
Figure 56625DEST_PATH_IMAGE149
in
Figure 65032DEST_PATH_IMAGE150
Figure 56122DEST_PATH_IMAGE151
In
Figure 833585DEST_PATH_IMAGE152
Figure 16042DEST_PATH_IMAGE153
In
Figure 449429DEST_PATH_IMAGE154
Figure 244209DEST_PATH_IMAGE155
In
Figure 672917DEST_PATH_IMAGE156
First, the
Figure 763626DEST_PATH_IMAGE157
And (4) round:
Figure 949888DEST_PATH_IMAGE158
(ii) a Satisfy the requirement of
Figure 282780DEST_PATH_IMAGE159
Block of
Figure 769256DEST_PATH_IMAGE149
And
Figure 293516DEST_PATH_IMAGE160
Figure 763812DEST_PATH_IMAGE161
in (1)
Figure 838078DEST_PATH_IMAGE162
Figure 241378DEST_PATH_IMAGE163
In (1)
Figure 933609DEST_PATH_IMAGE164
First, the
Figure 563305DEST_PATH_IMAGE165
And (3) wheel:
Figure 769158DEST_PATH_IMAGE166
(ii) a Satisfy the requirement of
Figure 728762DEST_PATH_IMAGE167
Block of
Figure 830710DEST_PATH_IMAGE168
And
Figure 10018DEST_PATH_IMAGE169
Figure 691667DEST_PATH_IMAGE170
in
Figure 508706DEST_PATH_IMAGE171
Figure 47135DEST_PATH_IMAGE172
Figure 448160DEST_PATH_IMAGE173
In
Figure 730237DEST_PATH_IMAGE174
Figure 664433DEST_PATH_IMAGE175
The operation result of the parallel FFT algorithm is as follows:
Figure 373763DEST_PATH_IMAGE176
Figure 527664DEST_PATH_IMAGE177
Figure 347852DEST_PATH_IMAGE178
Figure 336887DEST_PATH_IMAGE179
i.e. according to a parallel FFT algorithm,
Figure 951539DEST_PATH_IMAGE180
the polynomial coefficients are converted into a point value expression in the form of:
Figure 592736DEST_PATH_IMAGE181
at this time
Figure 449571DEST_PATH_IMAGE182
Thus, the parallel FFT result of the multiplicand 31 is
Figure 63086DEST_PATH_IMAGE183
(ii) a The parallel FFT result of multiplier 24 is
Figure 114219DEST_PATH_IMAGE184
Performing dot product on the parallel FFT result of the multiplicand 31 and the parallel FFT result of the multiplier 24 to obtain a dot product result of
Figure 977133DEST_PATH_IMAGE185
IFFT is carried out on the dot product result (the algorithm process is similar to the FFT algorithm process), and the transformation formula is
Figure 640589DEST_PATH_IMAGE186
The IFFT result calculation formula can be expressed as:
Figure 905348DEST_PATH_IMAGE187
Figure 392961DEST_PATH_IMAGE188
Figure 179389DEST_PATH_IMAGE189
Figure 941809DEST_PATH_IMAGE190
at this time, the process of the present invention,
Figure 61075DEST_PATH_IMAGE191
Figure 454010DEST_PATH_IMAGE192
Figure 13821DEST_PATH_IMAGE193
Figure 783194DEST_PATH_IMAGE194
Figure 491387DEST_PATH_IMAGE195
substituting the IFFT result calculation formula to obtain the IFFT result of
Figure 55224DEST_PATH_IMAGE196
Namely have
Figure 612982DEST_PATH_IMAGE197
As shown in fig. 4, on the basis of the foregoing embodiment, an embodiment of the present invention provides a privacy data homomorphic encryption apparatus, including:
a data obtaining module 41, configured to obtain private data to be encrypted;
a transformation module 42, configured to determine an encryption key and a target multiplier corresponding to the encryption key, and perform parallel FFT on the encryption key and the target multiplier respectively based on a streaming multiprocessor in a graphics processor, to obtain a first transformation result and a second transformation result;
a product module 43 for determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transformation result and the second transformation result;
an encryption module 44, configured to homomorphically encrypt the private data based on the encryption key and the target product result.
On the basis of the foregoing embodiment, in the apparatus for homomorphic encryption of private data provided in the embodiment of the present invention, the transformation module is specifically configured to:
determining the number of FFT points and the number of rounds of butterfly-shaped transformation operation in FFT based on the number of bits of the encryption key and the number of bits of the target multiplier;
representing the encryption key as a polynomial and distributing each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, based on the round, the FFT point number and the position of the polynomial coefficient distributed in each streaming type multiprocessor in the polynomial, determining the twiddle factor of each butterfly conversion operation in the round, screening out a plurality of streaming type multiprocessors, and based on the twiddle factor of each butterfly conversion operation in the round and the streaming type multiprocessors, executing each butterfly conversion operation in the round in parallel.
On the basis of the foregoing embodiment, in the apparatus for homomorphic encryption of private data provided in the embodiment of the present invention, the transformation module is specifically configured to:
determining the subscript interval of the input nodes of each butterfly transformation operation in any round based on the round;
calculating the node scale after any round based on the subscript interval of the input nodes and the FFT points, and determining the twiddle factor of each butterfly transformation operation in any round based on the node scale;
and screening the streaming multiprocessors based on the input node index interval and the positions of the polynomial coefficients distributed in each streaming multiprocessor in the polynomial.
On the basis of the foregoing embodiment, in the apparatus for homomorphic encryption of private data provided in the embodiment of the present invention, the transformation module is specifically configured to:
selecting the encryption key from an encryption key set and selecting the target multiplier from a target multiplier set;
the apparatus for homomorphic encryption of private data further comprises a set construction module configured to:
and constructing the encryption key set based on odd numbers of exponential powers of which the median is 2 in a random number set generated by a quantum random number generator, and constructing the target multiplier set based on integers of which the median is 2 in the random number set.
On the basis of the foregoing embodiment, in the privacy data homomorphic encryption apparatus provided in the embodiment of the present invention, the encryption module is specifically configured to:
generating a target random number based on the encryption key;
and homomorphic encrypting the private data based on the target random number and the target product result.
On the basis of the foregoing embodiment, in the apparatus for homomorphic encryption of private data provided in the embodiment of the present invention, the product module is specifically configured to:
and performing IFFT on the alternative product result to obtain the target product result.
Specifically, the functions of the modules in the privacy data homomorphic encryption device provided in the embodiment of the present invention correspond to the operation flows of the steps in the method embodiments one to one, and the implementation effects are also consistent.
The CPU-level main program of the privacy data homomorphic encryption device may include:
main()
v/selecting N-bit encryption keys from the encryption key set respectively
Figure 186045DEST_PATH_IMAGE198
And selecting N bit target multiplier from the target multiplier set
Figure 483166DEST_PATH_IMAGE199
Figure 217903DEST_PATH_IMAGE200
(ii) a v/N bit encryption key
Figure 62625DEST_PATH_IMAGE201
Figure 111484DEST_PATH_IMAGE202
(ii) a // N bit target multiplier Q
Figure 528690DEST_PATH_IMAGE203
(ii) a // array A for holding encryption keys
Figure 932864DEST_PATH_IMAGE002
Polynomial coefficient of
Figure 763417DEST_PATH_IMAGE204
(ii) a // array B for holding encryption keys
Figure 412704DEST_PATH_IMAGE002
Polynomial coefficient of the first transformation result of (1)
Figure 684416DEST_PATH_IMAGE205
(ii) a // array C for storing polynomial coefficients of the second conversion result of the target multiplier Q
Will be provided with
Figure 522141DEST_PATH_IMAGE206
The polynomial coefficients of (A) are stored in (A), i.e.
Figure 777673DEST_PATH_IMAGE207
Figure 965072DEST_PATH_IMAGE208
(ii) a // convert multipliers with parallel FFT
Figure 888029DEST_PATH_IMAGE201
Will be provided with
Figure 899585DEST_PATH_IMAGE209
Is stored in A, i.e.
Figure 845675DEST_PATH_IMAGE210
Figure 836765DEST_PATH_IMAGE211
(ii) a // convert multipliers with parallel FFT
Figure 614228DEST_PATH_IMAGE212
Figure 534036DEST_PATH_IMAGE213
//. Calculating the alternative product result resulting from the multiplication of the dot product///
Figure 295319DEST_PATH_IMAGE214
/IFFT is carried out on the alternative product result to obtain a conversion result which is stored in an array C
Figure 824520DEST_PATH_IMAGE215
And expressing the array C by using a coefficient expression to obtain a target product result.
As shown in fig. 5, on the basis of the foregoing embodiment, an embodiment of the present invention provides a privacy data homomorphic encryption system, including: a quantum random number generator 51, a graphic processor 52, and a private data homomorphic encryption device 53 provided in the above embodiments;
any two of the quantum random number generator 51, the graphics processor 52 and the private data homomorphic encryption device 53 are connected through interfaces;
the quantum random number generator 51 is configured to provide an encryption key and a target multiplier corresponding to the encryption key for the private data homomorphic encryption device;
the private data homomorphic encryption device 53 is used to invoke the graphics processor 52.
Specifically, in the embodiment of the present invention, as shown in fig. 6, the Quantum Random Number Generator (QRNG) 51 may be disposed in the random number generating device (generator) 61, the random number generating device 61 further includes a determining unit (Judge) 611, a storage unit (Memory) 612, and a first I/O interface 613, and the determining unit 611 determines and filters the random numbers generated by the quantum random number generator 51, determines the encryption key set, the target multiplier set, and the target random number set, and stores the encryption key set, the target multiplier set, and the target random number set in the storage unit 612.
The privacy data homomorphic encryption device 53 may be configured in the computer (Host) 62, the computer 62 further includes a memory (DRAM) 621 and a second I/O interface 622, and the encryption key, the target multiplier and the target random number may be respectively selected from the encryption key set, the target multiplier set and the target random number set stored in the storage unit 612 through the second I/O interface 622 and the first I/O interface 613.
The graphics processor 52 may be configured in the graphics processor device 63, the graphics processor device 63 further includes a storage (GDRAM) 631 and a third I/O interface 632, and the privacy data homomorphic encryption apparatus 53 may call the graphics processor 52 through the second I/O interface 622 and the third I/O interface 632.
According to the homomorphic encryption system for the private data, disclosed by the embodiment of the invention, through the combination of the quantum random number generator, the graphics processor and the homomorphic encryption devices for the private data, not only can parallel FFT (fast Fourier transform) be realized in the homomorphic encryption process for the private data, but also the efficiency of homomorphic encryption can be greatly improved. Moreover, the quantum random number generator is introduced, so that the homomorphic encryption effect can be ensured.
Fig. 7 illustrates a physical structure diagram of an electronic device, and as shown in fig. 7, the electronic device may include: a Processor (Processor) 710, a communication Interface 720, a Memory (Memory) 730, and a communication bus 740, wherein the Processor 710, the communication Interface 720, and the Memory 730 communicate with each other via the communication bus 740. Processor 710 may invoke logic instructions in memory 730 to perform the private data homomorphic encryption method provided in the various embodiments described above.
In addition, the logic instructions in the memory 730 can be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In another aspect, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can execute the privacy data homomorphic encryption method provided in the above embodiments.
In yet another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, the computer program being implemented by a processor to perform the privacy data homomorphic encryption method provided in the above embodiments.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for homomorphic encryption of private data, comprising:
acquiring private data to be encrypted;
determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in a graphics processor to obtain a first conversion result and a second conversion result;
determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transformation result and the second transformation result;
homomorphic encryption is performed on the private data based on the encryption key and the target product result.
2. The method for homomorphic encryption of private data according to claim 1, wherein the first transformation result is obtained based on the steps of:
determining the number of FFT points and the number of rounds of butterfly-shaped transformation operation in FFT based on the number of bits of the encryption key and the number of bits of the target multiplier;
representing the encryption key as a polynomial and distributing each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, based on the round, the FFT point number and the position of the polynomial coefficient distributed in each streaming multiprocessor in the polynomial, determining the twiddle factor of each butterfly transformation operation in the round, screening out a plurality of streaming multiprocessors, and based on the twiddle factor of each butterfly transformation operation in the round and the streaming multiprocessors, executing each butterfly transformation operation in the round in parallel.
3. The method for homomorphic encryption of private data according to claim 2, wherein said determining a twiddle factor for each butterfly operation in any round based on the position in the polynomial of said any round, the number of FFT points and the polynomial coefficients assigned in each streaming multiprocessor, and filtering out a plurality of streaming multiprocessors comprises:
determining the subscript interval of the input nodes of each butterfly transformation operation in any round based on the round;
calculating the node scale after any round based on the subscript interval of the input nodes and the FFT points, and determining the twiddle factor of each butterfly transformation operation in any round based on the node scale;
and screening the streaming multiprocessors based on the input node index interval and the positions of the polynomial coefficients distributed in each streaming multiprocessor in the polynomial.
4. The method of claim 1, wherein the determining an encryption key and a target multiplier corresponding to the encryption key comprises:
selecting the encryption key from an encryption key set and selecting the target multiplier from a target multiplier set;
the encryption key set is constructed on the basis of odd numbers with the exponent power of 2 in the random number set generated by the quantum random number generator, and the target multiplier set is constructed on the basis of integers with the exponent power of 2 in the random number set.
5. The method for homomorphic encryption of private data according to any of claims 1-4, wherein said homomorphic encrypting of said private data based on said encryption key and said target product result comprises:
generating a target random number based on the encryption key;
and homomorphic encrypting the privacy data based on the target random number and the target product result.
6. The method for homomorphic encryption of private data according to any of claims 1-4, wherein said determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transformation result and the second transformation result comprises:
and carrying out IFFT on the alternative product result to obtain the target product result.
7. A privacy data homomorphic encryption apparatus, comprising:
the data acquisition module is used for acquiring the private data to be encrypted;
the conversion module is used for determining an encryption key and a target multiplier corresponding to the encryption key, and respectively performing parallel FFT on the encryption key and the target multiplier based on a streaming multiprocessor in a graphics processor to obtain a first conversion result and a second conversion result;
a product module to determine a target product result of the encryption key and the target multiplier based on an alternative product result of the first transformation result and the second transformation result;
and the encryption module is used for carrying out homomorphic encryption on the privacy data based on the encryption key and the target product result.
8. A system for homomorphic encryption of private data, comprising: a quantum random number generator, a graphics processor, and the private data homomorphic encryption device of claim 7;
any two of the quantum random number generator, the graphics processor and the privacy data homomorphic encryption device are connected through interfaces;
the quantum random number generator is used for providing an encryption key and a target multiplier corresponding to the encryption key for the privacy data homomorphic encryption device;
the privacy data homomorphic encryption device is used for calling the graphics processor.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of homomorphic encryption of private data as claimed in any of claims 1-6 when executing the program.
10. A non-transitory computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the privacy data homomorphic encryption method of any one of claims 1-6.
CN202211618803.4A 2022-12-16 2022-12-16 Method, device and system for homomorphic encryption of private data Active CN115622685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211618803.4A CN115622685B (en) 2022-12-16 2022-12-16 Method, device and system for homomorphic encryption of private data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211618803.4A CN115622685B (en) 2022-12-16 2022-12-16 Method, device and system for homomorphic encryption of private data

Publications (2)

Publication Number Publication Date
CN115622685A true CN115622685A (en) 2023-01-17
CN115622685B CN115622685B (en) 2023-04-28

Family

ID=84880605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211618803.4A Active CN115622685B (en) 2022-12-16 2022-12-16 Method, device and system for homomorphic encryption of private data

Country Status (1)

Country Link
CN (1) CN115622685B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116383666A (en) * 2023-05-23 2023-07-04 重庆大学 Power data prediction method and device and electronic equipment
CN117896067A (en) * 2024-03-13 2024-04-16 杭州金智塔科技有限公司 Parallel modular reduction method and device suitable for SM2 cryptographic algorithm

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3602422B1 (en) * 2017-03-22 2022-03-16 Visa International Service Association Privacy-preserving machine learning
CN110190946B (en) * 2019-07-12 2021-09-03 之江实验室 Privacy protection multi-organization data classification method based on homomorphic encryption
CN111400766B (en) * 2020-03-25 2021-08-06 支付宝(杭州)信息技术有限公司 Method and device for multi-party joint dimension reduction processing aiming at private data
CN114978467B (en) * 2022-05-12 2024-05-14 南通大学 Privacy protection method for medical data sharing based on isomorphic encryption

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116383666A (en) * 2023-05-23 2023-07-04 重庆大学 Power data prediction method and device and electronic equipment
CN116383666B (en) * 2023-05-23 2024-04-19 重庆大学 Power data prediction method and device and electronic equipment
CN117896067A (en) * 2024-03-13 2024-04-16 杭州金智塔科技有限公司 Parallel modular reduction method and device suitable for SM2 cryptographic algorithm

Also Published As

Publication number Publication date
CN115622685B (en) 2023-04-28

Similar Documents

Publication Publication Date Title
EP3676985B1 (en) High-precision privacy-preserving real-valued function evaluation
US10778410B2 (en) Homomorphic data encryption method and apparatus for implementing privacy protection
CN115622685B (en) Method, device and system for homomorphic encryption of private data
Dai et al. Implementation and evaluation of a lattice-based key-policy ABE scheme
US9515828B2 (en) Sharing a secret via linear interpolation
Jiang et al. Matcha: A fast and energy-efficient accelerator for fully homomorphic encryption over the torus
Wang et al. An image encryption scheme based on chaotic system and compressed sensing for multiple application scenarios
Gong et al. Homomorphic evaluation of the integer arithmetic operations for mobile edge computing
Abu Dalhoum et al. Digital image scrambling based on elementary cellular automata
Biasse et al. FHEW with efficient multibit bootstrapping
Rezaei et al. An image encryption approach using tuned Henon chaotic map and evolutionary algorithm
CN116527235A (en) Data encryption method and device based on key rotation and electronic equipment
Ma et al. Quantum color image compression and encryption algorithm based on Fibonacci transform
Yang et al. FPGA accelerator for homomorphic encrypted sparse convolutional neural network inference
Murillo-Escobar et al. Comparison of two new chaos-based pseudorandom number generators implemented in microcontroller
CN117595992A (en) Method and processor for accelerating execution of number theory transformation NTT
CN117155572A (en) Method for realizing large integer multiplication in cryptographic technology based on GPU (graphics processing Unit) parallel
Khadem et al. Improved algorithms in parallel evaluation of large cryptographic S-boxes
CN111460488B (en) Multi-image rapid encryption method based on pre-storage and n-dimensional Arnold transformation
US8364958B2 (en) Sharing a secret via linear interpolation
CN117896067B (en) Parallel modular reduction method and device suitable for SM2 cryptographic algorithm
Zhang et al. Secure outsourcing of matrix convolutions
Wang et al. Denoising signals on the graph for distributed systems by secure outsourced computation
Wang et al. A homomorphic arithmetic model via Helib
Gold Privacy-Preserving Topological Data Analysis Using Homomorphic Encryption

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant