Data processing method, device, equipment and storage medium
By constructing an n-dimensional plaintext vector and using a preset key matrix for encoding and decoding, the low efficiency problem caused by the complex operation of the Paillier encryption system is solved, and more efficient data processing is achieved.
Patent Information
- Application Number
- CN202211262422.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2042-10-14
AI Technical Summary
In the prior art, the underlying operations of the Paillier encryption system are complex, resulting in low data processing efficiency.
Based on n corresponding plaintext messages to be processed, an n-dimensional plaintext vector is constructed for encoding and decoding. The code text addition operation is performed through the code text operation end, and the preset encryption and decryption key matrix is used for encoding and decoding to reduce the number of calculations.
It improves data processing efficiency, reduces the number of encoding and decoding and code text addition calculations, and improves processing efficiency.
Smart Images

Figure CN115630395B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular to a data processing method, apparatus, device, and storage medium. Background Art
[0002] Privacy computing refers to a set of technologies that implement data analysis and calculations while protecting the data itself from external leakage, so as to achieve the goal of "available and invisible" data, and realize the transformation and release of data value while fully protecting data and privacy security.
[0003] In related technologies, a Paillier encryption system is usually used to encrypt data. However, due to the complex underlying operations of the encryption system, the data processing efficiency is low. Summary of the Invention
[0004] In order to solve the above technical problems, an embodiment of the present disclosure provides a data processing method.
[0005] In a first aspect, the present disclosure provides a data processing method, the method comprising:
[0006] Based on the n plaintext messages to be processed that have corresponding relationships, an n-dimensional plaintext vector is constructed as the plaintext vector to be processed; wherein n is a natural number;
[0007] Encoding the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed, and sending the code text to a code text operation end; the code text operation end is used to perform a code text addition operation based on the code text according to target operation requirements to obtain a code text operation result;
[0008] The code text operation result returned by the code text operation end is received, and the code text operation result is decoded to obtain a plaintext vector corresponding to the code text operation result; the plaintext vector corresponding to the code text operation result is used to provide a plaintext message for the target operation requirement.
[0009] In an optional implementation, encoding the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed includes:
[0010] Encoding the plaintext vector to be processed using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed; wherein the preset encryption key matrix includes n encryption key vectors, the n encryption key vectors are respectively from n subspaces obtained by orthogonally partitioning the real vector space, and the encryption key vectors have a mapping relationship with the subspaces;
[0011] Correspondingly, decoding the code text operation result to obtain a plaintext vector corresponding to the code text operation result includes:
[0012] The code text operation result is decoded using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result; wherein the preset decryption key matrix includes the transpose of n decryption key vectors, the n decryption key vectors are respectively from the n subspaces, the decryption key vectors have a mapping relationship with the subspaces, and the product between the transpose of the decryption key vector and the encryption key vector in the same subspace is 1.
[0013] In an optional embodiment, before encoding the to-be-processed plaintext vector using a preset encryption key matrix to obtain a code text corresponding to the to-be-processed plaintext vector, the method further includes:
[0014] Obtaining at least one random factor vector from a first subspace; the first subspace is obtained by orthogonally partitioning the real vector space, and the first subspace is orthogonal to the n subspaces;
[0015] Accordingly, encoding the plaintext vector to be processed by using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed includes:
[0016] The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the to-be-processed plaintext vector.
[0017] In an optional embodiment, before encoding the plaintext vector using the preset encryption key matrix and the at least one random factor vector to obtain the code text corresponding to the plaintext vector to be processed, the method further includes:
[0018] Acquire real numbers having the same number as the at least one random factor vector from a real number field; the real numbers and the random factor vector have a mapping relationship;
[0019] Accordingly, encoding the to-be-processed plaintext vector using the preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the to-be-processed plaintext vector includes:
[0020] The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the random factor vector and the real number having a mapping relationship, to obtain a code text corresponding to the to-be-processed plaintext vector.
[0021] In an optional implementation, encoding the plaintext vector to be processed using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed includes:
[0022] The product of the preset encryption key matrix and the plaintext vector to be processed is determined as the code text corresponding to the plaintext vector to be processed.
[0023] In an optional implementation, encoding the plaintext vector to be processed using a preset encryption key matrix and the random factor vector and the real number having a mapping relationship to obtain a code text corresponding to the plaintext vector to be processed includes:
[0024] Determine the product of the preset encryption key matrix and the plaintext vector to be processed as the first intermediate code text;
[0025] and accumulating values obtained by multiplying the random factor vectors having a mapping relationship with the real numbers to obtain an accumulated value, and determining the accumulated value as a second intermediate code text;
[0026] A value obtained by adding the first intermediate code text and the second intermediate code text is determined as the code text corresponding to the plaintext vector to be processed.
[0027] In an optional implementation, the decoding of the coded text operation result using a preset decryption key matrix to obtain a plaintext vector corresponding to the coded text operation result includes:
[0028] The product of the preset decryption key matrix and the code text operation result is determined as the plaintext vector corresponding to the code text operation result.
[0029] In an optional embodiment, before encoding the to-be-processed plaintext vector using a preset encryption key matrix to obtain a code text corresponding to the to-be-processed plaintext vector, the method further includes:
[0030] Determine real symmetric matrices from real vector spaces;
[0031] After performing orthogonal decomposition on the real symmetric matrix, a first matrix is obtained;
[0032] Based on the column vectors in the first matrix, the n subspaces are respectively spanned.
[0033] In an optional implementation, after performing orthogonal decomposition on the real symmetric matrix to obtain the first matrix, the method further includes:
[0034] The first subspace is formed based on m consecutive column vectors in the first matrix, where m is a natural number.
[0035] In a second aspect, the present disclosure provides a data processing device, the device comprising:
[0036] A construction module, configured to construct an n-dimensional plaintext vector based on n plaintext messages to be processed having a corresponding relationship, as the plaintext vector to be processed; wherein n is a natural number;
[0037] An encoding module, configured to encode the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed;
[0038] A sending module, configured to send the code text to a code text operation terminal; the code text operation terminal is configured to perform a code text addition operation based on the code text according to target operation requirements to obtain a code text operation result;
[0039] A receiving module, configured to receive the code text operation result returned by the code text operation end;
[0040] A decoding module is used to decode the code text operation result to obtain a plain text vector corresponding to the code text operation result; the plain text vector corresponding to the code text operation result is used to provide a plain text message for the target operation requirement.
[0041] In a third aspect, the present disclosure provides a computer-readable storage medium, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a terminal device, the terminal device implements the above method.
[0042] In a fourth aspect, the present disclosure provides a data processing device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method when executing the computer program.
[0043] In a fifth aspect, the present disclosure provides a computer program product, which includes a computer program / instructions, and the computer program / instructions implement the above method when executed by a processor.
[0044] The technical solution provided by the embodiments of the present disclosure has at least the following advantages compared with the prior art:
[0045] The disclosed embodiments provide a data processing method. First, an n-dimensional plaintext vector is constructed based on n corresponding plaintext messages to be processed, as the plaintext vector to be processed, where n is a natural number. The plaintext vector to be processed is then encoded to obtain a codetext corresponding to the plaintext vector to be processed, and the codetext is sent to a codetext operation terminal. The codetext operation terminal is configured to perform a codetext addition operation on the codetext according to a target operation requirement to obtain a codetext operation result. The codetext operation result returned by the codetext operation terminal is received and decoded to obtain a plaintext vector corresponding to the codetext operation result. The plaintext vector corresponding to the codetext operation result is used to provide a plaintext message for the target operation requirement. Because the disclosed embodiments construct the n corresponding plaintext messages to be processed as the plaintext vector to be processed and perform encoding, decoding, and codetext addition calculations based on the plaintext vector to be processed, the number of encoding, decoding, and codetext addition calculations can be reduced, thereby improving the processing efficiency of the plaintext messages to be processed. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0047] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 A flowchart of a data processing method provided in an embodiment of the present disclosure;
[0049] Figure 2 A flowchart of another data processing method provided by an embodiment of the present disclosure;
[0050] Figure 3 A data interaction diagram of a data processing method provided by an embodiment of the present disclosure;
[0051] Figure 4 A schematic diagram of a real vector space provided in an embodiment of the present disclosure;
[0052] Figure 5 A schematic structural diagram of a data processing device provided in an embodiment of the present disclosure;
[0053] Figure 6 A schematic structural diagram of a data processing device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0054] In order to more clearly understand the above-mentioned objectives, features and advantages of the present disclosure, the scheme of the present disclosure will be further described below. It should be noted that the embodiments of the present disclosure and the features therein can be combined with each other in the absence of conflict.
[0055] In the following description, many specific details are set forth to facilitate a full understanding of the present disclosure, but the present disclosure may also be implemented in other ways different from those described herein; it is obvious that the embodiments in the specification are only part of the embodiments of the present disclosure, rather than all of the embodiments.
[0056] Privacy computing refers to a set of technologies that implement data analysis and calculations while protecting the data itself from external leakage, so as to achieve the goal of "available and invisible" data, and realize the transformation and release of data value while fully protecting data and privacy security.
[0057] In related technologies, a Paillier encryption system is usually used to encrypt data. However, due to the complex underlying operations of the encryption system, the data processing efficiency is low.
[0058] To this end, an embodiment of the present disclosure provides a data processing method. First, an n-dimensional plaintext vector is constructed based on n corresponding plaintext messages to be processed, as the plaintext vector to be processed, where n is a natural number. Then, the plaintext vector to be processed is encoded to obtain a codetext corresponding to the plaintext vector to be processed, and the codetext is sent to a codetext operation terminal. The codetext operation terminal is used to perform a codetext addition operation on the codetext according to a target operation requirement to obtain a codetext operation result. The codetext operation result returned by the codetext operation terminal is received and decoded to obtain a plaintext vector corresponding to the codetext operation result. The plaintext vector corresponding to the codetext operation result is used to provide a plaintext message for the target operation requirement. Because the embodiment of the present disclosure constructs the n corresponding plaintext messages to be processed as the plaintext vector to be processed and performs encoding, decoding, and codetext addition calculations based on the plaintext vector to be processed, the number of encoding, decoding, and codetext addition calculations can be reduced, thereby improving the processing efficiency of the plaintext messages to be processed.
[0059] Based on this, the present disclosure provides a data processing method, referring to Figure 1 , is a flow chart of a data processing method provided in an embodiment of the present disclosure, the method comprising:
[0060] S101: Constructing an n-dimensional plaintext vector based on n plaintext messages to be processed that have a corresponding relationship, as the plaintext vector to be processed.
[0061] Wherein, n is a natural number.
[0062] Among them, the n pending plaintext messages with a corresponding relationship mean that the n pending plaintext messages have the same identifier. For example, the pending plaintext message of user a on platform A is a1, the pending plaintext message on platform B is a2, and the pending plaintext message on platform C is a3. Then a1, a2, and a3 are pending plaintext messages with the same identifier, that is, they are all pending plaintext messages of user a, that is, the pending plaintext messages a1, a2, and a3 belong to 3 pending plaintext messages with a corresponding relationship.
[0063] A plaintext vector is an n-dimensional plaintext vector constructed by n plaintext messages to be processed with corresponding relationships. Assume that n plaintext messages to be processed are x1,…,x n ∈R, where R is the real number field, according to x1,…,x n The constructed n-dimensional plaintext vector x is as follows:
[0064]
[0065] S102: Encode the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed, and send the code text to a code text operation end.
[0066] The code text operation end is used to perform a code text addition operation based on the code text according to the target operation requirements to obtain a code text operation result.
[0067] Specifically, the target operation requirement refers to the requirement for performing code text addition operations on code texts in the plaintext vector to be processed.
[0068] To facilitate understanding of the target operation requirements, for example, assume that there are two companies, advertiser D and content platform E, among which the potential target customers of advertiser D are customer 1 and customer 2, and content platform E has the data of customer 1, customer 2 and customer 3 in October, November and December respectively. That is, the data of customer 1 in October, November and December held by content platform E constitute the plaintext vector 1 to be processed, the data of customer 2 in October, November and December constitute the plaintext vector 2 to be processed, and the data of customer 3 in October, November and December constitute the plaintext vector 3 to be processed. By encoding the above-mentioned plaintext vector 1 to be processed, the plaintext vector 2 to be processed and the plaintext vector 3 to be processed respectively, the code text corresponding to the plaintext vector 1 to be processed, the code text corresponding to the plaintext vector 2 to be processed and the code text corresponding to the plaintext vector 3 to be processed are obtained.
[0069] Since the potential target customers of advertiser D are customer 1 and customer 2 (i.e., target operation requirements), it is only necessary to perform code text addition operations on the code text corresponding to the plaintext vector 1 to be processed and the code text corresponding to the plaintext vector 2 to be processed.
[0070] Correspondingly, the code text operation end may be the server corresponding to the above-mentioned content platform E.
[0071] In an optional implementation, a preset encryption key matrix can be used to encode the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed. Specifically, the description of encoding the plaintext vector to be processed using a preset encryption key matrix is described in the following embodiments, and this disclosure does not elaborate on this.
[0072] It should be noted that the embodiments of the present disclosure do not limit the manner in which plaintext vector encoding is processed.
[0073] S103: Receive the code text operation result returned by the code text operation end, and decode the code text operation result to obtain a plain text vector corresponding to the code text operation result.
[0074] Among them, the plaintext vector corresponding to the code text operation result is used to provide plaintext messages for the target operation requirements.
[0075] In an optional implementation, a preset decryption key matrix can be used to decode the code text operation result to obtain a plaintext vector corresponding to the code text operation result. Specifically, the description of using the preset decryption key matrix to encode the plaintext vector to be processed is described in the following embodiment, and this disclosure does not elaborate on it here.
[0076] It should be noted that the embodiments of the present disclosure do not limit the manner in which the plaintext vector is decoded.
[0077] In the data processing method provided by the present disclosure, an n-dimensional plaintext vector is first constructed based on n corresponding plaintext messages to be processed, as the plaintext vector to be processed, where n is a natural number. The plaintext vector to be processed is then encoded to obtain a codetext corresponding to the plaintext vector to be processed, and the codetext is sent to a codetext operation terminal. The codetext operation terminal is used to perform a codetext addition operation on the codetext according to a target operation requirement to obtain a codetext operation result, receive the codetext operation result returned by the codetext operation terminal, and decode the codetext operation result to obtain a plaintext vector corresponding to the codetext operation result. The plaintext vector corresponding to the codetext operation result is used to provide a plaintext message for the target operation requirement. Because the embodiment of the present disclosure constructs the n corresponding plaintext messages to be processed as the plaintext vector to be processed and performs encoding, decoding, and codetext addition calculations based on the plaintext vector to be processed, the number of encoding, decoding, and codetext addition calculations can be reduced, thereby improving the processing efficiency of the plaintext messages to be processed.
[0078] Based on the above embodiments, the present disclosure also provides a data processing method, referring to Figure 2 , which is a flowchart of another data processing method provided in an embodiment of the present disclosure.
[0079] S201: Constructing an n-dimensional plaintext vector based on n plaintext messages to be processed that have a corresponding relationship, as the plaintext vector to be processed.
[0080] Wherein, n is a natural number.
[0081] It should be noted that step S201 is the same as the above-mentioned step S101. Please refer to the description of step S101 for details, which will not be described in detail here.
[0082] S202: Encode the plaintext vector to be processed using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed, and send the code text to a code text operation end.
[0083] The preset encryption key matrix includes n encryption key vectors, and the n encryption key vectors are respectively from n subspaces obtained by orthogonally dividing the real vector space, and the encryption key vectors have a mapping relationship with the subspaces.
[0084] The real vector space refers to a vector space on the real number field R, which is used to generate a preset encryption key matrix. Specifically, the preset encryption key matrix generation process is as follows:
[0085] First, randomly transform the real vector space R N Orthogonal partitioning into U1,…,U n subspaces, namely from U1,…,U n If a vector is extracted from any two subspaces in the subspaces, the two extracted vectors must be orthogonal; where N ≥ n, then a vector is extracted from each of the n subspaces to obtain the encryption key vectors u1,…,u n , used to form the preset encryption key matrix [u1…u n ].
[0086] It should be noted that the encryption key vector has a mapping relationship with the subspace. Different encryption key vectors come from different subspaces, that is, the encryption key vector u1 comes from subspace U1, the encryption key vector u2 comes from subspace U2, ..., the encryption key vector u n From subspace U n .
[0087] In addition, the real vector space R N Orthogonal partitioning into U1,…,U n There are many ways to form n subspaces. In an optional implementation, a real symmetric matrix is determined from a real vector space, and an orthogonal decomposition is performed on the real symmetric matrix to obtain a first matrix. Based on the column vectors in the first matrix, n subspaces are respectively formed.
[0088] A real symmetric matrix is one in which the number of rows and columns is the same, all elements are real numbers, and the transpose of a matrix is equal to the matrix itself.
[0089] The first matrix refers to an orthogonal matrix obtained by performing orthogonal decomposition on a real symmetric matrix.
[0090] In the embodiment of the present disclosure, from the real vector space R N Randomly select a real symmetric matrix M∈R N×N , after performing orthogonal decomposition on the real symmetric matrix M, we get M = Q∧Q T , where Q is the first matrix, Λ is the diagonal matrix, Q T is the transposed matrix of the first matrix, Q,Q T ,Λ∈R N×N , let U i The space spanned by the i-th column of the first matrix Q is formed based on the column vectors in the first matrix Q, and is respectively spanned into U1,…,U n subspaces.
[0091] For example, randomly select u i ,u i ′∈U i , i=1,…,n, satisfies u i T u i ′=1; randomly select u i ∈U i ,u j ∈U j , i=1,…,n,j=1,…,n,i≠j,satisfy u i T u j =0.
[0092] In an optional implementation, the product of a preset encryption key matrix and the plaintext vector to be processed is determined as the code text corresponding to the plaintext vector to be processed.
[0093] In the embodiment of the present disclosure, after obtaining the preset encryption key matrix and the plaintext vector to be processed, the product of the preset encryption key matrix and the plaintext vector to be processed can be determined as the code text corresponding to the plaintext vector to be processed.
[0094] Specifically, assuming that the plaintext vector to be processed is The default encryption key matrix W = [u1…u n ], then the code text E(x′) corresponding to the plaintext vector x′ to be processed is E(x′)=Wx′.
[0095] S203: Receive the code text operation result returned by the code text operation end, decode the code text operation result using a preset decryption key matrix, and obtain a plaintext vector corresponding to the code text operation result.
[0096] The preset decryption key matrix includes the transpose of n decryption key vectors, the n decryption key vectors come from n subspaces respectively, the decryption key vectors and the subspaces have a mapping relationship, and the product between the transpose of the decryption key vector and the encryption key vector in the same subspace is 1.
[0097] The code text operation result is obtained after the code text operation end performs a code text addition operation on the code text.
[0098] The code text operation terminal is used to perform operations on the code text, such as code text addition operations.
[0099] In the embodiment of the present disclosure, it is assumed that the code text corresponding to the plaintext vector x to be processed is E(x), and the code text corresponding to the plaintext vector x′ to be processed is E(x′). After determining the code texts E(x) and E(x′) corresponding to the plaintext vectors to be processed, the code texts are sent to the code text operation end, and the code text operation end performs a code text addition operation on the code texts E(x) and E(x′), obtains the corresponding code text operation result E(x)+E(x′) and returns it.
[0100] In practical applications, the number of plaintext vectors to be processed that participate in the same code text addition operation may include more than two. The specific processing method can be understood with reference to the above embodiment.
[0101] Specifically, the process of generating the preset decryption key matrix is as follows:
[0102] In the real vector space R N Orthogonal partitioning into U1,…,U n After the n subspaces are generated, the corresponding decryption key vectors are extracted from the above n subspaces. Among them, the decryption key vector has a mapping relationship with the subspace, and then the decryption key vector Transpose As a preset decryption key matrix in, u i is the encryption key vector.
[0103] It should be noted that the decryption key vector and encryption key vector u1,…,u n Subspaces from the same orthogonal partition, such as u1 all come from U1, u2 all come from U2, u n All from U n .
[0104] In an optional implementation, the real vector space R is randomly N Divided into U1,…,U n subspaces, N ≥ n, such that U1,…,U n It is an R N Orthogonal partitioning of space, i.e. random sampling Satisfy Then extract the corresponding encryption key vectors u1…u from the above n subspaces respectively n and the decryption key vector After obtaining the encryption key vector u1…u n and the decryption key vector After that, the encryption key vector u1…u n Composed of the preset encryption key matrix [u1…u n ], decryption key vector Transpose Composition of preset decryption key matrix
[0105] In the embodiment of the present disclosure, after obtaining the code text operation result, the code text operation result is decoded using a preset decryption key matrix to obtain a plaintext vector to be processed corresponding to the code text operation result.
[0106] In an optional implementation, after obtaining the code text operation result, the product of the preset decryption key matrix and the code text operation result is determined as the plaintext vector to be processed corresponding to the code text operation result.
[0107] Assume that the code text operation result D = E(x) + E(x′), and the preset encryption key matrix W = [u1…u n ], preset decryption key matrix
[0108] Wherein, E(x) is the code text corresponding to the plaintext vector x to be processed, and E(x′) is the code text corresponding to the plaintext vector x′ to be processed.
[0109] In the embodiment of the present disclosure, after obtaining the code text operation result D, the plaintext vector D′ to be processed corresponding to the code text operation result is calculated based on the product of the preset decryption key matrix and the code text operation result, where E(x)=Wx, E(x′)=Wx′ and
[0110] The specific calculation process of the plaintext vector D′ to be processed corresponding to the code text operation result is as follows:
[0111]
[0112] Among them, x+x′ is the plaintext vector to be processed corresponding to the code text operation result E(x)+E(x′).
[0113] In a data processing method provided by an embodiment of the present disclosure, an n-dimensional plaintext vector is first constructed based on n corresponding plaintext messages to be processed, as the plaintext vector to be processed, where n is a natural number. The plaintext vector to be processed is encoded using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed, and the code text is sent to a code text operation end, wherein the preset encryption key matrix includes n encryption key vectors, and the n encryption key vectors are respectively derived from n subspaces obtained by orthogonal partitioning of the real vector space, and the encryption key vectors and the subspaces have a mapping relationship. Then, the code text operation result returned by the code text operation end is received, and the code text operation result is decoded using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result, wherein the preset decryption key matrix includes the transpose of n decryption key vectors, and the n decryption key vectors are respectively derived from n subspaces, and the decryption key vectors and the subspaces have a mapping relationship, and the product between the transpose of the decryption key vector and the encryption key vector in the same subspace is 1. Since the embodiment of the present disclosure constructs n corresponding plaintext messages to be processed into plaintext vectors to be processed, and performs encoding, decoding and code-text addition calculations based on the plaintext vectors to be processed, the number of encoding, decoding and code-text addition calculations can be reduced, thereby improving the processing efficiency of the plaintext messages to be processed.
[0114] In order to improve the security of data during data processing, the present disclosure also provides a data processing method, referring to Figure 3 , is a data interaction diagram of a data processing method provided by an embodiment of the present disclosure, wherein the data processing method includes:
[0115] S301: The data processing end constructs an n-dimensional plaintext vector based on n corresponding plaintext messages to be processed as the plaintext vector to be processed.
[0116] Wherein, n is a natural number.
[0117] The data processing end can be a laptop, desktop computer, server or server cluster, etc.
[0118] It should be noted that step S301 is the same as the above-mentioned step S101. Please refer to the description of step S101 for details, which will not be described in detail here.
[0119] S302: Obtain at least one random factor vector from the first subspace.
[0120] The first subspace is obtained by orthogonally partitioning the real vector space, and the first subspace is orthogonal to the n subspaces.
[0121] The first subspace is used to encrypt the plaintext vector to be processed, so that the corresponding code text after the same plaintext vector to be processed is encrypted has randomness, thereby improving the security of data processing.
[0122] Specifically, the first subspace is obtained as follows:
[0123] Randomly transform the real vector space R N Orthogonal partitioning into n subspaces (U1,…,U n ) and a first subspace V, where N≥n+1, the first subspace V is orthogonal to the n subspaces, that is, any random factor vector v is taken from the first subspace V such that:
[0124]
[0125] For U i The transpose of any vector in the subspace.
[0126] In an optional embodiment, a real symmetric matrix is determined from a real vector space, and after performing orthogonal decomposition on the real symmetric matrix, a first matrix is obtained. Based on the column vectors in the first matrix, n subspaces are respectively spanned, and based on m consecutive column vectors in the first matrix, a first subspace is spanned; m is a natural number.
[0127] A real symmetric matrix is one in which the number of rows and columns is the same, all elements are real numbers, and the transpose of a matrix is equal to the matrix itself.
[0128] The first matrix refers to an orthogonal matrix obtained by performing orthogonal decomposition on a real symmetric matrix.
[0129] In the embodiment of the present disclosure, from the real vector space R N Randomly select a real symmetric matrix M′∈R N×N , where N≥n+1, after performing orthogonal decomposition on the real symmetric matrix M′, we get M′=Q∧Q T , where Q is the first matrix, Λ is the diagonal matrix, Q T is the transposed matrix of the first matrix, Q,Q T ,Λ∈R N×N , let U i The space spanned by the i-th column of the first matrix Q is formed based on the column vectors in the first matrix Q, and is respectively spanned into U1,…,U n subspaces, V is the first subspace spanned by the continuous m column vectors of the first matrix Q, such as Figure 4 As shown, the left side is the n subspaces spanned by the first matrix, and the right side is the first subspace spanned by the first matrix.
[0130] S303: Encode the plaintext vector to be processed using a preset encryption key matrix and at least one random factor vector to obtain a code text corresponding to the plaintext vector to be processed.
[0131] The preset encryption key matrix includes n encryption key vectors, and the n encryption key vectors are respectively from n subspaces obtained by orthogonally dividing the real vector space, and the encryption key vectors have a mapping relationship with the subspaces.
[0132] The random factor vector has a mapping relationship with the first subspace.
[0133] In the embodiment of the present disclosure, the real vector space R is randomly N Orthogonal partitioning into U1,…,U n subspaces and a first subspace V, where N≥n+1, and then extract the corresponding encryption key vectors u1,…,u from the above n subspaces respectively. n Composed of the preset encryption key matrix [u1…u n ], extract K>0 random factor vectors v1,…,v from the first subspace V K , using the preset encryption key matrix [u1…u n ] and random factor vectors v1,…,v K , encode the plaintext vector to be processed and obtain the code text corresponding to the plaintext vector to be processed.
[0134] In an optional embodiment, real numbers with the same number as at least one random factor vector are obtained from the real number field, and the plaintext vector to be processed is encoded using a preset encryption key matrix and random factor vectors and real numbers with a mapping relationship to obtain a code text corresponding to the plaintext vector to be processed.
[0135] Among them, there is a mapping relationship between real numbers and random factor vectors.
[0136] In the embodiment of the present disclosure, K>0 random factor vectors v1,…,v are extracted from the first subspace V. K , extract K real numbers α1,…,α from the real number field R K , and then use the preset encryption key matrix and the random factor vector and real number with a mapping relationship to encode the plaintext vector to be processed and obtain the code text corresponding to the plaintext vector to be processed.
[0137] In another optional implementation, the product of the preset encryption key matrix and the plaintext vector to be processed is determined as the first intermediate code text, and then the values obtained by multiplying the random factor vectors with a mapping relationship and the corresponding real numbers are accumulated to obtain an accumulated value, and the accumulated value is determined as the second intermediate code text, and then the value obtained by adding the first intermediate code text and the second intermediate code text is determined as the code text corresponding to the plaintext vector to be processed.
[0138] Among them, there is a mapping relationship between real numbers and random factor vectors.
[0139] The process of generating the first intermediate code text is the same as the process of generating the code text corresponding to the plaintext vector to be processed in step S102 above, and will not be described in detail here.
[0140] The generation process of the second intermediate code text is as follows:
[0141] First, K>0 random factor vectors v1,…,v are extracted from the first subspace V. K , extract K real numbers α1,…,α in the real number field R K , then accumulate the values after multiplying the random factor vector with the mapping relationship and the corresponding real number to get the accumulated value The accumulated value is the second intermediate code text.
[0142] In the embodiment of the present disclosure, after obtaining the first intermediate code text and the second intermediate code text, a value obtained by adding the first intermediate code text and the second intermediate code text is determined as the code text corresponding to the plaintext vector to be processed.
[0143] S304: The data processing end sends the code text to the code text operation end.
[0144] It should be noted that step S304 is the same as the above-mentioned step S102. For details, please refer to the description of step S102, which will not be described in detail here.
[0145] S305: The data processing end receives the code text operation result returned by the code text operation end, and decodes the code text operation result using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result.
[0146] Among them, the plaintext vector corresponding to the code text operation result is used to provide plaintext messages for the target operation requirements.
[0147] Specifically, the process of generating the preset decryption key matrix is the same as the process of generating the preset decryption key matrix corresponding to the plaintext vector in step S203 above, and no further details are given here.
[0148] In the embodiment of the present disclosure, after obtaining the code text operation result, the to-be-processed plaintext vector corresponding to the code text operation result is calculated based on the product of a preset decryption key matrix and the code text operation result.
[0149] Assume that the code text operation result D = E(y) + E(y′), and the preset encryption key matrix W = [u1…u n ], preset decryption key matrix
[0150] Among them, E(y) is the code text corresponding to the plaintext vector y to be processed, and E(y′) is the code text corresponding to the plaintext vector y′ to be processed.
[0151]
[0152]
[0153] Among them, v k 、v′ k is any random factor vector in the first subspace V,
[0154] The specific calculation process of the plaintext vector D′ to be processed corresponding to the code text operation result is as follows:
[0155]
[0156]
[0157] Among them, y+y′ is the plaintext vector to be processed corresponding to the code text operation result E(y)+E(y′).
[0158] In a data processing method provided by an embodiment of the present disclosure, a data processing end constructs an n-dimensional plaintext vector from n corresponding plaintext messages to be processed, where n is a natural number. Then, at least one random factor vector is obtained from a first subspace, wherein the first subspace is obtained by orthogonal partitioning of a real vector space, and the first subspace is orthogonal to the n subspaces. A preset encryption key matrix and at least one random factor vector are then used to encode the plaintext vector to obtain a codetext corresponding to the plaintext vector to be processed. The codetext operation result returned by the codetext operation end is received, and the codetext operation result is decoded using a preset decryption key matrix to obtain a plaintext vector corresponding to the codetext operation result. The plaintext vector corresponding to the codetext operation result is used to provide a plaintext message for a target operation requirement. In addition to encoding the plaintext vector to be processed using a preset encryption key matrix, the present disclosure adds a random factor vector, so that the codetext corresponding to the encrypted plaintext vector to be processed has randomness, thereby improving the security of data processing and ensuring the security of data during the data processing process.
[0159] Based on the above method embodiment, the present disclosure also provides a data processing device, referring to Figure 5 , is a structural diagram of a data processing device provided in an embodiment of the present disclosure, the device comprising:
[0160] A construction module 501 is configured to construct an n-dimensional plaintext vector based on n corresponding plaintext messages to be processed, as the plaintext vector to be processed; wherein n is a natural number;
[0161] An encoding module 502 is configured to encode the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed;
[0162] The sending module 503 is used to send the code text to the code text operation end; the code text operation end is used to perform a code text addition operation based on the code text according to the target operation requirement to obtain a code text operation result;
[0163] The receiving module 504 is configured to receive the code text operation result returned by the code text operation end;
[0164] The decoding module 505 is used to decode the code text operation result to obtain a plain text vector corresponding to the code text operation result; the plain text vector corresponding to the code text operation result is used to provide a plain text message for the target operation requirement.
[0165] In an optional implementation manner, the encoding module is specifically configured to:
[0166] Encoding the plaintext vector to be processed using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed; wherein the preset encryption key matrix includes n encryption key vectors, the n encryption key vectors are respectively from n subspaces obtained by orthogonally partitioning the real vector space, and the encryption key vectors have a mapping relationship with the subspaces;
[0167] Accordingly, the decoding module is specifically used for:
[0168] The code text operation result is decoded using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result; wherein the preset decryption key matrix includes the transpose of n decryption key vectors, the n decryption key vectors are respectively from the n subspaces, the decryption key vectors have a mapping relationship with the subspaces, and the product between the transpose of the decryption key vector and the encryption key vector in the same subspace is 1.
[0169] In an optional embodiment, the device further includes:
[0170] A first acquisition module is configured to acquire at least one random factor vector from a first subspace; the first subspace is obtained by orthogonally partitioning the real vector space, and the first subspace is orthogonal to the n subspaces;
[0171] Accordingly, the encoding module is specifically used for:
[0172] The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the to-be-processed plaintext vector.
[0173] In an optional embodiment, the device further includes:
[0174] A second acquisition module is configured to acquire, from a real number domain, real numbers having the same number as the at least one random factor vector; the real numbers and the random factor vectors have a mapping relationship;
[0175] Accordingly, the encoding module is specifically used for:
[0176] The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the random factor vector and the real number having a mapping relationship, to obtain a code text corresponding to the to-be-processed plaintext vector.
[0177] In an optional implementation manner, the encoding module is specifically configured to:
[0178] The product of the preset encryption key matrix and the plaintext vector to be processed is determined as the code text corresponding to the plaintext vector to be processed.
[0179] In an optional implementation manner, the encoding module is specifically configured to:
[0180] Determine the product of the preset encryption key matrix and the plaintext vector to be processed as the first intermediate code text;
[0181] and an accumulation module, configured to accumulate values obtained by multiplying the random factor vectors having a mapping relationship with the real numbers to obtain an accumulated value, and determine the accumulated value as a second intermediate code text;
[0182] A determination submodule is configured to determine a value obtained by adding the first intermediate code text and the second intermediate code text as the code text corresponding to the plaintext vector to be processed.
[0183] In an optional implementation, the decoding module is specifically configured to:
[0184] The product of the preset decryption key matrix and the code text operation result is determined as the plaintext vector corresponding to the code text operation result.
[0185] In an optional embodiment, the device further includes:
[0186] a determination module for determining a real symmetric matrix from a real vector space;
[0187] An execution module, configured to perform orthogonal decomposition on the real symmetric matrix to obtain a first matrix;
[0188] The first spanning module is used to span the n subspaces based on the column vectors in the first matrix.
[0189] In an optional embodiment, the device further includes:
[0190] The second spanning module is used to span the first subspace based on m consecutive column vectors in the first matrix, where m is a natural number.
[0191] In the data processing device provided by the embodiments of the present disclosure, an n-dimensional plaintext vector is first constructed based on n corresponding plaintext messages to be processed, as the plaintext vector to be processed, where n is a natural number. The plaintext vector to be processed is then encoded to obtain a codetext corresponding to the plaintext vector to be processed, and the codetext is sent to a codetext operation terminal. The codetext operation terminal is configured to perform a codetext addition operation on the codetext according to a target operation requirement to obtain a codetext operation result, receive the codetext operation result returned by the codetext operation terminal, and decode the codetext operation result to obtain a plaintext vector corresponding to the codetext operation result. The plaintext vector corresponding to the codetext operation result is used to provide a plaintext message for the target operation requirement. Because the embodiments of the present disclosure construct the n corresponding plaintext messages to be processed as the plaintext vector to be processed and perform encoding, decoding, and codetext addition calculations based on the plaintext vector to be processed, the number of encoding, decoding, and codetext addition calculations can be reduced, thereby improving the processing efficiency of the plaintext messages to be processed.
[0192] In addition to the above-mentioned method and apparatus, the embodiments of the present disclosure further provide a computer-readable storage medium, which stores instructions. When the instructions are executed on a terminal device, the terminal device implements the data processing method described in the embodiments of the present disclosure.
[0193] The embodiments of the present disclosure further provide a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the data processing method described in the embodiments of the present disclosure is implemented.
[0194] In addition, the present disclosure also provides a data processing device, see Figure 6 As shown, this may include:
[0195] Processor 601, memory 602, input device 603 and output device 604. The number of processors 601 in the data processing device can be one or more. Figure 6 In some embodiments of the present disclosure, the processor 601, the memory 602, the input device 603 and the output device 604 may be connected via a bus or other means, wherein: Figure 6 The bus connection is taken as an example.
[0196] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and data processing of the data processing device by running the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, at least one application required for a function, etc. In addition, the memory 602 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. The input device 603 can be used to receive input digital or character information and generate signal input related to user settings and function control of the data processing device.
[0197] Specifically in this embodiment, the processor 601 will load the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 will run the applications stored in the memory 602, thereby realizing the various functions of the above-mentioned data processing device.
[0198] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0199] The foregoing description is intended only to provide specific embodiments of the present disclosure, intended to enable those skilled in the art to understand and implement the present disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the embodiments described herein, but rather to be construed in the broadest manner consistent with the principles and novel features disclosed herein.
Claims
1. A data processing method, characterized in that: The method comprises: Based on the n plaintext messages to be processed that have corresponding relationships, an n-dimensional plaintext vector is constructed as the plaintext vector to be processed; wherein n is a natural number; Encoding the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed, and sending the code text to a code text operation end; the code text operation end is used to perform a code text addition operation based on the code text according to target operation requirements to obtain a code text operation result; receiving the code text operation result returned by the code text operation end, and decoding the code text operation result to obtain a plaintext vector corresponding to the code text operation result; the plaintext vector corresponding to the code text operation result is used to provide a plaintext message for the target operation requirement, and the plaintext vector corresponding to the code text operation result is the sum of the corresponding plaintext vectors to be processed; The encoding of the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed includes: Encoding the plaintext vector to be processed using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed; wherein the preset encryption key matrix includes n encryption key vectors, the n encryption key vectors are respectively from n subspaces obtained by orthogonally partitioning the real vector space, and the encryption key vectors have a mapping relationship with the subspaces; Correspondingly, decoding the code text operation result to obtain a plaintext vector corresponding to the code text operation result includes: Decoding the code text operation result using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result; wherein the preset decryption key matrix includes the transpose of n decryption key vectors, the n decryption key vectors are respectively from the n subspaces, the decryption key vectors have a mapping relationship with the subspaces, and the product between the transpose of the decryption key vector and the encryption key vector in the same subspace is 1; Before encoding the to-be-processed plaintext vector using a preset encryption key matrix to obtain a code text corresponding to the to-be-processed plaintext vector, the method further includes: Obtaining at least one random factor vector from a first subspace; the first subspace is obtained by orthogonally partitioning the real vector space, and the first subspace is orthogonal to the n subspaces; Accordingly, encoding the plaintext vector to be processed by using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed includes: The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the to-be-processed plaintext vector.
2. The method according to claim 1, characterized in that Before encoding the plaintext vector using the preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the plaintext vector to be processed, the method further includes: Acquire real numbers having the same number as the at least one random factor vector from a real number field; the real numbers and the random factor vector have a mapping relationship; Accordingly, encoding the to-be-processed plaintext vector using the preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the to-be-processed plaintext vector includes: The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the random factor vector and the real number having a mapping relationship, to obtain a code text corresponding to the to-be-processed plaintext vector.
3. The method according to claim 1, characterized in that The encoding of the to-be-processed plaintext vector by using a preset encryption key matrix to obtain a code text corresponding to the to-be-processed plaintext vector includes: The product of the preset encryption key matrix and the plaintext vector to be processed is determined as the code text corresponding to the plaintext vector to be processed.
4. The method according to claim 3, characterized in that The encoding of the to-be-processed plaintext vector by using the preset encryption key matrix and the random factor vector and the real number having a mapping relationship to obtain a code text corresponding to the to-be-processed plaintext vector includes: Determine the product of the preset encryption key matrix and the plaintext vector to be processed as the first intermediate code text; and accumulating values obtained by multiplying the random factor vectors having a mapping relationship with the real numbers to obtain an accumulated value, and determining the accumulated value as a second intermediate code text; A value obtained by adding the first intermediate code text and the second intermediate code text is determined as the code text corresponding to the plaintext vector to be processed.
5. The method according to claim 1, wherein The decoding of the code text operation result by using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result includes: The product of the preset decryption key matrix and the code text operation result is determined as the plaintext vector corresponding to the code text operation result.
6. The method according to claim 1, characterized in that Before encoding the to-be-processed plaintext vector using a preset encryption key matrix to obtain a code text corresponding to the to-be-processed plaintext vector, the method further includes: Determine real symmetric matrices from real vector spaces; After performing orthogonal decomposition on the real symmetric matrix, a first matrix is obtained; Based on the column vectors in the first matrix, the n subspaces are respectively spanned.
7. The method according to claim 6, characterized in that After performing orthogonal decomposition on the real symmetric matrix to obtain the first matrix, the method further includes: The first subspace is formed based on m consecutive column vectors in the first matrix, where m is a natural number.
8. A data processing device, characterized in that: The device comprises: A construction module, configured to construct an n-dimensional plaintext vector based on n plaintext messages to be processed having a corresponding relationship, as the plaintext vector to be processed; wherein n is a natural number; An encoding module, configured to encode the plaintext vector to be processed to obtain a code text corresponding to the plaintext vector to be processed; A sending module, configured to send the code text to a code text operation terminal; the code text operation terminal is configured to perform a code text addition operation based on the code text according to a target operation requirement to obtain a code text operation result; A receiving module, configured to receive the code text operation result returned by the code text operation end; A decoding module, configured to decode the coded text operation result to obtain a plaintext vector corresponding to the coded text operation result; the plaintext vector corresponding to the coded text operation result is used to provide a plaintext message for the target operation requirement, and the plaintext vector corresponding to the coded text operation result is the sum of the corresponding plaintext vectors to be processed; The encoding module is specifically used for: Encoding the plaintext vector to be processed using a preset encryption key matrix to obtain a code text corresponding to the plaintext vector to be processed; wherein the preset encryption key matrix includes n encryption key vectors, the n encryption key vectors are respectively from n subspaces obtained by orthogonally partitioning the real vector space, and the encryption key vectors have a mapping relationship with the subspaces; Accordingly, the decoding module is specifically used for: Decoding the code text operation result using a preset decryption key matrix to obtain a plaintext vector corresponding to the code text operation result; wherein the preset decryption key matrix includes the transpose of n decryption key vectors, the n decryption key vectors are respectively from the n subspaces, the decryption key vectors have a mapping relationship with the subspaces, and the product between the transpose of the decryption key vector and the encryption key vector in the same subspace is 1; The device further comprises: A first acquisition module is configured to acquire at least one random factor vector from a first subspace; the first subspace is obtained by orthogonally partitioning the real vector space, and the first subspace is orthogonal to the n subspaces; Accordingly, the encoding module is specifically used for: The to-be-processed plaintext vector is encoded using a preset encryption key matrix and the at least one random factor vector to obtain a code text corresponding to the to-be-processed plaintext vector.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores instructions, and when the instructions are executed on a terminal device, the terminal device implements the method according to any one of claims 1 to 7.
10. A data processing device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
File encrypting and decrypting method allowing parallel computing to be conducted in cloud storage system
CN104009835A
Homomorphic encryption method and device
CN111510281A