CN116150795B - Homomorphic encryption-based data processing method, system and related equipment - Google Patents

Homomorphic encryption-based data processing method, system and related equipment Download PDF

Info

Publication number
CN116150795B
CN116150795B CN202310406264.6A CN202310406264A CN116150795B CN 116150795 B CN116150795 B CN 116150795B CN 202310406264 A CN202310406264 A CN 202310406264A CN 116150795 B CN116150795 B CN 116150795B
Authority
CN
China
Prior art keywords
data
encryption
matrix
sorting
holding end
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
CN202310406264.6A
Other languages
Chinese (zh)
Other versions
CN116150795A (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.)
International Digital Economy Academy IDEA
Original Assignee
International Digital Economy Academy IDEA
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 International Digital Economy Academy IDEA filed Critical International Digital Economy Academy IDEA
Priority to CN202310406264.6A priority Critical patent/CN116150795B/en
Publication of CN116150795A publication Critical patent/CN116150795A/en
Application granted granted Critical
Publication of CN116150795B publication Critical patent/CN116150795B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/71Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure computing or processing of information
    • 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
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a homomorphic encryption-based data processing method, a homomorphic encryption-based data processing system and related equipment, wherein the method comprises the following steps: homomorphic encryption is carried out on data to be sequenced through a data holding end to obtain encrypted data; the data holding end sends the encrypted data to a server so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end; and acquiring a target sorting result corresponding to the data to be sorted through the sorting encryption result received by the data holding end. The invention is beneficial to improving the safety of data in the data processing process.

Description

Homomorphic encryption-based data processing method, system and related equipment
Technical Field
The present invention relates to the field of data encryption processing technologies, and in particular, to a data processing method, system and related device based on homomorphic encryption.
Background
With the development of science and technology, data processing is more and more emphasized, and meanwhile, the security requirement in the data processing process is also higher and higher. In order to improve the data processing efficiency or reduce the computational power requirement of the data holding end, the data of the data holding end can be uploaded to the cloud server for corresponding data processing.
In the prior art, in order to improve the security in the data processing process, data related to user privacy is protected, generally, the data is encrypted at a data holding end, then the encrypted data is transmitted to a cloud server, the cloud server decrypts the encrypted data to obtain plaintext data, then the plaintext data is correspondingly processed (e.g. ordered), and the processing result is encrypted and then returned to the data holding end. The problem in the prior art is that only the data transmission process is encrypted and protected, plaintext data is still used when data sorting and other processes are carried out in the cloud server, namely the cloud server can acquire real user data, which is not beneficial to improving the safety of the data and privacy protection of the data.
Accordingly, there is a need for improvement and development in the art.
Disclosure of Invention
The invention mainly aims to provide a homomorphic encryption-based data processing method, a homomorphic encryption-based data processing system and related equipment, and aims to solve the problems that in the prior art, data are encrypted at a data holding end and then are transmitted to a cloud server, the cloud server decrypts the encrypted data to obtain plaintext data, and then the scheme of correspondingly processing the plaintext data is not beneficial to improving the safety of the data and protecting the privacy of the data.
In order to achieve the above object, a first aspect of the present invention provides a homomorphic encryption-based data processing method, wherein the homomorphic encryption-based data processing method includes:
homomorphic encryption is carried out on data to be sequenced through a data holding end to obtain encrypted data;
the data holding end sends the encrypted data to a server so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end;
and acquiring a target sorting result corresponding to the data to be sorted through the sorting encryption result received by the data holding end.
Optionally, the homomorphic encryption of the data to be sequenced by the data holding end to obtain encrypted data includes:
acquiring data to be ordered through the data holding end, wherein the data to be ordered comprises a plurality of numerical values to be ordered;
obtaining a decomposition base and a layering processing layer number corresponding to the data to be sequenced according to the data bit width of the data to be sequenced, wherein the decomposition base is a data system when decomposing each data to be sequenced;
respectively decomposing each value to be sequenced according to the decomposition base and the layering processing layer number to obtain a decomposition vector corresponding to each value to be sequenced;
And obtaining the encrypted data through homomorphic encryption according to the decomposition vector.
Optionally, the encrypted data includes a row repetition encryption matrix and a column repetition encryption matrix, and the obtaining the encrypted data by homomorphic encryption according to the decomposition vector includes:
constructing a row repetition coding matrix and a column repetition coding matrix corresponding to the data to be ordered according to the decomposition vectors, wherein the row repetition coding matrix is composed of a target number of identical rows, elements in one row of the row repetition coding matrix are respectively the decomposition vectors, the target number is the number of the decomposition vectors, the column repetition coding matrix is composed of a target number of identical columns, and elements in one column of the column repetition coding matrix are respectively the decomposition vectors;
and homomorphic encrypting the row repetition coding matrix by the data holding end to obtain the row repetition coding matrix, and homomorphic encrypting the column repetition coding matrix to obtain the column repetition coding matrix.
Optionally, the performing homomorphic encryption on the row repetition coding matrix by the data holding end to obtain the row repetition coding matrix, and performing homomorphic encryption on the column repetition coding matrix to obtain the column repetition coding matrix includes:
Generating a public key, a private key and an evaluation key through the data holding end, wherein the private key is used for data decryption of the data holding end, and the evaluation key is used for data calculation of the encrypted data by the server;
homomorphic encryption is carried out on the line repetition coding matrix according to the public key through the data holding end to obtain the line repetition coding matrix;
and carrying out homomorphic encryption on the column repetition encryption matrix by the data holding end according to the public key to obtain the column repetition encryption matrix.
Optionally, the sending the encrypted data to a server through the data holding end to trigger the server to perform sorting processing according to the encrypted data to obtain a sorted encrypted result and return the sorted encrypted result to the data holding end includes:
and sending the evaluation key, the row repeated encryption matrix and the column repeated encryption matrix to the server through the data holding end so as to trigger the server to perform sorting processing according to the evaluation key, the row repeated encryption matrix and the column repeated encryption matrix to obtain a sorting encryption result and return the sorting encryption result to the data holding end.
Optionally, the server performs the sorting process according to the following steps:
calculating a difference matrix corresponding to the row repeated encryption matrix and the column repeated encryption matrix according to the evaluation key;
performing interpolation polynomials according to the difference matrix to obtain a comparison matrix;
and performing rotation multiplication operation on a plurality of decomposition layers according to the comparison matrix to obtain a sorting matrix corresponding to the data to be sorted, and taking the sorting matrix as the sorting encryption result.
Optionally, the obtaining, by the sorting encryption result received by the data holding end, a target sorting result corresponding to the data to be sorted includes:
decrypting the sorting encryption result by the data holding end according to the private key and obtaining the hamming weight corresponding to each value to be sorted;
and determining the value to be sequenced corresponding to each sequencing position by the data holding end according to the hamming weight to obtain the target sequencing result.
A second aspect of the present invention provides a homomorphic encryption based data processing system, where the homomorphic encryption based data processing system includes:
the data encryption module is used for homomorphic encryption of the data to be sequenced through the data holding end to obtain encrypted data;
The encrypted data processing module is used for sending the encrypted data to a server through the data holding end so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end;
and the data ordering module is used for acquiring a target ordering result corresponding to the data to be ordered according to the ordering encryption result received by the data holding end.
The third aspect of the present invention provides an intelligent terminal, where the intelligent terminal includes a memory, a processor, and a homomorphic encryption based data processing program stored in the memory and capable of running on the processor, where the homomorphic encryption based data processing program implements any one of the steps of the homomorphic encryption based data processing method when executed by the processor.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a homomorphic encryption based data processing program, which when executed by a processor, implements the steps of any one of the homomorphic encryption based data processing methods.
From the above, in the scheme of the invention, the data holding end performs homomorphic encryption on the data to be sorted to obtain encrypted data; the data holding end sends the encrypted data to a server so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end; and acquiring a target sorting result corresponding to the data to be sorted through the sorting encryption result received by the data holding end.
Compared with the prior art, in the scheme of the invention, the data holding end performs homomorphic encryption on the data to be sequenced to obtain the encrypted data, and sends the encrypted data to the server, so that the encrypted data is not decrypted in the server, but is subjected to sequencing treatment directly to obtain a sequencing encryption result. Because the data holding end performs homomorphic encryption on the data to be sorted, the sorting of the encrypted data by the server can be mapped to the plaintext data (namely the data to be sorted) to realize the corresponding sorting. Meanwhile, when data processing is carried out in the server, encrypted data is used, namely the server cannot acquire corresponding plaintext data, and the server cannot cause leakage of the plaintext data even if being invaded, so that the data security in the data processing process is improved, and privacy protection is facilitated for the data.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic flow chart of a homomorphic encryption based data processing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram showing a non-optimized and optimized data structure of an ordering matrix according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a calculation process for comparing and sorting two numbers according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a numerical comparison without dynamic layering according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of comparing values during dynamic layering according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of a data processing system based on homomorphic encryption according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of an internal structure of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, techniques, etc., in order to provide a thorough understanding of the embodiments of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
With the development of science and technology, data processing is more and more emphasized, and meanwhile, the security requirement in the data processing process is also higher and higher. In order to improve the data processing efficiency or reduce the computational power requirement of the data holding end, the data of the data holding end can be uploaded to the cloud server for corresponding data processing.
In the prior art, in order to improve the security in the data processing process, data related to user privacy is protected, generally, the data is encrypted at a data holding end, then the encrypted data is transmitted to a cloud server, the cloud server decrypts the encrypted data to obtain plaintext data, then the plaintext data is correspondingly processed (e.g. ordered), and the processing result is encrypted and then returned to the data holding end. The problem in the prior art is that only the data transmission process is encrypted and protected, plaintext data is still used when data sorting and other processes are carried out in the cloud server, namely the cloud server can acquire real user data, which is not beneficial to improving the safety of the data and privacy protection of the data.
In order to solve at least one of the above problems, the present invention provides a homomorphic encryption-based data processing method, which relates to the field of homomorphic cryptography and the field of data processing corresponding to information security, and specifically, performs homomorphic encryption on data to be sorted through a data holding end to obtain encrypted data; the data holding end sends the encrypted data to a server so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end; and acquiring a target sorting result corresponding to the data to be sorted through the sorting encryption result received by the data holding end.
Compared with the prior art, in the scheme of the invention, the data holding end performs homomorphic encryption on the data to be sequenced to obtain the encrypted data, and sends the encrypted data to the server, so that the encrypted data is not decrypted in the server, but is subjected to sequencing treatment directly to obtain a sequencing encryption result. Because the data holding end performs homomorphic encryption on the data to be sorted, the sorting of the encrypted data by the server can be mapped to the plaintext data (namely the data to be sorted) to realize the corresponding sorting. Meanwhile, when data processing is carried out in the server, encrypted data is used, namely the server cannot acquire corresponding plaintext data, and the server cannot cause leakage of the plaintext data even if being invaded, so that the data security in the data processing process is improved, and privacy protection is facilitated for the data.
In this embodiment, homomorphic encryption is performed using an homomorphic cryptographic algorithm. The homomorphic encryption algorithm is a special encryption algorithm, and besides the data encryption and decryption functions which can be completed by the common encryption algorithm, the homomorphic encryption algorithm can be mapped to the ciphertext operation of the homomorphic encryption algorithm aiming at the plaintext according to homomorphic properties. Therefore, the algorithm can support a 'ciphertext calculation' function, namely, the encrypted data can be operated without decrypting the ciphertext first. Decrypting the calculated ciphertext, wherein the obtained result is equivalent to the calculation result after the calculation of the plaintext. The full homomorphic password meets the technical path of the requirement of 'data availability invisible' of privacy calculation on the algorithm level, and is beneficial to ensuring the safe circulation of privacy data.
Compared with other technical branches of privacy computing, such as Trusted Execution Environment (TEE), multiparty secure computing (MPC) and the like, the isomorphic technology has the defect of lower processing performance. The efficiency of the fully homomorphic algorithm in ciphertext execution is about one ten thousandth of the plaintext calculation. Therefore, in this embodiment, how to improve the algorithm execution efficiency, for example, remove the data redundancy, reduce the homomorphic operation times for the ciphertext data, and so on, is also considered. Specifically, in an application scenario, by layering, sorting matrix optimization and other techniques, a larger-scale data capacity in a compatible sorting process is processed with fewer homomorphic operation times.
The traditional cryptographic algorithm has the function of encrypting and decrypting the data, namely only ensuring that the result is the original plaintext data when the encrypted data is decrypted. Besides the encryption and decryption functions, the homomorphic cryptographic algorithm also has homomorphic operation functions, namely after encrypting the plaintext message M to obtain the ciphertext C, the ciphertext message can be subjected to meaningful operation to perform certain operations on the original plaintext M
Figure SMS_10
Can homomorphically map to the operation on ciphertext>
Figure SMS_2
And (3) upper part. Specifically, the conventional cryptographic algorithm satisfies the following properties: / >
Figure SMS_7
,/>
Figure SMS_5
,/>
Figure SMS_8
. The full homomorphic encryption algorithm satisfies the following properties: />,/>
Figure SMS_14
Figure SMS_13
And (2) a->
Figure SMS_15
,/>
Figure SMS_1
Figure SMS_16
. Wherein M is a plaintext message, and C is a ciphertext message; (pk, sk) is an encryption algorithm key pair, typically pk is used for encryption and sk is used for decryption; enc represents an encryption algorithm, dec represents a decryption algorithm; f represents an arbitrary function for the plaintext message M, < ->
Figure SMS_3
Representing homomorphic operation mapped to ciphertext by f. />
Figure SMS_6
Representing information obtained by processing the plaintext information according to the function f,/>
Figure SMS_9
Representative pair->
Figure SMS_11
And (5) encrypting the obtained information. It should be noted that, in this embodiment, the function f represents a sorting function, ++>
Figure SMS_4
Then it is a homomorphic ordering operation mapped to ciphertext by function f.
Specifically, in the embodiment, a data processing method based on homomorphic encryption is provided for a scene of security ordering of both parties. The scene comprises a data holding end and a server, wherein the data holding end holds data to be ordered, and the server executes a safe ordering process. In one application scenario, consider the following hazard model: first, the server is semi-honest, following all specifications of the scheme in this embodiment, but allows the adversary to access all data maintained by the server after control by the adversary; furthermore, an attacker can legally log into the server, make illegal copies of the data, and hand over it to any malicious user. Therefore, it is desirable to avoid that the server learns any data content to be sorted during the sorting process.
As shown in fig. 1, an embodiment of the present invention provides a data processing method based on homomorphic encryption, and specifically, the method includes the following steps:
step S100, homomorphic encryption is carried out on the data to be sequenced through the data holding end to obtain encrypted data.
The data holding end is a terminal for storing data to be sequenced, and the data to be sequenced is data which needs to be sequenced and privacy protection. For example, the data holding end may be an intelligent terminal such as a mobile phone, an intelligent watch, or a computer of the user, and the data to be sequenced may be income data, score, weight data, height, age, or other specific data of the user, which is not limited herein. In this embodiment, in order to reduce the calculation amount of the data holding end, the task of ordering the data needs to be outsourced to the server on the premise of not revealing the user data, and the ordering task is executed by using the calculation force of the server, so that the calculation force requirement on the data holding end is reduced, and the processing efficiency of the system is improved. In an application scenario, the homomorphic encryption process is implemented by a preset homomorphic encryption algorithm, and an existing specific algorithm may be adopted, which is not limited herein.
Specifically, the homomorphic encryption of the data to be sequenced by the data holding end to obtain encrypted data includes: acquiring data to be ordered through the data holding end, wherein the data to be ordered comprises a plurality of numerical values to be ordered; obtaining a decomposition base and a layering processing layer number corresponding to the data to be sequenced according to the data bit width of the data to be sequenced, wherein the decomposition base is a data system when decomposing each data to be sequenced; respectively decomposing each value to be sequenced according to the decomposition base and the layering processing layer number to obtain a decomposition vector corresponding to each value to be sequenced; and obtaining the encrypted data through homomorphic encryption according to the decomposition vector.
In this embodiment, the data holding end acquires the data to be sorted
Figure SMS_17
Wherein->
Figure SMS_18
To->
Figure SMS_19
Represents->
Figure SMS_20
And the numerical values to be ordered need to be ordered. In the embodiment, the data system of each value to be sorted is the same (e.g., all the values are decimal), and in the practical application process, if the data systems of the data values to be sorted are different, the data systems are firstly converted into the same data system, e.g., all the data systems are firstly converted into preset decimal.
The data bit width is the number of bits of the occupied bits of the value to be ordered, and specifically, the data bit width of the data to be ordered under a preset system (for example, decimal system). In this embodiment, the decomposition base and the layering processing layer number are obtained by calculating according to the maximum data bit width in all the values to be ordered.
In an application scenario, a decomposition base and a layering processing layer number corresponding to a data bit width of a value to be ordered can be dynamically selected according to a preset bit width corresponding table. In another application scenario, the corresponding decomposition base and layering processing layer number can be obtained through dynamic calculation according to the data bit width.
In this embodiment, the data bit width is
Figure SMS_23
The decomposition group is->
Figure SMS_26
The layering treatment layer number is->
Figure SMS_30
Bit width of each layer of data after layering is +.>
Figure SMS_22
,/>
Figure SMS_25
The size of the ordered array is +.>
Figure SMS_28
The dimension of the ciphertext polynomial is +.>
Figure SMS_31
The number of ciphertext needed for packing the ordering matrix is +.>
Figure SMS_21
Multiplication depth is +.>
Figure SMS_33
The constraint is that
Figure SMS_34
Two sides are simultaneously opposite to (a)>
Figure SMS_35
The taking of the logarithm is->
Figure SMS_24
Then meet the requirement and let->
Figure SMS_27
The smallest case is->
Figure SMS_29
Dynamic decomposition algorithm selection->
Figure SMS_32
And (3) carrying out data decomposition by full prime number decomposition to reach the minimum multiplication depth. In one application scenario, the decomposition base and the layering layer take values that minimize the multiplication depth. For example, the data bit width can be 32 bits according to the real worldBinary decomposition bases, ternary decomposition bases and the like are selected according to the actual requirements, and the binary decomposition bases and the ternary decomposition bases are determined according to the actual requirements. After the decomposition base is determined, decomposition is carried out according to the decomposition base and the corresponding layering processing layer number to form a decomposition vector. It should be noted that, in an application scenario, a new data width after the values to be ordered are subjected to binary conversion may be determined according to the decomposition base, and the new data width is divided by the number of layers of hierarchical processing, so that the data bit width of each decomposition vector, that is, the data bit width of each layer, may be obtained.
In this embodiment, preprocessing is performed at the data holding end, and large-bit-width data is decomposed according to a determined decomposition base, for example, when the decomposition base takes 2, the binary expression form of the original number is obtained after decomposition. The layering processing layer number refers to the layering number in the layering comparison processing process in the sorting process. When the sorting comparison is performed, each coefficient in the decomposition vector is compared first, and then the comparison results are combined into a final comparison result. In the combination process, the large-bit-width data can be regarded as the splicing of a plurality of small-bit-width sub-data, the sub-data can be regarded as the splicing of smaller sub-data, each iteration is regarded as a comparison layer, and the total comparison layer number is the layering processing layer number.
It should be noted that, the determination of the layering processing layer number and the decomposition base and the corresponding decomposition process are a dynamic process, and the homomorphic multiplication depth of the comparison process can be ensured to be minimum, so that better processing performance is obtained. The layering processing layer number and the decomposition base are calculated and determined according to the data bit width and with the minimum homomorphic multiplication depth of the comparison process as a target.
In this embodiment, a dynamic decomposition method is used to perform optimal layer number decomposition on each value to be sequenced in the data to be sequenced according to the data bit width:
Figure SMS_36
Wherein->
Figure SMS_37
To->
Figure SMS_38
Represents->
Figure SMS_39
The values to be ordered which need to be ordered, decompose representing the decomposition process, < >>
Figure SMS_40
To->
Figure SMS_41
Representing>And decomposing the vector. In one application scenario, the decomposition process decomposes according to a data bit wide quality factor.
In this embodiment, the encrypted data includes a row repetition encryption matrix and a column repetition encryption matrix, and the obtaining the encrypted data by homomorphic encryption according to the decomposition vector includes: constructing a row repetition coding matrix and a column repetition coding matrix corresponding to the data to be ordered according to the decomposition vectors, wherein the row repetition coding matrix is composed of a target number of identical rows, elements in one row of the row repetition coding matrix are respectively the decomposition vectors, the target number is the number of the decomposition vectors, the column repetition coding matrix is composed of a target number of identical columns, and elements in one column of the column repetition coding matrix are respectively the decomposition vectors; and homomorphic encrypting the row repetition coding matrix by the data holding end to obtain the row repetition coding matrix, and homomorphic encrypting the column repetition coding matrix to obtain the column repetition coding matrix.
Specifically, a row repetition coding matrix is constructed according to the decomposition vector
Figure SMS_43
And column repetition coding matrix->
Figure SMS_44
Wherein, the method comprises the steps of, wherein,
Figure SMS_45
,/>
Figure SMS_46
further, the step of homomorphic encrypting the line repetition coding matrix by the data holding end to obtain the line repetition coding matrix, and homomorphic encrypting the column repetition coding matrix to obtain the column repetition coding matrix includes: generating a public key, a private key and an evaluation key through the data holding end, wherein the private key is used for data decryption of the data holding end, and the evaluation key is used for data calculation of the encrypted data by the server; homomorphic encryption is carried out on the line repetition coding matrix according to the public key through the data holding end to obtain the line repetition coding matrix; and carrying out homomorphic encryption on the column repetition encryption matrix by the data holding end according to the public key to obtain the column repetition encryption matrix.
Wherein the public key, the private key and the evaluation key correspond to each other, and in the data processing process, the data holding end only uploads the evaluation key to the server for assisting the server to execute
Figure SMS_47
Function without uploading the public and private keys. In this embodiment, the data holding end encodes the row repetition coding matrix ++using the homomorphic encryption method >
Figure SMS_48
And column repetition coding matrix->
Figure SMS_49
Performing packet packing encryption to obtain a line repetition encryption matrix +.>
Figure SMS_50
And column repetition encryption matrix->
Figure SMS_51
. In particular, the method comprises the steps of,
Figure SMS_52
,/>
Figure SMS_53
encryptions represent homomorphic Encryption, and existing homomorphic Encryption algorithms can be used, and are not particularly limited herein.
Step S200, the data holding end sends the encrypted data to a server so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end.
The server is a cloud server for performing data processing, and in this embodiment, the server is specifically configured to execute a sorting task. Specifically, the sending the encrypted data to the server through the data holding end to trigger the server to perform a sorting process according to the encrypted data to obtain a sorted encrypted result and return the sorted encrypted result to the data holding end includes: and sending the evaluation key, the row repeated encryption matrix and the column repeated encryption matrix to the server through the data holding end so as to trigger the server to perform sorting processing according to the evaluation key, the row repeated encryption matrix and the column repeated encryption matrix to obtain a sorting encryption result and return the sorting encryption result to the data holding end.
The sorting encryption result is obtained after sorting the encrypted data. It should be noted that, since the encryption process is performed based on the homomorphic encryption algorithm, the ordering of the encrypted data may also be mapped to the operation of plaintext data. Therefore, the ordering result of the plaintext can also be determined based on the ordering encryption result.
In an application scenario, the size relationship may be determined by performing one-to-one comparison on the encrypted data corresponding to each decomposition vector (i.e., the corresponding elements between the line repeated encryption matrix or the column repeated encryption matrix), so as to obtain a corresponding ordered encryption result.
In this embodiment, the server performs the sorting process according to the following steps: calculating a difference matrix corresponding to the row repeated encryption matrix and the column repeated encryption matrix according to the evaluation key; performing interpolation polynomials according to the difference matrix to obtain a comparison matrix; and performing rotation multiplication operation on a plurality of decomposition layers according to the comparison matrix to obtain a sorting matrix corresponding to the data to be sorted, and taking the sorting matrix as the sorting encryption result.
Specifically, the server uses the evaluation key to calculate the difference between the two encryption matrices and runs the interpolation polynomial to obtain the comparison result of the coefficients on each decomposition basis. Specifically, calculating a difference matrix corresponding to the row repeated encryption matrix and the column repeated encryption matrix according to the evaluation key; interpolating polynomials according to the difference matrix to obtain a comparison matrix
Figure SMS_54
The following formula (1) shows:
Figure SMS_55
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_56
obtaining a difference matrix, and>
Figure SMS_57
representing an interpolating polynomial approximating the comparison function.
Further, the server performs Rotation multiplication operation (i.e. Rotation-multiple) operation on the decomposition layer, and combines to obtain a sorting encryption result which can represent a comparison result between the values to be sorted, as shown in the following formula (2):
Figure SMS_58
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_59
representing rotation multiplication operations, +.>
Figure SMS_60
Representing the ordered encryption result. The plaintext operation corresponding to the rotation multiplication operation is shown in the following formula (3):
Figure SMS_61
wherein, the liquid crystal display device comprises a liquid crystal display device,
Figure SMS_63
is any two values to be ordered in the data to be ordered,/-for the data to be ordered>
Figure SMS_66
Is a decomposition group>
Figure SMS_69
The number of coefficients for that layer number. />
Figure SMS_64
Represents->
Figure SMS_67
Intra-area->
Figure SMS_68
Is the final comparison result, +.>
Figure SMS_70
Representing each decomposition coefficient in modulo +.>
Figure SMS_62
The following comparison result, < >>
Figure SMS_65
Representing the result of the comparison of whether the two numbers are equal (i.e., determining whether the two numbers are equal).
In one type of application scenario, the present invention provides,
Figure SMS_80
and->
Figure SMS_71
After comparison, a ranking matrix is obtained>
Figure SMS_77
,/>
Figure SMS_72
The corresponding plaintext content is->
Figure SMS_76
Wherein each ∈>
Figure SMS_79
Is a vector, the first position of the vector +.>
Figure SMS_84
Preserve +.>
Figure SMS_83
Number and->
Figure SMS_87
The number of comparison results, namely 0 or 1, are compared as follows: / >
Figure SMS_74
,/>
Figure SMS_78
The remaining positions of the vector hold numbers that are redundant results may not be of concern. For example->
Figure SMS_81
,/>
Figure SMS_85
Representing->
Figure SMS_82
;/>
Figure SMS_86
,/>
Figure SMS_73
Representing->
Figure SMS_75
In another application scenario, the numbers in the logarithmic set are compared in pairs, wherein two values in the logarithmic set
Figure SMS_97
And (3) with
Figure SMS_89
Is compared with the following: traversal k epsilon 1, u]Comparison->
Figure SMS_95
And->
Figure SMS_91
Is homomorphically evaluated by using a polynomial interpolation method
Figure SMS_92
The result is represented by two values (the comparison result of the original number is obtained by comparing each decomposition coefficient and finally combining): />
Figure SMS_96
. Wherein (1)>
Figure SMS_100
Represents->
Figure SMS_98
And->
Figure SMS_102
Comparison of the two decomposition coefficients, +.>
Figure SMS_88
And->Respectively represent->
Figure SMS_99
Post-decomposition->
Figure SMS_103
Personal systemNumber->
Figure SMS_101
Post-decomposition->
Figure SMS_104
And coefficients. Based on the decomposition radical->
Figure SMS_90
Homomorphism evaluation multiplication times of decomposed polynomial interpolation comparison formula is used +.>
Figure SMS_93
A representation; the homomorphic evaluation multiplication times, namely the multiplication operation times performed on the ciphertext, is one of the steps with the highest calculation cost in homomorphic encryption, and is therefore a key index of protocol performance. The reason for using the polynomial interpolation comparison formula is that homomorphic encryption supports multiplication and addition to ciphertext, and the comparison operation is a nonlinear operation and cannot be completed by directly using the arithmetic operation of addition and multiplication, so that the equivalent polynomial expression of the comparison operation is obtained by using the Lagrangian polynomial interpolation method, and can be completed by using the addition and multiplication, namely, the homomorphic encryption algorithm.
Further, the result is
Figure SMS_118
And performing layering evaluation. Layering aims at reducing multiplication depth, which determines encryption parameter size and further determines protocol performance. The larger the multiplication depth, the larger the encryption parameter, and the worse the scheme performance. The hierarchical evaluation process comprises the following steps: first step, score layer width is
Figure SMS_107
The layering depth is->
Figure SMS_120
The two satisfy the relationship->
Figure SMS_111
The method comprises the steps of carrying out a first treatment on the surface of the The comparison process of each layer is as follows:
Figure SMS_114
the number of multiplications required per layer is +.>
Figure SMS_117
The number of multiplications required for hierarchical evaluation by Result is
Figure SMS_119
LT refers to LessThan, i.e., less than a function, when A<B, the%>
Figure SMS_113
Otherwise
Figure SMS_116
The method comprises the steps of carrying out a first treatment on the surface of the EQ is Equal and returns to 1 when the two numbers are Equal. The second step, the base selection of base decomposition and the selection of layering width should ensure that the value of multiplication times depth is minimum, and the process is from +.>
Figure SMS_105
Increment of =3 (+)>
Figure SMS_109
Prime number in addition), for each +.>
Figure SMS_108
For all less than->
Figure SMS_110
Is->
Figure SMS_112
Traversing and calculating the corresponding depth value. Selecting the +.f. with the minimum corresponding depth value>
Figure SMS_115
And->
Figure SMS_106
And (5) performing basic decomposition and layering operations on the values.
It should be noted that the server repeatedly executes
Figure SMS_122
Obtaining a sorting matrix corresponding to the data to be sorted after the rotation multiplication operation>
Figure SMS_128
,/>
Figure SMS_132
The data bit width corresponding to the data to be sequenced is obtained. For all possible +. >
Figure SMS_121
,/>
Figure SMS_127
Obtaining the comparison result and constructing a matrix +.>
Figure SMS_130
,/>
Figure SMS_133
,/>
Figure SMS_124
. Wherein (1)>
Figure SMS_126
,/>
Figure SMS_131
And->
Figure SMS_134
The results are opposite. Therefore, only the matrix is considered>
Figure SMS_123
Is->
Figure SMS_125
Point(s) of (E)>
Figure SMS_129
The number of the numerical values to be ordered. For example a set of numbers [ a, b, c ]]A is generated by a common ordering matrix<a,a<b,a<c,b<a,b<b,b<c,c<a,c<b,c<c nine comparison results, while actually requiring only a<b,b<c,a<c three results, so the rest are redundant points. The method can remove redundant points and corresponding redundant operations in the common ordering matrix, and is beneficial to improving the ordering efficiency.
Step S300, obtaining a target sorting result corresponding to the data to be sorted according to the sorting encryption result received by the data holding end.
Specifically, after receiving the sorting encryption result, the data holding end decrypts the sorting encryption result according to the private key and obtains hamming weight corresponding to each value to be sorted; and determining the value to be sequenced corresponding to each sequencing position by the data holding end according to the hamming weight to obtain the target sequencing result.
And the server returns the ordering encryption result to the data holding end, and the data holding end uses the private key to decrypt to obtain the hamming weight corresponding to each data. The homomorphic execution process stops ciphertext calculation after obtaining ciphertext of M (M is an ordering matrix, namely a matrix formed by pairwise comparison results of the arrays to be ordered), and one party with homomorphic decryption capability decrypts the ciphertext to obtain plaintext, calculates hamming weight corresponding to each row and orders the dataset to obtain
Figure SMS_135
Wherein, satisfy
Figure SMS_136
,/>
Figure SMS_137
,/>
Figure SMS_138
,/>
Figure SMS_139
. And the data holding end selects the data corresponding to each sorting position according to the hamming weight to finish sorting.
In this embodiment, the encoding and batch processing are repeatedThe technique ensures that the sequencing process only needs to carry out one-time comparison operation, and simultaneously carries out optimal decomposition according to the bit width, thereby reducing the multiplication depth of the sequencing process to the minimum and obviously improving the system efficiency. FIG. 2 is a schematic diagram showing a non-optimized and optimized data structure of a sorting matrix according to an embodiment of the present invention, wherein before optimization, the sorting matrix is shown on the left side of FIG. 2, and has
Figure SMS_140
The points, after optimization, are dropped to as shown on the right side of fig. 2
Figure SMS_141
And (3) a point, which is beneficial to reducing the calculation amount. In this embodiment, the ordered result is positioned to the ordering matrix, instead of the ordered data set ciphertext, so that homomorphic calculation steps are reduced. And the party with homomorphic decryption function carries out plaintext calculation to obtain the ordered data set plaintext, which is beneficial to improving the data security. For a ranking matrix that is not optimized, the upper and lower triangular matrices have duplicate data that affects the data capacity supported in one ranking. In this embodiment, dynamic layering is performed, and if dynamic layering is not performed, the multiplication depth is equal to the bit length of the comparison number; when the bit length is larger, the performance index magnitude decreases as the multiplication depth increases; it can be seen that this embodiment is advantageous for improving the computational performance.
It should be noted that, in the homomorphic operation ordering process, a comparison operation is performed once, and a comparison result between any two ciphertexts can be obtained. All operations of the sorting process are performed on the ciphertext, so that the execution result of any intermediate step cannot be judged, and homomorphic operation does not support judging branch structures such as for loop, if-else and the like. When homomorphic operation sequencing is carried out, determining a decomposition base, and decomposing and comparing the number to be sequenced according to a specific system; and obtaining a sequencing matrix according to the comparison result to finish the sequencing result.
FIG. 3 is a schematic diagram showing a calculation process for comparing and sorting two numbers according to an embodiment of the present invention, in which binary decomposition and single-argument polynomials are taken as examplesA comparison example of two n-bit values A, B is specifically described, where a and B are two values of the size to be compared. As shown in fig. 3, a is binary decomposed into (a 1, a2, …, an), and B is binary decomposed into (B1, B2, …, bn). Bit-by-bit ratio size, the result is expressed as
Figure SMS_142
,i∈[1,n]. ai is less than bi->
Figure SMS_143
The value is noted as 2 and,
Figure SMS_144
the method comprises the steps of carrying out a first treatment on the surface of the ai is equal to bi->
Figure SMS_145
The value is marked as 0, < >>
Figure SMS_146
The method comprises the steps of carrying out a first treatment on the surface of the When ai is greater than bi, the process may be repeated,
Figure SMS_147
the value is recorded as 1, & lt>
Figure SMS_148
The calculation formula of whether A and B are equal is as follows:
Figure SMS_149
EQ (A, B) is 1, A is equal to B; otherwise, a and B are not equal. The judgment formula of whether A is smaller than B is as follows:
Figure SMS_150
Figure SMS_151
if 1, A is smaller than B. />
Figure SMS_152
Representing the length after integer decomposition, i.e. +.>
Figure SMS_153
Given a given
Figure SMS_154
The number to be ordered set consisting of n bits long>
Figure SMS_157
Obtaining a comparison algorithm according to the above>
Figure SMS_160
Ordering matrix of number: />
Figure SMS_155
Wherein->
Figure SMS_159
Time->
Figure SMS_161
Otherwise->
Figure SMS_163
. Calculating the hamming weight of each row of the ordering matrix +.>
Figure SMS_156
,/>
Figure SMS_158
,/>
Figure SMS_162
. Hamming weight is the number of non-zero symbols in a string of symbols, so it is equivalent to the hamming distance of an all-zero symbol string of the same length.
If the hamming weight corresponding to one row
Figure SMS_164
Equal to j+1, then->
Figure SMS_165
The ordering index is j in the ordered data, e.g. if +.>
Figure SMS_166
=1,Then +.>
Figure SMS_167
The first bit in the row is numbered 1. For example, the pre-ordered array is [ a0, a1, a2, a3]=[51,3,4,5]The array becomes [ b0, b1, b2, b3 ] after sorting in descending order]=[51,5,4,3]. Then 3 is subscripted to 1 before ordering and 3 in the ordered array.
As can be seen from the above, in the embodiment, after the data holding end performs homomorphic encryption on the data to be sorted to obtain the encrypted data and sends the encrypted data to the server, decryption is not performed in the server, but sorting processing is directly performed on the encrypted data to obtain the sorted encryption result. Because the data holding end performs homomorphic encryption on the data to be sorted, the sorting of the encrypted data by the server can be mapped to the plaintext data (namely the data to be sorted) to realize the corresponding sorting. Meanwhile, when data processing is carried out in the server, encrypted data is used, namely the server cannot acquire corresponding plaintext data, and the server cannot cause leakage of the plaintext data even if being invaded, so that the data security in the data processing process is improved, and privacy protection is facilitated for the data.
Furthermore, the dynamic layering technology is used for adapting the decomposition base number and the layering processing layer number, so that homomorphic operation complexity in the ordering function is reduced; and redundant points and corresponding redundant operations in the common ordering matrix are removed, homomorphic ordering steps of an executive party after the ciphertext of the ordering matrix is obtained are reduced, the executive party is used for executing the homomorphic ordering steps, the executive step of the ordering process is reasonably divided, and the performance of the ordering process is improved.
In this embodiment, the above process of comparing values based on dynamic layering is further specifically described based on a specific application scenario. Fig. 4 is a schematic flow chart of comparing values when dynamic layering is not performed, and fig. 5 is a schematic flow chart of comparing values when dynamic layering is performed. In this embodiment, taking binary decomposition as an example, two numbers of 15 and 20 are compared for a value of 8 bits in length. As shown in FIG. 4, 1The binary decomposition of 5 is: 00001111 Binary decomposition of 20 to 00010100; comparing binary decomposition representations of two numbers bit by bit, resulting in the result:
Figure SMS_178
,/>
Figure SMS_171
,/>
Figure SMS_174
,/>
Figure SMS_172
,/>
Figure SMS_176
,/>
Figure SMS_175
,/>
Figure SMS_179
,/>
Figure SMS_182
;/>
Figure SMS_185
,/>
Figure SMS_170
,/>
Figure SMS_177
,/>
Figure SMS_180
,/>
Figure SMS_183
,/>
Figure SMS_181
,/>
Figure SMS_184
,/>
Figure SMS_169
the method comprises the steps of carrying out a first treatment on the surface of the Calculate whether 15 and 20 are equal:
Figure SMS_173
the method comprises the steps of carrying out a first treatment on the surface of the So 15 and 20 are not equal (7 multiplications need to be calculated); calculate 15 if less than 20:
Figure SMS_168
The method comprises the steps of carrying out a first treatment on the surface of the Thus 15 is less than 20, the lt multiplication depth is 1 and the total calculated multiplication depth is 7+1=8.
As shown in fig. 5, the binary decomposition of 15 is: 00001111 The binary decomposition of 20 is 00010100, and binary decomposition representations of two numbers are compared bit by bit, resulting in the following:
Figure SMS_194
,/>
Figure SMS_187
,/>
Figure SMS_190
,/>
Figure SMS_198
,/>
Figure SMS_202
Figure SMS_204
,/>
Figure SMS_205
,/>
Figure SMS_197
;/>
Figure SMS_201
,/>
Figure SMS_186
,/>
Figure SMS_192
,/>
Figure SMS_189
,/>
Figure SMS_193
,/>
Figure SMS_196
,/>
Figure SMS_200
Figure SMS_191
. Comparing 8 bits according to the layering width of 2 bits, and comparing the sizes of 2 bits each time: after the first layering, 4 blocks are obtained, and each block is calculated: />
Figure SMS_195
,/>
Figure SMS_199
The method comprises the steps of carrying out a first treatment on the surface of the Obtaining a second layer, wherein the second layer contains a 4-bit LT result and a 4-bit EQ result, continuing to carry out second layering, and calculating LT and EQ of each block (the calculation formula is the same as that of the first layering); and after the second layer of calculation is finished, a 2-bit LT result and a 2-bit EQ result are obtained, and the final result of LT=1 and EQ=0 is obtained by continuing to calculate according to the 2-bit block. The same results were obtained when not stratified, after stratification: a total of 3 layering is calculated, each layering multiplication depth is 1, so the multiplication depths are together: 3×1+1=4. The method is beneficial to reducing the multiplication depth, thereby reducing the calculated amount and improving the calculation efficiency. In FIG. 5, L_first represents +.>
Figure SMS_203
L_second represents the above
Figure SMS_188
As shown in fig. 6, corresponding to the data processing method based on homomorphic encryption, an embodiment of the present invention further provides a data processing system based on homomorphic encryption, where the data processing system based on homomorphic encryption includes:
The data encryption module 410 is configured to homomorphic encrypt data to be ordered through the data holding end to obtain encrypted data;
an encrypted data processing module 420, configured to send the encrypted data to a server through the data holding end, so as to trigger the server to perform a sorting process according to the encrypted data to obtain a sorted encrypted result, and return the sorted encrypted result to the data holding end;
the data sorting module 430 is configured to obtain a target sorting result corresponding to the data to be sorted according to the sorting encryption result received by the data holding end.
In particular, in this embodiment, the specific functions of the data processing system based on homomorphic encryption and the modules thereof may refer to corresponding descriptions in the data processing method based on homomorphic encryption, which are not described herein again.
The above-mentioned dividing manner of each module of the data processing system based on homomorphic encryption is not limited, and is not particularly limited.
Based on the above embodiment, the present invention further provides an intelligent terminal, and a functional block diagram thereof may be shown in fig. 7. The intelligent terminal comprises a processor and a memory. The memory of the intelligent terminal comprises a homomorphic encryption-based data processing program, and the memory provides an environment for the operation of the homomorphic encryption-based data processing program. The data processing program based on homomorphic encryption realizes the steps of any one of the data processing methods based on homomorphic encryption when being executed by a processor. It should be noted that the above-mentioned intelligent terminal may also include other functional modules or units, which are not limited herein.
It will be appreciated by those skilled in the art that the schematic block diagram shown in fig. 7 is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation of the smart terminal to which the present invention is applied, and in particular, the smart terminal may include more or less components than those shown in the drawings, or may combine some components, or have a different arrangement of components.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium stores a homomorphic encryption-based data processing program, and the homomorphic encryption-based data processing program realizes any step of the homomorphic encryption-based data processing method provided by the embodiment of the invention when being executed by a processor.
It should be understood that the sequence number of each step in the above embodiment does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not be construed as limiting the implementation process of the embodiment of the present invention.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the above-described system is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, the specific names of the functional units and modules are only for distinguishing from each other, and are not used for limiting the protection scope of the present invention. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed system/intelligent terminal and method may be implemented in other manners. For example, the system/intelligent terminal embodiments described above are merely illustrative, e.g., the division of the modules or elements described above is merely a logical functional division, and may be implemented in other ways, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer-readable storage medium. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the steps of each method embodiment may be implemented. The computer program comprises computer program code, and the computer program code can be in a source code form, an object code form, an executable file or some intermediate form and the like. The computer readable medium may include: any entity or device capable of carrying the computer program code described above, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. The content of the computer readable storage medium can be appropriately increased or decreased according to the requirements of the legislation and the patent practice in the jurisdiction.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand 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 are not intended to depart from the spirit and scope of the various embodiments of the invention, which are also within the spirit and scope of the invention.

Claims (9)

1. A homomorphic encryption based data processing method, the method comprising:
homomorphic encryption is carried out on data to be sequenced through a data holding end to obtain encrypted data;
the step of homomorphic encryption of the data to be sequenced by the data holding end to obtain encrypted data comprises the following steps:
acquiring data to be ordered through the data holding end, wherein the data to be ordered comprises a plurality of numerical values to be ordered;
obtaining a decomposition base and a layering processing layer number corresponding to the data to be ordered according to the data bit width of the data to be ordered, wherein the decomposition base is a data system when each data to be ordered is decomposed;
Decomposing each value to be sequenced according to the decomposition base and the layering processing layer number to obtain a decomposition vector corresponding to each value to be sequenced;
obtaining the encrypted data through homomorphic encryption according to the decomposition vector;
the layering processing layer number is the layering layer number in the layering comparison processing process in the sorting process, and each coefficient in the decomposition vector is compared when sorting comparison is carried out, and the comparison result is combined into a final comparison result; in the combination process, the large-bit-width data are regarded as the splice of a plurality of small-bit-width sub-data, each small-bit-width sub-data is regarded as the splice of smaller sub-data, each iteration is regarded as a comparison layer, and the total comparison layer number is the layering processing layer number;
sending the encrypted data to a server through the data holding end so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end;
and acquiring a target sorting result corresponding to the data to be sorted through the sorting encryption result received by the data holding end.
2. The homomorphic encryption-based data processing method of claim 1, wherein the encrypted data comprises a row repetition encryption matrix and a column repetition encryption matrix, the encrypted data being obtained by homomorphic encryption based on the decomposition vector, comprising:
Constructing a row repetition coding matrix and a column repetition coding matrix corresponding to the data to be ordered according to the decomposition vectors, wherein the row repetition coding matrix consists of the same target number of rows, the elements in one row of the row repetition coding matrix are respectively the decomposition vectors, the target number is the number of the decomposition vectors, the column repetition coding matrix consists of the same target number of columns, and the elements in one column of the column repetition coding matrix are respectively the decomposition vectors;
and homomorphic encryption is carried out on the row repetition coding matrix through the data holding end to obtain the row repetition encryption matrix, and homomorphic encryption is carried out on the column repetition encryption matrix to obtain the column repetition encryption matrix.
3. The homomorphic encryption-based data processing method according to claim 2, wherein homomorphic encrypting the row repetition coded matrix by the data holding end to obtain the row repetition encrypted matrix, homomorphic encrypting the column repetition encrypted matrix to obtain the column repetition encrypted matrix, comprises:
generating a public key, a private key and an evaluation key through the data holding end, wherein the private key is used for the data holding end to decrypt data, and the evaluation key is used for the server to calculate the data of the encrypted data;
Homomorphic encryption is carried out on the line repetition coding matrix through the data holding end according to the public key to obtain the line repetition coding matrix;
and carrying out homomorphic encryption on the column repetition encryption matrix by the data holding end according to the public key to obtain the column repetition encryption matrix.
4. A homomorphic encryption-based data processing method according to claim 3, wherein said sending, by the data holding end, the encrypted data to a server to trigger the server to perform a sorting process according to the encrypted data to obtain a sorted encrypted result and return the sorted encrypted result to the data holding end comprises:
and sending the evaluation key, the row repeated encryption matrix and the column repeated encryption matrix to the server through the data holding end so as to trigger the server to perform sorting processing according to the evaluation key, the row repeated encryption matrix and the column repeated encryption matrix to obtain a sorting encryption result and return the sorting encryption result to the data holding end.
5. The homomorphic encryption-based data processing method of claim 4, wherein the server performs the sorting process according to the steps of:
Calculating a difference matrix corresponding to the row repeated encryption matrix and the column repeated encryption matrix according to the evaluation key;
performing interpolation polynomials according to the difference matrix to obtain a comparison matrix;
and performing rotation multiplication operation on a plurality of decomposition layers according to the comparison matrix to obtain a sorting matrix corresponding to the data to be sorted, and taking the sorting matrix as the sorting encryption result.
6. The homomorphic encryption-based data processing method according to claim 5, wherein the obtaining, by the sorting encryption result received by the data holding end, the target sorting result corresponding to the data to be sorted comprises:
decrypting the sorting encryption result by the data holding end according to the private key and obtaining the hamming weight corresponding to each value to be sorted;
and determining the value to be sequenced corresponding to each sequencing position by the data holding end according to the weight of each hamming to obtain the target sequencing result.
7. A homomorphic encryption based data processing system, the system comprising:
the data encryption module is used for homomorphic encryption of the data to be sequenced through the data holding end to obtain encrypted data;
The step of homomorphic encryption of the data to be sequenced by the data holding end to obtain encrypted data comprises the following steps:
acquiring data to be ordered through the data holding end, wherein the data to be ordered comprises a plurality of numerical values to be ordered;
obtaining a decomposition base and a layering processing layer number corresponding to the data to be ordered according to the data bit width of the data to be ordered, wherein the decomposition base is a data system when each data to be ordered is decomposed;
decomposing each value to be sequenced according to the decomposition base and the layering processing layer number to obtain a decomposition vector corresponding to each value to be sequenced;
obtaining the encrypted data through homomorphic encryption according to the decomposition vector;
the layering processing layer number is the layering layer number in the layering comparison processing process in the sorting process, and each coefficient in the decomposition vector is compared when sorting comparison is carried out, and the comparison result is combined into a final comparison result; in the combination process, the large-bit-width data are regarded as the splice of a plurality of small-bit-width sub-data, each small-bit-width sub-data is regarded as the splice of smaller sub-data, each iteration is regarded as a comparison layer, and the total comparison layer number is the layering processing layer number;
The encrypted data processing module is used for sending the encrypted data to a server through the data holding end so as to trigger the server to perform sorting processing according to the encrypted data to obtain a sorting encryption result and return the sorting encryption result to the data holding end;
and the data ordering module is used for acquiring a target ordering result corresponding to the data to be ordered according to the ordering encryption result received by the data holding end.
8. An intelligent terminal, characterized in that it comprises a memory, a processor and a homomorphic encryption based data processing program stored on the memory and executable on the processor, the homomorphic encryption based data processing program implementing the steps of the homomorphic encryption based data processing method according to any one of claims 1-6 when executed by the processor.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a homomorphic encryption based data processing program, which when executed by a processor, implements the steps of the homomorphic encryption based data processing method according to any one of claims 1-6.
CN202310406264.6A 2023-04-17 2023-04-17 Homomorphic encryption-based data processing method, system and related equipment Active CN116150795B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310406264.6A CN116150795B (en) 2023-04-17 2023-04-17 Homomorphic encryption-based data processing method, system and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310406264.6A CN116150795B (en) 2023-04-17 2023-04-17 Homomorphic encryption-based data processing method, system and related equipment

Publications (2)

Publication Number Publication Date
CN116150795A CN116150795A (en) 2023-05-23
CN116150795B true CN116150795B (en) 2023-07-14

Family

ID=86352701

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310406264.6A Active CN116150795B (en) 2023-04-17 2023-04-17 Homomorphic encryption-based data processing method, system and related equipment

Country Status (1)

Country Link
CN (1) CN116150795B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116975935B (en) * 2023-09-22 2023-12-26 北京天润基业科技发展股份有限公司 Data comparison method, storage medium and electronic device
CN117349868B (en) * 2023-12-04 2024-04-12 粤港澳大湾区数字经济研究院(福田) Fully homomorphic encryption and decryption method based on GPU, electronic equipment and storage medium
CN117435200B (en) * 2023-12-21 2024-04-16 粤港澳大湾区数字经济研究院(福田) Homomorphic encryption service code translation method, device, equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111510281A (en) * 2020-06-29 2020-08-07 腾讯科技(深圳)有限公司 Homomorphic encryption method and device
CN113240045A (en) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 Data dimension reduction method and device and related equipment
CN113746620A (en) * 2021-09-13 2021-12-03 深圳前海微众银行股份有限公司 Homomorphic encryption method, apparatus, medium, and computer program product
CN113812114A (en) * 2019-03-18 2021-12-17 英艾特股份公司 Homomorphic encryption
CN114817999A (en) * 2022-06-28 2022-07-29 北京金睛云华科技有限公司 Outsourcing privacy protection method and device based on multi-key homomorphic encryption

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190109701A1 (en) * 2016-08-02 2019-04-11 X-Logos, LLC Methods and systems for enhanced data-centric homomorphic encryption sorting using geometric algebra
CN107491497B (en) * 2017-07-25 2020-08-11 福州大学 Multi-user multi-keyword sequencing searchable encryption system supporting query in any language
EP3503456A1 (en) * 2017-12-19 2019-06-26 Koninklijke Philips N.V. Homomorphic encryption for password authentication
CN108718231B (en) * 2018-07-04 2023-05-23 深圳大学 Fully homomorphic encryption method, fully homomorphic encryption device and computer readable storage medium
CN111464282B (en) * 2019-01-18 2024-04-26 百度在线网络技术(北京)有限公司 Homomorphic encryption-based data processing method and device
CN110309674B (en) * 2019-07-04 2021-10-01 浙江理工大学 Ordering method based on fully homomorphic encryption
CN112182660A (en) * 2020-10-28 2021-01-05 深圳前海微众银行股份有限公司 Data sorting method and device
CN113111090B (en) * 2021-04-15 2023-01-06 西安电子科技大学 Multidimensional data query method based on order-preserving encryption
CN113794548A (en) * 2021-09-13 2021-12-14 深圳前海微众银行股份有限公司 Homomorphic encryption method, apparatus, medium, and computer program product
CN114168977A (en) * 2021-11-07 2022-03-11 西安电子科技大学 Cipher text-based numerical value safe sorting method and system
CN115118520B (en) * 2022-07-21 2023-06-02 建信金融科技有限责任公司 Data processing method, device and server
CN115834020A (en) * 2022-11-07 2023-03-21 阿里巴巴(中国)有限公司 Homomorphic encryption bootstrap method and device, processor, system on chip and computing equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113812114A (en) * 2019-03-18 2021-12-17 英艾特股份公司 Homomorphic encryption
CN111510281A (en) * 2020-06-29 2020-08-07 腾讯科技(深圳)有限公司 Homomorphic encryption method and device
CN113240045A (en) * 2021-06-01 2021-08-10 平安科技(深圳)有限公司 Data dimension reduction method and device and related equipment
CN113746620A (en) * 2021-09-13 2021-12-03 深圳前海微众银行股份有限公司 Homomorphic encryption method, apparatus, medium, and computer program product
CN114817999A (en) * 2022-06-28 2022-07-29 北京金睛云华科技有限公司 Outsourcing privacy protection method and device based on multi-key homomorphic encryption

Also Published As

Publication number Publication date
CN116150795A (en) 2023-05-23

Similar Documents

Publication Publication Date Title
CN116150795B (en) Homomorphic encryption-based data processing method, system and related equipment
CN113297606B (en) Color quantum image encryption and decryption method based on multiple chaos and DNA operation
CN1993922A (en) Stream cipher combining system and method
CN115276947B (en) Private data processing method, device, system and storage medium
CN102693398A (en) Data encryption method and system
WO2018211676A1 (en) Multiparty computation method, apparatus and program
CN115549891B (en) Homomorphic encryption method, homomorphic decryption method, homomorphic calculation method and equipment
CN112116672B (en) Color image preservation thumbnail encryption algorithm based on genetic algorithm
CN116484395A (en) Security calculation method based on privacy data and related equipment
CN113098675B (en) Binary data encryption system and method based on polynomial complete homomorphism
US6125183A (en) Cryptosystem for optical storage
CN117254897B (en) Identity base matrix homomorphic encryption method based on fault-tolerant learning
CN116707804B (en) Method and equipment for enhancing FF1 format reserved encryption security
CN116170142B (en) Distributed collaborative decryption method, device and storage medium
CN114465708B (en) Privacy data processing method, device, system, electronic equipment and storage medium
CN109495478B (en) Block chain-based distributed secure communication method and system
CN115103080B (en) Image encryption method and system based on DNA triploid variation
CN105099693A (en) Transmission method and transmission device
CN113612899A (en) Image encryption method based on RNA and pixel depth
Jasra et al. Mapping images over elliptic curve for encryption
KR102257779B1 (en) Tweaked interpolation for multiparty computation
NL9202284A (en) Block encryption based on algebraic encoding methods.
CN117527223B (en) Distributed decryption method and system for quantum-password-resistant grid
CN111314051A (en) Encryption and decryption method and device
CN116232562B (en) Model reasoning method and device

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