Privacy information extraction method and device based on post-quantum cryptography primitives
By adopting a method based on the principle of post-quantum cryptography in privacy computing, the database data is arranged in matrix form and encrypted, which solves the problems of low computing efficiency and high communication complexity in existing privacy computing technologies, and achieves efficient and secure extraction of privacy information.
Patent Information
- Application Number
- CN202411610495.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-11-12
AI Technical Summary
In existing privacy computing technologies, the computing efficiency is low and the communication complexity is high, making it difficult to effectively protect user privacy information.
Using a method based on the principle of post-quantum cryptography, the data elements stored in a linear structure in the database are arranged in a matrix form, and the efficiency of private information extraction is improved through encryption processing. The specific steps include determining the database area based on the historical plaintext search request, encrypting the location coordinates, and performing ciphertext query requests and response processing between the client and the server.
By reducing the computing time complexity and communication complexity of the server and client, the efficiency and security of the client obtaining target data from the server is improved, and the effective protection of user privacy information is ensured.
Smart Images

Figure CN119675851A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of privacy computing technology, and specifically to a method and device for extracting privacy information based on post-quantum cryptographic primitives. Background Art
[0002] With the rapid development of the information field, cloud computing has gradually become a trend. In this case, users can upload their data to the cloud server, and the cloud server will return the calculation results to the user after calculating the data, thereby greatly reducing the computing burden on the user side. Although this computing model can optimize user expenses, the key problem of cloud computing is that users leak their own computing data during the calculation process. These data may contain the user's privacy information and will be publicly stored in the server. To address this problem, a series of privacy computing solutions have been proposed, which can ensure that the server completes the computing task without knowing the user's privacy information.
[0003] With the rapid advancement of quantum information technology, the existing public key cryptography system will become increasingly insecure. Therefore, a series of post-quantum cryptographic schemes have been gradually proposed, most of which are based on lattice cryptography, hash functions, encoding and other technical routes. However, the privacy computing algorithms constructed by existing technical solutions have low computational efficiency and high communication complexity. Summary of the invention
[0004] The embodiments of the present invention provide a method, device, electronic device and readable storage medium for extracting private information based on post-quantum cryptographic primitives, which can solve the problems of low efficiency of privacy computing and high communication complexity in related technologies.
[0005] In order to solve the above problems, an embodiment of the present invention discloses a privacy information extraction method based on post-quantum cryptography primitives, which is applied to a server. The method includes:
[0006] Arrange the data elements stored in a linear structure in the database in the form of a matrix;
[0007] Determine a first region in the database according to a historical plaintext search request in a non-privacy computing scenario; the first region is a region in the database that meets a preset condition;
[0008] Encrypting 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;
[0009] Upon receiving a ciphertext query request sent by a client, encrypting the second position coordinates of each data element in a second area of the database in the database matrix to generate a second encryption result; the second area is an area in the database other than the first area;
[0010] Determining target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request, the first encryption result, and the second encryption result;
[0011] A query response message is sent to the client, wherein the query response message carries the target ciphertext data.
[0012] Optionally, determining the first region in the database according to the historical plaintext retrieval request in the non-privacy computing scenario includes:
[0013] Collect historical plaintext retrieval requests in non-privacy computing scenarios;
[0014] Calculate the number of times the data element at each position in the database is retrieved according to the historical plaintext search request;
[0015] The area formed by the positions whose number of times of being searched is greater than or equal to a preset number threshold is determined as the first area.
[0016] Optionally, encrypting the first position coordinates of each data in the first area in the database matrix to generate a first encryption result, and storing the first encryption result in a cache includes:
[0017] converting the first position coordinates of the respective data elements into third position coordinates in binary form;
[0018] encrypting the third position coordinates of each data element bit by bit to generate the first encryption result;
[0019] The first encryption result is stored in a cache.
[0020] Optionally, in a case where the ciphertext query request sent by the client is received, determining the target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request and the first encryption result and the second encryption result includes:
[0021] Upon receiving the ciphertext query request sent by the client, extracting the first encryption result from the cache;
[0022] Performing a first homomorphic calculation on the ciphertext query request, the first encryption result, and the second encryption result to generate a first calculation result;
[0023] Perform a second homomorphic calculation on the first operation result corresponding to the data with a value of 1 in the database to obtain a third encryption 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 in the form of a matrix includes:
[0026] Get the number of data elements stored in a linear structure in the database;
[0027] The number of rows and the number of columns of the matrix are determined according to the number of the 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 the 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 according to the number of data elements includes:
[0030] Performing a square root operation on the number of the data elements to obtain a first value;
[0031] When the first value is an integer, determining the first value as the number of rows and columns of the matrix;
[0032] When the first value is not an integer, rounding up the first value to obtain a second value;
[0033] The second value is determined as the number of rows and columns of the matrix.
[0034] The embodiment of the present invention discloses a privacy information extraction method based on post-quantum cryptography primitives, which is applied to a client. The method includes:
[0035] Encrypt the query coordinates in the database matrix to generate a ciphertext query request;
[0036] Sending the ciphertext query request to a server;
[0037] Receive a query response message sent by a server, wherein the query response message carries target ciphertext data; the target ciphertext data is determined according to the ciphertext 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 the first area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the first area is an area in the database that meets a preset condition, and the second area is an area in the database other than the first area;
[0038] The target ciphertext 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] converting the query coordinates into binary form;
[0041] Encrypt the binary query coordinates to generate a query vector;
[0042] Generate a ciphertext query request according to the query vector.
[0043] Optionally, the method further comprises:
[0044] Determine initialization parameters based on privacy computing scenario requirements;
[0045] Input the initialization parameters into a key generation function to obtain a public-private key pair;
[0046] The private key is saved locally, and the public key is sent to the server.
[0047] Optionally, decrypting the target ciphertext data to obtain target data includes:
[0048] The target ciphertext data is decrypted using the private key to obtain the target data.
[0049] On the other hand, an embodiment of the present invention provides a privacy information extraction device based on post-quantum cryptography primitives, which is applied to a server, and the device includes:
[0050] An arrangement module is used to arrange the data elements stored in a linear structure in the database in the form of a matrix;
[0051] A first determination module, configured to determine a first region in a database according to a historical plaintext search request in a non-privacy computing scenario; the first region is a region in the database that meets a preset condition;
[0052] A first encryption module, used for encrypting the first position coordinates of each data in the first area in the database matrix to generate a first encryption result, and storing the first encryption result in a cache;
[0053] A second encryption module is used to encrypt the second position coordinates of each data element in a second area in the database in the database matrix to generate a second encryption result when receiving a ciphertext query request sent by the client; the second area is an area in the database other than the first area;
[0054] A second determination module, configured to determine target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request and 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, wherein the query response message carries the target ciphertext data.
[0056] The embodiment of the present invention provides a privacy information extraction device based on post-quantum cryptography primitives, which is applied to a client, and the device includes:
[0057] A third encryption module is used to encrypt the query coordinates in the database matrix to generate a ciphertext query request;
[0058] A second sending module, used to send the ciphertext query request to a server;
[0059] A receiving module, used for receiving a query response message sent by a server, wherein the query response message carries target ciphertext data; the target ciphertext data is determined according to the ciphertext 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 the first area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the first area is an area in the database that meets a preset condition, and the second area is an area in the database other than the first area;
[0060] The decryption module is used to decrypt the target ciphertext data to obtain the target data.
[0061] On the other hand, an embodiment of the present invention further discloses an electronic device, which includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute the aforementioned private information extraction method based on post-quantum cryptographic primitives.
[0062] An embodiment of the present invention also discloses a readable storage medium. When the instructions in the readable storage medium are executed by a processor of an electronic device, the electronic device can execute the aforementioned privacy information extraction method based on post-quantum cryptographic primitives.
[0063] The embodiments of the present invention include the following advantages:
[0064] The embodiment of the present invention arranges the data elements stored in a linear structure in the database in the form of a matrix, thereby reducing the time complexity of the server and the client when calculating, and the communication complexity when communicating between the client and the server. Furthermore, the embodiment of the present invention determines the first area in the database according to the historical plaintext retrieval request in the non-privacy computing scenario; encrypts the first position coordinates of each data element in the first area in the database matrix to generate a first encryption result, and stores the first encryption result in the cache. By encrypting the position coordinates corresponding to part of the data in the database in advance 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 the data in the database, thereby improving the efficiency of the client obtaining the target data from the server. In the case of receiving the ciphertext query request sent by the client, the second position coordinates of each data element in the second area of the database in the database matrix are encrypted to generate a second encryption result; according to the ciphertext query request and the first encryption result and the second encryption result, the target ciphertext data corresponding to the ciphertext query request is determined; and a query response message is sent to the client, and the query response message carries the target ciphertext data. In the present invention, when the client obtains target data from the server, the server does not need to decrypt the ciphertext query request, but directly determines it through the ciphertext query request and the first encryption result and the second encryption result, thereby improving the security of the client obtaining the target data from the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 It is a flowchart of the steps of a method for extracting private information based on post-quantum cryptographic primitives provided by an embodiment of the present invention;
[0067] Figure 2 is a flowchart of another method for extracting private information based on post-quantum cryptographic primitives provided by an embodiment of the present invention;
[0068] Figure 3 is a schematic diagram of generating a first encryption result provided by an embodiment of the present invention;
[0069] Figure 4 It is a schematic diagram of a server sending a query response message to a client provided by an embodiment of the present invention;
[0070] Figure 5It is a schematic diagram of sending a ciphertext query request to a server provided by an embodiment of the present invention;
[0071] Figure 6 It is a schematic diagram of generating a public-private key pair and sending the public key to a server provided by an embodiment of the present invention;
[0072] Figure 7 It is a schematic diagram of decrypting target ciphertext data to obtain target data provided by an embodiment of the present invention;
[0073] Figure 8 It is a logic block diagram of a privacy information extraction device based on post-quantum cryptography primitives provided by an embodiment of the present invention;
[0074] Fig. 9 It is a logic block diagram of another privacy information extraction device based on post-quantum cryptography primitives provided by an embodiment of the present invention;
[0075] Fig.10 It is a structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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. 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.
[0077] The terms "first", "second", etc. in the specification and claims of the present invention are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, the term "and / or" in the specification and claims is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. In the embodiments of the present invention, the term "multiple" refers to two or more, and other quantifiers are similar.
[0078] Method Embodiment
[0079] The present invention provides a privacy information extraction method based on post-quantum cryptography primitives, which can be applied to a server, referring to Figure 1 , Figure 1 A flowchart of an embodiment of a method for extracting private information based on post-quantum cryptography primitives of the present invention is shown. The method may specifically include the following steps:
[0080] Step 101: Arrange the data elements stored in a linear structure in a database in the form of a matrix.
[0081] The privacy information extraction method based on post-quantum cryptographic primitives provided by an embodiment of the present invention can be applied to the field of privacy computing, where privacy computing refers to protecting data privacy when processing and analyzing data. Specifically, in the process of data sharing and utilization, the data is calculated and analyzed without exposing it 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 an embodiment of the present invention can be applied to a server to extract data from a database when the server, database administrator or other observers are unaware of the privacy information. The database is used to store the extracted data elements, and the server interacts with the database through a database interface. Linear structure storage refers to the arrangement of data elements in a linear order, and specific data elements can be accessed by index or position. Linear structure storage includes: sequential storage structure and chain storage structure. After the data elements are arranged in the form of a matrix, specific data elements can be accessed by the position coordinates of the data elements in the matrix. The data at each position in the database matrix has only one bit.
[0083] Step 102: 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.
[0084] Non-privacy computing scenarios refer to scenarios that do not involve or require special attention to data privacy protection during the process of computing and processing data. Plaintext search requests refer to query requests submitted in unencrypted or plaintext form during data processing and retrieval, which directly expose the information that the user wants to query. Among them, historical plaintext search requests include the location of the target search data, organize the records of all historical plaintext search requests, analyze historical plaintext search requests, and identify frequently queried data fields, frequently queried data locations, and query time and other information.
[0085] It should be noted that the preset condition refers to that the number of times the data element is queried is within a preset range. The area formed by the corresponding positions of the data element queried within the preset range in the database matrix is determined as the first area.
[0086] Step 103: Encrypt the first position coordinates of each data element in the first region in the database matrix to generate a first encryption result, and store the first encryption result in a cache;
[0087] The first encryption result is a summary of the first position coordinate encryption results corresponding to each data element in the first area.
[0088] In an embodiment of the present invention, in order to prevent the security impact of quantum computing on the public key system, a post-quantum encryption algorithm is used to encrypt the first position coordinates of each data element in the database matrix. Post-quantum encryption algorithms include: lattice-based algorithms and hash function-based algorithms. Lattice-based algorithms are a type of algorithm that uses a "lattice" structure for calculation. A lattice is a discrete subset in a vector space, consisting of all integer linear combinations of a set of basis vectors. For example, an encryption algorithm based on the learning with errors (LWE) problem not only provides an encryption scheme, but also has the ability to resist quantum attacks.
[0089] It should be noted that before encrypting the first position coordinates of each data element in the first area in the database matrix to generate a first encryption result, it may also include: receiving a public key sent by the client. Based on the public key and the first position coordinates corresponding to each data element, run a first encryption algorithm to encrypt the first position coordinates to generate a first encryption result. Exemplarily, a public key sent by the client is received, wherein the public key is generated by the client using a homomorphic encryption module algorithm based on LWE. The homomorphic encryption module algorithm based on LWE 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 data, and the Dec algorithm is used to decrypt encrypted data. The server receives the public key sent by the client, and uses the Enc algorithm in the homomorphic encryption module algorithm based on LWE to encrypt the first position coordinates. Figure 3 As shown, Figure 3 A schematic diagram is shown of encrypting the first position coordinates of each data element in the first area to generate a first encryption result.
[0090] The first position coordinates of each data element are encrypted to obtain the encrypted position coordinates corresponding to each data element, and the encrypted position coordinates corresponding to each data element are summarized as the first encryption result, and the encrypted position coordinates replace the original first position coordinates.
[0091] Step 104: upon receiving the ciphertext query request sent by the client, encrypt the second position coordinates of each data element in the second area of the database in the database matrix to generate a second encryption result; the second area is the area in the database other than the first area;
[0092] It should be noted that the encryption algorithm used to encrypt the second position coordinates of each data element in the second area in the database matrix is consistent with the encryption algorithm used to encrypt the first position coordinates of each data element in the first area in the database matrix.
[0093] Step 105: Determine target ciphertext data corresponding to the ciphertext query request according to 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 ciphertext query request and the first encryption result and the second encryption result calculated previously. The server has encrypted the first position coordinates corresponding to the data elements in the first area of the database and the second position coordinates of the data elements in the second area using a post-quantum cryptography algorithm (such as LWE) to obtain the first encryption result and the second encryption result.
[0095] In an embodiment of the present invention, when the server receives a ciphertext query request sent by the client, the server does not decrypt the ciphertext query request. When the server is unknown about the content of the ciphertext query request, the server 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, wherein the query response message carries the target ciphertext data.
[0097] The server constructs a query response message based on the target ciphertext 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 ciphertext data).
[0098] When the server and the client do not establish a communication connection or the connection is disconnected, the server establishes a network connection with the client, which can be implemented through protocols such as TCP / IP and HTTP.
[0099] By establishing a completed connection, the constructed query response message is sent to the client. In the process of sending the query response message, if there is a network error, connection interruption, etc., the server sends an error message to the client or retries to send the query response message. Figure 4 As shown, Figure 4A schematic diagram showing a server sending a query response message to a client is shown.
[0100] The embodiment of the present invention arranges the data elements stored in a linear structure in the database in the form of a matrix, thereby reducing the time complexity of the client generating an encryption request and the time complexity of the server calculating the position coordinates of the data elements in the matrix. Further, the embodiment of the present invention determines the first area in the database according to the historical plaintext retrieval request in the non-privacy computing scenario; it is possible to determine which data in the database is accessed by the client more times. The first position coordinates of each data element in the first area in the database matrix are encrypted to generate a first encryption result, and the first encryption result is stored in the cache. By encrypting the position coordinates corresponding to some data in the database in advance and storing them in the cache, the efficiency of the client obtaining the target data from the server is improved. In the case of receiving a ciphertext query request sent by the client, the second position coordinates of each data element in the second area of the database in the database matrix are encrypted to generate a second encryption result; according to the ciphertext query request and 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, and the query response message carries the target ciphertext data. In an embodiment of the present 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 the target data from the server.
[0101] Optionally, determining the first region in the database according to the historical plaintext retrieval request in the non-privacy computing scenario includes:
[0102] Step 11: Collect historical plaintext search requests in non-privacy computing scenarios;
[0103] Step 12: Calculate the number of times the data element at each position in the database is retrieved according to the historical plaintext search request;
[0104] Step 13: Determine the area formed by the positions whose number of searches is greater than or equal to a preset number threshold as the first area.
[0105] It should be noted that a reasonable number of times threshold is pre-set according to actual needs and analysis purposes. The preset number of times threshold is used to distinguish which data elements in the database are frequently searched by users and which data elements are rarely searched by users; or which location coordinates corresponding to each data element are frequently searched by users and which location coordinates are relatively less concerned.
[0106] The data sources of historical plaintext search requests include: search engines, which usually record the user's search request logs; database query logs, which also record the user's query operations, and the logs contain the user's plaintext search requests; public data sets, and some research institutions or organizations will publicly release user search request data sets. Extract the historical plaintext search request information for the server from the search engine, database query log or public data set, and preprocess the extracted plaintext search requests. The preprocessing operations include: cleaning the plaintext search request 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. In the case where the historical plaintext search request only includes data elements, the position coordinates of the data elements in the database matrix are obtained. The first number of times each data element in the database appears in the historical plaintext search request or the second number of times the position coordinates of each data element appear in the historical plaintext search request are counted. The first number and the second number are equal. The area consisting of the position coordinates corresponding to the data elements whose number of times to be retrieved is greater than or equal to the preset number threshold is determined as the first area. The first area includes the position coordinates of some data elements in the database matrix. The data elements at the position coordinates can be indexed according to the position coordinates.
[0108] In an embodiment of the present invention, by collecting historical plaintext retrieval requests in non-privacy computing scenarios, the number of times data elements at each location in the database are retrieved is calculated based on the historical plaintext retrieval requests, and the area consisting of locations where the number of times they are retrieved is greater than or equal to a preset number threshold is determined as the first area, so that it is possible to identify which part of the data in the database is frequently accessed by users.
[0109] Optionally, 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:
[0110] Step 21, converting the first position coordinates of each data element into 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 a 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), i indicates that the data element is in the i-1th row in the database matrix, and j indicates that the data element is in the j-1th column in the database matrix. i and j are both converted into binary form as the third position coordinates of the data element in the database matrix. The third position coordinates are bit-wise encrypted using an encryption algorithm to obtain a first encryption result; for example, the encryption algorithm can use the Enc algorithm in the homomorphic encryption module algorithm based on LWE.
[0114] It should be noted that the position coordinate set corresponding to all data elements in the database matrix is A, the position coordinate set corresponding to each data element in the first region is data1, and the position coordinate (i, j) in data1 is converted into binary form. The third position coordinate of the binary form of a single data element in the database matrix is and Where N is the number of data elements stored in a linear structure, is the number of rows and columns of the matrix, is the binary value of i after conversion, is the binary value after j conversion. The length of the binary value is determined by the number of rows and columns of the matrix. The Enc encryption algorithm is used to encrypt the third position coordinate in binary form bit by bit, and the result is and Right now Where pk is the public key used to encrypt the third position coordinates. Summarize and obtain the first encryption result. For example, the content in the database matrix is The first position coordinate set corresponding to the data element in the first region is data1 = {(1,1)}. First, the coordinate value is converted into binary form ((1), (1)), and the encryption algorithm Enc is used to encrypt the third position coordinate in binary form. get is the first encryption result.
[0115] In an embodiment of the present invention, the first position coordinates of each data element are converted into third position coordinates in binary form, the third position coordinates of each data element are bit-wise encrypted to generate a first encryption result, and the first encryption result is stored in a cache. By encrypting the position coordinates corresponding to some data in the database in advance 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 the data in the database, thereby improving the efficiency of the client in obtaining target data from the server.
[0116] Optionally, determining target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request and the first encryption result and the second encryption result includes:
[0117] Step 31: extracting the first encryption result from the cache;
[0118] Step 32: performing a first homomorphic calculation on the ciphertext query request, the first encryption result, and the second encryption result to generate a first calculation result;
[0119] Step 33: Perform a second homomorphic calculation on the first operation result corresponding to the data element whose value is 1 in the database to obtain a third encryption result of the target data;
[0120] Step 34: Use the third encryption result as target ciphertext data.
[0121] Among them, the first encryption result is obtained by summarizing the encryption results generated by encrypting the first position coordinates of each data element in the first area of the database in the database matrix, and is pre-stored in the cache. Therefore, when a ciphertext query request is received, it is necessary to extract the first encryption result from the cache. The second encryption result is obtained by summarizing the encryption results generated by encrypting the second position coordinates of each data element in the second area of the database in the database matrix when a ciphertext query request sent by the client is received. Specifically, the position coordinates of each data element in the second area in the database matrix are converted into binary form. For example, the position coordinates of a single data element in the database matrix are (i, j), and the binary position coordinates of the 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). Encrypt and get and Where pk is the public key used by the server to encrypt the binary location coordinates. The position coordinates corresponding to all data elements in the database matrix are converted into 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 area is The encrypted result of the position coordinates corresponding to a single data element in the second area is
[0122] It should be noted that performing the first homomorphic calculation on the ciphertext query request and the first encryption result and the second encryption result refers to performing the first homomorphic calculation on the ciphertext query request and the encrypted position coordinates of each data element in the database matrix.
[0123] The ciphertext query request received from the client is Homomorphic calculation is performed on the ciphertext query request, the first encryption result, and the second encryption result to generate a first operation result, wherein the first homomorphic calculation formula is as follows:
[0124]
[0125] in, It is the homomorphic multiplication operation of the homomorphic encryption module based on LWE. It is the modulo-2 homomorphic addition operation of the homomorphic encryption module based on LWE. The ciphertext query request sent by the client. It is the encrypted result after encrypting the position coordinates of each data element in the data matrix. is the encryption result of the binary value 1 using the Enc algorithm, ψ i,j It is the result of performing a first homomorphic calculation on the ciphertext query request, the first encryption result, and the second encryption result.
[0126] For example, the user's ciphertext query request is The content of the database matrix is The position coordinate set corresponding to each data element in the first region is data1 = {(1,1)}, and the position coordinate set 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 A first homomorphic calculation is performed on the ciphertext query request, the first encryption result, and the second encryption result to obtain a first calculation result.
[0127]
[0128] Among them, ψ 0,0 is the result of the first homomorphic calculation of the encrypted result corresponding to the position coordinate (0, 0) and the ciphertext query request, ψ 0,1is the result of the first homomorphic calculation of the encrypted result corresponding to the position coordinate (0, 1) and the ciphertext query request, ψ 1,0 is the result of the first homomorphic calculation of the encrypted result corresponding to the position coordinate (1, 0) and the ciphertext query request, ψ 1,1 is the result of the first homomorphic calculation of the encryption result corresponding to the position coordinate (1, 1) and the ciphertext query request. The first calculation result includes ψ 0,0 , 0,1 , 1,0 , 1,1 .
[0129] The second homomorphic calculation is performed on the first operation result corresponding to the data element with a value of 1 in the database. The second homomorphic calculation formula is as follows:
[0130]
[0131] DB[i,j]=1 refers to the data element with a value of 1 in the database matrix, and the server performs the second homomorphic calculation on the first operation results corresponding to the data element with a value of 1. For example, the database matrix is The data element position coordinates with a value of 1 are (0,1) and (1,0). Res is actually the third encryption result of the data with the position coordinates of (0, 1), and the third encryption result is used as the target ciphertext data.
[0132] In an embodiment of the present invention, the first encryption result is extracted from the cache; the first homomorphic calculation is performed on the ciphertext query request and the first encryption result and the second encryption result to generate a first operation result; the second homomorphic calculation 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 calculation on the ciphertext query request and 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 query, thereby 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 in the form of a matrix includes:
[0134] Step 41, obtaining the number of data elements stored in a linear structure in the database;
[0135] Step 42: Determine the number of rows and columns of the matrix according to 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: Arrange the data in the form of the matrix based on the number of rows and columns.
[0137] In the embodiment of the present invention, each data element is a binary value, and when the number of all data elements is N, the database is arranged as follows: When the number of data elements is N, the index length corresponding to each data element is logN; after the data elements are arranged in matrix form, the position coordinate length corresponding to 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 the data elements are arranged in a 4×4 matrix, the length of the position coordinate corresponding to each data element is 2log24.
[0138] After the linearly arranged data elements are arranged in a two-dimensional matrix, the length of the position coordinates corresponding to the data elements is reduced from logN to This reduces the number of times the encryption algorithm is executed on the location coordinates, reducing the time complexity of accessing all the data in the database; and shortens the length of the encryption request sent by the client, reducing the communication complexity when communicating between the client and the server.
[0139] Optionally, determining the number of rows and columns of the matrix according to the number of data elements in step 42 includes:
[0140] Step 51, performing a square root operation on the number of the data elements to obtain a first value;
[0141] Step 52: When 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 up the first value to obtain a 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 is equal to 25, Arrange the data elements stored in a linear structure in a 5×5 matrix; when the number N is equal to 24, Not an integer, yes Round up to 5, arrange the data elements stored in the linear structure into a 5×5 matrix, and fill the redundant positions with 0.
[0145] In an embodiment of the present invention, the number of rows and columns of the matrix is determined in two cases based on whether the value after the square root operation is an integer according to the number of data elements, thereby reducing the number of position coordinates corresponding to the data elements, reducing the number of times homomorphic encryption is performed, and reducing the communication complexity between the client and the server.
[0146] In summary, the privacy information extraction method based on post-quantum cryptography primitives provided by the embodiment of the present invention arranges the data elements stored in the database in a linear structure in the form of a matrix, reduces the number of indexes corresponding to the data elements, and reduces the time complexity of the server accessing all the data in the database. According to the historical plaintext retrieval request in the non-privacy computing scenario, the first area in the database is determined; the first position coordinates of each data element in the first area in the database matrix are encrypted to generate a first encryption result, and the first encryption result is stored in the cache. By encrypting the position coordinates corresponding to some data in the database in advance 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 obtaining the target data from the server. In the case of receiving the ciphertext query request sent by the client, the second position coordinates of each data element in the second area of the database in the database matrix are encrypted to generate a second encryption result; according to the ciphertext query request and 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, and the query response message carries the target ciphertext data. In the present invention, when the client obtains target data from the server, the server does not need to encrypt the ciphertext query request, but directly determines it through the ciphertext query request and the first encryption result and the second encryption result, thereby improving the security of the client obtaining the target data from the server.
[0147] The present invention provides a privacy information extraction method based on post-quantum cryptography primitives, which can be applied to the client. Figure 2 , shows a flowchart of another method for extracting private information based on post-quantum cryptography primitives according to an embodiment of the present invention, wherein the method may include the following steps:
[0148] Step S201, encrypting the query coordinates in the database matrix to generate a ciphertext query request;
[0149] Step S202: Send the ciphertext query request to the server;
[0150] Step S203: receiving a query response message sent by the server, wherein the query response message carries target ciphertext data;
[0151] Step S204: decrypt the target ciphertext data to obtain target data.
[0152] Specifically, the query coordinates in the database matrix are determined, the query coordinates are encrypted using a post-quantum encryption algorithm, and a ciphertext query request is generated based on the encrypted query coordinates. For example, the query coordinates are encrypted using an encryption algorithm in a homomorphic encryption module algorithm based on LWE, and a ciphertext query request is generated based on the encrypted query coordinates. The ciphertext query request is used to obtain target data from the server. Figure 5 As shown, Figure 5 A schematic diagram is shown of encrypting query coordinates in a database matrix, generating a ciphertext query request, and sending the ciphertext query request to a server.
[0153] When the server and the client have not established a communication connection or the connection is disconnected, a network connection is established with the server, which can be implemented through protocols such as TCP / IP and HTTP.
[0154] The ciphertext query request is sent to the client through the established communication link. When encountering network errors, connection interruptions, etc. during the process of sending the ciphertext query request, the client sends an error message to the server or retries to send the query response message.
[0155] It should be noted that 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 area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the first area is the area in the database that meets the preset conditions, and the second area is the area in the database other than the first area. Among them, the first encryption result is generated by the server and stored in the cache before the user sends the ciphertext query request, and the second encryption result is generated by the server after the user sends the ciphertext query request.
[0156] After receiving the target ciphertext data sent by the server, the decryption algorithm corresponding to the encryption algorithm is used to decrypt it to obtain the target data corresponding to the ciphertext query request.
[0157] In an embodiment of the present invention, the query coordinates in the database matrix are encrypted, a ciphertext query request is generated, the ciphertext query request is sent to the server, a query response message sent by the server is received, the query response message carries the target ciphertext data, the target ciphertext data is decrypted, and the target data is obtained; wherein the target ciphertext data is determined according to the ciphertext query request and the first encryption result and the second encryption result; the first encryption result is generated by the server and stored in the cache before the user sends the ciphertext query request, and the second encryption result is generated by the server after the user sends the ciphertext query request. After the client sends the query request to the server, the server does not need to encrypt the location coordinates of all the data in the database, thereby improving the efficiency of the client obtaining 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, converting 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 according to the query vector.
[0162] Specifically, determine the query coordinates (i, j) in the database matrix, convert the query coordinates into binary form, (i, j) = ((i0…i l-1 ),(j0…j l-1 )), where i x ,j x ∈{0,1} and x∈{0,1,l-1} and For the binary query coordinates ((i0…i l-1 ),(j0…j l-1 )) is encrypted, where (i0…i l-1 ) is to convert i into a binary value; (j0…j l-1 ) is to convert j into a binary value. Exemplarily, 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 ) is the result of encryption. is (j0…j l-1 ) is the encrypted result, pk, which is the public key used to encrypt the binary position coordinates. A ciphertext query request is generated based on the query vector, which includes: a message header (such as message type, length, status code, etc.) and a message body (the actual query vector).
[0163] In an embodiment of the present 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, thereby ensuring the security of the client obtaining data from the server.
[0164] Optionally, before step S201, the method further includes:
[0165] Step 71: Determine initialization parameters according to privacy computing scenario requirements;
[0166] Step 72: Input the initialization parameters into a key generation function to obtain a 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 private information varies in different privacy computing scenarios. In scenarios where the security of private information is required to be high, the encryption strength of private information needs to be increased. In an embodiment of the present invention, the encryption strength required for the privacy computing scenario is represented by initialization parameters. Exemplarily, the initialization parameters include: security parameters and upper bounds, where the security parameter is 1. λ , λ represents the length of a string of all 1s. For example, when λ=3, 1 λ =111, there is a positive correlation between security parameters and encryption strength. The larger the value of the security parameter, the higher the encryption strength requirement for privacy information in the privacy computing scenario.
[0169] After determining the initialization parameters, the initialization 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, determining the lattice dimension n, the modulus q and the noise distribution X, wherein the lattice dimension, the modulus and the noise distribution are uniform and the encryption strength is positively correlated, and the larger the lattice dimension and the modulus, the higher the encryption strength and the higher the security of the privacy information;
[0171] Step 82, set the number of samples m, 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 the matrix A i , calculate b i The formula is as shown in formula (7), where e i is a noise term randomly selected from the noise distribution X, and all bi Combined into vector b, together with matrix A, 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 a private key s and a 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, which is used to decrypt the encrypted data.
[0176] Exemplarily, in an embodiment of the present invention, a homomorphic encryption module algorithm based on the fault-tolerant learning problem can be used. The module algorithm includes four algorithms (Setup, KeyGen, Enc, Dec), wherein the Setup and KeyGen algorithms are used to generate public-private key pairs, the Enc algorithm is used to encrypt data, and the Dec algorithm is used to decrypt encrypted data. Among them, Setup and KeyGen generate public-private key pairs, and security parameters and upper bounds need to be input. The security parameters and upper bounds represent the encryption strength required for the privacy computing scenario. The larger the security parameter value and the upper bound value, the higher the encryption strength required for the privacy computing scenario. Figure 6 As shown, Figure 6 A schematic diagram showing a client generating a public-private key pair and sending the public key to a server.
[0177] After the public-private key pair is generated, the public key is sent to the server so that the server uses the public key and Enc encryption algorithm to encrypt the position coordinates of each data element in the database in the data matrix. The private key is retained locally to decrypt the encrypted data received from the server.
[0178] In the embodiment of the present invention, the initialization parameters are determined according to the privacy computing scenario requirements; the initialization parameters are input into the 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. The initialization parameters are determined according to different privacy computing scenario requirements, achieving flexibility in encrypting private information.
[0179] Optionally, decrypting the target ciphertext data to obtain target data includes:
[0180] The target ciphertext data is decrypted using the private key to obtain the target data.
[0181] In the embodiment of the present invention, the private key s is an n-dimensional vector, and the target ciphertext data c is generated by c=A×s+(e modq), where A is the public key matrix and e is the noise vector. After receiving the target ciphertext data, the private key s and the public key A are used for calculation, and the calculation result is processed (such as removing noise, performing the inverse operation of the modular operation, etc.) to obtain the final plaintext data. Figure 7 As shown, Figure 7 A schematic diagram of decrypting target ciphertext data to obtain target data is shown.
[0182] In the embodiment of the present invention, the public key is used to encrypt data, and the private key is used to decrypt data, which ensures the secure transmission of data. Only the data recipient holding the private key can decrypt the data, thereby effectively preventing unauthorized persons from obtaining the data content.
[0183] In summary, the privacy information extraction method based on post-quantum cryptography primitives provided by the embodiment of the present invention can be applied to the client, and the initialization parameters are determined according to the privacy computing scenario requirements; the initialization parameters are input into the key generation function to obtain a public-private key pair, the private key is saved locally, and the public key is sent to the server, so that the server uses the public key to encrypt the location coordinates in the database. The query coordinates are converted into binary form, the binary query coordinates are encrypted, and a ciphertext query request is generated; the ciphertext query request is sent to the server; the query response message sent by the server is received, and the query response message carries the target ciphertext data; the target ciphertext data is decrypted using the private key to obtain the target data, which improves the efficiency of the client obtaining data from the server and ensures the security of the client obtaining data from the server.
[0184] Device Embodiment
[0185] like Figure 8 As shown, Figure 8 A logic block diagram of a privacy information extraction device based on post-quantum cryptography primitives provided by an embodiment of the present invention is shown. The device may include:
[0186] An arrangement module is used to arrange the data elements stored in a linear structure in the database in the form of a matrix;
[0187] A first determination module, configured to determine a first region in a database according to a historical plaintext search request in a non-privacy computing scenario; the first region is a region in the database that meets a preset condition;
[0188] A first encryption module, used for encrypting the first position coordinates of each data in the first area in the database matrix to generate a first encryption result, and storing the first encryption result in a cache;
[0189] A second encryption module is used to encrypt the second position coordinates of each data element in a second area in the database in the database matrix to generate a second encryption result when receiving a ciphertext query request sent by the client; the second area is an area in the database other than the first area;
[0190] A second determination module, configured to determine target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request and 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, wherein the query response message carries the target ciphertext data.
[0192] In summary, the embodiment of the present invention provides a privacy information extraction device based on post-quantum cryptography primitives, which can arrange the data elements stored in a linear structure in a database in the form of a matrix, thereby reducing the number of position coordinates corresponding to all data elements in the database. According to the historical plaintext retrieval request in the non-privacy computing scenario, the first area in the database is determined, the first position coordinates of each data in the first area in the database matrix are encrypted to generate a first encryption result, and the first encryption result is stored in the cache, so that when the client sends a ciphertext query request to the server, the server does not need to encrypt the position coordinates of all data elements in the database in the database matrix, thereby improving the efficiency of the client in obtaining data from the server. According to the ciphertext query request and the first encryption result and the second encryption result, the target ciphertext data corresponding to the ciphertext query request is determined, and a query response message is sent to the client. The query response message carries the target ciphertext data, thereby ensuring the security of the client in obtaining data from the server.
[0193] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0194] like Fig. 9 As shown, Fig. 9 A logic block diagram of another privacy information extraction device based on post-quantum cryptography primitives provided by an embodiment of the present invention is shown, and the device may include:
[0195] A third encryption module is used to encrypt the query coordinates in the database matrix to generate a ciphertext query request;
[0196] A second sending module, used to send the ciphertext query request to a server;
[0197] A receiving module, used for receiving a query response message sent by a server, wherein the query response message carries target ciphertext data; the target ciphertext data is determined according to the ciphertext 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 the first area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the first area is an area in the database that meets a preset condition, and the second area is an area in the database other than the first area;
[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 by the embodiment of the present 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, and the query response message carries the target ciphertext data; the target ciphertext data is determined according to 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 area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the target ciphertext data is decrypted to obtain the target data, which improves the efficiency of the client in obtaining data from the server and ensures the security of the client in obtaining data from the server.
[0200] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0201] Reference Fig.10 , is a block diagram of an electronic device for extracting private information based on post-quantum cryptographic primitives provided by an embodiment of the present invention. Fig.10 As shown, the electronic device includes: a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store executable instructions, and the executable instructions enable the processor to execute the privacy information extraction method of the aforementioned embodiment.
[0202] The processor may 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 editable devices, transistor logic devices, hardware components or any combination thereof. The processor may also be a combination that implements a computing function, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[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 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0204] The memory can 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 can be EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory), magnetic tape, floppy disk and optical data storage device, etc.
[0205] The embodiment of the present invention also provides a non-temporary computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device (server or terminal), the processor is able to execute Figure 1 or Figure 2 The private information extraction method shown.
[0206] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0207] It should be understood by those skilled in the art that the embodiments of the present invention can provide methods and devices. Therefore, the embodiments of the present invention can be in the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of the present invention can be in 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] The embodiments of the present invention are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems) and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0209] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing terminal device to operate in a predictable manner, so that the instructions stored in the computer readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A 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 device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0211] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0212] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0213] The above is a detailed introduction to a privacy information extraction method, device, electronic device and readable storage medium based on post-quantum cryptographic primitives provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A method for extracting private information based on post-quantum cryptographic primitives, characterized in that: Applied to a server, the method comprises: Arrange the data elements stored in a linear structure in the database in the form of a matrix; Determine a first region in the database according to a historical plaintext search request in a non-privacy computing scenario; the first region is a region in the database that meets a preset condition; Encrypting 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; Upon receiving a ciphertext query request sent by a client, encrypting the second position coordinates of each data element in a second area of the database in the database matrix to generate a second encryption result; the second area is an area in the database other than the first area; Determining target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request, the first encryption result, and the second encryption result; A query response message is sent to the client, wherein the query response message carries the target ciphertext data.
2. The method according to claim 1, characterized in that The determining, according to the historical plaintext search request in the non-privacy computing scenario, the first region in the database includes: Collect historical plaintext retrieval requests in non-privacy computing scenarios; Calculate the number of times the data element at each position in the database is retrieved according to the historical plaintext search request; The area formed by the positions whose number of times of being searched is greater than or equal to a preset number threshold is determined as the first area.
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, comprises: converting the first position coordinates of the respective data elements into third position coordinates in binary form; encrypting the third position coordinates of each data element bit by bit to generate the first encryption result; The first encryption result is stored in a cache.
4. The method according to claim 1, characterized in that: The determining, according to the ciphertext query request and the first encryption result and the second encryption result, target ciphertext data corresponding to the ciphertext query request includes: extracting the first encryption result from the cache; Performing a first homomorphic calculation on the ciphertext query request, the first encryption result, and the second encryption result to generate a first calculation result; Perform a second homomorphic calculation on the first operation result corresponding to the data element whose value is 1 in the database to obtain a third encryption result of the target data; The third encryption result is used as the target ciphertext data.
5. The method according to claim 1, characterized in that The step of arranging the data elements stored in a linear structure in the database in the form of a matrix includes: Get the number of data elements stored in a linear structure in the database; The number of rows and the number of columns of the matrix are determined according to the number of the 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 the data elements. Based on the number of rows and columns, the data is arranged in the form of the matrix.
6. The method according to claim 5, characterized in that Determining the number of rows and columns of the matrix according to the number of data elements comprises: Performing a square root operation on the number of the data elements to obtain a first value; When the first value is an integer, determining the first value as the number of rows and columns of the matrix; When the first value is not an integer, rounding up the first value to obtain a second value; The second value is determined as the number of rows and columns of the matrix.
7. A method for extracting private information based on post-quantum cryptographic primitives, characterized in that: Applied to a client, the method comprises: Encrypt the query coordinates in the database matrix to generate a ciphertext query request; Sending the ciphertext query request to a server; Receive a query response message sent by a server, wherein the query response message carries target ciphertext data; the target ciphertext data is determined according to the ciphertext 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 the first area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the first area is an area in the database that meets a preset condition, and the second area is an area in the database other than the first area; The target ciphertext data is decrypted to obtain the target data.
8. The method according to claim 8, characterized in that The step of encrypting the query coordinates in the database matrix to generate a ciphertext query request includes: converting the query coordinates into binary form; Encrypt the binary query coordinates to generate a query vector; Generate a ciphertext query request according to the query vector.
9. The method according to claim 8, characterized in that The method further comprises: Determine initialization parameters based on privacy computing scenario requirements; Input the initialization parameters into a key generation function to obtain a public-private key pair; The private key is saved locally, and the public key is sent to the server.
10. The method according to claim 9, characterized in that The 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.
11. A privacy information extraction device based on post-quantum cryptography primitives, characterized in that: Applied to a server, the device comprises: An arrangement module is used to arrange the data elements stored in a linear structure in the database in the form of a matrix; A first determination module, configured to determine a first region in a database according to a historical plaintext search request in a non-privacy computing scenario; the first region is a region in the database that meets a preset condition; A first encryption module, used for encrypting the first position coordinates of each data in the first area in the database matrix to generate a first encryption result, and storing the first encryption result in a cache; A second encryption module is used to encrypt the second position coordinates of each data element in a second area in the database in the database matrix to generate a second encryption result when receiving a ciphertext query request sent by the client; the second area is an area in the database other than the first area; A second determination module, configured to determine target ciphertext data corresponding to the ciphertext query request according to the ciphertext query request and 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 ciphertext data.
12. A privacy information extraction device based on post-quantum cryptography primitives, characterized in that: Applied to a client, the device comprises: A third encryption module is used to encrypt the query coordinates in the database matrix to generate a ciphertext query request; A second sending module, used to send the ciphertext query request to a server; A receiving module, used for receiving a query response message sent by a server, wherein the query response message carries target ciphertext data; the target ciphertext data is determined according to the ciphertext 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 the first area in the database matrix, and the second encryption result is generated by encrypting the second position coordinates of each data in the second area; the first area is an area in the database that meets a preset condition, and the second area is an area in the database other than the first area; The decryption module is used to decrypt the target ciphertext data to obtain the target data.
13. A readable storage medium, characterized in that: When the instructions in the readable storage medium are executed by a processor of an electronic device, the processor is enabled to execute the private information extraction method based on post-quantum cryptographic primitives as described in any one of claims 1 to 6, or to execute the private information extraction method based on post-quantum cryptographic primitives as described in any one of claims 7 to 10.
14. An electronic device, characterized in that: The electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to execute the private information extraction method based on post-quantum cryptographic primitives as described in any one of claims 1 to 6 by one or more processors, or to execute the private information extraction method based on post-quantum cryptographic primitives as described in any one of claims 7 to 10.
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
Grid-based certificateless searchable encryption method and device, equipment and medium
CN118337374A
Method for confidentially querying a location-based service by homomorphing cryptography
US20180267981A1