Data privacy query method and electronic device

CN121637570BActive Publication Date: 2026-10-23INSPUR (BEIJING) ELECTRONICS INFORMATION IND CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610148700.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-02-03
Publication Date
2026-10-23
Estimated Expiration
2046-02-03

AI Technical Summary

Technical Problem

[0002]PIR(隐匿查询,Private Information Retrieval)技术在医疗健康(保护患者隐私)、金融投资(隐藏投资意图)及政务管理(纪检侦察)等领域具有重要的应用前景,但由于当前的PIR协议在处理大规模数据库时(由于单次查询要求服务端具有线性/亚线性计算复杂度)效率低下,因此当前尚未在实践中广泛部署

Benefits of technology

[0006]可见,本申请应用于客户端,包括:获取目标记录在原始数据库中的索引,得到原始索引,并基于原始索引以及预设查询向量长度获取目标数据密文在相应数据库分块中的位置,得到局部索引序列;目标数据密文为对目标记录加密后得到的密文;沿局部索引序列对应的索引树中的各层单元树的路径标签查找索引树,得到从根结点到叶子结点的目标路径;将目标路径中叶子结点的位置确定为目标记录在密态数据库中的目标位置,并将目标位置广播至各服务端,以根据目标位置在各服务端的密态数据库中查找相应的目标秘密分享份额,并将目标秘密分享份额发送至客户端;对接收到的各目标秘密分享份额进行聚合得到目标数据密文,并对目标数据密文进行解密,得到目标记录。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121637570B_ABST
    Figure CN121637570B_ABST
Patent Text Reader

Abstract

The application discloses a data concealment query method and electronic equipment, and relates to the technical field of information security, which comprises the following steps: obtaining the index of the target record in the original database to obtain an original index, and obtaining the position of the target data ciphertext in the corresponding database block based on the original index and the length of the query vector to obtain a local index sequence; finding the index tree along the path label corresponding to the local index sequence to obtain a target path; determining the position of the leaf node in the target path as the target position of the target record in the ciphertext database, and broadcasting the target position to each server to find the corresponding target secret share in the ciphertext database of the server according to the target position; aggregating each target secret share received, and decrypting the aggregated target data ciphertext to obtain the target record. The application can improve the security and efficiency of data concealment query, and effectively protect the query privacy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information security technology, and in particular to a data concealment query method and electronic device. Background Technology

[0002] PIR (Private Information Retrieval) technology has significant application prospects in fields such as healthcare (protecting patient privacy), financial investment (concealing investment intentions), and government administration (disciplinary inspection and investigation). However, due to the inefficiency of current PIR protocols in processing large-scale databases (because a single query requires linear / sublinear computational complexity on the server side), it has not yet been widely deployed in practice.

[0003] Furthermore, in multi-server covert query scenarios based on secret sharing, administrators typically need to interact frequently and rely on auxiliary data generated by trusted third parties to perform multiplication operations for secret sharing. This results in significant communication overhead for administrators and makes the security of the covert query system heavily dependent on trusted third parties, thereby increasing security vulnerabilities. Moreover, in covert query technology, to hide query keywords or indexes, administrators often need to send large amounts of irrelevant data, causing substantial communication overhead. Summary of the Invention

[0004] In view of this, the purpose of this application is to provide a data concealment query method and electronic device, which can improve the security of data concealment queries. Furthermore, by querying an index tree to determine the location information of the target record in the encrypted database, the client only needs to broadcast the location information during real-time queries, and the server only needs to return the data at the corresponding location, thus ensuring the client's query intent during real-time queries. In addition, since only location information needs to be sent, and no large amount of other information needs to be sent, the amount of data communication (i.e., communication overhead) and computing resources between the client and the server are reduced, thereby improving the computational efficiency and query efficiency of concealment queries. Moreover, multiple servers need to participate, thus ensuring that a single data service provider (i.e., the server) cannot know the specific query content of the data query provider (i.e., the client), thereby effectively protecting query privacy. The specific solution is as follows: Firstly, this application discloses a data concealment query method, applied to a client, including: Obtain the index of the target record in the original database to obtain the original index. Based on the original index and the preset query vector length, obtain the position of the target data ciphertext in the corresponding database block to obtain the local index sequence. The target data ciphertext is the ciphertext obtained after encrypting the target record. Search the index tree along the path labels of each unit tree in the index tree corresponding to the local index sequence to obtain the target path from the root node to the leaf node; The position of the leaf node in the target path is determined as the target position of the target record in the secret database. The target position is broadcast to each server so that the corresponding target secret sharing share can be found in the secret database of each server according to the target position. The target secret sharing share is then sent to the client. The received target secret sharing shares are aggregated to obtain target data ciphertext, and the target data ciphertext is decrypted to obtain the target record.

[0005] Secondly, this application discloses an electronic device, including a processor and a memory; wherein the processor executes a computer program stored in the memory to implement the aforementioned data concealment query method.

[0006] As can be seen, this application is applied to the client and includes: obtaining the index of the target record in the original database to obtain the original index, and obtaining the position of the target data ciphertext in the corresponding database block based on the original index and a preset query vector length to obtain a local index sequence; the target data ciphertext is the ciphertext obtained after encrypting the target record; searching the index tree along the path labels of each level of the unit tree in the index tree corresponding to the local index sequence to obtain the target path from the root node to the leaf node; determining the position of the leaf node in the target path as the target position of the target record in the encrypted database, and broadcasting the target position to each server so as to find the corresponding target secret sharing share in the encrypted database of each server according to the target position, and sending the target secret sharing share to the client; aggregating the received target secret sharing shares to obtain the target data ciphertext, and decrypting the target data ciphertext to obtain the target record.

[0007] In this application, the position of the encrypted data in the corresponding database block is first obtained based on the index of the target record in the original database and the preset query vector length, resulting in a local index sequence. Then, the path label corresponding to the local index sequence is used to search the index tree to obtain the target path from the root node to the leaf node. The position of the leaf node in the target path is then sent to multiple servers so that the servers can find the corresponding secret sharing share through the position. The secret sharing shares sent by multiple servers are then aggregated and decrypted to obtain the target record to be queried. By employing the above methods, since the server's feedback only contains data related to the target record, it ensures that the client cannot obtain any information other than the data related to the target record, thereby improving the security of data concealment queries. Furthermore, by using the query index tree to determine the location information of the target record in the encrypted database, the client only needs to broadcast the location information during real-time queries, and the server only needs to return the data at the corresponding location, thus ensuring the client's query intent during real-time queries. In addition, since only location information needs to be sent, without sending a large amount of other information, the amount of data communication (i.e., communication overhead) and computing resources between the client and the server are reduced, thereby improving the computational efficiency and query efficiency of concealment queries. Moreover, since multiple servers need to participate, it ensures that a single data service provider (i.e., the server) cannot know the specific query content of the data query provider (i.e., the client), thus effectively protecting query privacy. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0009] Figure 1 This is a flowchart of a data concealment query method based on a local index disclosed in this application; Figure 2 This is a specific schematic diagram of multi-party data interaction disclosed in this application; Figure 3 This is a schematic diagram of a specific encrypted database structure disclosed in this application; Figure 4 This application discloses a specific method for data hiding queries based on global and local indexes. (Flowchart) Detailed Implementation

[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0011] It should be noted that, in the description of this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0012] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0013] This application discloses a data concealment query method applied to a client-side application; see [link to relevant documentation]. Figure 1 As shown, the method includes: Step S11: Obtain the index of the target record in the original database to obtain the original index, and obtain the position of the target data ciphertext in the corresponding database block based on the original index and the preset query vector length to obtain the local index sequence; the target data ciphertext is the ciphertext obtained after encrypting the target record.

[0014] It should be noted that the data concealment query scheme proposed in this application is applied to the client side, and the client can communicate with the server to query pre-stored encrypted data from the server. For details, see [link to relevant documentation]. Figure 2 As shown, the server, acting as a hosting platform for sensitive data, possesses substantial storage, computing, and bandwidth resources. It is responsible for responding to client queries. A single server does not possess complete information about the original data (such as sensitive data); instead, it stores data processed using cryptographic techniques (such as homomorphic encryption or secret sharing). Different servers interact through cryptographic communication. The cryptographic data stored on the client originates from the data owner (i.e., the data provider), which can be the owner or manager of the sensitive data (such as a medical institution possessing massive amounts of medical data). The sensitive data is processed using cryptographic techniques, such as homomorphic encryption or secret sharing, and then the processed data is uploaded to the server for storage.

[0015] In addition, the client can interact with the server and generate an index tree and a hidden query tree based on the preset query vector length and the size of the original database. When performing real-time hidden queries, it generates a local index sequence based on the index of the target record and the preset query vector length, and searches the index tree based on the local index sequence to obtain the position of the target record in the hidden database and feeds it back to each server. It can also receive data fed back from each server and recover the target record through a series of aggregation and decryption operations.

[0016] In this embodiment, when a client needs to perform a hidden query, the index of the target record to be queried (such as private data of medical institutions or government departments, such as tax data, patient medical records, etc.) in the original database (such as a database in the fields of medicine or government affairs) is first obtained to obtain the original index. Then, based on the original index and the preset query vector length, the position of the target data ciphertext in the corresponding database block is determined to obtain the local index sequence. The target data ciphertext is the ciphertext obtained by encrypting the target record (using a homomorphic encryption algorithm to encrypt the target record). Each data entry in the original database is a record, and the target record refers to the data that the client wants to query.

[0017] It should be noted that before performing the data concealment query, this application pre-constructs a cryptographic database offline. The specific construction process is as follows: multiple key pairs are alternately generated through client-server interaction, resulting in multiple first-round keys on the client and multiple second-round keys on the server. Each key pair includes a public key pair and a private key pair, with the public key pair containing the cardinality and modulus of multiple different rounds. A complete multi-way tree is constructed based on the preset query vector length and the original database capacity. Each path from the parent node to the child node within each unit tree of the complete multi-way tree is randomly labeled, resulting in a database containing path labels. An index tree is constructed; a query vector is generated based on path labels to obtain a target query vector, which is then homomorphically encrypted to obtain a target encrypted query vector; the path labels in the index tree are replaced with the corresponding target encrypted query vectors to obtain a first encrypted query tree; the first encrypted query tree is sent to the server, and the system traverses downwards from the root node of the first encrypted query tree, dividing the sub-databases stored in the parent node of each layer of the unit tree into equal-length blocks to obtain multiple database blocks. The inner product of the database blocks and multiple target encrypted query vectors is calculated to generate multiple sub-databases containing only a single data record, thus obtaining a encrypted database. In one specific implementation, firstly, a series of public parameters can be set for each participating party, specifically including: setting an original database (denoted as a set) on the server. That is, the labels of all records in the original database range from 0 to ) scale And the modulus N on which the secret sharing of raw data (such as sensitive data that medical institutions need to store) is based; a preset query vector length l is set on the client side, and a public parameter is set. ,in This indicates rounding down to the nearest integer.

[0018] Next, the client and a specific server interact alternately to generate... A Paillier key pair, resulting in a collection of A public key pair and The round key for each private key pair. Specifically, the client can first generate a random round key. prime pairs As a private key pair, satisfying Where gcd is the greatest common divisor, and is set Paillier modulus Similarly, the server can first generate randomly. prime pairs As a private key pair, satisfying and set Paillier modulus The moduli of the client and server satisfy the following constraints: ; In the formula, t represents the number of servers. Based on Each Paillier modulus, with the client and server each setting a public base: ; This yields multiple public key pairs located on the client side. and multiple public key pairs located on the server. .in, Let i be the base number of the client in the i-th round. Let i be the modulus of the client in round i. Let i be the base number of the i-th round on the server side. Let be the modulus of the i-th round on the server side.

[0019] Furthermore, the client bases the query vector length l on the preset query vector length and the original database size (i.e., database size). structure The system first constructs a complete l-ary tree, and then randomly labels each path (the edge from the parent node to the child node) within each unit tree of the complete l-ary tree to obtain an index tree containing path labels. For any unit tree in the index tree, the client constructs a corresponding query vector based on the path labels.

[0020] Next, for any th Layered unit tree, the client uses Paillier public key pair The Paillier algorithm (a classic semi-homomorphic encryption algorithm whose ciphertext has additive homomorphism) is used to perform homomorphic encryption on l target query vectors. That is, Paillier encryption operation is performed on each component of the target query vector to obtain the target secret query vector. Then, each path label of the index tree is replaced with the corresponding target secret query vector to obtain the first secret query tree, and the first secret query tree is sent to the server.

[0021] After the server receives the first encrypted query tree sent by the client, it traverses downwards from the root node of the first encrypted query tree, performing equal-length block processing (i.e., uniform block division) on the sub-databases stored in the parent nodes of each unit tree, thus obtaining multiple database blocks. Then, it calculates the inner product of each database block with l target encrypted query vectors, obtaining l reduced-size sub-databases, which are stored in their corresponding child node positions. This block division and inner product calculation method is recursively applied to the (child) databases in the parent nodes of each unit tree in the next layer, resulting in continuously reduced-size sub-databases. After a finite number of iterations, a sub-database containing only a single data record is obtained. All these sub-databases containing only a single data record constitute a encrypted database. By pre-creating sub-databases containing only a single data record (in ciphertext form), i.e., encrypted databases, during real-time covert queries, the specific data record can be accurately located directly from the sub-databases of the encrypted database using location information, thereby improving the efficiency of covert queries. Furthermore, by performing block operations on the original database, privacy protection can be achieved for the original database.

[0022] Specifically, each path from a parent node to a child node within each unit tree of the complete multi-way tree is randomly labeled to obtain an index tree containing path labels. This can include: randomly selecting elements from a set from 0 to a preset query vector length minus one, and using these elements as labels for any path from a parent node to a child node within any unit tree of the complete multi-way tree, thus obtaining an index tree containing path labels. Here, a unit tree is a minimal multi-way tree composed of any non-leaf node and its target number of child nodes; different paths within the same unit tree have different path labels; the target number is the same as the preset query vector length. In this embodiment, for each path (edge ​​from a parent node to a child node) within any unit tree of the complete l-way tree, the client can uniformly and randomly select elements from the set... We select elements from the set as labels for the path (i.e., path labels, integers between 0 and l minus one), such that different paths have different path labels. That is, the sequence of l path labels from left to right in any unit tree is: A random permutation of a path-labeled, complete l-ary tree is called an index tree, which can be secretly stored by the client. It should be noted that, for the convenience of covert queries, this application defines the concept of a unit tree. A minimum l-ary tree consisting of any non-leaf node and its l child nodes is called a unit tree, and a unit tree consisting of any i-th level (non-leaf) node and its l child nodes is called a subtree. Layered unit tree, where By using an index tree, the location information of target records in a secure database can be secretly stored. This allows clients to broadcast location information during online queries, while the server only needs to respond with the corresponding data, thus ensuring the client's query intent. Furthermore, setting path labels using random tagging enhances data query security.

[0023] Specifically, constructing a query vector based on path tags to obtain the target query vector can include: constructing random query vectors for each level of the index tree; setting the target component in the random query vector to 1 and setting all other components to 0, thus obtaining the target query vector corresponding to each path tag; the position of the target component is the same as the value of the element corresponding to the path tag. In this embodiment, a random query vector can be constructed for each level of the index tree first, and then each component in the random query vector can be set. For example, for any path tag... The corresponding target query vector is the first one. A vector with one component set to 1 and all other components set to 0. If the value of the element corresponding to the path label is 2, then two components in the query vector are set to 1, and the other components are set to 0.

[0024] In one specific implementation, the sub-databases stored in the parent nodes of each level of the unit tree are sequentially divided into equal-length blocks to obtain multiple database blocks. Specifically, this may include: calculating the global index of the original database and the end records of each level of sub-databases using the current server and based on the capacity, to obtain a target global index; dividing the sub-databases stored in the parent nodes of each level of the unit tree into equal-length blocks according to a preset query vector length, to obtain multiple database blocks; the number of database blocks stored in the parent node is equal to the value of the next-level target global index plus one. In this embodiment, the current server can first base its calculation on the capacity of the original database (i.e., the database size). Calculate the global index of the end records of the original database and each level of sub-databases to obtain the target global index. The specific calculation formula is as follows: ; In the formula, Indicates rounding up. This represents the global index of the last record in the i-th level sub-database. This represents the global index of the last record in the original database. The number of target global indexes equals the number of computation rounds, and the number of child database blocks stored in the parent node equals the value of the next-level target global index plus one, which is the quotient of the current child database length divided by the preset query vector length and then rounded up.

[0025] Next, the server divides the sub-databases stored in the parent node of the current unit tree into blocks according to the preset query vector length. Specifically, for The server stores the first (i)th element at the parent node position in any i-th level unit tree. The sub-database is divided into blocks according to a preset query vector length l. That is, starting from the 0th data, every l consecutive data records are grouped into a block, resulting in multiple database blocks, as follows: ; It should be noted that when the first If a block has fewer than l elements, it can be padded with 0. Based on the local index of each data record's ciphertext in the current sub-database (the position of the data record's ciphertext in the database block), the original database is divided into multiple disjoint and reduced-size sub-databases (the order of the sub-databases is randomized). The same operation is then performed on each sub-database in the same way to obtain multiple further reduced-size sub-databases (the order of the sub-databases is randomized). This operation is recursively repeated until multiple reduced-size sub-databases containing data record ciphertexts with the same local index are obtained (the order of the sub-databases is randomized), which can achieve fast querying of target data.

[0026] Furthermore, the inner product of the database blocks and multiple target encrypted query vectors is calculated to generate multiple sub-databases containing only a single data record, resulting in an encrypted database. Specifically, this can include: calculating the inner product of each database block and multiple target encrypted query vectors on the first server to obtain the multiplicative share in encrypted form of a single data record; encrypting the multiplicative share using the public key pair from the second round key and a homomorphic encryption algorithm on the first server to obtain the encrypted share; and converting the multiplicative share into an additive share using a homomorphic encryption algorithm based on the encrypted share through interaction between the first server and other servers, resulting in an encrypted database containing multiple additive share shares. For example, for any... Let the target dense-state query vector corresponding to the j-th path of the i-th level unit tree be . Each server can calculate the inner product of each database block and the target encrypted query vector to obtain the multiplication share in Paillier ciphertext form of a certain data record. The multiplication share (i.e., multiplication share) of all data records can be represented as: ; In the formula, the symbol This represents the scalar multiplication operation between elements (scalars) on the ring and Paillier ciphertext. This represents the XOR mathematical operator.

[0027] For situations where there are two servers (the first server and the second server) Second server In scenarios like this, it can be done through the first server. and utilize the location Local Paillier public key pair Performing Paillier homomorphic encryption on the multiplicative share yields the ciphertext form of the multiplicative share, i.e., the encrypted share. .

[0028] ; In the formula, mod represents the modulo operation.

[0029] Next, the first server Share after encryption Send to the second server When the second server Received Then, the shares can be shared through interaction between the two servers, based on encryption. The Paillier algorithm is used to transform each multiplication sharing share into an addition sharing form, thereby obtaining multiple addition sharing shares, and all addition sharing shares are used as a dense state database.

[0030] Specifically, through interaction between the first server and other servers and based on the encrypted shared shares, a homomorphic encryption algorithm is used to convert the multiplicative shared shares into an additive shared form, resulting in a cryptographic database containing multiple additive shared shares. This can include: the first server sending the encrypted shared shares to the second server to select the same number of random elements as the multiplicative shared shares, and calculating the power of the corresponding encrypted shared share using each multiplicative shared share as an exponent to obtain the first power, and calculating the power of the current round's base using each random element as an exponent to obtain the second power, and calculating the ratio of the first power to the second power on a ring based on the square of the modulus of the previous round, and sending the ratio to the first server; the first server then uses the homomorphic encryption algorithm to compare the values ​​and perform decryption based on the private key pair in the second round's key to obtain the cryptographic database containing multiple additive shared shares. In this embodiment, the first server... Share after encryption Send to the second server back, Select a number of random elements equal to the share of the multiplication operation (the size of the sub-database in the current round). .for Each share of the multiplication principle is represented by its respective shareholding. Ciphertext for calculating the corresponding multiplication share of the exponent The power of, and the various random elements Calculate the current round base for the index. The power of is used to obtain the first and second powers, and the ratio of the first power to the second power is calculated on the ring formed by the squares of the moduli of the previous round. The specific calculation formula is as follows: ; then, ratio Send to the first server Meanwhile, the second server We can obtain: .

[0031] When the first server Received Sent Afterwards, one can utilize the first [unclear] held by oneself private key pair of the round From the second server The ratio of received Perform the decryption operation to obtain... Addition sharing format Specifically, it can be expressed as: .

[0032] The aforementioned multiple additive sharing shares can constitute a dense database. For details, see [link to documentation]. Figure 3 As shown, Figure 3 This illustrates a specific dense-state database. It can be seen that the dense-state query tree is a complete l-ary tree containing the root node D and 8 leaf nodes, with a total length of... Layers, counted from layer 0 to layer 1. Layer. Furthermore, the dense query tree contains a unit tree of... Layers, counted from layer 1 to layer 2. The unit tree is divided into layers. The first layer consists of the root node D and its l child nodes (called first-level child nodes). The second layer consists of any first-level child node and its l child nodes (called second-level child nodes), and so on up to the [layer name missing]. The layer unit tree is composed of arbitrary The first child node and its l child nodes (called The database is composed of level 0 child nodes. The database stored at the root node D is called the original database (also known as the level 0 child database). The database stored at the position of the i-th level child node is called the i-th level child database.

[0033] In another specific implementation, the multiplication sharing shares are transformed into an addition sharing form to obtain a cryptographic database containing multiple addition sharing shares. Specifically, this can include: through interaction between a first server and other servers, and based on the encrypted sharing shares, using a Beaver triple-based algorithm to transform the multiplication sharing shares into an addition sharing form, resulting in a cryptographic database containing multiple addition sharing shares. Beaver triples can efficiently implement secret multiplication in secure multi-party computation, consisting of randomly generated triples (a, b, c) satisfying c = a × b. Its core function is to generate random values ​​during the preprocessing stage, thereby reducing the communication and computational overhead of online computation. Therefore, by transforming the multiplication sharing shares into an addition sharing form using a Beaver triple-based algorithm, the communication and computational overhead of covert queries can be significantly reduced.

[0034] It should be noted that before traversing downwards layer by layer from the root node of the first secret query tree, the process specifically includes: storing the storage address of the original database or a secret sharing format for the original database at the root node of the first secret query tree. In this embodiment, the server will pre-define the storage address of the original database (or secret sharing format) as the root node of the secret query tree, and then obtain the secret database through multiple rounds of interactive iterative calculations based on the secret query tree generated by the client.

[0035] In another specific implementation, after constructing a complete multi-way tree based on the preset query vector length and the capacity of the original database, the method further includes: selecting a preset number of permutations on the target set to obtain a global permutation; the target set is a set from 0 to the preset query vector length minus one; randomly selecting elements from the target set and using these elements as labels for any single-sided path within any unit tree of the complete multi-way tree to obtain initial labels; constructing a query vector based on the initial labels to obtain an initial query vector, and using the public key pair from the first round key and a homomorphic encryption algorithm to encrypt each component of the initial query vector to obtain an initial encrypted query vector; and sending the global permutation and the initial encrypted query vector to... On the server side, the components of the initial dense query vector are permuted based on global permutation to obtain a derived dense query vector. The server then replaces the initial label of any single-sided path within any unit tree of the complete multi-way tree with the initial dense query vector, and sets the label of another single-sided path within any unit tree as the derived dense query vector, resulting in a second dense query tree. Starting from the root node of the second dense query tree, the server traverses downwards layer by layer, dividing the sub-databases stored in the parent node of each unit tree into equal-length blocks, resulting in multiple database blocks. The server then calculates the inner product of each database block with the initial dense query vector and the derived dense query vector to generate multiple sub-databases containing only a single data record, thus obtaining a dense database. In this embodiment, the client can also select a path label for each unit tree and construct a corresponding query vector, then... A public global permutation extension yields other Each path label and its corresponding query vector are used, so for each unit tree, the client only needs to encrypt and send one query vector. Specifically, the client first selects a set... On Replacement And for any It satisfies the following constraints: ; in, For set The identity permutation on, that is, for any ,have It should be noted that a permutation on a set is a bijection from that set to itself.

[0036] Next, for each unit tree, the client selects uniformly and randomly. The path label (called the initial label) serves as the path label for a given path (such as the path from the parent node to the leftmost child node), and a query vector is constructed based on this path label. (i.e., the initial query vector), so that The Each component The value is 1 for all components and 0 for all others. Query vectors corresponding to each path Client settings For example, when global permutation... For cyclic shift transformations, for any , A permutation satisfies the following condition: .

[0037] Furthermore, for any _th Layered unit tree, the client uses Paillier public key pair For the initial query vector Homomorphic encryption is performed, that is, Paillier encryption is applied to each component of the initial query vector to obtain the initial encrypted query vector. Next, the client will Global permutations and the initial dense-state query vector of all unit trees Send it to the server. After receiving the above information, the server can... Each global permutation permutes each component of the initial dense-state query vector of each unit tree to obtain the other... The dense query vector of each path, i.e., the derived dense query vector, is then obtained. The dense query tree of the layer (i.e., the second dense query tree). Specifically, for any... The derived dense-state query vector is: .

[0038] Finally, the server traverses down layer by layer from the root node of the second dense query tree, dividing the sub-databases stored in the parent node in each layer of the unit tree into equal-length blocks to obtain multiple database blocks. Then, it calculates the inner product of the database blocks with the initial dense query vector and the derived dense query vector, thereby generating multiple sub-databases containing only a single data record, resulting in a dense database for real-time hidden queries.

[0039] Step S12: Search the index tree along the path labels of each unit tree in the index tree corresponding to the local index sequence to obtain the target path from the root node to the leaf node.

[0040] In this embodiment, see Figure 3 As shown, through the local index sequence {D, D0, D... 01 D 011} Locate the path labels of each unit tree level in the index tree to obtain the corresponding label sequence {e0, e...} 01 e011 This gives us a target path from the root node to a leaf node, which is the leftmost edge in the index tree.

[0041] Step S13: Determine the position of the leaf node in the target path as the target position of the target record in the secret database, and broadcast the target position to each server so that the corresponding target secret sharing share can be found in the secret database of each server according to the target position, and the target secret sharing share can be sent to the client.

[0042] In this embodiment, the positions of leaf nodes in the target path are identified, and these leaf node positions are recorded as the target locations in the encrypted database. The target locations are then broadcast to each server. Upon receiving the target location, the server can search its local encrypted database for the corresponding target secret share (i.e., the encrypted portion of the target record), and then return the target secret share to the client.

[0043] Step S14: Aggregate the received target secret sharing shares to obtain target data ciphertext, and decrypt the target data ciphertext to obtain the target record.

[0044] In this embodiment, the client aggregates all the target secret sharing shares sent by the server to obtain the target data ciphertext (such as Paillier ciphertext), and then uses the Paillier algorithm to decrypt the target data ciphertext to obtain the target record to be queried, such as patient privacy data in the medical and health field, investment intention data in the financial investment field, etc.

[0045] Specifically, decrypting the target data ciphertext to obtain the target record can include: decrypting the target data ciphertext using a homomorphic encryption algorithm in descending order iterative steps based on a preset modulus and the first-round key, to obtain the target record. In this embodiment, the client first aggregates the multiple target secret sharing shares returned by each server to obtain the target record. The additive share of the Paillier ciphertext, i.e., the target data ciphertext. The specific calculation formula is as follows: ; Among them, t targets secretly share a portion. Stored separately on different servers, such as ,Right now storage , ..., storage .

[0046] It can be seen that in calculation At that time, first on the mod server... The feedback results (i.e., the target secret sharing share) of each server on the ring of the round module are summed, and then the summation result is compared with the first... The square of the round modulus is used for modulo (i.e., modulo) calculation. Then, the client uses the... private key pair of the round Encrypt the target data in descending order. To perform the decryption operation, the formula is: ; for (Iterating in descending order), the client loops through the following steps: first calculate Then calculate The target record is ultimately maintained by get.

[0047] As shown above, when obtaining target data, it is necessary to first aggregate all the target secret sharing shares sent by all servers, and then decrypt the target data ciphertext obtained after aggregation to obtain the target record. It is evident that the target record cannot be obtained based on the target secret sharing shares of some servers, and the participation of all servers is required, thereby improving the security of data concealment query. At the same time, the feedback results from the servers only contain information related to the target record, thereby ensuring that the client has difficulty obtaining other information related to the target record, thus improving data security.

[0048] As can be seen, in this embodiment, the position of the encrypted data in the corresponding database block is obtained based on the index of the target record in the original database and the preset query vector length, resulting in a local index sequence. Then, the path label corresponding to the local index sequence is used to search the index tree to obtain the target path from the root node to the leaf node. The position of the leaf node in the target path is then sent to multiple servers so that the servers can find the corresponding secret sharing share through the position and perform aggregation and decryption operations on the secret sharing shares sent by multiple servers to obtain the target record to be queried. By employing the above methods, since the server's feedback only contains data related to the target record, it ensures that the client cannot obtain any information other than the data related to the target record, thereby improving the security of data concealment queries. Furthermore, by using the query index tree to determine the location information of the target record in the encrypted database, the client only needs to broadcast the location information during real-time queries, and the server only needs to return the data at the corresponding location, thus ensuring the client's query intent during real-time queries. In addition, since only location information needs to be sent, without sending a large amount of other information, the amount of data communication (i.e., communication overhead) and computing resources between the client and the server are reduced, thereby improving the computational efficiency and query efficiency of concealment queries. Moreover, since multiple servers need to participate, it ensures that a single data service provider (i.e., the server) cannot know the specific query content of the data query provider (i.e., the client), thus effectively protecting query privacy.

[0049] This application discloses a specific method for concealed data lookup, applied to a client-side application. See [link to relevant documentation]. Figure 4 As shown, the method includes: Step S21: Obtain the index of the target record in the original database to obtain the original index, and determine the position of the target data ciphertext in the corresponding sub-database based on the original index and the preset query vector length to obtain the global index sequence; the target data ciphertext is the ciphertext obtained after encrypting the target record.

[0050] In this embodiment, the client obtains the original index of the target record in the original database. Then, based on the original index and the preset query vector length, the absolute position of the target data ciphertext in the corresponding sub-database is calculated to obtain the global index sequence. The specific calculation formula is as follows: ; That is, the global index of the i-th round is The result of dividing the global index of the round by the preset query vector length l is then rounded down.

[0051] Step S22: Perform a modulo operation on the global index sequence and the preset query vector length to obtain the position of the target data ciphertext in the corresponding database block, and obtain the local index sequence.

[0052] In this embodiment, the client can use the aforementioned global index sequence. Calculate the local index sequence The local index of the i-th round is the remainder obtained by subtracting the query vector length from the global index of the i-th round (i.e., mod). The formula for calculating any local index in the local index sequence is: .

[0053] Step S23: Search the index tree along the path labels of each unit tree in the index tree corresponding to the local index sequence to obtain the target path from the root node to the leaf node.

[0054] In this embodiment, the client follows the local index sequence. By searching the index tree according to the path labels of each unit tree in the index tree, a target path from the root node to the leaf node is obtained.

[0055] Step S24: Determine the position of the leaf node in the target path as the target position of the target record in the secret database, and broadcast the target position to each server so that the corresponding target secret sharing share can be found in the secret database of each server according to the target position, and the target secret sharing share can be sent to the client.

[0056] It should be noted that since the leaf node locations store the encrypted information of the target record, the client can broadcast the leaf node locations to all servers. Specifically, for the first-level unit tree with the root node as its parent node, the client selects the path label as... The first-level child node; for the second-level unit tree with the first-level child node as its parent node, the client selects the path label as The second-level child nodes; iterate the above process until for the second-level child nodes. The first child node is the first child node of the parent node. Layered unit tree, customer selected tag as of The leaf nodes are then identified, and their positions in the secret database are broadcast to each server.

[0057] Step S25: Aggregate the received target secret sharing shares to obtain target data ciphertext, and decrypt the target data ciphertext to obtain the target record.

[0058] For a more detailed description of the process of step S25, please refer to the relevant content disclosed in the foregoing embodiments, which will not be repeated here.

[0059] As can be seen, this application proposes an efficient data concealment query scheme that can simultaneously protect the queryer's intent and database privacy through multi-server collaboration. First, based on the target record's index in the original database and a preset query vector length, the position of the target data ciphertext in the corresponding sub-database is determined, resulting in a global index sequence. Then, a modulo operation is performed on the global index sequence and the preset query vector length to obtain the position of the target data ciphertext in the corresponding database block, resulting in a local index sequence. Next, the index tree is searched along the path labels of each unit tree in the index tree corresponding to the local index sequence to obtain a target path. Based on the position of the leaf nodes in the target path, the ciphertext data related to the target record is obtained from each server. Finally, the target record is obtained through decryption. This method significantly reduces the computational and communication overhead of real-time data concealment query: the computational overhead is reduced from... Reduced to the server side Client At the same time, the communication overhead will be reduced from Descended to the client server-side .

[0060] Accordingly, this application also discloses a data concealment query device applied to a client, the device comprising: The index retrieval module is used to retrieve the index of the target record in the original database to obtain the original index; The location acquisition module is used to obtain the location of the target data ciphertext in the corresponding database block based on the original index and the preset query vector length, and to obtain the local index sequence; the target data ciphertext is the ciphertext obtained after encrypting the target record. The search module is used to search the index tree along the path labels of each unit tree in the index tree corresponding to the local index sequence, and obtain the target path from the root node to the leaf node. The determination module is used to determine the position of the leaf node in the target path as the target position of the target record in the dense database. The broadcast module is used to broadcast the target location to each server so that the corresponding target secret sharing share can be found in the secret database of each server according to the target location, and the target secret sharing share can be sent to the client. The aggregation and decryption module is used to aggregate the received target secret sharing shares to obtain target data ciphertext, and decrypt the target data ciphertext to obtain the target record.

[0061] The specific workflow of each of the above modules can be found in the relevant content disclosed in the foregoing embodiments, and will not be repeated here.

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

[0063] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described data concealment query method embodiments when running.

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

[0065] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described data concealment query method embodiments.

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

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

[0068] The above provides a detailed description of the data concealment query method and electronic device provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make various improvements and modifications to this application without departing from its principles, and these improvements and modifications also fall within the protection scope of this application.

Claims

1. A method for hidden data query, characterized in that, Applied to the client side, including: Obtain the index of the target record in the original database to obtain the original index, and obtain the position of the target data ciphertext in the corresponding database block based on the original index and the preset query vector length to obtain the local index sequence; the target data ciphertext is the ciphertext obtained after encrypting the target record; The target path from the root node to the leaf node is obtained by searching the index tree along the path labels of each unit tree in the index tree corresponding to the local index sequence. The position of the leaf node in the target path is determined as the target position of the target record in the secret database, and the target position is broadcast to each server so that the corresponding target secret sharing share can be found in the secret database of each server according to the target position, and the target secret sharing share is sent to the client; The received target secret sharing shares are aggregated to obtain the target data ciphertext, and the target data ciphertext is decrypted in descending order using the i-th round private key pair in the client key to obtain the target record; Before obtaining the index of the target record in the original database, the process further includes: the client and the first server interacting alternately to generate multiple Paillier key pairs. The client first randomly generates multiple prime number pairs as private key pairs and sets multiple Paillier moduli. The server first randomly generates multiple prime number pairs as private key pairs and sets multiple Paillier moduli. The moduli of the client and the server satisfy the following constraints: ; In the formula, t represents the number of servers; Based on multiple Paillier moduli, the client and server respectively set public bases: ; in, Let i be the base number of the client in the i-th round. Let i be the modulus of the client in round i. Let i be the base number of the i-th round on the server side. Given the i-th round modulus of the server, keys for multiple rounds located on the client and multiple rounds located on the server are obtained; the key pair includes a public key pair and a private key pair, and the public key pair contains the radix and modulus of multiple different rounds; A complete multi-way tree is constructed based on a preset query vector length and the capacity of the original database. Each path from the parent node to the child node within each unit tree of the complete multi-way tree is randomly labeled to obtain an index tree containing path labels. A query vector is constructed based on the path labels to obtain a target query vector. The target query vector is then homomorphically encrypted to obtain a target encrypted query vector. The path labels in the index tree are replaced with the corresponding target encrypted query vectors to obtain a first encrypted query tree. The first encrypted query tree is sent to the server to traverse downwards layer by layer from the root node of the first encrypted query tree. The sub-databases stored in the parent nodes of each unit tree are divided into equal-length blocks to obtain multiple database blocks. The inner product of each database block and multiple target encrypted query vectors is calculated to generate multiple sub-databases containing only a single data record, thus obtaining the encrypted database. The step of calculating the inner product of the database block and the multiple target encrypted query vectors to generate multiple sub-databases containing only a single data record, thus obtaining the encrypted database, includes: calculating the inner product of each database block and the multiple target encrypted query vectors through a first server to obtain a multiplicative share in encrypted form of a single data record; encrypting the multiplicative share using the public key pair in the server key and a homomorphic encryption algorithm through the first server to obtain an encrypted share; and converting the multiplicative share into an additive share form using a homomorphic encryption algorithm through interaction between the first server and other servers, based on the encrypted share, to obtain the encrypted database containing multiple additive share forms.

2. The data concealment query method according to claim 1, characterized in that, The step of randomly labeling each path from the parent node to the child node within each unit tree of the complete multi-way tree to obtain an index tree containing path labels includes: Randomly select elements from the set from 0 to the preset query vector length minus one, and use the elements as labels for any path from the parent node to the child node in any unit tree of the complete multi-way tree, to obtain an index tree containing path labels; The unit tree is a minimal multi-way tree composed of any non-leaf node and its target number of child nodes. Different paths within the same unit tree have different path labels. The target number is the same as the length of the preset query vector. Accordingly, constructing a query vector based on the path label to obtain the target query vector includes: Construct random query vectors for each level of the unit tree in the index tree; The target component in the random query vector is set to 1, and all other components are set to 0 to obtain the target query vector corresponding to each path label; the position of the target component is the same as the value of the element corresponding to the path label. Accordingly, the step of homomorphically encrypting the target query vector to obtain the target encrypted query vector includes: Using the public key pair in the client key and the homomorphic encryption algorithm, each component in the target number of target query vectors is encrypted to obtain the target encrypted query vector.

3. The data concealment query method according to claim 1, characterized in that, The process of sequentially dividing the sub-databases stored in the parent node of each layer of the unit tree into equal-length blocks results in multiple database blocks, including: Using the current server and based on the capacity size, calculate the global index of the original database and the end records of each level of the sub-database to obtain the target global index; According to the preset query vector length, the sub-databases stored in the parent node in each layer of the unit tree are divided into equal-length blocks to obtain multiple database blocks; the number of the multiple database blocks stored in the parent node is equal to the value of the target global index at the next level plus one.

4. The data concealment query method according to claim 3, characterized in that, The method of interacting with other servers through the first server and based on the encrypted sharing share, using a homomorphic encryption algorithm to convert the multiplicative sharing share into an additive sharing form, to obtain the encrypted database containing multiple additive sharing shares, includes: The first server sends the encrypted sharing share to the second server to select the same number of random elements as the multiplicative sharing share, and calculates the power of the corresponding encrypted sharing share with each multiplicative sharing share as the exponent to obtain the first power, and calculates the power of the current round's base with each random element as the exponent to obtain the second power, and calculates the ratio of the first power to the second power on a ring based on the square of the modulus of the previous round, and sends the ratio to the first server; The first server, based on the private key pair in the server key, uses a homomorphic encryption algorithm to decrypt the ratio, thereby obtaining the encrypted database containing multiple additive sharing shares.

5. The data concealment query method according to claim 1, characterized in that, After constructing a complete multi-way tree based on the preset query vector length and the capacity of the original database, the process also includes: A predetermined number of permutations are selected from the target set to obtain the global permutation; the target set is a set from 0 to the predetermined query vector length minus one. Randomly select elements from the target set and use the elements as labels for any single-sided path within any unit tree of the complete multi-way tree to obtain initial labels; A query vector is constructed based on the initial tag to obtain the initial query vector. Then, the public key pair in the client key and the homomorphic encryption algorithm are used to encrypt each component in the initial query vector to obtain the initial encrypted query vector. The global permutation and the initial dense query vector are sent to the server so that each component of the initial dense query vector is permuted based on the global permutation to obtain the derived dense query vector; The server replaces the initial label of any one-sided path within any unit tree of the complete multi-way tree with the initial dense query vector, and sets the label of another one-sided path within any unit tree as the derived dense query vector to obtain the second dense query tree. The server starts from the root node of the second dense query tree and traverses downwards layer by layer. It divides the sub-databases stored in the parent node in each layer of the unit tree into equal-length blocks to obtain multiple database blocks. It then calculates the inner product of the database blocks with the initial dense query vector and the derived dense query vector to generate multiple sub-databases containing only a single data record, thus obtaining the dense database.

6. The data concealment query method according to claim 1, characterized in that, The step of decrypting the target data ciphertext using the i-th round private key pair in the client key in a descending order iterative manner to obtain the target record includes: Based on a preset modulus and multiple private key pairs in the client key, and using a homomorphic encryption algorithm to decrypt the target data ciphertext in descending order using the i-th round private key pair in the client key, the target record is obtained.

7. The data concealment query method according to any one of claims 1 to 6, characterized in that, The step of obtaining the position of the target data ciphertext in the corresponding database block based on the original index and a preset query vector length, to obtain a local index sequence, includes: Based on the original index and the preset query vector length, the position of the target data ciphertext in the corresponding sub-database is determined, and a global index sequence is obtained; A modulo operation is performed on the global index sequence and the preset query vector length to obtain the position of the target data ciphertext in the corresponding database block, thus obtaining a local index sequence.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the data concealment query method as described in any one of claims 1 to 7 when executing the computer program.

Citation Information

Patent Citations

  • Cipher state data query method and device, storage medium and electronic equipment

    CN117473133A

  • Data processing method, product, equipment and computer readable storage medium

    CN120068158A