A privacy information extraction method and device based on post-quantum cryptography primitives
Patent Information
- Application Number
- CN202411610495.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2044-11-12
AI Technical Summary
[0004]本发明实施例提供一种基于后量子密码学原语的隐私信息提取方法、装置、电子设备及可读存储介质,可以解决相关技术中隐私计算效率低、通信复杂度高的问题
[0064] This invention reduces the time complexity of server and client computations by arranging data elements stored in a linear structure in the database in matrix form. ,Furthermore, this invention addresses the communication complexity between the client and server. In this embodiment, based on a historical plaintext retrieval request in a non-privacy computing scenario, a first region in the database is determined. The first position coordinates of each data element in the first region within the database matrix are encrypted to generate a first encrypted result, which is then stored in a cache. By pre-encrypting and storing the position coordinates of some data in the database, the server does not need to encrypt the position coordinates of all data in the database after the client sends a query request, thus improving the efficiency of the client obtaining target data from the server. Upon receiving a ciphertext query request from the client, the second position coordinates of each data element in the second region of the database within the database matrix are encrypted to generate a second encrypted result. Based on the ciphertext query request, the first encrypted result, and the second encrypted result, the target ciphertext data corresponding to the ciphertext query request is determined. A query response message is sent to the client, carrying the target ciphertext data. In this invention, when the client obtains target data from the server, the server does not need to decrypt the ciphertext query request; instead, the data is directly determined through the ciphertext query request, the first encrypted result, and the second encrypted result, improving the security of the client obtaining target data from the server.
Smart Images

Figure CN119675851B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of privacy computing technology, specifically to a method and apparatus for extracting privacy information based on post-quantum cryptography primitives. Background Technology
[0002] With the rapid development of the information technology field, cloud computing has gradually become a trend. In this context, users can upload their data to cloud servers, which then perform calculations and return the results to the user, significantly reducing the computational burden on the user's end. While this computing model optimizes user overhead, a key issue with cloud computing is the potential leakage of user-generated computational data during the computation process. This data may contain users' private information, which is publicly stored on the server. To address this issue, a series of privacy-preserving computing solutions have been proposed, ensuring that servers complete computational tasks without knowing users' private information.
[0003] With the rapid advancement of quantum information technology, existing public-key cryptography systems are becoming increasingly insecure. Therefore, a series of post-quantum cryptographic schemes have been proposed, most of which are based on techniques such as lattice cryptography, hash functions, and encoding. However, the privacy-preserving computation algorithms constructed using existing technologies suffer from low computational efficiency and high communication complexity. Summary of the Invention
[0004] This invention provides a method, apparatus, electronic device, and readable storage medium for extracting privacy information based on post-quantum cryptography primitives, which can solve the problems of low privacy computation efficiency and high communication complexity in related technologies.
[0005] To address the aforementioned problems, this invention discloses a privacy information extraction method based on post-quantum cryptography primitives, applied to a server. The method includes:
[0006] Arrange the data elements stored in the database in a linear structure in the form of a matrix;
[0007] Based on historical plaintext retrieval requests in a non-privacy computing scenario, a first region in the database is determined; the first region is a region in the database that meets preset conditions.
[0008] The first encrypted result is generated by encrypting the first position coordinates of each data element in the first region in the database matrix, and the first encrypted result is stored in the cache.
[0009] Upon receiving a ciphertext query request from the client, the second position coordinates of each data element in the second region of the database within the database matrix are encrypted to generate a second encryption result; the second region is the region in the database other than the first region.
[0010] Based on the ciphertext query request, the first encryption result, and the second encryption result, determine the target ciphertext data corresponding to the ciphertext query request;
[0011] A query response message is sent to the client, the query response message carrying the target encrypted data.
[0012] Optionally, determining the first region in the database based on historical plaintext retrieval requests in a non-privacy computing scenario includes:
[0013] Collect historical plaintext retrieval requests in non-privacy computing scenarios;
[0014] Based on the historical plaintext retrieval request, calculate the number of times each data element in the database is retrieved;
[0015] The region formed by the positions where the number of searches is greater than or equal to a preset threshold number is defined as the first region.
[0016] Optionally, the step of encrypting the first position coordinates of each data point in the first region within the database matrix to generate a first encryption result, and storing the first encryption result in a cache, includes:
[0017] Convert the first position coordinates of each data element into the third position coordinates in binary form;
[0018] The third position coordinates of each data element are encrypted bit by bit to generate the first encryption result;
[0019] Store the first encryption result in the cache.
[0020] Optionally, upon receiving a ciphertext query request from a client, determining the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result includes:
[0021] Upon receiving a ciphertext query request from the client, the first encrypted result is retrieved from the cache;
[0022] A first homomorphic computation is performed on the ciphertext query request, the first encryption result, and the second encryption result to generate a first operation result;
[0023] Perform a second homomorphic computation on the first operation result corresponding to the data with a value of 1 in the database to obtain the third encrypted result of the target data;
[0024] The third encryption result is used as the target ciphertext data.
[0025] Optionally, arranging the data elements stored in the database in a linear structure according to a matrix includes:
[0026] Get the number of data elements stored in the database in a linear structure;
[0027] The number of rows and columns of the matrix are determined based on the number of data elements; wherein the number of rows is equal to the number of columns, and the product of the number of rows and the number of columns is equal to the number of data elements.
[0028] Based on the number of rows and columns, the data is arranged in the form of the matrix.
[0029] Optionally, determining the number of rows and columns of the matrix based on the number of data elements includes:
[0030] The first value is obtained by taking the square root of the number of the data elements;
[0031] If the first value is an integer, the first value is determined as the number of rows and columns of the matrix;
[0032] If the first value is not an integer, the first value is rounded up to obtain the second value;
[0033] The second value is determined as the number of rows and columns of the matrix.
[0034] This invention discloses a privacy information extraction method based on post-quantum cryptography primitives, applied to a client. The method includes:
[0035] Encrypt the query coordinates in the database matrix to generate a ciphertext query request;
[0036] Send the encrypted query request to the server;
[0037] The system receives a query response message from a server, the query response message carrying target encrypted data; the target encrypted data is determined based on the encrypted query request and a first encryption result and a second encryption result; the first encryption result is generated by encrypting the first position coordinates of each data in a first region in a database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in a second region; the first region is a region in the database that meets preset conditions, and the second region is a region in the database other than the first region;
[0038] The target encrypted data is decrypted to obtain the target data.
[0039] Optionally, encrypting the query coordinates in the database matrix to generate a ciphertext query request includes:
[0040] Convert the query coordinates into binary form;
[0041] Encrypt the binary query coordinates to generate a query vector;
[0042] Based on the query vector, a ciphertext query request is generated.
[0043] Optionally, the method further includes:
[0044] Determine the initialization parameters based on the requirements of privacy-preserving computing scenarios;
[0045] Input the initialization parameters into the key generation function to obtain the public-private key pair;
[0046] The private key is stored locally, and the public key is sent to the server.
[0047] Optionally, the step of decrypting the target ciphertext data to obtain the target data includes:
[0048] The target ciphertext data is decrypted using the private key to obtain the target data.
[0049] On the other hand, embodiments of the present invention provide a privacy information extraction device based on post-quantum cryptography primitives, applied to a server, the device comprising:
[0050] The sorting module is used to arrange data elements stored in the database in a linear structure in the form of a matrix.
[0051] The first determining module is used to determine a first region in the database based on historical plaintext retrieval requests in a non-privacy computing scenario; the first region is a region in the database that meets preset conditions.
[0052] The first encryption module is used to encrypt the first position coordinates of each data in the first region in the database matrix to generate a first encryption result, and store the first encryption result in the cache.
[0053] The second encryption module is used to encrypt the second position coordinates of each data element in the database matrix in the second region of the database when a ciphertext query request is received from the client, and generate a second encryption result; the second region is the region in the database other than the first region;
[0054] The second determining module is used to determine the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result;
[0055] The first sending module is used to send a query response message to the client, the query response message carrying the target encrypted data.
[0056] This invention provides a privacy information extraction device based on post-quantum cryptography primitives, applied to a client. The device includes:
[0057] The third encryption module is used to encrypt the query coordinates in the database matrix and generate a ciphertext query request.
[0058] The second sending module is used to send the encrypted query request to the server;
[0059] A receiving module is used to receive a query response message sent by a server, wherein the query response message carries target encrypted data; the target encrypted data is determined based on the encrypted query request and a first encryption result and a second encryption result; the first encryption result is generated by encrypting the first position coordinates of each data in a first region in a database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in a second region; the first region is a region in the database that meets preset conditions, and the second region is a region in the database other than the first region;
[0060] The decryption module is used to decrypt the target ciphertext data to obtain the target data.
[0061] In another aspect, embodiments of the present invention also disclose an electronic device, the electronic device including a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors of the aforementioned privacy information extraction method based on post-quantum cryptography primitives.
[0062] This invention also discloses a readable storage medium, which, when the instructions in the readable storage medium are executed by the processor of an electronic device, enables the electronic device to execute the aforementioned privacy information extraction method based on post-quantum cryptography primitives.
[0063] The embodiments of the present invention have the following advantages:
[0064] This invention reduces the time complexity of server and client computations by arranging data elements stored in a linear structure in the database in matrix form. ,Furthermore, this invention addresses the communication complexity between the client and server. In this embodiment, based on a historical plaintext retrieval request in a non-privacy computing scenario, a first region in the database is determined. The first position coordinates of each data element in the first region within the database matrix are encrypted to generate a first encrypted result, which is then stored in a cache. By pre-encrypting and storing the position coordinates of some data in the database, the server does not need to encrypt the position coordinates of all data in the database after the client sends a query request, thus improving the efficiency of the client obtaining target data from the server. Upon receiving a ciphertext query request from the client, the second position coordinates of each data element in the second region of the database within the database matrix are encrypted to generate a second encrypted result. Based on the ciphertext query request, the first encrypted result, and the second encrypted result, the target ciphertext data corresponding to the ciphertext query request is determined. A query response message is sent to the client, carrying the target ciphertext data. In this invention, when the client obtains target data from the server, the server does not need to decrypt the ciphertext query request; instead, the data is directly determined through the ciphertext query request, the first encrypted result, and the second encrypted result, improving the security of the client obtaining target data from the server. Attached Figure Description
[0065] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0066] Figure 1 This is a flowchart illustrating the steps of a privacy information extraction method based on post-quantum cryptography primitives provided in an embodiment of the present invention.
[0067] Figure 2 This is a flowchart of another privacy information extraction method based on post-quantum cryptography primitives provided in an embodiment of the present invention;
[0068] Figure 3 This is a schematic diagram illustrating the generation of a first encryption result according to an embodiment of the present invention;
[0069] Figure 4 This is a schematic diagram illustrating how a server sends a query response message to a client, according to an embodiment of the present invention.
[0070] Figure 5 This is a schematic diagram illustrating how a encrypted query request is sent to a server, according to an embodiment of the present invention.
[0071] Figure 6 This is a schematic diagram illustrating the generation of a public-private key pair and the sending of the public key to the server, as provided in an embodiment of the present invention.
[0072] Figure 7 This is a schematic diagram illustrating how target encrypted data is decrypted to obtain target data, according to an embodiment of the present invention.
[0073] Figure 8 This is a logic block diagram of a privacy information extraction device based on post-quantum cryptography primitives provided in an embodiment of the present invention;
[0074] Figure 9 This is a logic block diagram of another privacy information extraction device based on post-quantum cryptography primitives provided in an embodiment of the present invention;
[0075] Figure 10 This is a structural diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0076] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0077] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, the term "and / or" in the specification and claims is used to describe the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. In embodiments of this invention, the term "multiple" refers to two or more, and other quantifiers are similar.
[0078] Method Implementation Examples
[0079] This invention provides a privacy information extraction method based on post-quantum cryptography primitives, which can be applied to servers, as shown in the following figure. Figure 1 , Figure 1The flowchart illustrates an embodiment of a privacy information extraction method based on post-quantum cryptography primitives according to the present invention. The method specifically includes the following steps:
[0080] Step 101: Arrange the data elements stored in the database in a linear structure in the form of a matrix.
[0081] The privacy information extraction method based on post-quantum cryptography primitives provided in this invention can be applied to the field of privacy computing. Privacy computing refers to protecting data privacy when processing and analyzing data. Specifically, during the process of data sharing and utilization, data is processed and analyzed while being exposed to other participants in an unreadable form, thereby ensuring the confidentiality and security of the data.
[0082] The privacy information extraction method based on post-quantum cryptography primitives provided in this invention can be applied to servers to extract data from a database when the privacy information is unknown to the server, database administrator, or other observers. The database stores the extracted data elements, and the server interacts with the database through a database interface. Linear structure storage refers to data elements arranged in a linear order, allowing access to specific data elements by index or position. Linear structure storage includes sequential storage structures and linked storage structures. Arranging data elements in a matrix allows access to specific data elements by their position coordinates within the matrix. Each position in the database matrix contains only one bit.
[0083] Step 102: Based on the historical plaintext retrieval request in the non-privacy computing scenario, determine the first region in the database; the first region is the region in the database that meets the preset conditions.
[0084] Non-privacy computing scenarios refer to situations where data privacy protection is not involved or is not particularly important during data computation and processing. Plaintext search requests refer to queries submitted in unencrypted or plaintext form during data processing and retrieval, directly exposing the information the user wants to find. Historical plaintext search requests include the location of the target search data. By compiling and analyzing all historical plaintext search request records, frequently queried data fields, frequently queried data locations, and query times, etc., can be identified.
[0085] It should be noted that the preset condition refers to the number of times a data element is queried being within a preset range. The region formed by the positions of the data whose query counts are within the preset range in the database matrix is defined as the first region.
[0086] Step 103: Encrypt the first position coordinates of each data element in the database matrix in the first region to generate the first encryption result, and store the first encryption result in the cache;
[0087] The first encryption result is a summary of the encryption results of the first position coordinates corresponding to each data element in the first region.
[0088] In this embodiment of the invention, to prevent the security impact of quantum computing on the public-key cryptosystem, a post-quantum encryption algorithm is used to encrypt the first position coordinates of each data element in the database matrix. The post-quantum encryption algorithm includes lattice-based algorithms and hash function-based algorithms. Lattice-based algorithms are a class of algorithms that utilize a lattice structure for computation. A lattice is a discrete subset of a vector space, consisting of all integer linear combinations of a set of basis vectors. For example, encryption algorithms based on the Learning With Errors (LWE) problem not only provide encryption schemes but also possess resistance to quantum attacks.
[0089] It should be noted that before encrypting the first position coordinates of each data element in the database matrix in the first region to generate the first encrypted result, the process may further include: receiving a public key sent by the client. Based on the public key and the first position coordinates corresponding to each data element, a first encryption algorithm is run to encrypt the first position coordinates, generating the first encrypted result. For example, the public key sent by the client is received, where the public key is generated by the client using an LWE-based homomorphic encryption module algorithm. The LWE-based homomorphic encryption module algorithm includes four algorithms: Setup algorithm, KeyGen algorithm, Enc algorithm, and Dec algorithm. The Setup algorithm and KeyGen algorithm generate a public-private key pair, the Enc algorithm is used to encrypt the data, and the Dec algorithm is used to decrypt the encrypted data. The server receives the public key sent by the client and uses the Enc algorithm from the LWE-based homomorphic encryption module algorithm to encrypt the first position coordinates. Figure 3 As shown, Figure 3 A schematic diagram is shown of a method for encrypting the first position coordinates of each data element in a first region to generate a first encrypted result.
[0090] The first position coordinates of each data element are encrypted to obtain the encrypted position coordinates of each data element. The encrypted position coordinates of each data element are then summarized as the first encryption result, and the original first position coordinates are replaced by the encrypted position coordinates.
[0091] Step 104: Upon receiving a ciphertext query request from the client, encrypt the second position coordinates of each data element in the second region of the database within the database matrix to generate a second encryption result; the second region is the region in the database other than the first region.
[0092] It should be noted that the encryption algorithm used to encrypt the second position coordinates of each data element in the second region within the database matrix is the same as the encryption algorithm used to encrypt the first position coordinates of each data element in the first region within the database matrix.
[0093] Step 105: Determine the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result;
[0094] The server needs to determine the target ciphertext data corresponding to the ciphertext query request based on the previously calculated first and second encryption results. Specifically, the server has already encrypted the first position coordinates of data elements in the first region of the database and the second position coordinates of data elements in the second region using a post-quantum cryptography algorithm (such as LWE), obtaining the first and second encryption results.
[0095] In this embodiment of the invention, when the server receives a ciphertext query request sent by the client, it does not decrypt the ciphertext query request. When the server does not know the content of the ciphertext query request, it directly matches the ciphertext query request with the first encryption result and the second encryption result to protect the user's privacy information.
[0096] Step 106: Send a query response message to the client, the query response message carrying the target encrypted data.
[0097] The server constructs a query response message based on the target encrypted data according to the communication protocol agreed upon between the client and the server. The query response message includes: a message header (such as message type, length, status code, etc.) and a message body (the actual target encrypted data).
[0098] If the server and client have not established a communication connection or the connection is broken, the server establishes a network connection with the client. Specifically, this can be achieved through protocols such as TCP / IP and HTTP.
[0099] Once a connection is established, the server sends the constructed query response message to the client. If network errors or connection interruptions occur during the sending of the query response message, the server sends an error message to the client or retrys sending the query response message. For example... Figure 4 As shown, Figure 4This diagram illustrates a server sending a query response message to a client.
[0100] This invention reduces the time complexity of client-generated encryption requests and server-side computation of data element coordinates in the matrix by arranging data elements stored linearly in the database in a matrix. Furthermore, based on historical plaintext retrieval requests in a non-privacy computing scenario, this invention determines a first region in the database, identifying which data in the database is accessed most frequently by the client. The first position coordinates of each data element in the first region within the database matrix are encrypted to generate a first encryption result, which is then stored in a cache. By pre-encrypting and storing the position coordinates of some data in the database in the cache, the efficiency of the client retrieving target data from the server is improved. Upon receiving a ciphertext query request from the client, the second position coordinates of each data element in the second region of the database within the database matrix are encrypted to generate a second encryption result. Based on the ciphertext query request, the first encryption result, and the second encryption result, the target ciphertext data corresponding to the ciphertext query request is determined. A query response message carrying the target ciphertext data is sent to the client. In this embodiment of the invention, when the client obtains target data from the server, the server does not need to decrypt the ciphertext query request. Instead, the target data corresponding to the ciphertext query request is directly determined through the ciphertext query request and the first encryption result and the second encryption result, thereby improving the security of the client obtaining target data from the server.
[0101] Optionally, determining the first region in the database based on historical plaintext retrieval requests in a non-privacy computing scenario includes:
[0102] Step 11: Collect historical plaintext retrieval requests in non-privacy computing scenarios;
[0103] Step 12: Based on the historical plaintext retrieval request, calculate the number of times each data element in the database is retrieved;
[0104] Step 13: The region formed by the positions where the number of searches is greater than or equal to a preset threshold number is determined as the first region.
[0105] It should be noted that a reasonable frequency threshold should be pre-set based on actual needs and analytical objectives. The pre-set frequency threshold is used to distinguish which data elements in the database are frequently searched by users and which are less frequently searched; or which location coordinates corresponding to each data element are frequently searched by users and which are relatively less frequently searched.
[0106] Historical plaintext search request data sources include: search engines, which typically record user search request logs; database query logs, which also record user query operations and contain users' plaintext search requests; and public datasets, where some research institutions or organizations publish user search request datasets. Historical plaintext search request information to the server is extracted from search engines, database query logs, or public datasets. The extracted plaintext search requests are then preprocessed, including cleaning the information and removing invalid or abnormal data items.
[0107] After preprocessing the historical plaintext search requests, the collected historical plaintext search requests are parsed to extract the data elements queried by the user or the position coordinates of the data elements in the database matrix. If the historical plaintext search request only includes data elements, the position coordinates of the data elements in the database matrix are obtained. The first occurrence count of each data element in the database in the historical plaintext search request, or the second occurrence count of each data element's position coordinates in the historical plaintext search request, is counted. If the first and second occurrence counts are equal, the region corresponding to the position coordinates of the data elements whose search frequency is greater than or equal to a preset threshold is defined as the first region. The first region includes the position coordinates of some data elements in the database matrix, and the data elements at those position coordinates can be indexed.
[0108] In this embodiment of the invention, by collecting historical plaintext retrieval requests in non-privacy computing scenarios, and calculating the number of times data elements at each location in the database are retrieved based on the historical plaintext retrieval requests, the region consisting of the locations whose number of retrievals is greater than or equal to a preset threshold number is determined as the first region, which can identify which part of the data in the database is the data that is accessed frequently by users.
[0109] Optionally, the step of encrypting the first position coordinates of each data element in the first region within the database matrix to generate a first encryption result, and storing the first encryption result in a cache, includes:
[0110] Step 21: Convert the first position coordinates of each data element into the third position coordinates in binary form;
[0111] Step 22: Encrypt the third position coordinates of each data element bit by bit to generate the first encryption result;
[0112] Step 23: Store the first encryption result in the cache.
[0113] It should be noted that the first position coordinates of each data element in the database matrix are in the form of (i, j), where i represents the data element's position in the (i-1)th row and j represents its position in the (j-1)th column. Both i and j are converted to binary form and used as the third position coordinates of the data element in the database matrix. An encryption algorithm is then used to encrypt the third position coordinates bit by bit to obtain the first encryption result; for example, the encryption algorithm could be the Enc algorithm from the LWE-based homomorphic encryption module.
[0114] It should be noted that the set of position coordinates corresponding to all data elements in the database matrix is A, and the set of position coordinates corresponding to each data element in the first region is data1. Converting the position coordinates (i, j) in data1 to binary form, the third position coordinate of a single data element in the binary form of the database matrix is... and Where N is the number of data elements stored in a linear structure. Let be the number of rows and columns of the matrix. It is the binary value of i after conversion. This is the binary value after conversion of j. The length of the binary value is determined by the number of rows and columns of the matrix. The third position coordinate in the converted binary form is then encrypted bit-by-bit using the Enc encryption algorithm, yielding... and Right now Here, pk is the public key used to encrypt the third position coordinates. This is used to encrypt the data elements corresponding to each data element in the first region. The results are then aggregated to obtain the first encrypted result. For example, the content of the database matrix is... The set of first position coordinates corresponding to the data elements in the first region is data1 = {(1,1)}. First, this coordinate value is converted to binary form ((1),(1)). Then, the third position coordinate in binary form is encrypted using the Enc encryption algorithm. get This is the first encryption result.
[0115] In this embodiment of the invention, by converting the first position coordinates of each data element into the third position coordinates in binary form, bitwise encrypting the third position coordinates of each data element, generating a first encryption result, and storing the first encryption result in a cache, by pre-encrypting the position coordinates corresponding to some data in the database and storing them in the cache, after the client sends a query request to the server, the server does not need to encrypt the position coordinates of all data in the database, thereby improving the efficiency of the client in obtaining the target data from the server.
[0116] Optionally, determining the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result includes:
[0117] Step 31: Extract the first encryption result from the cache;
[0118] Step 32: Perform a first homomorphic computation on the ciphertext query request, the first encryption result, and the second encryption result to generate a first operation result;
[0119] Step 33: Perform a second homomorphic computation on the first operation result corresponding to the data element with a value of 1 in the database to obtain the third encryption result of the target data;
[0120] Step 34: Use the third encryption result as the target ciphertext data.
[0121] The first encryption result is obtained by summarizing the encrypted results generated from encrypting the first position coordinates of each data element in the first region of the database matrix, and is pre-stored in the cache. Therefore, upon receiving a ciphertext query request, the first encryption result needs to be retrieved from the cache. The second encryption result is obtained by summarizing the encrypted results generated from encrypting the second position coordinates of each data element in the second region of the database matrix upon receiving a ciphertext query request from the client. Specifically, the position coordinates of each data element in the second region of the database matrix are converted into binary form. For example, if the position coordinates of a single data element in the database matrix are (i, j), the binary position coordinates of that data element in the database matrix are: in and For example, when the number of data elements is 16, l-1 = 1, the position coordinates of a single data element in the database matrix are (2, 3), and the converted binary form is (10, 11). The Enc encryption algorithm is used for... Encrypt to obtain and Here, pk is the public key used by the server to encrypt the binary location coordinates. This is used to encrypt the data elements corresponding to each data element in the first region. The results are then summarized to obtain the second encrypted result. The position coordinates of all data elements in the database matrix are converted to binary form as follows: in, And x∈{0,1,l-1}; for and The encrypted position coordinates obtained after encryption are: and The encrypted result of the position coordinates corresponding to a single data element in the first region is: The encryption result of the position coordinates corresponding to a single data element in the second region is:
[0122] It should be noted that performing the first homomorphic computation on the ciphertext query request and the first and second encryption results means performing the first homomorphic computation on the ciphertext query request and the encrypted position coordinates of each data element in the database matrix.
[0123] The encrypted query request received from the client is Homomorphic computation is performed on the ciphertext query request, the first encryption result, and the second encryption result to generate the first operation result. The formula for the first homomorphic computation is as follows:
[0124]
[0125] in, This refers to the homomorphic multiplication operation of the LWE-based homomorphic encryption module. This refers to the modulo-2 homomorphic addition operation of the LWE-based homomorphic encryption module. For encrypted query requests sent by the client, It is the encrypted result of encrypting the position coordinates of each data element in the data matrix. ψ is the encrypted result of encrypting the binary value 1 using the Enc algorithm. i,j The result is the operation after performing a first homomorphic computation on the ciphertext query request, the first encryption result, and the second encryption result.
[0126] For example, a user's encrypted query request is The contents of the database matrix are The set of position coordinates corresponding to each data element in the first region is data1 = {(1,1)}, and the set of position coordinates corresponding to each data element in the second region is data2 = {(0,0),(0,1),(1,0)}. The first encryption result corresponding to data1 is... The encryption result corresponding to data2 is: Perform a first homomorphic computation on the ciphertext query request, the first encryption result, and the second encryption result to obtain the first operation result.
[0127]
[0128] Where, ψ 0,0 It is the result of performing the first homomorphic computation on the encryption result corresponding to the position coordinates (0, 0) and the ciphertext query request, ψ 0,1It is the result of performing the first homomorphic computation on the encryption result corresponding to the position coordinates (0, 1) and the ciphertext query request, ψ 1,0 It is the result of performing the first homomorphic computation on the encryption result corresponding to the position coordinates (1, 0) and the ciphertext query request, ψ 1,1 It is the result of performing a first homomorphic computation on the encryption result corresponding to the position coordinates (1,1) and the ciphertext query request. The first computation result includes ψ 0,0 ψ 0,1 ψ 1,0 ψ 1,1 .
[0129] Perform a second homomorphic computation on the first operation result corresponding to the data element with a value of 1 in the database. The formula for the second homomorphic computation is as follows:
[0130]
[0131] DB[i,j] = 1 refers to data elements in the database matrix with a value of 1. The server performs a second homomorphic computation between the first operation results corresponding to the data elements with a value of 1. For example, the database matrix is... The coordinates of the data elements with a value of 1 are (0,1) and (1,0). Res is actually the third encryption result of the data at position coordinates (0, 1), and the third encryption result is used as the target ciphertext data.
[0132] In this embodiment of the invention, the first encryption result is extracted from the cache; a first homomorphic computation is performed on the ciphertext query request, the first encryption result, and the second encryption result to generate a first operation result; a second homomorphic computation is performed on the first operation result corresponding to the data element with a value of 1 in the database to obtain a third encryption result of the target data; and the third encryption result is used as the target ciphertext data. By directly performing the first homomorphic computation on the ciphertext query request with the first encryption result and the second encryption result, the server does not need to decrypt the ciphertext query request, preventing the server, database administrator, or other users from obtaining the specific content of the client's query, thus ensuring the security of the client obtaining the target data from the server.
[0133] Optionally, arranging the data elements stored in the database in a linear structure according to a matrix includes:
[0134] Step 41: Obtain the number of data elements stored in the database in a linear structure;
[0135] Step 42: Determine the number of rows and columns of the matrix based on the number of data elements; wherein the number of rows is equal to the number of columns, and the product of the number of rows and the number of columns is equal to the number of data elements.
[0136] Step 43: Based on the number of rows and columns, arrange the data in the form of the matrix.
[0137] In this embodiment of the invention, each data element is a one-bit binary value. When the total number of data elements is N, the database is arranged as follows: The data is in matrix form. When the number of data elements is N, the index length of each data element is logN; after arranging the data elements in matrix form, the position coordinate length of each data element is... For example, when the number of data elements is 16, the length of the binary index corresponding to each data element is log216; after arranging the data elements in a 4×4 matrix, the length of the position coordinates corresponding to each data element is 2log24.
[0138] In this embodiment of the invention, after arranging linearly arranged data elements into a two-dimensional matrix, the length of the position coordinates corresponding to the data elements is reduced from logN to [a smaller value]. This reduces the number of times encryption algorithms are applied to location coordinates, lowering the time complexity of accessing all data in the database; and it also shortens the length of encryption requests sent by the client, reducing the communication complexity between the client and the server.
[0139] Optionally, determining the number of rows and columns of the matrix based on the number of data elements in step 42 includes:
[0140] Step 51: Perform a square root operation on the number of data elements to obtain a first value;
[0141] Step 52: If the first value is an integer, determine the first value as the number of rows and columns of the matrix;
[0142] Step 53: If the first value is not an integer, round the first value up to obtain the second value;
[0143] Step 54: Determine the second value as the number of rows and columns of the matrix.
[0144] For example, when the number N equals 25, The data elements stored in a linear structure are arranged in a 5×5 matrix; when the number N equals 24, Not an integer, yes Round up to 5, arrange the data elements stored in a linear structure into a 5×5 matrix, and fill redundant positions with 0.
[0145] In this embodiment of the invention, the number of rows and columns of the matrix are determined in two cases based on whether the value after performing a square root operation on the number of data elements is an integer. This reduces the number of position coordinates corresponding to data elements, reduces the number of times homomorphic encryption is performed, and lowers the communication complexity between the client and the server.
[0146] In summary, the privacy information extraction method based on post-quantum cryptography primitives provided in this invention reduces the number of indexes corresponding to data elements by arranging data elements stored in a linear structure in the database in a matrix form, thereby reducing the time complexity of the server accessing all data in the database. Based on historical plaintext retrieval requests in a non-privacy computing scenario, a first region in the database is determined; the first position coordinates of each data element in the first region within the database matrix are encrypted to generate a first encryption result, which is then stored in a cache. By pre-encrypting the position coordinates corresponding to some data in the database and storing them in the cache, the server does not need to encrypt the position coordinates of all data in the database after the client sends a query request, thus improving the efficiency of the client retrieving target data from the server. Upon receiving a ciphertext query request from the client, the second position coordinates of each data element in the second region of the database within the database matrix are encrypted to generate a second encryption result; based on the ciphertext query request, the first encryption result, and the second encryption result, the target ciphertext data corresponding to the ciphertext query request is determined; a query response message carrying the target ciphertext data is sent to the client. In this invention, when the client obtains target data from the server, the server does not need to encrypt the encrypted query request. Instead, the data is directly determined by the encrypted query request and the first and second encryption results, which improves the security of the client obtaining target data from the server.
[0147] This invention provides a privacy information extraction method based on post-quantum cryptography primitives, which can be applied to client-side applications. (Refer to...) Figure 2 The diagram illustrates a flowchart of another embodiment of the privacy information extraction method based on post-quantum cryptography primitives of the present invention. The method may include the following steps:
[0148] Step S201: Encrypt the query coordinates in the database matrix to generate a ciphertext query request;
[0149] Step S202: Send the encrypted query request to the server;
[0150] Step S203: Receive a query response message sent by the server, wherein the query response message carries target encrypted data;
[0151] Step S204: Decrypt the target ciphertext data to obtain the target data.
[0152] Specifically, the query coordinates in the database matrix are determined, and these coordinates are encrypted using a post-quantum encryption algorithm. A ciphertext query request is then generated based on the encrypted coordinates. For example, the query coordinates are encrypted using an encryption algorithm from a LWE-based homomorphic encryption module, and a ciphertext query request is generated based on the encrypted coordinates. This ciphertext query request is used to retrieve the target data from the server. Figure 5 As shown, Figure 5 This diagram illustrates a method of encrypting query coordinates in a database matrix, generating a ciphertext query request, and sending the ciphertext query request to a server.
[0153] In the event that the server and client have not established a communication connection or the connection has been broken, a network connection with the server can be established. Specifically, this can be achieved through protocols such as TCP / IP and HTTP.
[0154] Once a communication link is established, the encrypted query request is sent to the client. If a network error or connection interruption occurs during the transmission of the encrypted query request, the client sends an error message to the server or attempts to resend the query response.
[0155] It should be noted that the target encrypted data is determined based on the encrypted query request and the first and second encryption results. The first encryption result is generated by encrypting the first position coordinates of each data point in the database matrix within the first region, and the second encryption result is generated by encrypting the second position coordinates of each data point in the second region. The first region is the region in the database that meets preset conditions, and the second region is the region in the database excluding the first region. Specifically, the first encryption result is generated by the server and stored in the cache before the user sends the encrypted query request, while the second encryption result is generated by the server after the user sends the encrypted query request.
[0156] After receiving the target ciphertext data sent by the server, the target data corresponding to the encryption algorithm is decrypted using the decryption algorithm corresponding to the encryption algorithm to obtain the target data corresponding to the ciphertext query request.
[0157] In this embodiment of the invention, the query coordinates in the database matrix are encrypted to generate a ciphertext query request. This ciphertext query request is sent to the server, and a query response message is received from the server. The query response message carries target ciphertext data, which is then decrypted to obtain the target data. The target ciphertext data is determined based on the ciphertext query request and a first encryption result and a second encryption result. The first encryption result is generated by the server and stored in a cache before the user sends the ciphertext query request, while the second encryption result is generated by the server after the user sends the ciphertext query request. After the client sends a query request to the server, the server does not need to encrypt the position coordinates of all data in the database, thereby improving the efficiency of the client retrieving the target data from the server.
[0158] Optionally, encrypting the query coordinates in the database matrix to generate a ciphertext query request includes:
[0159] Step 61: Convert the query coordinates into binary form;
[0160] Step 62: Encrypt the binary query coordinates to generate a query vector;
[0161] Step 63: Generate a ciphertext query request based on the query vector.
[0162] Specifically, determine the query coordinates (i,j) in the database matrix, convert the query coordinates to binary form, and (i,j) = ((i0…i) l-1 ),(j0…j l-1 )), where i x ,j x x∈{0,1} and x∈{0,1,l-1} and For query coordinates in binary form ((i0…i l-1 ),(j0…j l-1 Encryption is performed, where (i0…i l-1 (j0…j) converts i to a binary value; l-1 ) converts j to a binary value. For example, a homomorphic encryption module based on LWE is used to perform homomorphic encryption on each bit in the coordinates to generate a query vector. in Yes(i0…i l-1 The result after encryption. It is (j0…j l-1 The encrypted result, pk, is the public key used to encrypt the binary position coordinates. A ciphertext query request is generated based on the query vector. The ciphertext query request includes: a message header (such as message type, length, status code, etc.) and a message body (the actual query vector).
[0163] In this embodiment of the invention, the query coordinates in the database matrix are converted into binary form; the binary query coordinates are encrypted to generate a query vector; and a ciphertext query request is generated based on the query vector to prevent other users from obtaining the client's target query content, thus ensuring the security of the client obtaining data from the server.
[0164] Optionally, the method prior to step S201 further includes:
[0165] Step 71: Determine the initialization parameters based on the privacy computing scenario requirements;
[0166] Step 72: Input the initialization parameters into the key generation function to obtain the public-private key pair;
[0167] Step 73: Save the private key locally and send the public key to the server.
[0168] It should be noted that the encryption strength of privacy information varies under different privacy computing scenarios. In scenarios with high security requirements for privacy information, it is necessary to increase the encryption strength. In this embodiment of the invention, the required encryption strength for the privacy computing scenario is represented by initialization parameters. Exemplarily, the initialization parameters include: a security parameter and an upper bound, where the security parameter is 1. λ λ represents the length of the string consisting entirely of 1s. For example, when λ = 3, 1 λ =111. There is a positive correlation between the security parameter and the encryption strength. The larger the security parameter value, the higher the encryption strength requirement for privacy information in privacy computing scenarios.
[0169] After determining the initialization parameters, these parameters are input into the key generation function to generate a public-private key pair. Specifically, the encryption algorithm based on the fault-tolerant learning problem includes the following steps:
[0170] Step 81: Determine the lattice dimension n, modulus q, and noise distribution X. The encryption strength is positively correlated with the uniformity of the lattice dimension, modulus, and noise distribution; the larger the lattice dimension and modulus, the higher the encryption strength and the higher the security of the privacy information.
[0171] Step 82: Set the number of samples m, where m > n;
[0172] Step 83: Randomly select an n-dimensional column vector s as the private key.
[0173] Step 84: Randomly and uniformly select an m×n matrix A. For each row a of matrix A... i Calculate b i The formula is as shown in equation (7), where e i It is a noise term randomly selected from the noise distribution X, and all bi Combined into vector b, together with matrix A, they form the public key (A, b).
[0174] b i =a i ×s+(e i mod q) (7)
[0175] It should be noted that in the LWE-based homomorphic encryption scheme, the public key consists of a matrix A and a vector b, where A is a uniformly distributed random m×n matrix, and b is generated by the private key s and the noise vector e, satisfying b=A×s+(e mod q). The public key is used to encrypt data; the private key is an n-dimensional column vector s, used to decrypt the encrypted data.
[0176] For example, in this embodiment of the invention, a homomorphic encryption module algorithm based on fault-tolerant learning can be used. The module algorithm includes four algorithms (Setup, KeyGen, Enc, Dec). The Setup and KeyGen algorithms are used to generate public-private key pairs, the Enc algorithm is used to encrypt the data, and the Dec algorithm is used to decrypt the encrypted data. The Setup and KeyGen algorithms generate public-private key pairs, requiring input security parameters and upper bounds. These security parameters and upper bounds represent the encryption strength required for the privacy computing scenario; the larger the security parameter values and upper bound values, the higher the encryption strength required for the privacy computing scenario. Figure 6 As shown, Figure 6 This diagram illustrates a client generating a public-private key pair and sending the public key to the server.
[0177] After generating the public-private key pair, the public key is sent to the server so that the server can use the public key and the Enc encryption algorithm to encrypt the position coordinates of each data element in the data matrix. The private key is kept locally and used to decrypt the encrypted data received from the server.
[0178] In this embodiment of the invention, initialization parameters are determined according to the requirements of privacy computing scenarios; the initialization parameters are input into a key generation function to obtain a public-private key pair; the private key is stored locally, and the public key is sent to the server. Determining the initialization parameters according to different privacy computing scenarios enables flexibility in encrypting privacy information.
[0179] Optionally, the step of decrypting the target ciphertext data to obtain the target data includes:
[0180] The target ciphertext data is decrypted using the private key to obtain the target data.
[0181] In this embodiment of the invention, the private key *s* is an n-dimensional vector, and the target ciphertext data *c* is generated by *c = A × s + (e mod q)*, where A is the public key matrix and *e* is a noise vector. Upon receiving the target ciphertext data, calculations are performed using the private key *s* and the public key *A*. The calculation results are then processed (e.g., noise removal, inverse modulo operation, etc.) to obtain the final plaintext data. Figure 7 As shown, Figure 7 This diagram illustrates a method of decrypting target ciphertext data to obtain the target data.
[0182] In this embodiment of the invention, the public key is used to encrypt data, while the private key is used to decrypt data, ensuring secure data transmission. Only the data recipient holding the private key can decrypt the data, thereby effectively preventing unauthorized personnel from obtaining data content.
[0183] In summary, the privacy information extraction method based on post-quantum cryptography primitives provided in this invention can be applied to a client. It determines initialization parameters according to the privacy computing scenario requirements; inputs these parameters into a key generation function to obtain a public-private key pair; stores the private key locally; and sends the public key to the server, enabling the server to encrypt location coordinates in the database using the public key. The query coordinates are converted to binary form and encrypted to generate a ciphertext query request; this request is sent to the server; the server sends a query response message containing the target ciphertext data; and the target ciphertext data is decrypted using the private key to obtain the target data. This improves the efficiency of the client retrieving data from the server while ensuring the security of the data retrieved by the client.
[0184] Device Examples
[0185] like Figure 8 As shown, Figure 8 This diagram illustrates a logic block diagram of a privacy information extraction device based on post-quantum cryptography primitives according to an embodiment of the present invention. The device may include:
[0186] The sorting module is used to arrange data elements stored in the database in a linear structure in the form of a matrix.
[0187] The first determining module is used to determine a first region in the database based on historical plaintext retrieval requests in a non-privacy computing scenario; the first region is a region in the database that meets preset conditions.
[0188] The first encryption module is used to encrypt the first position coordinates of each data in the first region in the database matrix to generate a first encryption result, and store the first encryption result in the cache.
[0189] The second encryption module is used to encrypt the second position coordinates of each data element in the database matrix in the second region of the database when a ciphertext query request is received from the client, and generate a second encryption result; the second region is the region in the database other than the first region;
[0190] The second determining module is used to determine the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result;
[0191] The first sending module is used to send a query response message to the client, the query response message carrying the target encrypted data.
[0192] In summary, this invention provides a privacy information extraction device based on post-quantum cryptography primitives. It can arrange data elements stored in a linear structure in a database in a matrix form, reducing the number of position coordinates corresponding to all data elements in the database. Based on a historical plaintext retrieval request in a non-privacy computing scenario, a first region in the database is determined. The first position coordinates of each data element in the first region within the database matrix are encrypted to generate a first encryption result, which is stored in a cache. This allows the server to avoid encrypting the position coordinates of all data elements in the database matrix when the client sends a ciphertext query request, improving the efficiency of data retrieval from the server. Based on the ciphertext query request, the first encryption result, and the second encryption result, the target ciphertext data corresponding to the ciphertext query request is determined. A query response message is sent to the client, carrying the target ciphertext data, ensuring the security of data retrieval from the server by the client.
[0193] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.
[0194] like Figure 9 As shown, Figure 9 This diagram illustrates a logic block diagram of another privacy information extraction device based on post-quantum cryptography primitives provided by an embodiment of the present invention. The device may include:
[0195] The third encryption module is used to encrypt the query coordinates in the database matrix and generate a ciphertext query request.
[0196] The second sending module is used to send the encrypted query request to the server;
[0197] A receiving module is used to receive a query response message sent by a server, wherein the query response message carries target encrypted data; the target encrypted data is determined based on the encrypted query request and a first encryption result and a second encryption result; the first encryption result is generated by encrypting the first position coordinates of each data in a first region in a database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in a second region; the first region is a region in the database that meets preset conditions, and the second region is a region in the database other than the first region;
[0198] The decryption module is used to decrypt the target ciphertext data to obtain the target data.
[0199] In summary, the privacy information extraction device based on post-quantum cryptography primitives provided in this embodiment of the invention can encrypt the query coordinates in the database matrix to generate a ciphertext query request; send the ciphertext query request to the server; receive the query response message sent by the server, the query response message carrying the target ciphertext data; the target ciphertext data is determined based on the ciphertext query request and the first encryption result and the second encryption result; the first encryption result is generated by encrypting the first position coordinates of each data in the first region in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second region; decrypt the target ciphertext data to obtain the target data, thereby improving the efficiency of the client obtaining data from the server and ensuring the security of the client obtaining data from the server.
[0200] As the apparatus embodiment is basically similar to the method embodiment, it is described in a relatively simple manner. For relevant details, please refer to the description of the method embodiment.
[0201] Reference Figure 10 This is a structural block diagram of an electronic device for extracting privacy information based on post-quantum cryptography primitives, provided by an embodiment of the present invention. Figure 10 As shown, the electronic device includes: a processor, a memory, a communication interface, and a communication bus. The processor, the memory, and the communication interface communicate with each other through the communication bus. The memory is used to store executable instructions, which cause the processor to execute the privacy information extraction method of the aforementioned embodiment.
[0202] The processor can be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable devices, transistor logic devices, hardware components, or any combination thereof. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, or a combination of a DSP and a microprocessor.
[0203] The communication bus may include a path for transmitting information between the memory and the communication interface. The communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one line is used in the figure, but this does not indicate that there is only one bus or one type of bus.
[0204] The memory may be ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or it may be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory), magnetic tape, floppy disk, and optical data storage devices, etc.
[0205] This invention also provides a non-transitory computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device (server or terminal), enables the processor to perform... Figure 1 or Figure 2 The method for extracting privacy information is shown.
[0206] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0207] Those skilled in the art will understand that embodiments of the present invention can provide methods and apparatus. Therefore, embodiments of the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0208] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0209] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a predictive manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0210] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0211] Although preferred embodiments of the present invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present invention.
[0212] Finally, 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, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0213] The present invention provides a detailed description of a method, apparatus, electronic device, and readable storage medium for extracting privacy information based on post-quantum cryptography primitives. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, those skilled in the art will recognize that there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A method for extracting privacy information based on post-quantum cryptography primitives, characterized in that, Applied to a server, the method includes: Arrange the data elements stored in the database in a linear structure in the form of a matrix; Based on historical plaintext retrieval requests in a non-privacy computing scenario, a first region in the database is determined; the first region is a region in the database that meets preset conditions. The first encrypted result is generated by encrypting the first position coordinates of each data element in the first region in the database matrix, and the first encrypted result is stored in the cache. Upon receiving a ciphertext query request from the client, the second position coordinates of each data element in the second region of the database within the database matrix are encrypted to generate a second encryption result; the second region is the region in the database other than the first region. Based on the ciphertext query request, the first encryption result, and the second encryption result, determine the target ciphertext data corresponding to the ciphertext query request; Send a query response message to the client, the query response message carrying the target encrypted data; The step of determining the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result includes: Retrieve the first encryption result from the cache; A first homomorphic computation is performed on the ciphertext query request, the first encryption result, and the second encryption result to generate a first operation result; Perform a second homomorphic computation on the first operation result corresponding to the data element with a value of 1 in the database to obtain the third encryption result of the target data; The third encryption result is used as the target ciphertext data.
2. The method according to claim 1, characterized in that, The step of determining the first region in the database based on historical plaintext retrieval requests in a non-privacy computing scenario includes: Collect historical plaintext retrieval requests in non-privacy computing scenarios; Based on the historical plaintext retrieval request, calculate the number of times each data element in the database is retrieved; The region formed by the positions where the number of searches is greater than or equal to a preset threshold number is defined as the first region.
3. The method according to claim 1, characterized in that, The step of encrypting the first position coordinates of each data element in the first region in the database matrix to generate a first encryption result, and storing the first encryption result in a cache, includes: Convert the first position coordinates of each data element into the third position coordinates in binary form; The third position coordinates of each data element are encrypted bit by bit to generate the first encryption result; Store the first encryption result in the cache.
4. The method according to claim 1, characterized in that, The step of arranging data elements stored in the database in a linear structure according to a matrix includes: Get the number of data elements stored in the database in a linear structure; The number of rows and columns of the matrix are determined based on the number of data elements; wherein the number of rows is equal to the number of columns, and the product of the number of rows and the number of columns is equal to the number of data elements. Based on the number of rows and columns, the data is arranged in the form of the matrix.
5. The method according to claim 4, characterized in that, Determining the number of rows and columns of the matrix based on the number of data elements includes: The first value is obtained by taking the square root of the number of the data elements; If the first value is an integer, the first value is determined as the number of rows and columns of the matrix; If the first value is not an integer, the first value is rounded up to obtain the second value; The second value is determined as the number of rows and columns of the matrix.
6. A method for extracting privacy information based on post-quantum cryptography primitives, characterized in that, Applied to a client, the method includes: Encrypt the query coordinates in the database matrix to generate a ciphertext query request; Send the encrypted query request to the server; The system receives a query response message from a server, the query response message carrying target encrypted data; the target encrypted data is determined based on the encrypted query request and a first encryption result and a second encryption result; the first encryption result is generated by encrypting the first position coordinates of each data in a first region in a database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in a second region; the first region is a region in the database that meets preset conditions, and the second region is a region in the database other than the first region; The target ciphertext data is decrypted to obtain the target data; The target ciphertext data is determined by performing a second homomorphic calculation on the first operation result corresponding to the data element with a value of 1 in the database to obtain a third encryption result of the target data. The first operation result is generated by performing a first homomorphic calculation on the ciphertext query request, the first encryption result, and the second encryption result. The first encryption result is extracted from the cache.
7. The method according to claim 6, characterized in that, The step of encrypting the query coordinates in the database matrix to generate a ciphertext query request includes: Convert the query coordinates into binary form; Encrypt the binary query coordinates to generate a query vector; Based on the query vector, a ciphertext query request is generated.
8. The method according to claim 7, characterized in that, The method further includes: Determine the initialization parameters based on the requirements of privacy-preserving computing scenarios; Input the initialization parameters into the key generation function to obtain the public-private key pair; The private key is stored locally, and the public key is sent to the server.
9. The method according to claim 8, characterized in that, The process of decrypting the target ciphertext data to obtain the target data includes: The target ciphertext data is decrypted using the private key to obtain the target data.
10. A privacy information extraction device based on post-quantum cryptography primitives, characterized in that, Applied to a server, the device includes: The sorting module is used to arrange data elements stored in the database in a linear structure in the form of a matrix. The first determining module is used to determine a first region in the database based on historical plaintext retrieval requests in a non-privacy computing scenario; the first region is a region in the database that meets preset conditions. The first encryption module is used to encrypt the first position coordinates of each data in the first region in the database matrix to generate a first encryption result, and store the first encryption result in the cache. The second encryption module is used to encrypt the second position coordinates of each data element in the database matrix in the second region of the database when a ciphertext query request is received from the client, and generate a second encryption result; the second region is the region in the database other than the first region; The second determining module is used to determine the target ciphertext data corresponding to the ciphertext query request based on the ciphertext query request, the first encryption result, and the second encryption result; The first sending module is used to send a query response message to the client, wherein the query response message carries the target encrypted data; Specifically, the second determining module is used for: Retrieve the first encryption result from the cache; A first homomorphic computation is performed on the ciphertext query request, the first encryption result, and the second encryption result to generate a first operation result; Perform a second homomorphic computation on the first operation result corresponding to the data element with a value of 1 in the database to obtain the third encryption result of the target data; The third encryption result is used as the target ciphertext data.
11. A privacy information extraction device based on post-quantum cryptography primitives, characterized in that, Applied to a client, the device includes: The third encryption module is used to encrypt the query coordinates in the database matrix and generate a ciphertext query request. The second sending module is used to send the encrypted query request to the server; A receiving module is used to receive a query response message sent by a server, wherein the query response message carries target encrypted data; the target encrypted data is determined based on the encrypted query request and a first encryption result and a second encryption result; the first encryption result is generated by encrypting the first position coordinates of each data in a first region in a database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in a second region; the first region is a region in the database that meets preset conditions, and the second region is a region in the database other than the first region; The decryption module is used to decrypt the target ciphertext data to obtain the target data; The target ciphertext data is determined by performing a second homomorphic calculation on the first operation result corresponding to the data element with a value of 1 in the database to obtain a third encryption result of the target data. The first operation result is generated by performing a first homomorphic calculation on the ciphertext query request, the first encryption result, and the second encryption result. The first encryption result is extracted from the cache.
12. A readable storage medium, characterized in that, When the instructions in the readable storage medium are executed by the processor of the electronic device, the processor is enabled to perform the privacy information extraction method based on post-quantum cryptography primitives as described in any one of claims 1 to 5, or to perform the privacy information extraction method based on post-quantum cryptography primitives as described in any one of claims 6 to 9.
13. An electronic device, characterized in that, The electronic device includes a memory and one or more programs, wherein one or more programs are stored in the memory and configured to be executed by one or more processors using the privacy information extraction method based on post-quantum cryptography primitives as described in any one of claims 1 to 5, or to execute the privacy information extraction method based on post-quantum cryptography primitives as described in any one of claims 6 to 9.
Citation Information
Patent Citations
Compression-supporting privacy information retrieval method and system based on secure multi-party computing
CN117150557A
Private information retrieval method based on homomorphic encryption
CN118094615A