CN115622685B - 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
CN115622685B
CN115622685B CN202211618803.4A CN202211618803A CN115622685B CN 115622685 B CN115622685 B CN 115622685B CN 202211618803 A CN202211618803 A CN 202211618803A CN 115622685 B CN115622685 B CN 115622685B
Authority
CN
China
Prior art keywords
encryption key
target
result
encryption
round
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.)
Active
Application number
CN202211618803.4A
Other languages
Chinese (zh)
Other versions
CN115622685A (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, device and system for private data, wherein the method acquires the private data to be encrypted; determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in a graphics processor to obtain a first transformation result and a second transformation 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. The method can ensure the security of the private data by homomorphic encryption of the private data. In addition, the parallel FFT is carried out by utilizing the streaming multiprocessors 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 present invention relates to the field of data processing technologies, and in particular, to a method, an apparatus, and a system for homomorphic encryption of private data.
Background
Along with the gradual strong consciousness of people on protecting privacy data, homomorphic encryption is used as a widely applied security technology, 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, namely that ciphertext operation is carried out on homomorphic encrypted data to obtain an output, the output is decrypted, and the obtained decryption result is identical with the output result obtained by processing unencrypted original data by the same method. In homomorphic encryption of private data, a large number of multiplication operations and linear combination operations are generally required, and the process is complex, which greatly reduces the encryption efficiency of the private data.
For this reason, it is urgently required to provide a method for homomorphic encryption of private data.
Disclosure of Invention
The invention provides a homomorphic encryption method, device and system for private data, which are used for solving the defects in the prior art.
The invention provides a homomorphic encryption method for private data, which comprises the following steps:
acquiring privacy data to be encrypted;
determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in a graphics processor to obtain a first transformation result and a second transformation result;
Determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transform result and the second transform result;
and homomorphic encryption is carried out 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 FFT point number and round number of butterfly transformation operation in FFT based on the bit number of the encryption key and the bit number of the target multiplier;
representing the encryption key as a polynomial and assigning each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, determining a twiddle factor of each butterfly transformation operation in the any round based on the any round, the FFT point number and the position of a polynomial coefficient distributed in each flow multiprocessor in the polynomial, screening out a plurality of flow multiprocessors, and executing each butterfly transformation operation in the any round in parallel based on the twiddle factor of each butterfly transformation operation in the any round and the plurality of flow multiprocessors.
According to the homomorphic encryption method for private data provided by the invention, the rotation factor of each butterfly transformation operation in any turn is determined based on the position of the polynomial coefficient distributed in any turn, the FFT point number and each streaming multiprocessor, and a plurality of streaming multiprocessors are screened out, comprising:
determining the subscript interval of an input node of each butterfly transformation operation in any round based on the round;
calculating the node scale after any turn based on the input node index interval and the FFT point number, and determining a twiddle factor of each butterfly transformation operation in any turn based on the node scale;
the plurality of streaming multiprocessors is screened out based on the input node index interval and the locations in the polynomial of the polynomial coefficients assigned in each streaming multiprocessor.
According to the homomorphic encryption method for private data provided by the invention, the determining of the encryption key and the 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;
Wherein the encryption key set is constructed based on an odd number of the exponent of 2 in a random number set generated by a quantum random number generator, and the target multiplier set is constructed based on an integer of the exponent of 2 in the random number set.
According to the homomorphic encryption method for private data provided by the invention, the homomorphic encryption is carried out 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 encryption is carried out on the privacy data based on the target random number and the target product result.
According to the homomorphic encryption method for private data provided by the invention, the determining of the 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 comprises the following steps:
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 privacy data to be encrypted;
the transformation module is used for determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in the graphics processor to obtain a first transformation result and a second transformation result;
A product module for determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transform result and the second transform result;
and the encryption module is used for homomorphic encryption of the privacy data based on the encryption key and the target product result.
The invention also provides a homomorphic encryption system for the private data, which comprises the following steps: the device comprises a quantum random number generator, a graphic processor and the privacy data homomorphic encryption device;
any two of the quantum random number generator, the graphic processor and the privacy data homomorphic encryption device are connected through an interface;
the quantum random number generator is used for providing an encryption key for the privacy data homomorphic encryption device and a target multiplier corresponding to the encryption key;
the privacy data homomorphic encryption device is used for calling the graphics processor.
The invention also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the homomorphic encryption method of the privacy data when executing the program.
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, device and system for private data, wherein the method firstly acquires the private data to be encrypted; then determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in a graphics processor to obtain a first transformation result and a second transformation result; thereafter determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transform result and the second transform result; and finally, homomorphic encryption is carried out on the private data based on the encryption key and the target product result. The method can ensure the security of the private data by homomorphic encryption of the private data. In addition, the parallel FFT is carried out by utilizing the streaming multiprocessors 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 invention or the technical solutions of the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method for homomorphic encryption of private data;
FIG. 2 is a corresponding diagram of a thread model and a hardware structure level of 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 conversion process of 8-point polynomials in the homomorphic encryption method of privacy data provided by the invention;
fig. 4 is a schematic structural diagram of a privacy data homomorphic encryption device provided by the invention;
FIG. 5 is a schematic diagram of a system for homomorphic encryption of private data according to the present invention;
FIG. 6 is a schematic diagram of a second embodiment of a system for homomorphic encryption of private data;
fig. 7 is a schematic structural diagram of an electronic device provided by the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Because the existing homomorphic encryption method generally needs a large amount of multiplication and linear combination operation in the homomorphic encryption process of the private data, the process is complex, and the encryption efficiency of the private data is greatly reduced. Therefore, the embodiment of the invention provides a homomorphic encryption method for private data.
Fig. 1 is a schematic flow chart of a method for homomorphic encryption of private data, in an embodiment of the invention, as shown in fig. 1, the method includes:
s1, acquiring privacy data to be encrypted;
s2, determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in a graphics processor to obtain a first transformation result and a second transformation result;
s3, 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;
s4, homomorphic encryption is carried out on the private data based on the encryption key and the target product result.
Specifically, in the method for homomorphic encryption of private data provided in the embodiment of the present invention, the execution subject is a device for homomorphic encryption of private data, and the device may be a central processing unit (central processing unit, CPU) and may be configured in a computer, where the computer may be a local computer or a cloud computer, and the local computer may be a computer, a tablet, or the like, and is not limited herein specifically.
First, step S1 is performed to obtain the private data to be encrypted, where the private data may be data that the user needs to encrypt, and the private data may be decimal data. The user can be a person, a company, an enterprise and the like, and the privacy data can be face feature data of the person, an identity card number, a mobile phone number, a bank card password, a web page browsing record and the like, and can also be financial data, fund flow data, important client information and the like of the company or the enterprise.
Then, step S2 is executed to determine the encryption key and the target multiplier corresponding to the encryption key, where the encryption key and the target multiplier may be random numbers, and may be generated by a quantum random number generator, which is not specifically 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 whole odd number is the large integer of the odd number, and the large integer is the number whose range is beyond the range that the basic data type can represent.
Graphics processor (Graphics Processing Unit, GPU) is a special purpose image rendering hardware with better versatility and higher performance for each hardware. The thread model 21 of the GPU shown in fig. 2 may include Grid, block, thread and Warp. Grid, block, thread is a software organization structure, which is three levels of thread organization, corresponding to devices (devices), streaming multiprocessors (Streaming Multiprocessor, SM) and unified computing Device architecture (Compute Unified Device Architecture, CUDA) cores (cores), respectively, of hardware structure level 22.
The smallest unit in which the GPU operates is Thread. Multiple threads may constitute one Block, and multiple blocks executing the same program may constitute Grid. Multiple blocks share memory (Cache), so each inter-Block communication can be considered as a full communication mode.
Based on this, when parallel fast fourier transforms (Fast Fourier Transformation, FFT) are performed on the encryption key and the target multiplier respectively by the SMs in the GPU, parallelized butterfly transform operations of the FFT may be distributed to different SMs in a hierarchical structure to be performed, so as to improve the parallelism of the FFT. The basic idea of parallel FFT is to split FFT according to iterative rounds of butterfly transformation operation, parallelize the same butterfly transformation operation in each round, then use each SM in GPU as a calculation node of parallel calculation, and distribute parallelized butterfly transformation operation to different SMs, thereby improving parallelism of FFT and conversion efficiency.
Before parallel FFT is performed on the encryption key and the target multiplier respectively by SM in the GPU, the encryption key and the target multiplier may be represented as polynomials, respectively, the degree of which 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 expressed as one
Figure 320917DEST_PATH_IMAGE004
A sub-polynomial, the polynomial having two representation methods, coefficient representation and point value representation.
Coefficient representation:
Figure 673139DEST_PATH_IMAGE005
wherein, the method comprises the steps of, wherein,
Figure 66074DEST_PATH_IMAGE006
as a function of the amount of the independent variable,
Figure 106843DEST_PATH_IMAGE007
as a function of the variables,
Figure 610636DEST_PATH_IMAGE008
is an index
Figure 345593DEST_PATH_IMAGE009
Independent variable of (2)
Figure 909430DEST_PATH_IMAGE006
Is used to determine the coefficient of the polynomial of (c),
Figure 968653DEST_PATH_IMAGE010
is that
Figure 243514DEST_PATH_IMAGE011
One term of the sub-polynomials, a coefficient vector consisting of the polynomial coefficients of all the terms
Figure 337372DEST_PATH_IMAGE012
Uniquely defining this polynomial, i.e. large integers
Figure 72110DEST_PATH_IMAGE013
. Calculating the multiplication of two large integers, i.e. two, according to the coefficient representation
Figure 618629DEST_PATH_IMAGE014
The complex degree of the polynomial multiplication is that
Figure 231269DEST_PATH_IMAGE015
Point value representation: to a group of interpolation nodes different from each other
Figure 382896DEST_PATH_IMAGE016
Respectively take in
Figure 288535DEST_PATH_IMAGE007
Obtaining
Figure 322350DEST_PATH_IMAGE017
Each value is taken
Figure 470172DEST_PATH_IMAGE018
Wherein
Figure 538622DEST_PATH_IMAGE019
. According to algebraic basic theorem, one
Figure 818425DEST_PATH_IMAGE020
The polynomial of degree is in complex domain and is only
Figure 858579DEST_PATH_IMAGE021
Root, thus one
Figure 311557DEST_PATH_IMAGE022
Polynomial of degree
Figure 765672DEST_PATH_IMAGE023
The polynomial is uniquely determined by the different value points.
FFT is a kind of FFT that can be performed at
Figure 481956DEST_PATH_IMAGE024
A discrete fourier transform (Discrete Fourier transform, DFT) algorithm completed in time. The DFT will give coefficient vectors for the polynomial
Figure 192160DEST_PATH_IMAGE025
Is converted into
Figure 183250DEST_PATH_IMAGE026
The calculation formula is as follows:
Figure 960713DEST_PATH_IMAGE027
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure 379056DEST_PATH_IMAGE028
is that
Figure 110645DEST_PATH_IMAGE029
The root of the secondary unit,
Figure 639847DEST_PATH_IMAGE030
the polynomial of the point value representation is converted into the coefficient representation using FFT, a process called inverse discrete fourier transform (Inverse Discrete Fourier Transform, IDFT) whose calculation formula is:
Figure 271816DEST_PATH_IMAGE031
Wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure 625175DEST_PATH_IMAGE032
is that
Figure 545858DEST_PATH_IMAGE033
The root of the secondary unit,
Figure 144329DEST_PATH_IMAGE034
the polynomial can be obtained by utilizing the periodicity, symmetry and halving property of the unit primitive root
Figure 896385DEST_PATH_IMAGE035
The polynomial sequence of (2) is divided into an even index term and an odd index term according to the index, and FFT is respectively carried out to obtain
Figure 152136DEST_PATH_IMAGE036
And
Figure 356852DEST_PATH_IMAGE037
then
Figure 696698DEST_PATH_IMAGE038
The FFT transform result of the polynomial sequence of (c) is:
Figure 67374DEST_PATH_IMAGE039
thus will
Figure 998421DEST_PATH_IMAGE033
The FFT of the points is broken down into two
Figure 690433DEST_PATH_IMAGE040
FFT of point, let
Figure 365128DEST_PATH_IMAGE041
To the power of 2, so recursively decomposed, the algorithm complexity is
Figure 796503DEST_PATH_IMAGE042
. In the recursion process, the array is continuously split layer by layer from the top, the operation result with the minimum granularity is generated to the lowest layer, and then the final result is formed layer by layer. Additional storage space is needed in the process of separating the subscripts, and space complexity is improved.
To reduce the spatial complexity, special operations are performed layer by layer from the bottom results back to the top. This operation is called butterfly (butterfly) operation, which can be used to sequence a sequence
Figure 367293DEST_PATH_IMAGE043
In situ conversion to
Figure 812181DEST_PATH_IMAGE044
Its space complexity is
Figure 523522DEST_PATH_IMAGE045
. To implement butterfly operations, it is necessary to perform a bit reverse order (bit reverse) on the sequence index,the following index
Figure 104676DEST_PATH_IMAGE046
. After the conversion of the original sequence elements is completed in the bit reverse order, FFT operation is performed layer by layer according to the cycle. The temporal complexity of such an algorithm is
Figure 846367DEST_PATH_IMAGE047
The spatial complexity is
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.
After that, step S3 is performed, the first transformation result and the second transformation result may be multiplied first, so as 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 the polynomial of the encryption key and the second transformation result can be regarded as a point value representation of the polynomial of the target multiplier, the first transformation result and the second transformation result are multiplied, i.e. the dot product is calculated for both.
Thereafter, a target product result may be determined from the alternative product results. Since the alternative multiplication result is still in the form of a point value representation, the coefficient representation of the alternative multiplication result can be obtained by performing inverse fast fourier transform (Inverse Fast Fourier Transform, IFFT) on the alternative multiplication result, i.e. the target product result of the encryption key and the target multiplier, which 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 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 homomorphic encryption algorithms, partial homomorphic encryption algorithms, approximately homomorphic encryption algorithms, and the like. If ciphertext data obtained by a homomorphic encryption algorithm can execute the operations of addition and multiplication infinitely, the homomorphic encryption algorithm is a complete homomorphic encryption algorithm, and is abbreviated as a homomorphic encryption algorithm.
Taking the full homomorphic encryption scheme (DGHV) on integers as an example, the DGHV belongs to symmetric encryption, and generally includes a key generation stage (KeyGen), an encryption algorithm (Encrypt) stage, a decryption algorithm stage (Decrypt), a homomorphic calculation stage (evaluation), and the like.
In the key generation stage, according to a security parameter lambda, an odd number of N bits is selected as an encryption key p by 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 in the encryption stage can 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 and q are both random large integers, r is the target random number, usually a small integer, and can be determined by p. The relationship of r to p can be expressed as |2r| < |p/2|. c is an encryption result obtained by homomorphic encryption of the privacy data m.
In the homomorphic encryption process of the private data, the private data can be homomorphic encrypted according to the bits, namely m is any bit of the private data, the value space of m is {0,1}, and the value space of c is an integer, namely the ciphertext space.
Based on stream type multiprocessor in the graphic processor, parallel FFT is carried out on encryption key and target multiplier to obtain first conversion result and second conversion result, namely, the encryption key and target multiplier are respectively represented as a polynomial by coefficient representation, and the polynomial of the encryption key and the polynomial of the target multiplier are converted from coefficient representation form to point value representation form. The time complexity of the process is
Figure 25075DEST_PATH_IMAGE049
N is the number of polynomial coefficients of the encryption key. Thereafter, an alternative product of the first and second transformation results is determined, i.e. atComputing polynomial multiplication in the form of a point value representation, the process having a temporal complexity of
Figure 460736DEST_PATH_IMAGE050
. Finally, determining the target product result of the encryption key and the target multiplier through the alternative product result, namely converting the point value representation form of the alternative product result into the coefficient representation form through IFFT to obtain the final target product result, wherein the time complexity of the process is as follows
Figure 373328DEST_PATH_IMAGE051
. Through the three processes, the total time complexity in determining the target product result of the encryption key and the target multiplier is
Figure 760185DEST_PATH_IMAGE052
. It can be seen that the time complexity of determining the target product result of the encryption key and the target multiplier can be reduced to
Figure 580373DEST_PATH_IMAGE049
While the prior scheme for determining the product result of two large integers based on divide-and-conquer method has the time complexity as high as
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 embodiment of the invention provides a homomorphic encryption method for private data, which comprises the steps of firstly, acquiring the private data to be encrypted; then determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in a graphics processor to obtain a first transformation result and a second transformation result; thereafter determining a target product result of the encryption key and the target multiplier based on the alternative product result of the first transform result and the second transform result; and finally, homomorphic encryption is carried out on the private data based on the encryption key and the target product result. The method can ensure the security of the private data by homomorphic encryption of the private data. In addition, the parallel FFT is carried out by utilizing the streaming multiprocessors 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 above embodiment, in the method for homomorphic encryption of private data provided in the embodiment of the present invention, the first transformation result is obtained based on the following steps:
determining FFT point number and round number of butterfly transformation operation in FFT based on the bit number of the encryption key and the bit number of the target multiplier;
representing the encryption key as a polynomial and assigning each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, determining a twiddle factor of each butterfly transformation operation in the any round based on the any round, the FFT point number and the position of a polynomial coefficient distributed in each flow multiprocessor in the polynomial, screening out a plurality of flow multiprocessors, and executing each butterfly transformation operation in the any round in parallel based on the twiddle factor of each butterfly transformation operation in the any round and the plurality of flow multiprocessors.
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 transformation result, the number of FFT points and the number of rounds of butterfly transformation operation in the 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 FFT point number N needs to be an exponent power of 2, the minimum value among the exponent powers of 2 that is greater than or equal to the maximum number of bits can be selected as the FFT point number N. The number of rounds of butterfly transformation 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 FFT point number N. 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.
For having
Figure 565537DEST_PATH_IMAGE055
The FFT of the polynomial of the points has the following characteristics:
1) The FFT process can be divided into
Figure 923837DEST_PATH_IMAGE056
The operations of the butterfly transformation of the wheel are carried out in each round
Figure 334090DEST_PATH_IMAGE057
The butterfly transformation units;
2) In each round, butterfly transformation operations among different butterfly transformation units are executed in parallel;
3) In each round of FFT, unit root
Figure 883758DEST_PATH_IMAGE058
Also known as twiddle factors. The rotation factor of each round is
Figure 215513DEST_PATH_IMAGE059
Figure 377504DEST_PATH_IMAGE060
Wherein t refers to the node scale after each round of recursion decomposition, and the value is halved step by step along with the rounds of recursion.
4) Order the
Figure 173422DEST_PATH_IMAGE061
Then at
Figure 94324DEST_PATH_IMAGE062
Wheel, the input nodes of each butterfly conversion unit are separated
Figure 241271DEST_PATH_IMAGE063
The subscript interval of the input nodes of each point, namely butterfly conversion operation, is
Figure 675795DEST_PATH_IMAGE064
To have the following
Figure 795061DEST_PATH_IMAGE065
The FFT of the polynomial of the points is for example as shown in fig. 3:
1) The FFT procedure is totally divided into
Figure 420952DEST_PATH_IMAGE066
The operations of the butterfly transformation of the wheel are carried out in each round
Figure 258458DEST_PATH_IMAGE067
The butterfly transform units, rectangular boxes in fig. 3.
2) In each round, the calculation among different butterfly transformation units can be carried out in parallel;
3) At the position of
Figure 496672DEST_PATH_IMAGE068
A round corresponding to the lowest level of the recursive decomposition, so that the node scale
Figure 706330DEST_PATH_IMAGE069
I.e.
Figure 4587DEST_PATH_IMAGE070
Thus the rotation factor of the round is
Figure 329389DEST_PATH_IMAGE071
At the position of
Figure 636874DEST_PATH_IMAGE072
A round with node size 2 times that of the previous round, so
Figure 963688DEST_PATH_IMAGE073
I.e.
Figure 432846DEST_PATH_IMAGE074
Thus the rotation factor of the round is
Figure 979365DEST_PATH_IMAGE075
Figure 90541DEST_PATH_IMAGE076
At the position of
Figure 557948DEST_PATH_IMAGE077
A round corresponding to the topmost layer of the recursive decomposition, so the node scale
Figure 666850DEST_PATH_IMAGE078
I.e.
Figure 966244DEST_PATH_IMAGE079
Thus the rotation factor of the round is
Figure 848487DEST_PATH_IMAGE080
4) At the position of
Figure 651358DEST_PATH_IMAGE081
Wheel, the input nodes of each butterfly conversion unit are separated
Figure 727898DEST_PATH_IMAGE082
The node subscript interval is that
Figure 983430DEST_PATH_IMAGE083
At the position of
Figure 141136DEST_PATH_IMAGE084
Wheels, each butterfly changeThe input nodes of the cells are spaced apart
Figure 798513DEST_PATH_IMAGE085
The node subscript interval is 2;
at the position of
Figure 45955DEST_PATH_IMAGE086
Wheel, the input nodes of each butterfly conversion unit are separated
Figure 552897DEST_PATH_IMAGE087
The node subscript interval is 1 at each point.
In FIG. 3, the following is illustrative
Figure 12829DEST_PATH_IMAGE088
Are coefficient representation forms of polynomial coefficients,
Figure 790292DEST_PATH_IMAGE089
are all point value representation forms of polynomial coefficients.
Thereafter, each polynomial coefficient of the encryption key may be assigned to one of the streaming multiprocessors, e.g., a kth polynomial coefficient of the encryption key may be assigned to a kth streaming multiprocessor
Figure 5372DEST_PATH_IMAGE090
Is a kind of medium.
Further, for any round
Figure 731102DEST_PATH_IMAGE091
Based on either round
Figure 525883DEST_PATH_IMAGE092
FFT point number N, position of polynomial coefficients allocated in each stream multiprocessor in polynomial
Figure 626694DEST_PATH_IMAGE093
Determining a twiddle factor of each butterfly transformation operation in any turn h
Figure 215938DEST_PATH_IMAGE094
And screening out a plurality of streaming multiprocessors.
For example, the twiddle factor of each butterfly transformation operation in any round h can be determined according to any round h and the FFT point number N
Figure 697473DEST_PATH_IMAGE095
And then, according to the position k of the polynomial coefficient distributed in each streaming multiprocessor in the polynomial, screening out a plurality of streaming multiprocessors which can be used for performing butterfly transformation operations in any turn h. The number of the screened stream type multiprocessors is equal to the number of butterfly-shaped conversion operations in any round h.
Finally, the twiddle factor for each butterfly transform operation in any round h
Figure 30365DEST_PATH_IMAGE095
And a plurality of streaming multiprocessors that perform each butterfly transformation operation in any round h in parallel. That is, for any round h, each selected stream-type multiprocessor corresponds to one butterfly transformation unit, butterfly transformation operations of all butterfly transformation units in any round h are executed in parallel by the corresponding stream-type multiprocessor, and each stream-type multiprocessor realizes execution action by the corresponding Block.
In the embodiment of the invention, in each round, the rotation factors of each butterfly transformation operation in each round are combined by the plurality of stream multiprocessors selected through screening, and each butterfly transformation operation in each round is executed in parallel, so that the execution efficiency of the butterfly transformation operation can be greatly improved, and the determination efficiency of the first transformation result is further improved.
On the basis of the above embodiment, the method for homomorphic encryption of private data provided in the embodiment of the present invention, the second transformation result is obtained based on the following steps:
determining FFT point number and round number of butterfly transformation operation in FFT based on the bit number of the encryption key and the bit number of the target multiplier;
representing the target multiplier as a polynomial and assigning each polynomial coefficient of the target multiplier into a streaming multiprocessor;
for any round, determining a twiddle factor of each butterfly transformation operation in the any round based on the any round, the FFT point number and the position of a polynomial coefficient distributed in each flow multiprocessor in the polynomial, screening out a plurality of flow multiprocessors, and executing each butterfly transformation operation in the any round in parallel based on the twiddle factor of each butterfly transformation operation in the any round and the plurality of flow multiprocessors.
Specifically, in the embodiment of the present invention, the step of determining the second transformation result is identical to the step of determining the first transformation result in the above embodiment, and the difference is only that in the above embodiment, the encryption key is represented as a polynomial and the polynomial coefficient is utilized, and in the embodiment of the present invention, the objective multiplier is represented as a polynomial and the polynomial coefficient is utilized, which is not described in detail herein.
On the basis of the foregoing embodiments, the method for homomorphic encryption of private data provided in the embodiments of the present invention determines a twiddle factor of each butterfly transformation operation in any round based on the round, the FFT point number, and a position of a polynomial coefficient allocated in each streaming multiprocessor in the polynomial, and screens out a plurality of streaming multiprocessors, including:
determining the subscript interval of an input node of each butterfly transformation operation in any round based on the round;
calculating the node scale after any turn based on the input node index interval and the FFT point number, and determining a twiddle factor of each butterfly transformation operation in any turn based on the node scale;
the plurality of streaming multiprocessors is screened out based on the input node index interval and the locations in the polynomial of the polynomial coefficients assigned in each streaming multiprocessor.
Specifically, in the embodiment of the present invention, when determining the twiddle factor of each butterfly transformation operation in any round and screening out multiple streaming multiprocessors, the subscript interval s of the input node of each butterfly transformation operation in any round h, that is, the subscript interval of the input node of each butterfly transformation unit, may be determined according to any round h, for example
Figure 720104DEST_PATH_IMAGE096
Thereafter, the node scale t after any round h can be calculated according to the input node index interval s and the FFT point number N, for example, there can be
Figure 512873DEST_PATH_IMAGE097
. From the node size t, a twiddle factor for 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 input node subscript interval t and the position k of the polynomial coefficient allocated 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
If you are
Figure 890316DEST_PATH_IMAGE101
Satisfying the screening condition, then explain
Figure 51170DEST_PATH_IMAGE102
Can pass through the corresponding in any round h
Figure 460286DEST_PATH_IMAGE103
Performing butterfly transformation of a butterfly transformation unitOperating, wherein all the streaming multiprocessors meeting the screening conditions in any round h pass through the corresponding
Figure 921354DEST_PATH_IMAGE104
And executing the butterfly conversion operation of each butterfly conversion unit in any round h in parallel.
Based on the above embodiments, the pseudo code of the parallel FFT algorithm can be expressed as:
Figure 50066DEST_PATH_IMAGE105
/(and/or (V)/will be
Figure 167058DEST_PATH_IMAGE106
In (a) and (b)
Figure 645444DEST_PATH_IMAGE107
Numbering in order
Input array
Figure 725133DEST_PATH_IMAGE108
Polynomial coefficients for storing encryption keys or target multipliers
Array of results
Figure 997983DEST_PATH_IMAGE109
For storing the first or second conversion result
/(and/or distribution)
Figure 664587DEST_PATH_IMAGE110
To the point of
Figure 946664DEST_PATH_IMAGE111
In (3) distribution of
Figure 87052DEST_PATH_IMAGE112
To the point of
Figure 327540DEST_PATH_IMAGE113
In the process, the liquid crystal display device comprises a liquid crystal display device,
Figure 481441DEST_PATH_IMAGE114
is that
Figure 504892DEST_PATH_IMAGE115
Defined variables are used to assist in computation
{
Figure 559173DEST_PATH_IMAGE116
/(all)
Figure 439405DEST_PATH_IMAGE117
Parallel execution
Figure 549443DEST_PATH_IMAGE118
Hybrid/fast Fourier transform
Figure 907743DEST_PATH_IMAGE119
Wheel
Figure 79181DEST_PATH_IMAGE120
//
Figure 67996DEST_PATH_IMAGE121
The index interval of the input node of the butterfly conversion unit of the round is represented;
Figure 930910DEST_PATH_IMAGE122
//
Figure 591436DEST_PATH_IMAGE123
representing the node scale of the recursion decomposition corresponding to the current round;
Figure 121775DEST_PATH_IMAGE124
of the round//
Figure 547071DEST_PATH_IMAGE125
Figure 897281DEST_PATH_IMAGE126
Figure 895586DEST_PATH_IMAGE127
Screening out that the round meets the screening condition
Figure 14852DEST_PATH_IMAGE128
Each of which is
Figure 611050DEST_PATH_IMAGE129
Corresponding to one butterfly transformation unit in the round, performing butterfly transformation operations of all butterfly transformation units in parallel
Figure 714135DEST_PATH_IMAGE130
Is that
Figure 716464DEST_PATH_IMAGE131
Bit inversion of (a)
Figure 690236DEST_PATH_IMAGE132
Is that
Figure 457335DEST_PATH_IMAGE133
Bit inversion of (a)
Figure 301180DEST_PATH_IMAGE134
Figure 343085DEST_PATH_IMAGE135
Figure 436943DEST_PATH_IMAGE136
Figure 171681DEST_PATH_IMAGE137
The method comprises the steps of carrying out a first treatment on the surface of the The first transformation result or the second transformation result is stored in the array B,
Figure 216735DEST_PATH_IMAGE138
is that
Figure 593490DEST_PATH_IMAGE139
Bit inversion of (a)
}
Time complexity analysis of parallel FFT algorithm: the parallel FFT algorithm realizes parallelization aiming at butterfly transformation operation of each iteration round, and the time complexity is constant, namely
Figure 541854DEST_PATH_IMAGE140
Recursively iterate in dichotomy
Figure 447493DEST_PATH_IMAGE141
Wheels, thus of complexity of
Figure 982773DEST_PATH_IMAGE142
On the basis of the above embodiment, the method for homomorphic encryption of private data provided in the embodiment of the present invention, where 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;
wherein the encryption key set is constructed based on an odd number of the exponent of 2 in a random number set generated by a quantum random number generator, and the target multiplier set is constructed based on an integer of the exponent of 2 in the random number set.
Specifically, in the embodiment of the present invention, when determining the encryption key and the target multiplier corresponding to the encryption key, 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 all sets formed by random large integers.
The encryption key set can be obtained by constructing an odd number of 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 the odd numbers of the exponent power of 2 in the bit number and are random numbers. The target multiplier set is obtained by constructing integers with the exponent power of 2 in the random number set generated by the quantum random number generator, namely the target multipliers in the target multiplier set are all integers with the exponent power of 2 in number and are random numbers.
It is understood that the set of random numbers stores therein the quantum random numbers generated by the quantum random number generator. In contrast to pseudo-random numbers, the randomness of quantum random numbers is derived from a classical physical random source that can produce a completely unpredictable random sequence. The quantum random number generator adopts laser phase fluctuation as a random source, the laser phase fluctuation is essentially derived from spontaneous radiation, the quantum random number generator belongs to nondeterministic quantum noise, and a measurement result accords with Gaussian distribution and is a good quantum random source.
The quantum random number generator works independently after being electrified, and can continuously output a binary random number sequence to the outside after being electrified without any external trigger signal source.
In the embodiment of the invention, the odd number with the digit of 2 exponentiation can be screened from the random number set and used as the encryption key to be stored in the encryption key set, and the integer with the digit of 2 exponentiation can be screened from the random number set and used as the target multiplier 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, and the target multiplier is read from the target multiplier set, so that the random number generation efficiency is improved while the physical true random number is generated, and the homomorphic encryption efficiency is further improved.
On the basis of the foregoing embodiment, the method for homomorphic encryption of private data according to the embodiment of the present invention, where the homomorphic encryption of 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 encryption is carried out on the privacy data based on the target random number and the target product result.
Specifically, in the embodiment of the invention, when the encryption key and the target product result are combined to homomorphic encrypt the private data, the target random number can be generated according to the encryption key. That is, as for the encryption key p, since the relation between the target random number r and the encryption key p is |2r| < |p/2|, the encryption key p is needed to be used when the target random number r is generated, so long as the small integer satisfying the relation can be met, and the homomorphic encryption result can be ensured to 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., the homomorphically encrypted result c of the private data m is calculated 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 encryption of private data provided in the embodiment of the present invention, where determining, based on an alternative product result of the first transformation result and the second transformation result, a target product result of the encryption key and the target multiplier 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 transformation result and the second transformation result are both obtained by parallel FFT, the result of the alternative multiplication of the first transformation result and the second transformation result needs to be subjected to inverse fast fourier transform (Inverse Fast Fourier Transform, IFFT), so as to obtain the result of the target multiplication of the encryption key and the target multiplier.
On the basis of the above embodiment, an operation example of the parallel FFT algorithm is given in the embodiment of the present invention, in which only the multiplication of small integers is calculated as an example, but the same is used for large integers, and the acceleration effect is more obvious.
For example: by passing throughParallel FFT algorithm, computation
Figure 835323DEST_PATH_IMAGE143
31 and 24, the maximum number of bits of the result is 4, i.e
Figure 903773DEST_PATH_IMAGE144
. For a 4-bit integer, this can be expressed as
Figure 980313DEST_PATH_IMAGE145
. The polynomial coefficient expression vector of the multiplicand 31 is therefore:
Figure 999960DEST_PATH_IMAGE146
the method comprises the steps of carrying out a first treatment on the surface of the The polynomial coefficient expression vector of 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 (a)
Figure 65032DEST_PATH_IMAGE150
Figure 56122DEST_PATH_IMAGE151
In (a)
Figure 833585DEST_PATH_IMAGE152
Figure 16042DEST_PATH_IMAGE153
In (a)
Figure 449429DEST_PATH_IMAGE154
Figure 244209DEST_PATH_IMAGE155
In (a)
Figure 672917DEST_PATH_IMAGE156
First, the
Figure 763626DEST_PATH_IMAGE157
Round:
Figure 949888DEST_PATH_IMAGE158
the method comprises the steps of carrying out a first treatment on the surface of the Satisfy the following requirements
Figure 282780DEST_PATH_IMAGE159
Block of (2) is
Figure 769256DEST_PATH_IMAGE149
And
Figure 293516DEST_PATH_IMAGE160
Figure 763812DEST_PATH_IMAGE161
in (a)
Figure 838078DEST_PATH_IMAGE162
Figure 241378DEST_PATH_IMAGE163
In (a)
Figure 933609DEST_PATH_IMAGE164
First, the
Figure 563305DEST_PATH_IMAGE165
Wheel:
Figure 769158DEST_PATH_IMAGE166
the method comprises the steps of carrying out a first treatment on the surface of the Satisfy the following requirements
Figure 728762DEST_PATH_IMAGE167
Block of (2) is
Figure 830710DEST_PATH_IMAGE168
And
Figure 10018DEST_PATH_IMAGE169
Figure 691667DEST_PATH_IMAGE170
in (a)
Figure 508706DEST_PATH_IMAGE171
Figure 47135DEST_PATH_IMAGE172
Figure 448160DEST_PATH_IMAGE173
In (a)
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 the parallel FFT algorithm,
Figure 951539DEST_PATH_IMAGE180
the polynomial coefficients of (a) are converted into point value expression representations as:
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
The method comprises the steps of carrying out a first treatment on the surface of the The parallel FFT result of multiplier 24 is
Figure 114219DEST_PATH_IMAGE184
Dot product is performed 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
Performing IFFT (algorithm process is similar to FFT algorithm process) on dot product result, and transforming into a formula
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 liquid crystal display device,
Figure 61075DEST_PATH_IMAGE191
Figure 454010DEST_PATH_IMAGE192
Figure 13821DEST_PATH_IMAGE193
Figure 783194DEST_PATH_IMAGE194
Figure 491387DEST_PATH_IMAGE195
the IFFT result is brought into an IFFT result calculation formula, and the IFFT result can be obtained as
Figure 55224DEST_PATH_IMAGE196
Namely there is
Figure 612982DEST_PATH_IMAGE197
As shown in fig. 4, on the basis of the above embodiment, in an embodiment of the present invention, a device for homomorphic encryption of private data is provided, including:
a data acquisition module 41, configured to acquire private data to be encrypted;
the transformation module 42 is 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 based on a stream 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 transform result and the second transform result;
and 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 above embodiment, the privacy data homomorphic encryption device provided in the embodiment of the present invention, the transformation module is specifically configured to:
determining FFT point number and round number of butterfly transformation operation in FFT based on the bit number of the encryption key and the bit number of the target multiplier;
representing the encryption key as a polynomial and assigning each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, determining a twiddle factor of each butterfly transformation operation in the any round based on the any round, the FFT point number and the position of a polynomial coefficient distributed in each flow multiprocessor in the polynomial, screening out a plurality of flow multiprocessors, and executing each butterfly transformation operation in the any round in parallel based on the twiddle factor of each butterfly transformation operation in the any round and the plurality of flow multiprocessors.
On the basis of the above embodiment, the privacy data homomorphic encryption device provided in the embodiment of the present invention, the transformation module is specifically configured to:
determining the subscript interval of an input node of each butterfly transformation operation in any round based on the round;
Calculating the node scale after any turn based on the input node index interval and the FFT point number, and determining a twiddle factor of each butterfly transformation operation in any turn based on the node scale;
the plurality of streaming multiprocessors is screened out based on the input node index interval and the locations in the polynomial of the polynomial coefficients assigned in each streaming multiprocessor.
On the basis of the above embodiment, the privacy data homomorphic encryption device 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 privacy data homomorphic encryption device further comprises a set construction module, which is used for:
the encryption key set is constructed based on an odd number of the exponent power of 2 in a random number set generated by a quantum random number generator, and the target multiplier set is constructed based on an integer of the exponent power of 2 in the random number set.
On the basis of the above embodiment, the privacy data homomorphic encryption device 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 encryption is carried out on the privacy data based on the target random number and the target product result.
On the basis of the foregoing embodiments, the privacy data homomorphic encryption device provided in the embodiments 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 each module in the privacy data homomorphic encryption device provided in the embodiment of the present invention are in one-to-one correspondence with the operation flows of each step in the above method embodiment, and the achieved effects are consistent.
The CPU-level main program of the privacy data homomorphic encryption device may include:
main()
selecting N-bit encryption keys from the encryption key set
Figure 186045DEST_PATH_IMAGE198
Selecting an N-bit target multiplier from a set of target multipliers
Figure 483166DEST_PATH_IMAGE199
Figure 217903DEST_PATH_IMAGE200
The method comprises the steps of carrying out a first treatment on the surface of the v/N bit encryption key
Figure 62625DEST_PATH_IMAGE201
Figure 111484DEST_PATH_IMAGE202
The method comprises the steps of carrying out a first treatment on the surface of the the/N-bit target multiplier Q
Figure 528690DEST_PATH_IMAGE203
The method comprises the steps of carrying out a first treatment on the surface of the The// array A is used for storing the encryption key
Figure 932864DEST_PATH_IMAGE002
Polynomial coefficients of (a)
Figure 763417DEST_PATH_IMAGE204
The method comprises the steps of carrying out a first treatment on the surface of the The// array B is used for storing the encryption key
Figure 412704DEST_PATH_IMAGE002
Polynomial coefficients of the first transform result of (a)
Figure 684416DEST_PATH_IMAGE205
The method comprises the steps of carrying out a first treatment on the surface of the The// array C is used for storing polynomial coefficients of the second conversion result of the target multiplier Q
Will be
Figure 522141DEST_PATH_IMAGE206
The polynomial coefficients of (a) are stored in A, i.e
Figure 777673DEST_PATH_IMAGE207
Figure 965072DEST_PATH_IMAGE208
The method comprises the steps of carrying out a first treatment on the surface of the Conversion of multipliers using parallel FFT
Figure 888029DEST_PATH_IMAGE201
Will be
Figure 899585DEST_PATH_IMAGE209
The polynomial coefficients of (a) are stored in A, i.e
Figure 845675DEST_PATH_IMAGE210
Figure 836765DEST_PATH_IMAGE211
The method comprises the steps of carrying out a first treatment on the surface of the Conversion of multipliers using parallel FFT
Figure 614228DEST_PATH_IMAGE212
Figure 534036DEST_PATH_IMAGE213
Alternate product result obtained by multiplying/calculating dot product:////// is%
Figure 295319DEST_PATH_IMAGE214
IFFT is carried out on the result of the alternative multiplication 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 above embodiment, in an embodiment of the present invention, a system for homomorphic encryption of private data is provided, including: a quantum random number generator 51, a graphic processor 52, and a privacy data homomorphic encryption device 53 provided in the above embodiments;
any two of the quantum random number generator 51, the graphic processor 52 and the privacy data homomorphic encryption device 53 are connected through interfaces;
the quantum random number generator 51 is used for providing an encryption key for the privacy data homomorphic encryption device and a target multiplier corresponding to the encryption key;
the privacy 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, a Quantum Random Number Generator (QRNG) 51 may be configured in a random number generating device (generator) 61, where the random number generating device 61 further includes a judging unit (Judge) 611, a storing unit (Memory) 612, and a first I/O interface 613, and the judging unit 611 performs judgment screening on the random number generated by the quantum random number generator 51, so as to determine an encryption key set, a target multiplier set, and a target random number set, and store the encrypted key set, the target multiplier set, and the target random number set in the storing unit 612.
The privacy data homomorphic encryption device 53 may be configured in a computer (Host) 62, where 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 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, respectively.
The graphics processor 52 may be configured in the graphics processor apparatus 63, and the graphics processor apparatus 63 further includes a storage (GDRAM) 631 and a third I/O interface 632, and the privacy data homomorphic encryption device 53 may invoke the graphics processor 52 through the second I/O interface 622 and the third I/O interface 632.
The privacy data homomorphic encryption system provided by the embodiment of the invention can realize parallel FFT (fast Fourier transform) in the homomorphic encryption process of the privacy data by combining the quantum random number generator, the graphic processor and the privacy data homomorphic encryption device provided by the embodiments, and can greatly improve the homomorphic encryption efficiency. Moreover, the quantum random number generator is introduced, so that homomorphic encryption effect can be ensured.
Fig. 7 illustrates a physical schematic diagram of an electronic device, as shown in fig. 7, which may include: processor (Processor) 710, communication interface (Communications Interface) 720, memory (Memory) 730, and communication bus 740, wherein Processor 710, communication interface 720, memory 730 communicate with each other via communication bus 740. The processor 710 may invoke logic instructions in the memory 730 to perform the privacy data homomorphic encryption methods provided in the embodiments described above.
Further, the logic instructions in the memory 730 described above may be implemented in the form of software functional units and may be stored in a computer readable storage medium when sold or used as a stand alone product. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, the present invention also provides a computer program product, where the computer program product includes a computer program, where the computer program can be stored on a non-transitory computer readable storage medium, and when the computer program is executed by a processor, the computer can perform the privacy data homomorphic encryption method provided in the foregoing embodiments.
In yet another aspect, the present invention also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, is implemented to perform the privacy data homomorphic encryption method provided in the above embodiments.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on this understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the prior art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the respective embodiments or some parts of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (9)

1. A method for homomorphic encryption of private data, comprising:
acquiring privacy data to be encrypted;
determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in a graphics processor to obtain a first transformation result and a second transformation result;
determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transform result and the second transform result;
homomorphic encryption is carried out on the privacy data based on the encryption key and the target product result;
The first transformation result is obtained based on the following steps:
determining FFT point number and round number of butterfly transformation operation in FFT based on the bit number of the encryption key and the bit number of the target multiplier;
representing the encryption key as a polynomial and assigning each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, determining a twiddle factor of each butterfly transformation operation in the any round based on the any round, the FFT point number and the position of a polynomial coefficient distributed in each flow multiprocessor in the polynomial, screening out a plurality of flow multiprocessors, and executing each butterfly transformation operation in the any round in parallel based on the twiddle factor of each butterfly transformation operation in the any round and the plurality of flow multiprocessors.
2. The method according to claim 1, wherein the determining a twiddle factor of each butterfly transformation operation in any round based on the round, the FFT point number, and a position of a polynomial coefficient allocated in each streaming multiprocessor in the polynomial, and screening out a plurality of streaming multiprocessors includes:
Determining the subscript interval of an input node of each butterfly transformation operation in any round based on the round;
calculating the node scale after any turn based on the input node index interval and the FFT point number, and determining a twiddle factor of each butterfly transformation operation in any turn based on the node scale;
the plurality of streaming multiprocessors is screened out based on the input node index interval and the locations in the polynomial of the polynomial coefficients assigned in each streaming multiprocessor.
3. The method for homomorphic encryption of private data according to claim 1, wherein said 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;
wherein the encryption key set is constructed based on an odd number of the exponent of 2 in a random number set generated by a quantum random number generator, and the target multiplier set is constructed based on an integer of the exponent of 2 in the random number set.
4. A method of homomorphic encryption of private data according to any one of claims 1-3, wherein homomorphic encrypting the private data based on the encryption key and the target product result comprises:
Generating a target random number based on the encryption key;
and homomorphic encryption is carried out on the privacy data based on the target random number and the target product result.
5. A method of homomorphic encryption of private data according to any one of claims 1-3, wherein said determining a target product result of said encryption key and said target multiplier based on an alternative product result of said first transform result and said second transform result comprises:
and performing IFFT on the alternative product result to obtain the target product result.
6. A privacy data homomorphic encryption device, comprising:
the data acquisition module is used for acquiring the privacy data to be encrypted;
the transformation module is used for determining an encryption key and a target multiplier corresponding to the encryption key, and respectively carrying out parallel FFT on the encryption key and the target multiplier based on a stream multiprocessor in the graphics processor to obtain a first transformation result and a second transformation result;
a product module for determining a target product result of the encryption key and the target multiplier based on an alternative product result of the first transform result and the second transform result;
The encryption module is used for homomorphic encryption of the privacy data based on the encryption key and the target product result;
the transformation module is specifically used for:
determining FFT point number and round number of butterfly transformation operation in FFT based on the bit number of the encryption key and the bit number of the target multiplier;
representing the encryption key as a polynomial and assigning each polynomial coefficient of the encryption key to a streaming multiprocessor;
for any round, determining a twiddle factor of each butterfly transformation operation in the any round based on the any round, the FFT point number and the position of a polynomial coefficient distributed in each flow multiprocessor in the polynomial, screening out a plurality of flow multiprocessors, and executing each butterfly transformation operation in the any round in parallel based on the twiddle factor of each butterfly transformation operation in the any round and the plurality of flow multiprocessors.
7. A system for homomorphic encryption of private data, comprising: a quantum random number generator, a graphics processor and the privacy data homomorphic encryption device according to claim 6;
any two of the quantum random number generator, the graphic processor and the privacy data homomorphic encryption device are connected through an interface;
The quantum random number generator is used for providing an encryption key for the privacy data homomorphic encryption device and a target multiplier corresponding to the encryption key;
the privacy data homomorphic encryption device is used for calling the graphics processor.
8. 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 one of claims 1-5 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the method of homomorphic encryption of private data according to any one of claims 1-5.
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 CN115622685A (en) 2023-01-17
CN115622685B true 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)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116383666B (en) * 2023-05-23 2024-04-19 重庆大学 Power data prediction method and device and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110190946A (en) * 2019-07-12 2019-08-30 之江实验室 A kind of secret protection multimachine structure data classification method based on homomorphic cryptography
CN110537191A (en) * 2017-03-22 2019-12-03 维萨国际服务协会 Secret protection machine learning
CN111400766A (en) * 2020-03-25 2020-07-10 支付宝(杭州)信息技术有限公司 Method and device for multi-party joint dimension reduction processing aiming at private data
CN114978467A (en) * 2022-05-12 2022-08-30 南通大学 Privacy protection method for medical data sharing based on fully homomorphic encryption

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110537191A (en) * 2017-03-22 2019-12-03 维萨国际服务协会 Secret protection machine learning
CN110190946A (en) * 2019-07-12 2019-08-30 之江实验室 A kind of secret protection multimachine structure data classification method based on homomorphic cryptography
CN111400766A (en) * 2020-03-25 2020-07-10 支付宝(杭州)信息技术有限公司 Method and device for multi-party joint dimension reduction processing aiming at private data
CN114978467A (en) * 2022-05-12 2022-08-30 南通大学 Privacy protection method for medical data sharing based on fully homomorphic encryption

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李宗育等.同态加密技术及其在云计算隐私保护中的应用 .《软件学报》.2018,1830-1851. *

Also Published As

Publication number Publication date
CN115622685A (en) 2023-01-17

Similar Documents

Publication Publication Date Title
Nejatollahi et al. Post-quantum lattice-based cryptography implementations: A survey
US10565514B2 (en) System and method for emulation of a quantum computer
Wang et al. Accelerating fully homomorphic encryption using GPU
Jiang et al. Matcha: A fast and energy-efficient accelerator for fully homomorphic encryption over the torus
US20100054458A1 (en) Sharing a secret via linear interpolation
Machicao et al. Chaotic encryption method based on life-like cellular automata
Li et al. Quantum image weighted average filtering in spatial domain
Abu Dalhoum et al. Digital image scrambling based on elementary cellular automata
CN115622685B (en) Method, device and system for homomorphic encryption of private data
CN112636895A (en) Image encryption and decryption method and image encryption and decryption system
Yang et al. Some properties of the logistic map over the finite field and its application
Li et al. A image encryption algorithm based on coexisting multi-attractors in a spherical chaotic system
EP4162355A1 (en) Protection of transformations by intermediate randomization in cryptographic operations
Yang et al. FPGA accelerator for homomorphic encrypted sparse convolutional neural network inference
CN116527235A (en) Data encryption method and device based on key rotation and electronic equipment
Pramkaew et al. Lightweight scheme of secure outsourcing SVD of a large matrix on cloud
Ma et al. Quantum color image compression and encryption algorithm based on Fibonacci transform
Wen et al. The EEG signals encryption algorithm with K-sine-transform-based coupling chaotic system
Zhang et al. Image encryption algorithm based on the Matryoshka transform and modular-inverse matrix
Li et al. Privacy preserving via multi-key homomorphic encryption in cloud computing
WO2023110216A1 (en) Polynomial multiplication of encrypted values
CN113434886B (en) Method and device for jointly generating data tuples for secure computation
Zhang et al. Image encryption algorithm of hyper-chaotic system based on spiral scrambling
CN111460488B (en) Multi-image rapid encryption method based on pre-storage and n-dimensional Arnold transformation
Ebel et al. Orion: A Fully Homomorphic Encryption Compiler for Private Deep Neural Network Inference

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