Symmetrical security privacy information retrieval method and system based on homomorphic encryption
By adopting the method of symmetrical security and privacy information retrieval based on homogenic encryption in the medical system, using the offset volume instead of query vector and ciphertext splicing technology to solve the problem of low privacy information search efficiency and insufficient security in existing technologies, realize Efficient and secure privacy information retrieval services.
Patent Information
- Application Number
- CN202411512830.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-01-28
Smart Images

Figure CN119377992A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of privacy computing methods, and specifically relates to a symmetric security privacy information retrieval method and system based on homomorphic encryption. Background Art
[0002] At present, with the explosive growth of Internet information and data, people are paying more and more attention to personal privacy protection. In order to guide and regulate data security and privacy protection, new requirements are put forward for privacy protection algorithms. Access to public databases may bring privacy issues and may leak sensitive information of users. In the medical field, if a patient wants to query therapeutic drugs through the medical system and uses the disease name as a keyword to query, the medical system will know the patient's disease condition, which may leak the patient's privacy to other institutions. In this context, privacy information retrieval technology has received more and more attention. Privacy information retrieval is a privacy protection primitive whose goal is to ensure that the query party can send queries to the server and obtain the required results, while the server cannot obtain the user's specific query information. However, in the existing medical system, efficient privacy information retrieval methods are mainly based on BFV homomorphic encryption construction. However, this information retrieval method currently has some defects, such as the inability to ensure the privacy security of server-side users, the patient's disease condition is easily leaked during the query and information retrieval process, and the query calculation and communication efficiency is low, making it difficult to meet both query efficiency and symmetric security. Summary of the invention
[0003] The purpose of the present invention is to provide a symmetric security privacy information retrieval method and system based on homomorphic encryption to solve the problems in the current medical service system that the privacy security of server-side users cannot be ensured, the patient's disease condition is easily leaked during the query and information retrieval process, and the query calculation and communication efficiency is low, making it difficult to simultaneously meet the query efficiency and symmetric security issues.
[0004] In order to achieve the above object, the present invention adopts the following technical scheme: The present invention provides a symmetric security privacy information retrieval method based on homomorphic encryption, which specifically includes the following steps: S1. Construct a homomorphic encryption system based on encryption algorithm parameters and generate an encryption public key and an encryption private key; S2, the server provides data, encodes the data it holds, and organizes the encoded data into a data matrix; S3. The client generates query information according to the index to be queried, and sends the query information to the server; wherein: if it is the first query, a query vector is generated; if it is not the first query, an offset is generated to replace the query vector; S4, the server generates a corresponding query vector based on the query information received from the client, and performs a query operation; S5. The server performs operations based on the query vector and the data matrix to obtain an encrypted query result, and sends the encrypted query result to the client; S6. The client uses the encrypted private key to decrypt the encrypted query result and obtain the query result data.
[0005] In some implementations, in S1, the encryption algorithm parameters include security parameters and ciphertext polynomial coefficients, ciphertext, and plaintext.
[0006] Furthermore, in S1, in the homomorphic encryption system: the plaintext is a polynomial ring The ciphertext is a polynomial ring form; in, The coefficients are not greater than and Integer polynomials of , is the degree of the polynomial.
[0007] In some embodiments, in S2, the number of rows and columns of the data matrix is determined according to the amount of data held by the server and the data length, wherein the number of rows is determined by the data length and the number of columns is determined by the amount of data, each piece of data held by the server is divided, and the divided data is placed in the data matrix, and the same piece of data is placed in one column of the data matrix.
[0008] In some implementations, S3 is specifically as follows: the client user provides a query index, and for the first query, a query vector is generated as a query, the query vector includes several ciphertexts, and each ciphertext includes several coefficients; for a non-first query, an offset is generated as a query based on the last query index and the current query index; the current query index is cached, and the query is sent to the server.
[0009] Furthermore, in S3, an offset is generated based on the last query index and the current query index as the query according to the following formula (1): (1); in, is the offset, The index for the last query. For this query index, is the number of coefficient terms.
[0010] In some implementations, S4 is specifically: if the server receives a query vector , then As the query vector in the query operation Output, and query vector Cache; if an offset is received , then according to the cached query vector and offset , after processing, a new query vector is generated and cached as the query vector .
[0011] Furthermore, in S4, the specific processing process is: according to For the query vector The elements in are translated as follows: (2); according to Pair Vector Each element in performs ciphertext rotation, and the number of bits rotated is the value of offset[1], thereby obtaining a new query vector.
[0012] In some implementations, S5 specifically includes: performing an inner product of the query vector and the data matrix to obtain a covered ciphertext matrix, performing a ciphertext rotation operation on each item of the ciphertext matrix, and the number of bits rotated is the number of rows where the ciphertext is located; adding the rotated ciphertexts row by row, and sending the resulting ciphertext to the client after obtaining it.
[0013] The present invention also provides a symmetric security privacy information retrieval system based on homomorphic encryption, the symmetric security privacy information retrieval system includes a query generation module, an encoding module, a query vector construction module and a reply generation module; wherein: The query generation module is used to generate a corresponding query based on the query index provided by the query party; The encoding module is used to encode the data in the server database; and organize the encoded data into a data matrix; The query vector construction module is used to receive the query information from the client, generate the corresponding query vector, and perform the query operation; The reply generation module is used to convert the execution result of the query operation into the actual query result.
[0014] Compared with the prior art, the present invention provides a symmetric security privacy information retrieval method and system based on homomorphic encryption, which has the following beneficial technical effects.
[0015] The present invention provides a symmetric security privacy information retrieval method based on homomorphic encryption, which specifically includes the following steps: S1, constructing a homomorphic encryption system based on encryption algorithm parameters, and generating an encrypted public key and an encrypted private key; S2, the server provides data, encodes the data it holds, and organizes the encoded data to form a data matrix; S3, the client generates query information according to the index to be queried, and sends the query information to the server; wherein: if it is the first query, a query vector is generated; if it is not the first query, an offset is generated to replace the query vector; S4, the server generates a corresponding query vector based on the query information received from the client, and performs a query operation; S5, the server performs an operation based on the query vector and the data matrix to obtain an encrypted query result, and sends the encrypted query result to the client; S6, the client uses the encrypted private key to decrypt the encrypted query result to obtain the query result data. Based on the above, the present invention constructs a homomorphic encryption system, data encoding and matrixing, generates and sends query information, the server performs query operations, the encrypted result is returned, and the client decrypts and obtains the result. The present invention uses the technology of homomorphic encryption to allow encrypted data to be calculated without exposing the specific content of the data. The data is always in an encrypted state during transmission and calculation to protect user privacy. Through homomorphic encryption technology, encrypted data can be directly queried without decryption, which improves processing efficiency. The same key is used for encryption and decryption, which simplifies the key management process. The present invention improves the existing encoding method for privacy information retrieval based on homomorphic encryption and realizes symmetric privacy security on both the server and the client.
[0016] The present invention uses a special discontinuous coding form in the encoding stage. Based on this coding form, when the server returns the result, it will overwrite the unqueried data, protect the privacy of the server, and ensure symmetric privacy security. The present invention proposes a method of using an offset to replace the query vector, sending the offset to replace the actual query vector on the client side, quickly completing the client's calculation, and reducing the content sent by the client by using the offset to replace the query vector. At the same time, the method of using the offset to replace the query vector and the reply ciphertext splicing method improves the execution efficiency of privacy information retrieval and significantly improves communication efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings in the specification are used to provide further understanding of the present invention and constitute a part of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0018] Figure 1 A schematic diagram of a symmetric security privacy information retrieval method based on homomorphic encryption and a flow chart of a method in the system of the present invention; Figure 2A schematic diagram of a flow chart of an embodiment of a symmetric security privacy information retrieval method and system based on homomorphic encryption according to the present invention; Figure 3 This is a schematic diagram of the architecture of a symmetric security privacy information retrieval method based on homomorphic encryption and a privacy information retrieval method protocol system based on homomorphic encryption in the system of the present invention. DETAILED DESCRIPTION
[0019] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0020] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0022] In the description of the embodiments of the present invention, it should be noted that if the terms "upper", "lower", "horizontal", "inner", etc. indicate an orientation or positional relationship based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship in which the product of the invention is usually placed when in use, it is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "first", "second", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance.
[0023] In addition, if the term "horizontal" appears, it does not mean that the component must be absolutely horizontal, but can be slightly tilted. For example, "horizontal" only means that its direction is more horizontal than "vertical", which does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0024] In the description of the embodiments of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal connection of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0025] How to achieve symmetric privacy security for both the server and the client, while improving the execution efficiency of privacy information retrieval and the communication efficiency during protocol execution.
[0026] like Figure 1 As shown above, the present invention provides a symmetric security privacy information retrieval method based on homomorphic encryption, which specifically includes the following steps: S1. Construct a homomorphic encryption system based on encryption algorithm parameters and generate an encryption public key and an encryption private key; S2, the server provides data, encodes the data it holds, and organizes the encoded data into a data matrix; S3. The client generates query information according to the index to be queried, and sends the query information to the server; wherein: if it is the first query, a query vector is generated; if it is not the first query, an offset is generated to replace the query vector; S4, the server generates a corresponding query vector based on the query information received from the client, and performs a query operation; S5. The server performs operations based on the query vector and the data matrix to obtain an encrypted query result, and sends the encrypted query result to the client; S6. The client uses the encrypted private key to decrypt the encrypted query result and obtain the query result data.
[0027] Based on the above, the present invention provides a symmetric security privacy information retrieval method based on homomorphic encryption, which solves the problem of symmetric security in the query information retrieval of seriously ill patients in the medical system by using data encoding. The limitation of the message length for the privacy information retrieval of the patient query party is solved by improving the query calculation process, and supports querying messages with longer lengths. At the same time, by using an offset instead of a query vector and a method of concatenating the result ciphertext, the communication efficiency is amortized to multiple queries, which improves the communication efficiency of the query, solves the problem of low efficiency of symmetric security privacy information retrieval, and provides effective guarantee for the privacy information security of patients, especially for some special patients with a higher degree of privacy, which helps to improve their psychological construction.
[0028] In some embodiments, a symmetric security privacy information retrieval method based on homomorphic encryption of the present invention is specifically as follows: 1. The server and client negotiate encryption algorithm parameters and enter security parameters , construct a BFV homomorphic encryption system, the plaintext is a polynomial ring The ciphertext is represented in the form of a polynomial ring In the form of Respectively indicate that the coefficient is not greater than and Integer polynomials of , is the polynomial degree, and outputs the encrypted public key , private key .
[0029] The client and the server negotiate the security parameter λ and the ciphertext polynomial coefficient N, the ciphertext modulus q, and the plaintext modulus t, and perform random sampling based on the security parameters. , output the public key and private key ; 2. The server encodes the held data and inputs the data ,in is the number of data in the database, and the plaintext polynomial ring that encodes the data In the example, the encoded structure is regarded as a data matrix, each polynomial coefficient is an element in the matrix, the data is encoded non-continuously by column, and different parts of each data are stored in the same coefficient position of different polynomial rings. Output data matrix , the number of columns of the data matrix By data volume Determine the number of rows Determined by the length of the data.
[0030] The number of rows and columns of the data matrix is determined according to the number of data n and length s held by the server, where the number of rows is determined by the length of the data, and the number of rows is m=⌊ ⌋, the number of columns is determined by the amount of data, the number of columns is l=⌊n / N⌋N, each data held by the server is divided, and the length of each part after division is , put the divided data into the data matrix, and put the same data into a column of the data matrix, for example, In the data matrix .
[0031] 3. Query information and enter the public key and the index to be queried For the first query, generate a query vector based on the query index i As a query, the query vector contains ciphertexts, each containing Item coefficients, for all items in the ciphertext, need to satisfy the The first item is 1, and the rest are 0. For non-first query, the client uses the last query index Index with this query Generate offset: as follows formula (1); (1); As a query; the client caches the query index and sends the query to the server; 4. Receive the query from the client (query party, search party, patient and his / her family, etc.) and make a judgment. If a query vector is received , directly As the query vector in the query operation Output, and query vector Cache; if an offset is received , according to the cache vector and offset Generate a query vector based on Pair Vector The elements in are translated as follows: (2); according to Pair Vector Each element in performs ciphertext rotation, and the number of bits rotated is Get the new query vector And cache as ; 5. Row query operation, input data matrix and query vector , query vector With data matrix Do the inner product to get the ciphertext matrix after covering ,right Perform ciphertext rotation on each ciphertext. The number of digits rotated is the number of rows the ciphertext is in. Add the rotated ciphertext row by row and output the result , sent to the client; 6. The client decrypts the query information and enters the query results and private key , the server outputs the client's query data , completing queries and retrievals that protect client privacy and ensure accuracy.
[0032] like Figure 3As shown, in order to realize the above-mentioned symmetric security privacy information retrieval method based on homomorphic encryption, the present invention also proposes a symmetric security privacy information retrieval system based on homomorphic encryption, the system includes a query generation module, an encoding module, a query vector construction module and a reply generation module; wherein: Query generation module: For the querying party, the client needs to generate the corresponding query through the query index provided by the querying party user. The query generation module will first determine whether the current query is the first query. If so, the query generation module will normally construct a complete query vector and cache the index of this query. Otherwise, it is necessary to check the relative position of the current query index and the previously cached index, and generate a set of offsets based on this relative position. The offset is sent to the server as the actual query; Encoding module, before the protocol starts executing, the server first needs to encode the message in the database. A message is not stored continuously in rows, but in the same column of different rows. Corresponding to the plaintext polynomial, it is stored in the same coefficient position of each plaintext polynomial. Therefore, the number of rows of the message matrix is determined by the message size, and the number of columns is fixed, which is equal to the length of a BFV homomorphic encryption polynomial plaintext; Query vector construction module: The query vector construction module on the server side receives the query sent by the client and outputs the corresponding query vector. If a query vector is received, a copy of the query vector needs to be retained and the query vector and the message matrix need to be used to perform the query operation. If an offset is received, a new query vector needs to be constructed using the previously saved query vector copy and the offset to perform the query operation, and the new query vector needs to be saved as a copy. The reply generation module on the server side is used to convert the execution results of the query operation into actual query results. In batch queries, the server side generates multiple results. If the message length is short, if multiple results are directly returned to the client, it will bring a large communication cost. The reply generation module can splice multiple messages into a small amount of ciphertext through ciphertext splicing to save the communication overhead of the result return process. In the case of a large message length, a single ciphertext cannot accommodate a message. In this case, multiple ciphertexts will be used to load the reply through reply generation.
[0033] The following is a detailed description of a symmetric security privacy information retrieval method and system based on homomorphic encryption of the present invention through specific embodiments in conjunction with the accompanying drawings.
[0034] like Figure 2 As shown in Figure 2, the client of the medical query system generates a homomorphic encrypted public key based on the negotiated parameters. and private key ; The patient or family member query user on the client selects a set of query indexes, and the client needs to execute a set of times Batch query of The client constructs a set of queries based on the query index, including a query vector and Offset , and send it to the server; The server of the medical query system generates a set of query vectors based on the query ;in: ; The server of the medical query system is based on the query vector Perform query operations with the data matrix to generate a set of query results. The server of the medical query system concatenates the generated set of query results into the same ciphertext through homomorphic rotation operations and homomorphic addition, and returns them to the server.
[0035] After the result is returned to the client, the patient or family member of the client uses the private key Decrypt to get the query data .
[0036] In summary, the present invention provides a symmetric security privacy information retrieval method and system based on homomorphic encryption, which realizes data privacy protection through homomorphic encryption technology, ensures that data is not leaked during transmission and calculation, and enhances data security. When it is not the first query, the present invention significantly reduces the amount of calculation by generating an offset instead of a completely new query vector. The present invention ensures the accuracy and reliability of encryption and decryption operations by controlling the encryption algorithm parameters and defining the polynomial ring form of the plaintext and ciphertext, and provides efficient and secure privacy information retrieval services for patients and their families in the medical system, etc. The user experience is improved.
[0037] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any ordinary technician in the industry can smoothly implement the present invention as shown in the specification and described above. However, any equivalent changes, modifications and evolutions made by technicians familiar with the profession without departing from the scope of the technical solution of the present invention using the technical content disclosed above are all equivalent embodiments of the present invention. At the same time, any equivalent changes, modifications and evolutions made to the above embodiments based on the essential technology of the present invention are still within the protection scope of the technical solution of the present invention.
Claims
1. A symmetric security privacy information retrieval method based on homomorphic encryption, characterized in that: The specific steps include: S1. Construct a homomorphic encryption system based on encryption algorithm parameters and generate an encryption public key and an encryption private key; S2, the server provides data, encodes the data it holds, and organizes the encoded data into a data matrix; S3. The client generates query information according to the index to be queried, and sends the query information to the server; wherein: if it is the first query, a query vector is generated; if it is not the first query, an offset is generated to replace the query vector; S4, the server generates a corresponding query vector based on the query information received from the client, and performs a query operation; S5. The server performs operations based on the query vector and the data matrix to obtain an encrypted query result, and sends the encrypted query result to the client; S6. The client uses the encrypted private key to decrypt the encrypted query result and obtain the query result data.
2. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 1 is characterized in that: In S1, the encryption algorithm parameters include security parameters and ciphertext polynomial coefficients, ciphertext and plaintext.
3. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 2 is characterized in that: In S1, in the homomorphic encryption system: the plaintext is a polynomial ring The ciphertext is a polynomial ring form; in, The coefficients are not greater than and Integer polynomials of , is the degree of the polynomial.
4. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 1 is characterized in that: In S2, the number of rows and columns of the data matrix is determined according to the amount of data held by the server and the data length, wherein the number of rows is determined by the data length and the number of columns is determined by the amount of data. Each piece of data held by the server is divided and the divided data is placed in the data matrix, and the same piece of data is placed in one column of the data matrix.
5. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 1 is characterized in that: The S3 is specifically as follows: the client user provides a query index, and for the first query, a query vector is generated as the query, the query vector includes several ciphertexts, and each ciphertext includes several coefficients; for a non-first query, an offset is generated as the query based on the last query index and the current query index; the current query index is cached, and the query is sent to the server.
6. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 5 is characterized in that: In S3, an offset is generated based on the last query index and the current query index as a query according to the following formula (1): (1); in, is the offset, The index for the last query. For this query index, is the number of coefficient terms.
7. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 1 is characterized in that: S4 is specifically as follows: if the server receives a query vector , then As the query vector in the query operation Output, and query vector Cache; if an offset is received , then according to the cached query vector and offset , after processing, a new query vector is generated and cached as the query vector .
8. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 7 is characterized in that: In said S4, the specific processing process is: according to For the query vector The elements in are translated as follows: (2); according to Pair Vector Each element in performs ciphertext rotation, and the number of bits rotated is the value of offset[1], thereby obtaining a new query vector.
9. The symmetric security privacy information retrieval method based on homomorphic encryption according to claim 1 is characterized in that: S5 specifically comprises: performing an inner product between the query vector and the data matrix to obtain a covered ciphertext matrix, performing a ciphertext rotation operation on each item of the ciphertext matrix, and the number of bits rotated is the number of rows where the ciphertext is located; The rotated ciphertext is added row by row, and the resulting ciphertext is sent to the client.
10. A symmetric security privacy information retrieval system according to any one of claims 1 to 9, characterized in that: The symmetric security privacy information retrieval system includes a query generation module, an encoding module, a query vector construction module and a reply generation module; wherein: The query generation module is used to generate a corresponding query based on the query index provided by the querying user; The encoding module is used to encode the data in the server database; and organize the encoded data into a data matrix; The query vector construction module is used to receive the query information from the client, generate the corresponding query vector, and perform the query operation; The reply generation module is used to convert the execution result of the query operation into the actual query result.