A data query method, device, medium and equipment
Patent Information
- Application Number
- CN202610899178.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-22
- Publication Date
- 2026-10-30
AI Technical Summary
[0004]有鉴于此,本发明提供了一种数据查询方法、装置、介质及设备,主要目的在于解决目前数据查询过程中存在隐私泄露的问题
[0015]本申请中的数据查询方法、装置、介质及设备,通过引入加密查询和代理节点,利用代理节点基于加密后的查询关键字、采用隐私查询协议,向服务端发送查询请求,能保证在准确、可靠的获得查询结果的前提下,实现了对客户端查询信息的保密,避免了客户端隐私的泄露。与此同时,通过利用代理节点与服务端进行通信,能规避客户端资源限制的问题。客户端仅需进行查询条件加密与结果解密操作,实现了客户端的计算负载最小化。
Smart Images

Figure CN123012008A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and in particular to a data query method, apparatus, medium and device. Background Technology
[0002] Currently, when conducting bond analysis and portfolio management, clients (financial institutions) typically need to submit specific bond IDs and time intervals as query criteria to a third-party platform, such as a bond information service provider / server, to obtain characteristic data such as the fair value of the bond, principal and interest over the period, and bond valuation gains and losses.
[0003] However, existing data query methods typically employ plaintext queries, where the client directly submits the bond ID and time range to the server. While this method is simple to deploy and responds quickly, it poses a serious privacy risk: the server can easily discern the client's intent, leading to privacy breaches. Summary of the Invention
[0004] In view of this, the present invention provides a data query method, apparatus, medium and device, the main purpose of which is to solve the problem of privacy leakage in the current data query process.
[0005] To address the aforementioned problems, this application provides a data query method applied to a client, comprising: The query keywords are encrypted using a shared symmetric key to obtain encrypted query keywords. The shared symmetric key is obtained in advance through negotiation with the server. The encrypted query keyword is sent to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol; Receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; The target encrypted query result is decrypted based on the shared symmetric key to obtain the target query result.
[0006] Optionally, the data query method further includes: randomly generating a first private key, and generating a first public key corresponding to the first private key based on a predetermined prime number, a predetermined radix, and the first private key; The first public key is sent to the server so that the server can generate the shared symmetric key based on the first public key, the predetermined prime number, and the second private key held by the server. The system receives a second public key sent by the server and generates the shared symmetric key based on the second public key, the predetermined prime number, and its own first private key.
[0007] Optionally, the data query method further includes: sharing the predetermined prime number and predetermined base with the server in advance via broadcast.
[0008] Optionally, sending the encrypted query keyword to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol, specifically includes: The encrypted query keyword is sent to a predetermined proxy node, which then uses a pre-generated additive homomorphic public key to encrypt the encrypted query keyword to obtain a ciphertext vector, and sends a query request containing the ciphertext vector to the server.
[0009] Optionally, the target encrypted query result obtained by decrypting the original encrypted query result returned by the server based on the query request, sent by the receiving proxy node, specifically includes: The system receives a target encrypted query result sent by a proxy node, obtained by decrypting the original encrypted query result returned by the server based on an additive homomorphic private key. The additive homomorphic private key corresponds to the additive homomorphic public key. The original encrypted query result is generated by the server through homomorphic encryption processing based on the coefficients of a first polynomial, the coefficients of a second polynomial, and the ciphertext vector in the query request. The coefficients of the first polynomial are the coefficients in the first polynomial constructed by the server based on the encrypted keyword and the encrypted key value. The coefficients of the second polynomial are the coefficients in the second polynomial constructed by the server based on the encrypted keyword. The encrypted keyword is obtained by the server encrypting a keyword in the database based on a shared symmetric key. The encrypted key value is obtained by the server encrypting a key value in the database based on a shared symmetric key.
[0010] To address the aforementioned problems, this application provides a data query method applied to a server, comprising: Each keyword and key value in the database is encrypted using a shared symmetric key to obtain encrypted keywords and encrypted key values. The first polynomial is constructed based on the encryption key and the encryption key value, and the second polynomial is constructed based on the encryption key; The receiving proxy node sends a query request based on the encrypted query keywords received from the client, using a predefined privacy query protocol; Based on the query request, the original encrypted query result is generated using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. The original encrypted query result is sent to the proxy node, which decrypts the original encrypted query result to obtain the target encrypted query result and then sends the target encrypted query result back to the client.
[0011] To address the aforementioned problems, this application provides a data query device, comprising: The first encryption module is used to encrypt the query keyword based on a shared symmetric key to obtain the encrypted query keyword. The shared symmetric key is obtained in advance through negotiation with the server. The first sending module is used to send the encrypted query keyword to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol. The first receiving module is used to receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; The decryption module is used to decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
[0012] To address the aforementioned problems, this application provides a data query device, comprising: The second encryption module encrypts each keyword and key value in the database based on a shared symmetric key to obtain encrypted keywords and encrypted key values. A construction module is used to construct a first polynomial based on the encryption key and the encryption key value, and to construct a second polynomial based on the encryption key; The second receiving module is used to receive query requests sent by the proxy node based on encrypted query keywords received from the client and using a predetermined privacy query protocol; The generation module is used to generate the original encrypted query result based on the query request, using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. The second sending module is used to send the original encrypted query result to the proxy node, so that the proxy node can decrypt the original encrypted query result to obtain the target encrypted query result and feed the target encrypted query result back to the client.
[0013] To address the aforementioned problems, this application provides a storage medium storing a computer program that, when executed by a processor, implements the steps of any of the aforementioned data query methods.
[0014] To address the aforementioned problems, this application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of any of the aforementioned data query methods.
[0015] The data query method, apparatus, medium, and device in this application, by introducing encrypted querying and proxy nodes, utilizes proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol. This ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by using proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load.
[0016] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description
[0017] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of preferred embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings: Figure 1 This is a flowchart illustrating a data query method according to an embodiment of this application; Figure 2 This is a flowchart illustrating a data query method according to another embodiment of this application; Figure 3 This is a flowchart illustrating a data query method according to another embodiment of this application; Figure 4 This is a structural block diagram of a data query device according to another embodiment of this application; Figure 5 This is a structural block diagram of a data query device according to another embodiment of this application; Figure 6 This is a structural block diagram of an electronic device according to another embodiment of this application. Detailed Implementation
[0018] Various embodiments and features of this application are described herein with reference to the accompanying drawings.
[0019] It should be understood that various modifications can be made to the embodiments described herein. Therefore, the above description should not be considered as limiting, but merely as an example of embodiments. Other modifications within the scope and spirit of this application will be apparent to those skilled in the art.
[0020] The accompanying drawings, which are included in and form part of this specification, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0021] These and other features of this application will become apparent from the following description of preferred forms of embodiments given as non-limiting examples, with reference to the accompanying drawings.
[0022] It should also be understood that although this application has been described with reference to some specific examples, those skilled in the art can certainly implement many other equivalent forms of this application.
[0023] The above and other aspects, features and advantages of this application will become more apparent when taken in conjunction with the accompanying drawings and in view of the following detailed description.
[0024] Specific embodiments of this application are described thereafter with reference to the accompanying drawings; however, it should be understood that the claimed embodiments are merely examples of this application, which can be implemented in various ways. Well-known and / or repeated functions and structures are not described in detail to avoid unnecessary or redundant details that could obscure the application. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but merely serve as the basis and representative basis for the claims to teach those skilled in the art to use this application in a variety of substantially any suitable detailed structures.
[0025] This specification may use the phrases “in one embodiment,” “in another embodiment,” “in yet another embodiment,” or “in other embodiments,” all of which may refer to one or more of the same or different embodiments according to this application.
[0026] This application provides a data query method, which can be specifically applied to the client terminals of financial institutions, such as... Figure 1 As shown, the specific steps include the following: Step S101: Encrypt the query keyword based on the shared symmetric key to obtain the encrypted query keyword. The shared symmetric key is obtained in advance through negotiation with the server. In this step, the client can negotiate with the server beforehand to determine a shared symmetric key K_shared. Simultaneously, the server will pre-encrypt keywords and key values in the database using this shared symmetric key, obtaining encrypted keywords and key values.
[0027] Then, the client uses the shared symmetric key K_shared to encrypt the query keyword Query_Key, obtaining the encrypted query keyword Enc_K(Query_Key). The query keyword can be the ID of a bond.
[0028] Step S102: Send the encrypted query keyword to a predetermined proxy node so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol. In this step, after receiving the encrypted query keyword, the proxy node can send a privacy query request to the server via the Privacy Query Protocol (PIR). In this embodiment, the PIR ensures that the encrypted data is computable without disclosing the query content.
[0029] In this step, after the client sends the encrypted query key to the proxy node, the proxy node can use a pre-generated additive homomorphic public key to encrypt the encrypted query key to obtain a ciphertext vector. Then, the proxy node sends a query request containing the ciphertext vector to the server.
[0030] Step S103: Receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; In this embodiment, after receiving a query request from the proxy node, the server generates an original encrypted query result based on the query request and then sends it back to the proxy node. The proxy node decrypts the original encrypted query result to obtain the target encrypted query result. Finally, the proxy node sends the target encrypted query result to the client, and thus the client receives the target encrypted query result.
[0031] Specifically, after receiving a query request from the proxy node, the server performs homomorphic encryption based on the first polynomial coefficients, the second polynomial coefficients, and the ciphertext vector in the query request to obtain the original encrypted query result. The server then sends the original encrypted query result back to the proxy node, which decrypts the original encrypted query result using the additive homomorphic private key to obtain the target encrypted query result. The proxy node then sends this target encrypted query result to the client.
[0032] Step S104: Decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
[0033] The method in this embodiment, by introducing encrypted queries and proxy nodes, utilizes proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol. This ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by using proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load. In this embodiment, during the data query process, since the query keywords are encrypted by the client and the query results returned by the server are also encrypted, the proxy node does not know the specific query conditions or the specific data corresponding to the query results. At the same time, the server also does not know the query conditions or the client's intent. Therefore, the data query method in this application can guarantee the client's data privacy and security.
[0034] Based on the above embodiments, another embodiment of this application provides a data query method, taking an application to a client corresponding to a financial institution as an example, specifically including the following steps: Step 1: Randomly generate a first private key a, and based on a predetermined prime number, a predetermined radix, and the first private key a, generate a first public key A corresponding to the first private key; In the specific implementation process, the predetermined prime number p and the predetermined base g can be shared with the server in advance via broadcast.
[0035] Specifically, the client generates the first public key A corresponding to the first private key a in the following way: A = g^a modp.
[0036] Step 2: Send the first public key A to the server so that the server can generate a shared symmetric key based on the first public key A, the predetermined prime number p, and the second private key b held by the server. The formula for calculating the shared symmetric key on the server side is: K_shared = A^b mod p Step 3: Receive the second public key sent by the server, and generate the shared symmetric key based on the second public key, the predetermined prime number, and the first private key held by the client. In this step, the server will pre-generate a second private key b randomly, and then generate a second public key B corresponding to the second private key based on a predetermined prime number p, a predetermined radix g, and the second private key b.
[0037] The client generates the shared symmetric key in the following way: K_shared = B^a mod p.
[0038] Step 4: Encrypt the query keyword Query_Key using the shared symmetric key K_shared to obtain the encrypted query keyword Enc_K(Query_Key); Step 5: Send the encrypted query key Enc_K (Query_Key) to the designated proxy node, so that the proxy node can use the pre-generated additive homomorphic public key to encrypt the encrypted query key to obtain a ciphertext vector, and send the query request containing the ciphertext vector to the server. In this step, the proxy node pre-generates an additive homomorphic public key pk and an additive homomorphic private key sk. Therefore, after receiving the encrypted query key Enc_K(Query_Key) sent by the client, the proxy node uses the additive homomorphic public key pk to perform secondary encryption on the encrypted query key. Specifically, the proxy node can use the additive homomorphic public key pk to perform calculations from the first power to the nth power on the encrypted query key (i.e., encrypting Enc_K(Query_Key) to the first power to the nth power using pk), obtaining a ciphertext vector vector. Then, the proxy node generates a query request based on the ciphertext vector and sends it to the server.
[0039] Step Six: Receive the target encrypted query result sent by the proxy node, obtained by decrypting the original encrypted query result fed back by the server based on the additive homomorphic private key. The additive homomorphic private key corresponds to the additive homomorphic public key. The original encrypted query result is generated by the server through homomorphic encryption processing based on the first polynomial coefficients, the second polynomial coefficients, and the ciphertext vector in the query request. The first polynomial coefficients are the coefficients in the first polynomial constructed by the server based on the encrypted keyword and the encrypted key value. The second polynomial coefficients are the coefficients in the second polynomial constructed by the server based on the encrypted keyword. The encrypted keyword is obtained by the server encrypting the keyword in the database based on the shared symmetric key. The encrypted key value is obtained by the server encrypting the key value in the database based on the shared symmetric key. In this embodiment, after generating a shared symmetric key, the server encrypts the keywords and key values in the database using the shared symmetric key to obtain encrypted keywords and encrypted key values. The server can then further construct a first polynomial based on the encrypted keywords and encrypted key values, and a second polynomial based on the encrypted keywords. Specifically, the server can use the encrypted keyword x... i and the encrypted key m i Performing Lagrange interpolation, the highest power is obtained as n. The first polynomial G(x) of 1 satisfies G(x) i )=m iMeanwhile, the server can calculate the second polynomial F(x) with the highest power n, F(x) = (x... x1)×(x x2)×...×(x x n ), that is, F(x) i )=0.
[0040] Therefore, after receiving the query request sent by the proxy node, the server can calculate the homomorphic ciphertext Enc(F(x)) based on the ciphertext vector, the coefficients of the second polynomial F(x), and the coefficients of the first polynomial G(x) in the query request. t )), Enc(G(x t This means obtaining the original encrypted query result, and then the server sends the original encrypted query result back to the proxy node.
[0041] After receiving the original encrypted query result from the server, the proxy node can use the addition homomorphic private key sk to process the original encrypted query result (homomorphic ciphertext Enc(F(x)). t )) and Enc(G(x t The encrypted query result is decrypted and then sent to the client.
[0042] Step 7: Decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result; The method in this embodiment, by introducing encrypted queries and proxy nodes, utilizes proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol. This ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by using proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load. In this embodiment, during the data query process, since the query keywords are encrypted by the client and the query results returned by the server are also encrypted, the proxy node does not know the specific query conditions or the specific data corresponding to the query results. At the same time, the server also does not know the query conditions or the client's intent. Therefore, the data query method in this application can guarantee the client's data privacy and security.
[0043] Another embodiment of this application provides a data query method, specifically applicable to a server / client of a bond information platform. This server has a database for storing bond information, such as... Figure 2 As shown, the method in this embodiment includes the following steps: Step S201: Encrypt each keyword and each key value in the database based on the shared symmetric key to obtain encrypted keywords and encrypted key values; In the specific implementation process of this step, the server can negotiate with the client in advance to obtain a shared symmetric key. Then, the server uses the shared symmetric key to encrypt the key and key value in the database to obtain the encrypted key and encrypted key value.
[0044] Step S202: Construct a first polynomial based on the encryption key and the encryption key value, and construct a second polynomial based on the encryption key; In the specific implementation of this step, the server can construct a first polynomial based on the encrypted key and its value, and then construct a second polynomial based on the encrypted key. Specifically, the server can construct the second polynomial based on the encrypted key x. i and the encrypted key m i Performing Lagrange interpolation, the highest power is obtained as n. The first polynomial G(x) of 1 satisfies G(x) i )=m i Meanwhile, the server can calculate the second polynomial F(x) with the highest power n, F(x) = (x... x1)×(x x2)×...×(x x n ), that is, F(x) i )=0.
[0045] Step S203: Receive a query request sent by the proxy node based on the encrypted query keywords received from the client and using a predetermined privacy query protocol; In this step, the proxy node pre-generates an additive homomorphic public key `pk` and an additive homomorphic private key `sk`. Therefore, after receiving the encrypted query key `Enc_K(Query_Key)` from the client, the proxy node uses the additive homomorphic public key `pk` to perform a second encryption on the encrypted query key. Specifically, the proxy node can use the additive homomorphic public key `pk` to calculate the encrypted query key to the power of 1 through n (i.e., encrypting `Enc_K(Query_Key)` to the power of 1 through n using `pk`), obtaining a ciphertext vector `vector`. The proxy node then generates a query request based on the ciphertext vector and sends it to the server.
[0046] Step S204: Based on the query request, generate the original encrypted query result using the first polynomial coefficients in the first polynomial and the second polynomial coefficients in the second polynomial. In this step, after receiving the query request from the proxy node, the server calculates the homomorphic ciphertext Enc(F(x)) based on the ciphertext vector, the coefficients of the second polynomial F(x), and the coefficients of the first polynomial G(x) in the query request. t )), Enc(G(x t This means obtaining the original encrypted query result.
[0047] Step S205: The original encrypted query result is sent to the proxy node so that the proxy node can decrypt the original encrypted query result to obtain the target encrypted query result and then feed the target encrypted query result back to the client.
[0048] In the specific implementation process of this step, after the server sends the original encrypted query result to the proxy node, the proxy node will decrypt the original encrypted query result based on the additive homomorphic private key sk, thereby obtaining the target encrypted query result. Then, the proxy node will feed back the target encrypted query result to the client, so that the client can decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
[0049] The method in this embodiment, by introducing encrypted queries and proxy nodes, utilizes proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol. This ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by using proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load. In this embodiment, during the data query process, since the query keywords are encrypted by the client and the query results returned by the server are also encrypted, the proxy node does not know the specific query conditions or the specific data corresponding to the query results. At the same time, the server also does not know the query conditions or the client's intent. Therefore, the data query method in this application can guarantee the client's data privacy and security.
[0050] Based on the above embodiments, the data query method in this application will be explained and described below in conjunction with specific application scenarios. For example... Figure 3 As shown, the participants in the data query method in this example include the client (financial institution), the proxy node (intermediate node), and the server (bond information platform). The proxy node and server can be deployed on the same local area network to optimize protocol communication efficiency, but they should be non-colluding entities to ensure security. The overall query is divided into two parts: a key negotiation phase and a covert query phase, specifically including the following steps: Step 1: Key Negotiation Initialization: The client and server complete the symmetric key negotiation through Diffie-Hellman (DH) or other standard key negotiation protocols. After the negotiation, both parties hold a shared symmetric key K_shared.
[0051] The specific key negotiation process includes: (1) The client shares the predetermined prime number p and the predetermined base g with the server in advance via broadcast; Where g is a positive integer less than p.
[0052] (2) The client randomly generates a first private key a, and generates a first public key A corresponding to the first private key based on a predetermined prime number p, a predetermined base g, and the first private key a; at the same time, the server randomly generates a second private key b, and generates a second public key B corresponding to the second private key based on a predetermined prime number p, a predetermined base g, and the second private key b. In this context, the first private key 'a' is a positive integer less than p. The second private key 'b' is also a positive integer less than p.
[0053] The first public key A is generated as follows: A = g^a mod p. The second public key B is generated as follows: B = g^b mod p.
[0054] (3) The client sends the first public key A to the server; at the same time, the server sends the second public key B to the client; (4) The client generates a shared symmetric key based on the prime number p predetermined by the server's second public key B and the first private key a held by the client; at the same time, the server generates a shared symmetric key based on the client's first public key A, the predetermined prime number p and the second private key b held by the server.
[0055] The formula for generating a shared symmetric key by the client is: K_shared = B^a mod p.
[0056] The formula for calculating / generating the shared symmetric key on the server side is: K_shared = A^b mod p.
[0057] Step 2: Database encryption: The server encrypts the keywords and key values in its complete bond database based on the shared symmetric key pair K_shared, that is, it encrypts ({Key: Value}) to obtain the encrypted keyword Enc_K(Key) and the encrypted key value Enc_K(Value); Enc_K(·) represents a symmetric encryption operation (such as AES) using the key K_shared. This process is a preprocessing step and is performed only once during database initialization or updates.
[0058] Furthermore, the server can construct a first polynomial based on the encrypted key and its value, and a second polynomial based on the encrypted key. Specifically, the server can construct a second polynomial based on the encrypted key x. i =Enc_K(Key i ) and the encrypted key m i =Enc_K(Value i Performing Lagrange interpolation, the highest power is obtained as n. The first polynomial G(x) of 1 satisfies G(x) i )=m i Meanwhile, the server can calculate the second polynomial F(x) with the highest power n, F(x) = (x... x1)×(x x2)×...×(x x n ), that is, F(x) i )=0.
[0059] Step 3: The client and server store the shared symmetric key K_shared locally; Step 4: The client encrypts the query key Query_Key based on the shared symmetric key K_shared to obtain the encrypted query key Enc_K(Query_Key), and sends the encrypted query key Enc_K(Query_Key) to the proxy node; Step 5: The proxy node uses the pre-generated additive homomorphic public key to encrypt the received encrypted query keyword to obtain a ciphertext vector, and sends the query request containing the ciphertext vector to the server. In this step, the proxy node pre-generates an additive homomorphic public key pk and an additive homomorphic private key sk. Therefore, after receiving the encrypted query key from the client, the proxy node can use the additive homomorphic public key pk to perform calculations from the first to the nth power on the encrypted query key Enc_K(Query_Key) (i.e., encrypting Enc_K(Query_Key) from the first to the nth power using pk), obtaining a ciphertext vector vector. The proxy node can then generate a query request based on the ciphertext vector and send it to the server, thus initiating a PIR query from the proxy node to the server.
[0060] Step 6: The server performs homomorphic encryption based on the coefficients of the first polynomial, the coefficients of the second polynomial, and the ciphertext vector in the query request to generate the original encrypted query result. In this step, the server can perform homomorphic ciphertext computation based on the coefficients of the first polynomial G(x), the coefficients of the second polynomial F(x), and the ciphertext vector in the query request, to obtain the original encrypted query result Enc(F(x)). t )) and Enc(G(x t )).
[0061] Step 7: The server sends the original encrypted query results to the proxy node; Step 8: The proxy node decrypts the original encrypted query result based on the additive homomorphic private key sk to obtain the target encrypted query result; Step 9: The proxy node sends the target encrypted query results to the client; Step 10: The client decrypts the target encrypted query result based on the shared symmetric key K_shared to obtain the target query result {Query_Key: Query_Val}.
[0062] The data query method in this embodiment ensures that the structure and content of the bond platform database are not exposed; the proxy node only acts as a "blind relay" and cannot access any plaintext data. At the same time, it ensures that the client's query intent is not revealed, thus guaranteeing the client's data privacy. Furthermore, the client only needs to participate in lightweight encryption and decryption operations, thereby avoiding client resource limitations and adapting to various query scenarios such as mobile terminals or browsers.
[0063] The method in this application has the following significant technical advantages: Two-way privacy protection: Both the client's query content and the platform's database content are encrypted to avoid information leakage; Lightweight client deployment: The client does not need to participate in high-intensity PIR calculations, making it easy to integrate into mobile terminals, browsers, and other terminals; Efficient deployment: Proxy nodes and servers can be deployed on the same local area network, improving the efficiency of PIR protocol execution and reducing communication latency; Strong scalability: Adaptable to different key management mechanisms and PIR algorithms, enabling flexible deployment.
[0064] Another embodiment of this application provides a data query device, such as... Figure 4 As shown, it includes: The first encryption module 11 is used to encrypt the query keyword based on a shared symmetric key to obtain the encrypted query keyword. The shared symmetric key is obtained in advance through negotiation with the server. The first sending module 12 is used to send the encrypted query keyword to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol. The first receiving module 13 is used to receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; The decryption module 14 is used to decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
[0065] In this embodiment, the data query device further includes a first negotiation module, which is used for: A first private key is randomly generated, and a first public key corresponding to the first private key is generated based on a predetermined prime number, a predetermined radix, and the first private key. The first public key is sent to the server so that the server can generate the shared symmetric key based on the first public key, the predetermined prime number, and the second private key held by the server. The system receives a second public key sent by the server and generates the shared symmetric key based on the second public key, the predetermined prime number, and its own first private key.
[0066] In this embodiment, the data query device further includes a sharing module, which is used to: share the predetermined prime number and the predetermined base with the server in advance via broadcast.
[0067] In this embodiment, the first sending module is specifically used to: send the encrypted query keyword to a predetermined proxy node, so that the proxy node can use a pre-generated additive homomorphic public key to encrypt the encrypted query keyword to obtain a ciphertext vector, and send a query request containing the ciphertext vector to the server.
[0068] In this embodiment, the first receiving module is specifically used to: receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the additive homomorphic private key. The additive homomorphic private key corresponds to the additive homomorphic public key. The original encrypted query result is generated by the server performing homomorphic encryption processing based on the first polynomial coefficients, the second polynomial coefficients, and the ciphertext vector in the query request. The first polynomial coefficients are the coefficients in the first polynomial constructed by the server based on the encrypted keyword and the encrypted key value. The second polynomial coefficients are the coefficients in the second polynomial constructed by the server based on the encrypted keyword. The encrypted keyword is obtained by the server encrypting the keyword in the database based on the shared symmetric key. The encrypted key value is obtained by the server encrypting the key value in the database based on the shared symmetric key.
[0069] The device in this embodiment, by introducing encrypted queries and proxy nodes, uses the proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol. This ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by utilizing proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load.
[0070] Another embodiment of this application provides a data query device, such as... Figure 5 As shown, it includes: The second encryption module 21 is used to encrypt each keyword and each key value in the database based on a shared symmetric key to obtain encrypted keywords and encrypted key values. Construction module 22 is used to construct a first polynomial based on the encryption key and the encryption key value, and to construct a second polynomial based on the encryption key; The second receiving module 23 is used to receive a query request sent by the proxy node based on the encrypted query keywords received from the client and using a predetermined privacy query protocol; The generation module 24 is used to generate the original encrypted query result based on the query request, using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. The second sending module 25 is used to send the original encrypted query result to the proxy node, so that the proxy node can decrypt the original encrypted query result to obtain the target encrypted query result and feed the target encrypted query result back to the client.
[0071] The device in this example, by introducing encrypted queries and proxy nodes, uses the proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol. This ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by utilizing proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load.
[0072] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the following method steps: Step 1: Encrypt the query keyword using a shared symmetric key to obtain the encrypted query keyword. The shared symmetric key is obtained in advance through negotiation with the server. Step 2: Send the encrypted query keyword to the designated proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using the designated privacy query protocol; Step 3: Receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; Step 4: Decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
[0073] Alternatively, when the computer program is executed by the processor, it implements the following method steps: Step 1: Encrypt each keyword and key value in the database using a shared symmetric key to obtain encrypted keywords and encrypted key values; Step 2: Construct the first polynomial based on the encryption key and encryption key value, and construct the second polynomial based on the encryption key; Step 3: Receive the query request sent by the proxy node based on the encrypted query keywords received from the client and using a predefined privacy query protocol; Step 4: Based on the query request, generate the original encrypted query result using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. Step 5: Send the original encrypted query result to the proxy node so that the proxy node can decrypt the original encrypted query result to obtain the target encrypted query result and then send the target encrypted query result back to the client.
[0074] The specific implementation process of the above method steps can be found in the embodiments of the above arbitrary data query method, and will not be repeated here.
[0075] This application introduces encrypted queries and proxy nodes. By using proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol, it ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by utilizing proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load.
[0076] Another embodiment of this application provides an electronic device, such as... Figure 6 As shown, it includes at least a memory 1 and a processor 2. The memory 1 stores a computer program, and the processor 2 performs the following method steps when executing the computer program in the memory 1: Step 1: Encrypt the query keyword using a shared symmetric key to obtain the encrypted query keyword. The shared symmetric key is obtained in advance through negotiation with the server. Step 2: Send the encrypted query keyword to the designated proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using the designated privacy query protocol; Step 3: Receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; Step 4: Decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
[0077] Alternatively, the processor, when executing a computer program on the memory, performs the following method steps: Step 1: Encrypt each keyword and key value in the database using a shared symmetric key to obtain encrypted keywords and encrypted key values; Step 2: Construct the first polynomial based on the encryption key and encryption key value, and construct the second polynomial based on the encryption key; Step 3: Receive the query request sent by the proxy node based on the encrypted query keywords received from the client and using a predefined privacy query protocol; Step 4: Based on the query request, generate the original encrypted query result using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. Step 5: Send the original encrypted query result to the proxy node so that the proxy node can decrypt the original encrypted query result to obtain the target encrypted query result and then send the target encrypted query result back to the client.
[0078] The specific implementation process of the above method steps can be found in the embodiments of the above arbitrary data query method, and will not be repeated here.
[0079] This application introduces encrypted queries and proxy nodes. By using proxy nodes to send query requests to the server based on encrypted query keywords and a privacy query protocol, it ensures the confidentiality of client query information while guaranteeing accurate and reliable query results, thus preventing client privacy leaks. Simultaneously, by utilizing proxy nodes to communicate with the server, the issue of client resource limitations can be circumvented. The client only needs to perform query condition encryption and result decryption operations, minimizing the client's computational load.
[0080] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. A data query method, applied to a client, characterized in that, include: The query keywords are encrypted using a shared symmetric key to obtain encrypted query keywords. The shared symmetric key is obtained in advance through negotiation with the server. The encrypted query keyword is sent to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol; Receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; The target encrypted query result is decrypted based on the shared symmetric key to obtain the target query result.
2. The method as described in claim 1, characterized in that, The method further includes: A first private key is randomly generated, and a first public key corresponding to the first private key is generated based on a predetermined prime number, a predetermined radix, and the first private key. The first public key is sent to the server so that the server can generate the shared symmetric key based on the first public key, the predetermined prime number, and the second private key held by the server. The system receives a second public key sent by the server and generates the shared symmetric key based on the second public key, the predetermined prime number, and its own first private key.
3. The method as described in claim 1, characterized in that, The method further includes: sharing the predetermined prime number and the predetermined base with the server in advance via broadcast.
4. The method as described in claim 1, characterized in that, The step of sending the encrypted query keyword to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol, specifically includes: The encrypted query keyword is sent to a predetermined proxy node, which then uses a pre-generated additive homomorphic public key to encrypt the encrypted query keyword to obtain a ciphertext vector, and sends a query request containing the ciphertext vector to the server.
5. The method as described in claim 4, characterized in that, The target encrypted query result, obtained by decrypting the original encrypted query result returned by the server based on the query request and sent by the receiving proxy node, specifically includes: The system receives a target encrypted query result sent by a proxy node, obtained by decrypting the original encrypted query result returned by the server based on an additive homomorphic private key. The additive homomorphic private key corresponds to the additive homomorphic public key. The original encrypted query result is generated by the server through homomorphic encryption processing based on the coefficients of a first polynomial, the coefficients of a second polynomial, and the ciphertext vector in the query request. The coefficients of the first polynomial are the coefficients in the first polynomial constructed by the server based on the encrypted keyword and the encrypted key value. The coefficients of the second polynomial are the coefficients in the second polynomial constructed by the server based on the encrypted keyword. The encrypted keyword is obtained by the server encrypting a keyword in the database based on a shared symmetric key. The encrypted key value is obtained by the server encrypting a key value in the database based on a shared symmetric key.
6. A data query method, characterized in that, Applied to the server side, including: Each keyword and key value in the database is encrypted using a shared symmetric key to obtain encrypted keywords and encrypted key values. The first polynomial is constructed based on the encryption key and the encryption key value, and the second polynomial is constructed based on the encryption key; The receiving proxy node sends a query request based on the encrypted query keywords received from the client, using a predefined privacy query protocol; Based on the query request, the original encrypted query result is generated using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. The original encrypted query result is sent to the proxy node, which decrypts the original encrypted query result to obtain the target encrypted query result and then sends the target encrypted query result back to the client.
7. A data query device, characterized in that, include: The first encryption module is used to encrypt the query keyword based on a shared symmetric key to obtain the encrypted query keyword. The shared symmetric key is obtained in advance through negotiation with the server. The first sending module is used to send the encrypted query keyword to a predetermined proxy node, so that the proxy node can send a query request to the server based on the encrypted query keyword and using a predetermined privacy query protocol. The first receiving module is used to receive the target encrypted query result sent by the proxy node, which is obtained by decrypting the original encrypted query result fed back by the server based on the query request; The decryption module is used to decrypt the target encrypted query result based on the shared symmetric key to obtain the target query result.
8. A data query device, characterized in that, include: The second encryption module encrypts each keyword and key value in the database based on a shared symmetric key to obtain encrypted keywords and encrypted key values. A construction module is used to construct a first polynomial based on the encryption key and the encryption key value, and to construct a second polynomial based on the encryption key; The second receiving module is used to receive query requests sent by the proxy node based on encrypted query keywords received from the client and using a predetermined privacy query protocol; The generation module is used to generate the original encrypted query result based on the query request, using the first polynomial coefficient in the first polynomial and the second polynomial coefficient in the second polynomial. The second sending module is used to send the original encrypted query result to the proxy node, so that the proxy node can decrypt the original encrypted query result to obtain the target encrypted query result and feed the target encrypted query result back to the client.
9. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the steps of the data query method according to any one of claims 1-5 or 6.
10. An electronic device, characterized in that, It includes at least a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program in the memory, implements the steps of the data query method according to any one of claims 1-5 or 6.