A privacy protection based communication method and device

By adjusting the transformation key generation method and finely splitting matrix-vector multiplication operations, the problem of slow ciphertext processing speed in homomorphic encryption schemes is solved, achieving both timely data processing and privacy protection.

CN121125054BActive Publication Date: 2026-02-17LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511658134.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-13
Publication Date
2026-02-17
Estimated Expiration
2045-11-13

AI Technical Summary

Technical Problem

Existing homomorphic encryption schemes are slow in ciphertext processing, which affects the timeliness of data processing.

Method used

By adjusting the generation method of the transformation key, the transformation key is generated based on the cyclic shift operation, and the matrix-vector multiplication operation is finely divided into inner product operation and cyclic left shift operation, reducing the number of rotation operations.

Benefits of technology

It improves the processing speed of encrypted data, ensures the timeliness of data processing, and achieves privacy protection for plaintext data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125054B_ABST
    Figure CN121125054B_ABST
Patent Text Reader

Abstract

The application discloses a communication method and device based on privacy protection, relates to the field of data protection, and comprises the following steps: a server obtains an encryption processing result by performing a series of processing on ciphertext data sent by a client, so that the server can complete the processing on the ciphertext data without knowing plaintext data, that is, the plaintext data is only visible in the client and invisible in the server, thereby realizing the privacy protection of the plaintext data and improving the security of the data. Furthermore, the generation mode of a transformation key is adjusted to generate the transformation key based on a cyclic shift operation, and matrix vector multiplication based on the transformation key is finely divided into inner product operation and cyclic left shift operation, so that the number of rotation operations in the matrix vector multiplication is reduced, the speed of the matrix vector multiplication is improved, the speed of the server for processing the ciphertext data of the client is correspondingly improved, and the timeliness of data processing is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data protection, and in particular to a communication method and device based on privacy protection. BACKGROUND

[0002] With the development of technologies such as artificial intelligence and cloud computing, data, as a core production factor, has become a new driving force for promoting high-quality economic development. However, data has the characteristics of intangibility and non-consumption, and can be replicated infinitely at near-zero cost, so the leakage problem in the process of data circulation and processing cannot be ignored. It has become an important research topic to maximize data value while protecting data privacy. Homomorphic encryption allows direct processing of ciphertext, and the processing result is the same as the result obtained by directly processing the plaintext, so homomorphic encryption is one of the important technical means to realize data "available but invisible" and protect data privacy and security. However, the design of homomorphic encryption scheme is complex, and the processing speed of ciphertext is slow, which seriously affects the timeliness of data processing. SUMMARY

[0003] The present application provides a communication method and device based on privacy protection to at least solve the problem of slow processing speed of ciphertext data of the server to the client in the related art, which affects the timeliness of data processing.

[0004] The present application provides a communication method based on privacy protection applied to a server, comprising:

[0005] Obtaining ciphertext data sent by a client; the ciphertext data is data obtained by encoding and encrypting plaintext data by the client;

[0006] Performing a first number of processing operations on the ciphertext data to obtain a first number of groups of processing data; wherein each processing operation comprises performing a matrix-vector multiplication operation based on a second number of groups of ciphertext and a corresponding second number of groups of transformation keys to obtain a corresponding group of processing data; the second number of groups of ciphertext is ciphertext obtained by dividing the ciphertext data, the transformation key is a key generated based on a cyclic shift operation, and the matrix-vector multiplication operation comprises an inner product operation and a cyclic left shift operation;

[0007] Performing homomorphic multiplication operation on the first number of groups of processing data to obtain an encrypted processing result;

[0008] Transmitting the encrypted processing result to the client, so that the client decrypts and decodes the encrypted processing result, and determines the processing result corresponding to the plaintext data based on the decoded result.

[0009] The present application also provides an electronic device comprising:

[0010] A memory for storing a computer program;

[0011] a processor for implementing the steps of any of the above privacy protection based communication methods when executing a computer program.

[0012] The application also provides a computer readable storage medium, which stores a computer program, wherein the computer program implements the steps of any of the above privacy protection based communication methods when executed by a processor.

[0013] The application also provides a computer program product comprising a computer program, which implements the steps of any of the above privacy protection based communication methods when executed by a processor.

[0014] According to the application, since the server performs a series of processing on the ciphertext data sent by the client to obtain an encryption processing result, the server can complete the processing on the ciphertext data without knowing the plaintext data, and the processing result of the ciphertext data after decryption is the same as the result of directly processing the plaintext data, at this time the plaintext data is only visible in the client and invisible in the server, thereby realizing the privacy protection of the plaintext data and improving the security of the data. Further, the application adjusts the generation mode of the transformation key to generate the transformation key based on the cyclic shift operation, and finely divides the matrix vector multiplication operation based on the transformation key into inner product operation and cyclic left shift operation, thereby reducing the number of rotation operations in the matrix vector multiplication operation, improving the speed of the matrix vector multiplication operation, and correspondingly improving the speed of the server processing the ciphertext data of the client, thereby ensuring the timeliness of data processing. BRIEF DESCRIPTION OF DRAWINGS

[0015] In order to more clearly illustrate the embodiments of the application, the drawings needed in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.

[0016] Figure 1 A privacy protection based communication method flowchart provided for the embodiments of the application;

[0017] Figure 2 A vector division schematic diagram provided for the embodiments of the application;

[0018] Figure 3 Another vector division schematic diagram provided for the embodiments of the application;

[0019] Figure 4 Still another vector division schematic diagram provided for the embodiments of the application. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present application will be described clearly and completely in the description below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.

[0021] It should be noted that, in the description of the present application, the terms "comprise", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. The terms "first", "second" and the like in the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence.

[0022] In order to enable those skilled in the art to better understand the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments.

[0023] Homomorphic encryption allows direct processing of ciphertext, and the processing result is the same as the result obtained by directly processing the plaintext, so homomorphic encryption is one of the important technical means to realize data "available but invisible" and protect data privacy and security. However, the design of homomorphic encryption scheme is complex, and the processing speed of ciphertext is slow, which seriously affects the timeliness of data processing. Therefore, the present application provides a communication method based on privacy protection, which adjusts the generation mode of the transformation key to generate the transformation key based on the cyclic shift operation, and finely splits the matrix vector multiplication operation based on the transformation key into inner product operation and cyclic left shift operation, thereby reducing the number of rotation operations in the matrix vector multiplication operation, improving the speed of the matrix vector multiplication operation, and correspondingly improving the speed of the server processing the ciphertext data of the client, thereby ensuring the timeliness of data processing.

[0024] The embodiments of the present application provide a communication method based on privacy protection, which combines Figure 1 The execution flow of the communication method based on privacy protection is shown in the figure, and the method of the present application is described in detail.

[0025] Step S11, obtaining ciphertext data sent by a client; the ciphertext data is data obtained by encoding and encrypting plaintext data by the client.

[0026] In step S12, the first number of processing operations are performed on the ciphertext data to obtain the first number of groups of processing data; each processing operation includes performing a matrix-vector multiplication operation based on the second number of groups of ciphertexts and corresponding second number of groups of transformation keys to obtain a corresponding group of processing data; the second number of groups of ciphertexts are ciphertexts obtained by dividing the ciphertext data, the transformation keys are keys generated based on a cyclic shift operation, and the matrix-vector multiplication operation includes an inner product operation and a cyclic left shift operation.

[0027] In the embodiment of the present application, the server first obtains the ciphertext data sent by the client, and then performs the first number of processing operations on the ciphertext data to obtain the corresponding first number of groups of processing data, that is, one processing operation corresponds to one group of processing data. The ciphertext data is data obtained by the client by sequentially encoding and encrypting the plaintext data.

[0028] Moreover, for any one of the first number of processing operations, the processing operation can specifically include: dividing the ciphertext data into the second number of groups of ciphertexts, and then performing a matrix-vector multiplication operation based on the second number of groups of ciphertexts and corresponding second number of groups of transformation keys to obtain a corresponding group of processing data; wherein the transformation key is a key generated based on a cyclic shift operation, and the matrix-vector multiplication operation includes an inner product operation and a cyclic left shift operation.

[0029] It should be noted that the number of moves of the cyclic shift operation and the cyclic left shift operation is the same, and the number of moves in any one processing operation is a value determined based on the number of processing times corresponding to the processing operation. At this time, the first number of processing operations corresponds to different second number of groups of transformation keys.

[0030] For example, assuming that the first number is , the ciphertext data needs to be processed times to obtain groups of processing data. Moreover, the number of moves of the cyclic shift operation and the cyclic left shift operation is 0 in the 0th processing operation, 1 in the 1st processing operation, and so on, and -1 in the -1th processing operation.

[0031] In the embodiment of the present application, the client uses a public key for encryption of data and uses a private key for decryption of data. Therefore, the client needs to generate a public key and a private key based on homomorphic encryption parameters in advance, define the generation mode of the transformation key, and generate the transformation key required for homomorphic encryption and transmit it to the server.

[0032] Specifically, the client first sets N as a power of 2, and sets as a 2Nth cyclotomic field, A ring of integers K The remainder of class q is the modulo q. The ciphertext modulo is... , extended modulus ,in For different prime numbers, L and k are preset values. Represent the set of rational numbers, Represents the set of integers. Homomorphic encryption encoding and decoding is... and Mapping between Represents the set of complex numbers. According to the homomorphic encryption security standard, given security parameters... N and The relationship was thus established.

[0033] Next, the client generates a public key and a private key based on the private key distribution, error distribution, etc. The public key is used for encryption, and the private key is used for decryption. Specifically, the client selects a polynomial s based on the distribution HWT(h), and then... Choose a polynomial e, where HWT(h) denotes the polynomial in the set The sample is taken uniformly from the middle, and the weight of the Hamming is h; express The difference between China and the West is The discrete Gaussian distribution. The client is... The polynomial a is obtained by uniform sampling in the middle, let Then the client's private key is The public key is .

[0034] It should be noted that the polynomial s is selected based on the distribution HWT(h), which means uniformly sampling N values ​​from the set {0,+1,-1} and having a Hamming weight (i.e., the number of +1 and -1 values) of h, thereby determining the polynomial s based on the selected N values.

[0035] Furthermore, the client defines a circular left shift operation, specifically as follows: Let the polynomial... , Represent the set of real numbers. Given an integer k that is relatively prime to 2N, map... Defined as Given the ciphertext ct of message m, and the corresponding private key sk, map... When applied to ct, then For about The ciphertext, corresponding to the private key is .right Performing a key transformation operation yields information about... ciphertext The corresponding private key is sk. Specifically, let the vector... If the encoding is a polynomial m(X), then For corresponding The ciphertext, This is a circular left shift of z bits by r bits. The circular left shift operation is implemented by mapping the ciphertext and performing a key transformation.

[0036] For the transformation key, the client selects an integer. ,make , This indicates rounding up, calculating... ,in .exist Randomly and uniformly sampled And based on the error distribution sampling polynomial ,in .make:

[0037] ;

[0038] in Then the transformation key corresponding to the circular left shift operation of r bits is: . Specifically:

[0039] .

[0040] Among them, Random and uniform sampling can include... Randomly and uniformly sampled ,exist Randomly and uniformly sampled ,and, Modulus Remaining rings, Modulus Remainder ring.

[0041] It can be observed that the transformation keys corresponding to the circular left shift operation appear in groups, totaling [number missing]. Each group of transformation keys includes several pairs (k+L+1 pairs) of transformation keys, and each pair of transformation keys includes a first key a and a second key b.

[0042] In each pair of transformation keys, the first key is a key obtained by the client through uniform sampling from a first preset data distribution, which is... The second key in each pair of transformation keys is a key generated by the client using the first key and the second polynomial in each pair of transformation keys, based on a cyclic shift operation; the second polynomial is a polynomial obtained by the client by uniformly sampling in the second preset data distribution, which is HWT(h), and the second polynomial is polynomial s.

[0043] Furthermore, assume the first quantity is The second quantity is When performing the Mth processing operation on the encrypted data, the value of M ranges from 0 to... An integer of -1, assuming the ciphertext data contains L+1 polynomials, denoted as... Then the L+1 polynomials are divided into Grouped ciphertext, each group of ciphertext includes A polynomial. Taking the 0th ciphertext as an example, for the 0th ciphertext... polynomials Perform a polynomial expansion operation to obtain L+1+k polynomials, then combine these L+1+k polynomials with the transformation key. Multiplying the L+1+k pairs of polynomials in the given text yields the L+1+k pairs of polynomials. Similarly, multiplying the first ciphertext, the second ciphertext, ..., the... Perform a similar operation on ciphertext group -1 as on ciphertext group 0 to obtain... The calculation results are divided into groups, each containing L+1+k pairs of polynomials. Then... Adding the results of the calculations together, we obtain L+1+k pairs of polynomials, which is... Group cipher and The result is obtained by performing an inner product operation on the transformed keys. Finally, the polynomial is applied to the sum of the L+1+k values. Mapping, also known as circular left shift by r bits, yields a set of processed data corresponding to the Mth processing operation, where r = M, and the value of r ranges from 0 to... An integer of -1. Correspondingly, when performing operations on ciphertext data... After this processing operation, we can obtain The data is processed in groups, and each group of data includes L+1+k pairs of polynomials.

[0044] Step S13: Perform homomorphic multiplication on the first batch of processed data to obtain the encryption result.

[0045] Step S14: Transmit the encryption processing result to the client so that the client can decrypt and decode the encryption processing result and determine the processing result corresponding to the plaintext data based on the decoding result.

[0046] In this embodiment of the invention, after obtaining the first set of processed data, homomorphic multiplication is performed on the first set of processed data to obtain the encryption result. Specifically, this may include: performing homomorphic multiplication on the first set of processed data using a third set of encoded vectors to obtain the third set of operation results; wherein the third set of encoded vectors is a vector determined based on the target matrix required for the homomorphic multiplication operation; processing the third set of operation results according to a preset processing logic to obtain the third set of processed data; and determining the encryption result based on the third set of processed data.

[0047] According to one example, in the process of performing homomorphic multiplication on a first number of processed data using any set of encoded vectors to obtain a corresponding set of operation results, it may specifically include: performing homomorphic multiplication on a first number of processed data using any set of encoded vectors to obtain a corresponding first number of operation results; wherein, any set of encoded vectors includes a first number of vectors; and determining a set of operation results corresponding to any set of encoded vectors by adding the first number of operation results together.

[0048] Specifically, let's assume the first quantity is... The third quantity is , that is, shared Group coding vectors, each group coding vector includes There are L+1+k encoded vectors, and each encoded vector includes L+1+k polynomials. For any given set of encoded vectors, the server assigns L+1+k polynomials to each set of encoded vectors. There are L+1+k encoded vectors, each containing L+1+k polynomials. Homomorphic multiplication is performed on the processed data (each processed data includes L+1+k pairs of polynomials) to obtain the corresponding... Each operation result includes L+1+k pairs of polynomials; The results of each operation are added together to obtain a set of results corresponding to any set of encoded vectors, which is L+1+k pairs of polynomials. Correspondingly, when using... Group coding vectors respectively for After performing homomorphic multiplication on the grouped data, we can obtain... The results of the group operations, each group of results includes L+1+k pairs of polynomials.

[0049] According to one example, in the process of processing any set of operation results according to a preset processing logic to obtain a corresponding set of processed data, it may specifically include: dividing any set of operation results into a second number of sub-results; performing matrix-vector multiplication based on the second number of sub-results and the corresponding second number of transformation keys to obtain a corresponding set of processed data.

[0050] Specifically, let's assume the first quantity is... The third quantity is The second quantity is If any set of operation results includes L+1+k pairs of polynomials, first perform polynomial reduction on the L+1+k pairs of polynomials in the set of operation results to obtain L+1 polynomials, and then divide the L+1 polynomials into... Sub-results, each sub-result includes A polynomial. Taking the 0th sub-result as an example, for the 0th sub-result... Perform polynomial expansion operations on each polynomial to obtain L+1+k polynomials, and then combine these L+1+k polynomials with the transformation key. Multiplying the L+1+k pairs of polynomials in the original text yields the L+1+k pairs of polynomials. Similarly, multiplying the first group of sub-results, the second group of sub-results, ..., the... The sub-results of group -1 are processed similarly to those of group 0 to obtain... The calculation results are divided into groups, each containing L+1+k pairs of polynomials. Then... Adding the results of the calculations together, we obtain L+1+k pairs of polynomials, which is... Subgroup results and The result is obtained by performing an inner product operation on the transformed keys. Finally, the polynomial is applied to the sum of the L+1+k values. Mapping, also known as circular left shift by r bits, yields a set of processed data corresponding to any given set of operation results. Here, r takes the value of... , ,for The result of the 0th group of operations in the group operation results, where k is 0, for The first group of results in the group operation results has k = 1, and so on, for... The first in the group operation result The result of the group operation, where k is It can be observed that r is based on the first quantity The value determined by the group number of any set of calculation results. Correspondingly, the value is processed according to the preset logic. After processing the results of the group operations separately, we can obtain... The data is processed in groups, and each group of data includes L+1+k pairs of polynomials.

[0051] According to one example, determining the encryption result based on the third set of processed data can specifically include: adding the third set of processed data to obtain a sum, and determining the encryption result based on the sum.

[0052] Specifically, let's assume the third quantity is... , Each set of processed data in the set includes L+1+k pairs of polynomials, which will The L+1+k pairs of polynomials in the group processing data are added together to obtain the sum, which is the L+1+k pairs of polynomials. Then, a polynomial reduction operation is performed on the sum to obtain the L+1 pairs of polynomials. Finally, the L+1 pairs of polynomials are resized to obtain the encrypted result, which is the L+1 pairs of polynomials.

[0053] The server finally transmits the encryption result to the client, so that the client can first decrypt the encryption result using its private key, then decode the decrypted result to obtain the decoded result, and finally determine the processing result corresponding to the plaintext data based on the decoded result. For example, let the decryption result be... Client-side computing The decoded result is obtained, where U represents the Vandermonde matrix. This represents the scaling factor.

[0054] Furthermore, the third quantization encoding vector used by the server in homomorphic multiplication is specifically obtained by the server pre-compiling, cyclically shifting, and encoding the target matrix required for homomorphic multiplication.

[0055] According to one example, the process of determining the third order of magnitude encoding vector may specifically include: dividing the target matrix to obtain the third order of magnitude partition vector; performing a circular right shift operation on the third order of magnitude partition vector to obtain the third order of magnitude right shift vector; and encoding the third order of magnitude right shift vector to obtain the third order of magnitude encoding vector.

[0056] Specifically, let's assume the first quantity is... The third quantity is ,for The k-th partition vector in the group partition vector, where k takes values ​​from 0 to... The server will divide the k-th group of the vector into integers. All vectors are cyclically shifted to the right. Position, among which This is used to obtain the right-shift vector of the kth group. It can be observed that the number of positions for the cyclic right shift is determined based on the first quantity and the group number of the kth group's partition vector. Then, the server processes the right-shift vector of the kth group... Encode each vector to obtain the k-th encoded vector.

[0057] Specifically, for each vector encoding operation, a Vandermonde matrix is ​​required. The Vandermonde matrix is ​​defined as follows: Let... Here, i represents an imaginary number. ,in U is the following Vandermonde matrix:

[0058] ;in, express 2.

[0059] For the encoding operation of each vector z, when the dimension of z is equal to N / 2, the server computes... The elements of m are The coefficients of the polynomial. When the dimension of z is not equal to N / 2, zero-padding is performed on z so that the dimension of the padded z is divisible by N / 2. Let the dimension of z be t, and map z to the polynomial as described above. The polynomial in, where Finally, the server multiplies the resulting polynomial by a scaling factor. It is then reduced to the closest integer coefficient polynomial to obtain the encoding vector corresponding to vector z, which includes L+1+k polynomials.

[0060] According to one example, the target matrix is ​​partitioned to obtain a third number of partition vectors. Specifically, this may include: when the target matrix satisfies a first preset condition, determining the number of first vectors and the dimension of the first vectors based on the minimum and maximum values ​​of the number of rows and columns of the target matrix, respectively; using the number of first vectors and the dimension of the first vectors, partitioning the target matrix to obtain several partition vectors corresponding to the target matrix; dividing the several partition vectors corresponding to the target matrix into a third number of partition vectors; wherein each group of partition vectors includes a first number of partition vectors.

[0061] The first preset condition includes: the maximum value of the number of rows and columns of the target matrix is ​​less than or equal to N / 2.

[0062] For example, let the target matrix A be an m x n matrix, let , ,like Then, based on the generalized diagonal, the target matrix A is divided into... There are n vectors, each with dimension n. That is, the number of the first vector is The dimension of the first vector is Then The vectors are divided into Group partition vectors; wherein each group partition vector includes A partition vector.

[0063] by Figure 2 Taking the 5x3 matrix shown as an example, based on the generalized diagonal, the matrix can be divided into three vectors of dimension 5: (1,5,9,10,14), (2,6,7,11,15), and (3,4,8,12,13). Figure 3 Taking the 3x5 matrix shown as an example, based on the generalized diagonal, the matrix can be divided into three vectors of dimension 5, including: (1,7,13,4,10), (2,8,11,5,14), and (3,6,12,9,15). Among them, the elements of the same color in a matrix form a generalized diagonal.

[0064] According to one example, the target matrix is ​​divided to obtain a third number of partition vectors. Specifically, this may include: when the target matrix does not satisfy a first preset condition, dividing the target matrix into blocks to obtain sub-matrices; wherein all sub-matrices satisfy the first preset condition; determining the corresponding number of second vectors and the second vector dimension based on the minimum and maximum values ​​of the number of rows and columns of the sub-matrices, respectively; using the number of second vectors and the second vector dimension, dividing the corresponding sub-matrices to obtain several partition vectors corresponding to the sub-matrices; dividing the several partition vectors corresponding to the sub-matrices into a third number of partition vectors; wherein each group of partition vectors includes a first number of partition vectors.

[0065] If the maximum value of the number of rows and columns of the target matrix is ​​less than or equal to N / 2, the target matrix does not meet the first preset condition, indicating that the maximum value of the number of rows and columns of the target matrix is ​​greater than N / 2.

[0066] It should be noted that there is no limitation on the method of matrix partitioning, as long as each submatrix after partitioning satisfies the first preset condition. Furthermore, for each submatrix after partitioning, vector partitioning is required according to the above steps to obtain several partition vectors corresponding to each submatrix. Then, the several partition vectors corresponding to each submatrix are further divided into a third number of partition vectors. Each group of partition vectors includes the first number of partition vectors.

[0067] According to one example, the target matrix is ​​partitioned to obtain a third number of partition vectors. Specifically, this may include: when the target matrix satisfies a second preset condition, determining the number of third vectors and the dimension of the third vectors based on the minimum and maximum values ​​of the number of rows and columns of the target matrix, respectively; using the number of third vectors and the dimension of the third vectors, partitioning the target matrix to obtain several partition vectors corresponding to the target matrix; zero-padding the several partition vectors corresponding to the target matrix to obtain several padded vectors corresponding to the target matrix; concatenating the several padded vectors corresponding to different target matrices so that the dimension of the concatenated vectors satisfies a preset dimension condition to obtain several concatenated vectors; and dividing the several concatenated vectors into a third number of partition vectors; wherein each group of partition vectors includes a first number of partition vectors.

[0068] The second preset condition is the maximum value of the number of rows and columns of the target matrix. Much less than N / 2. When When the dimension is much smaller than N / 2, the partition vectors of multiple matrices can be merged and concatenated, making the dimension of the merged and concatenated vector close to N / 2, thereby improving the coding density. Specifically, let matrix A1 be an m1-row n1-column matrix, let... , ; Matrix A2 is an m2 x n2 matrix, let , Divide matrix A1 into There are n vectors, each padded with zeros at the end, such that the vector dimension is n. Divide matrix A2 into There are n vectors, each padded with zeros at the end, such that the vector dimension is n. The partition vectors of matrix A1 and matrix A2 are concatenated together to make the dimension of the concatenated vector close to N / 2, thus obtaining several concatenated vectors. These concatenated vectors are then divided into a third number of partition vector groups; each group contains the first number of partition vectors. Figure 4 This is a schematic diagram of the concatenation of the partition vectors of a 3x2 matrix A1 and a 3x4 matrix A2. Elements of the same color in a matrix form a generalized diagonal.

[0069] It should be noted that the ciphertext data is the data obtained by the client encrypting the first polynomial; the first polynomial is the polynomial obtained by the client encoding the extended vector; and the extended vector is the vector obtained by the client extending the vector determined based on the plaintext data.

[0070] Furthermore, the number of vectors determined by the client based on plaintext data (referred to as client vectors) is the same as the number of target matrices required for homomorphic multiplication operations in the server, and they correspond one-to-one. Specifically, the dimension of a client vector is the same as the number of columns in a target matrix. Moreover, when a target matrix is ​​divided into multiple sub-matrices, the corresponding client vectors are also divided into multiple vectors, and the dimension of these multiple vectors is identical to the number of columns in each sub-matrix. For target matrices that do not meet the second preset condition, i.e., target matrices for which the vector partitioning and concatenation operation has not been performed, the client will repeat the vectors corresponding to the target matrix. This process is repeated to obtain the corresponding extended vector. For the target matrix that satisfies the second preset condition, i.e., the target matrix for which the vector concatenation operation is performed, the client will repeat the vector corresponding to the target matrix. The vectors are then concatenated to obtain the corresponding extended vector. The client encodes the extended vector into a first polynomial, which is an integer-coefficient polynomial, following the steps described above. The client then encrypts the encoded integer-coefficient polynomial using the public key and sends the ciphertext data to the server.

[0071] Through this application, since the server performs a series of processes on the ciphertext data sent by the client to obtain the encryption result, the server can complete the processing of the ciphertext data without knowing the plaintext data. Furthermore, the decrypted result of the ciphertext data processing is identical to the result of directly processing the plaintext data. In this case, the plaintext data is only visible to the client and not to the server, thus achieving privacy protection for the plaintext data and improving data security. Further, this application adjusts the generation method of the transformation key to generate the transformation key based on a cyclic shift operation, and finely decomposes the matrix-vector multiplication operation performed based on the transformation key into inner product operations and cyclic left shift operations. This reduces the number of rotation operations in the matrix-vector multiplication operation, increases the speed of the matrix-vector multiplication operation, and correspondingly increases the speed at which the server processes the client's ciphertext data, ensuring the timeliness of data processing.

[0072] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0073] Embodiments of this application also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above-described privacy-preserving communication method embodiments.

[0074] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described privacy-preserving communication method embodiments when it is run.

[0075] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0076] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described privacy-preserving communication method embodiments.

[0077] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above-described privacy-preserving communication method embodiments.

[0078] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0079] The foregoing has provided a detailed description of a privacy-preserving communication method provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only intended to aid in understanding the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of the claims of this application.

Claims

1. A privacy protection based communication method, characterized by, The application is applied to a server, and comprises the following steps: obtaining ciphertext data sent by a client; the ciphertext data is data obtained by encoding and encrypting plaintext data by the client; performing a first number of processing operations on the ciphertext data to obtain a first number of sets of processed data; wherein each of the processing operations comprises performing a matrix-vector multiplication operation based on a second number of sets of ciphertext and a corresponding second number of sets of transformation keys to obtain a corresponding set of processed data; the second number of sets of ciphertext are obtained by dividing the ciphertext data, the transformation keys are generated based on a cyclic shift operation, and the matrix-vector multiplication operation comprises an inner product operation and a cyclic left shift operation; the cyclic left shift operation is performed on a polynomial result obtained by the inner product operation mapping operation; The definition of the mapping is wherein the polynomial , represents the set of real numbers, k is an integer coprime with 2N, and N is a power of 2. performing homomorphic multiplication operation on the first number of groups of processing data to obtain an encrypted processing result; transmitting the encrypted processing result to the client, so that the client decrypts and decodes the encrypted processing result, and determines a processing result corresponding to the plaintext data based on the decoded result.

2. The privacy protection based communication method of claim 1, wherein, The number of moved bits in the cyclic shift operation and the cyclic left shift operation is the same, and the number of moved bits in each of the processing operations is a value determined based on a processing frequency corresponding to each of the processing operations.

3. The privacy protection based communication method of claim 1, wherein, The homomorphic multiplication operation on the first number of groups of processing data to obtain an encrypted processing result comprises the following steps: performing homomorphic multiplication operation on the first number of groups of processing data by using a third number of groups of encoding vectors respectively to obtain a third number of groups of operation results; the third number of groups of encoding vectors are vectors determined based on a target matrix required by the homomorphic multiplication operation; processing the third number of groups of operation results respectively according to a preset processing logic to obtain a third number of groups of processing data; determining an encrypted processing result based on the third number of groups of processing data; In the process of performing homomorphic multiplication operation on the first number of groups of processing data by using any one of the groups of encoding vectors to obtain a corresponding group of operation results, the following steps are included: performing homomorphic multiplication operation on the first number of groups of processing data by using any one of the groups of encoding vectors to obtain a corresponding first number of operation results; any one of the groups of encoding vectors includes a first number of vectors; determining a group of operation results corresponding to any one of the groups of encoding vectors based on the first number of operation results.

4. The privacy protection based communication method of claim 3, wherein, In the process of processing any one of the groups of operation results according to a preset processing logic to obtain a corresponding group of processing data, the following steps are included: dividing any one of the groups of operation results into a second number of groups of sub-results; performing the matrix-vector multiplication operation based on the second number of groups of sub-results and a corresponding second number of groups of transformation keys to obtain a corresponding group of processing data; and the determination of an encrypted processing result based on the third number of groups of processing data comprises the following steps: adding the third number of groups of processing data to obtain an addition result, and determining an encrypted processing result based on the addition result.

5. The privacy protection based communication method of claim 3, wherein, The determination of the third number of groups of encoding vectors comprises the following steps: dividing the target matrix to obtain a third number of groups of division vectors; performing cyclic right shift operation on the third number of groups of division vectors respectively to obtain a third number of groups of right shift vectors; encoding the third number of groups of right shift vectors respectively to obtain the third number of groups of encoding vectors.

6. The privacy protection based communication method of claim 5, wherein, The division of the target matrix to obtain a third number of groups of division vectors comprises the following steps: when the target matrix satisfies a first preset condition, determining a first number of vectors and a first vector dimension based on the minimum and maximum of the number of rows and the number of columns of the target matrix respectively; The target matrix is divided by using the first vector quantity and the first vector dimension to obtain a plurality of division vectors corresponding to the target matrix; The plurality of division vectors corresponding to the target matrix are divided into the third number of groups of division vectors; each group of division vectors includes a first number of division vectors.

7. The privacy protection based communication method of claim 5, wherein, The division of the target matrix to obtain the third number of groups of division vectors includes: When the target matrix does not satisfy the first preset condition, the target matrix is blocked to obtain a plurality of sub-matrices; each of the sub-matrices satisfies the first preset condition; Based on the minimum and maximum of the number of rows and the number of columns of the sub-matrix, a corresponding second vector quantity and a second vector dimension are determined respectively; The corresponding sub-matrix is divided by using the second vector quantity and the second vector dimension to obtain a plurality of division vectors corresponding to the sub-matrix; The plurality of division vectors corresponding to the sub-matrix are divided into the third number of groups of division vectors; each group of division vectors includes a first number of division vectors.

8. The privacy-preservation based communication method of claim 5, wherein, The division of the target matrix to obtain the third number of groups of division vectors includes: When the target matrix satisfies the second preset condition, a third vector quantity and a third vector dimension are determined based on the minimum and maximum of the number of rows and the number of columns of the target matrix; The target matrix is divided by using the third vector quantity and the third vector dimension to obtain a plurality of division vectors corresponding to the target matrix; The plurality of division vectors corresponding to the target matrix are zero-padded to obtain a plurality of padded vectors corresponding to the target matrix; The plurality of padded vectors corresponding to different target matrices are spliced to make the vector dimension of the spliced vector satisfy a preset dimension condition, to obtain a plurality of spliced vectors; The plurality of spliced vectors are divided into the third number of groups of division vectors; each group of division vectors includes a first number of division vectors.

9. The privacy-preserving based communication method according to any one of claims 1 to 8, characterized in that, The ciphertext data is data obtained by the client encrypting a first polynomial; the first polynomial is a polynomial obtained by the client encoding an extended vector; the extended vector is a vector obtained by the client extending a vector determined based on the plaintext data; And each group of transformation keys includes a plurality of pairs of transformation keys, and each pair of transformation keys includes a first key and a second key; The first key in each pair of transformation keys is a key obtained by the client uniformly sampling in a first preset data distribution; the second key in each pair of transformation keys is a key generated by the client using the first key in each pair of transformation keys and a second polynomial based on a cyclic shift operation; The second polynomial is a polynomial obtained by the client uniformly sampling in a second preset data distribution.

10. An electronic device, comprising: It includes: A memory for storing a computer program; A processor for executing the computer program to implement the steps of the communication method based on privacy protection according to any one of claims 1 to 9.