Trie-based private set intersection method and system
By using a trie to represent sets and combining multi-threaded concurrent execution, the problems of large memory consumption and long execution time in existing safe intersection protocols are solved, and efficient safe intersection is achieved.
Patent Information
- Application Number
- PCT/CN2023/136351
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-24
- Filing Date
- 2023-12-05
- Publication Date
- 2024-11-28
AI Technical Summary
Existing secure intersection protocols lack innovation in set representation methods, resulting in large memory consumption, long running time, large network communication volume, and difficulty in parallel optimization.
The set is represented by a trie encoding method, and the nodes of the trie are traversed by lexicographical order. Combined with a preset safe intersection protocol, the intersection operation is performed concurrently by multiple threads.
It reduces system memory overhead, shortens runtime, improves the efficiency of safe intersection, and is easy to optimize in parallel.
Smart Images

Figure CN2023136351_28112024_PF_FP_ABST
Abstract
Description
A safe intersection method and system based on dictionary tree Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a tree-based secure intersection method and system. Background Art
[0002] The secure intersection protocol aims to solve a problem where different entities, each holding their own set data, need to jointly compute the intersection of their sets. Because they don't trust each other, they can't disclose their own sets. With increasingly stringent data protection regulations, this problem has important real-world applications. For example, financial institutions need to intersect their blacklists, where each institution doesn't want to disclose its own blacklist, but still wants to know which users are on the shared blacklist. Technical issues
[0003] Current mainstream secure intersection protocols, such as those based on RSA and OT, all use asymmetric cryptographic tools to achieve intersection between sets. Their underlying representations of sets are relatively primitive and inefficient, such as arrays, linked lists, and hash tables. After asymmetric encryption, the elements of the set are matched against the elements of the participating parties, ultimately retaining the shared elements to form the intersection. These mainstream secure intersection schemes often focus on asymmetric cryptographic and matching algorithms, with little innovation in the underlying set representation methods. Current asymmetric cryptographic algorithms are generally time-consuming, and the encrypted ciphertext occupies a significantly larger space. As a result, current secure intersection algorithms often consume large amounts of memory, require long execution times, involve high network traffic, and are difficult to optimize in parallel. Technical Solutions
[0004] The purpose of the present invention is to provide a safe intersection method and system based on a dictionary tree, which reduces system memory overhead and shortens system operation time by improving the representation of the underlying set, thereby improving the efficiency of safe intersection and facilitating parallel optimization.
[0005] The embodiment of the present invention is achieved as follows:
[0006] In a first aspect, an embodiment of the present application provides a secure intersection method based on a dictionary tree, which includes:
[0007] Use the dictionary tree encoding method to encode the original set of all participants into the corresponding dictionary tree;
[0008] Traverse all nodes of the dictionary tree in lexicographic order and call the preset secure intersection protocol to perform secure intersection to obtain the dictionary tree shared by all participants;
[0009] Decode the common dictionary tree of all participants to obtain the intersection.
[0010] Based on the first aspect, in some embodiments of the present invention, the step of encoding the original set of all participants into a corresponding dictionary tree using the dictionary tree encoding method includes:
[0011] Determine encoding parameters according to the selected secure intersection protocol;
[0012] Based on the encoding parameters, different character strings are used to represent the original set of each participant;
[0013] Encode the strings in the original set into the corresponding dictionary tree.
[0014] Based on the first aspect, in some embodiments of the present invention, the step of traversing all nodes of the dictionary tree in lexicographic order and calling a preset secure intersection protocol to perform secure intersection to obtain a dictionary tree common to all participants includes:
[0015] Traverse all nodes of the dictionary tree in lexicographic order to obtain the outgoing edge set corresponding to the current node;
[0016] Call the preset secure intersection protocol to perform secure intersection on the outgoing edge sets of the participants, retain the shared outgoing edges, and prune the other outgoing edges;
[0017] Recursively traverse the shared outgoing edges until all nodes are processed and a dictionary tree common to all participants is obtained.
[0018] Based on the first aspect, some embodiments of the present invention further include: when traversing the dictionary tree, based on the independent characteristics of the subtrees, enabling different threads to concurrently execute intersection of the subtrees under the same path.
[0019] In a second aspect, an embodiment of the present application provides a tree-based secure intersection system, comprising:
[0020] The encoding module is used to encode the original set of all participants into a corresponding dictionary tree using the dictionary tree encoding method;
[0021] The secure intersection module is used to traverse all nodes of the dictionary tree in lexicographic order and call the preset secure intersection protocol to perform secure intersection to obtain the dictionary tree shared by all participants;
[0022] The decoding module is used to decode the common dictionary tree of all participants to obtain the intersection.
[0023] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory for storing one or more programs and a processor. When the one or more programs are executed by the processor, the method described in any one of the first aspects is implemented.
[0024] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described above in any one of the first aspects. Beneficial effects
[0025] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:
[0026] The embodiment of the present application provides a safe intersection method and system based on a dictionary tree. First, the original set of all participants is encoded into a corresponding dictionary tree using the dictionary tree encoding method. Then, all nodes of the dictionary tree are traversed in lexicographic order, and the preset safe intersection protocol is called to perform safe intersection to obtain a dictionary tree common to all participants. Finally, the obtained dictionary tree common to all participants is decoded to obtain an intersection. The present application uses a dictionary tree to represent the set of participants, and the space utilization is better than the traditional set representation method, especially in the case of a very long common prefix. Because each time the safe intersection protocol is called, only the outgoing edge set of each node is targeted, the scale of each safe intersection is very small and does not take up a lot of memory space. Secondly, the complexity of adding, deleting, and querying elements on the dictionary tree is 0 / 1, which makes it easy to maintain the set. In addition, since different subtrees under the same path are independent of each other, different threads can be executed concurrently in the process of traversing subnodes, which is easy to optimize in parallel. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0028] FIG1 is a flowchart of an embodiment of a safe intersection method based on a dictionary tree provided by the present invention;
[0029] FIG2 is a dictionary tree representation of the set held by participant A in an embodiment of a dictionary tree-based secure intersection method provided by the present invention;
[0030] FIG3 is a dictionary tree representation of the set held by participant B in an embodiment of a dictionary tree-based secure intersection method provided by the present invention;
[0031] FIG4 is a dictionary tree of the set held by participant A after traversing node a in an embodiment of a dictionary tree-based secure intersection method provided by the present invention;
[0032] FIG5 is a dictionary tree of the set held by participant B after traversing node a in an embodiment of a dictionary tree-based secure intersection method provided by the present invention;
[0033] FIG6 is a dictionary tree of the remaining set of participant A after traversing all nodes in an embodiment of a dictionary tree-based secure intersection method provided by the present invention;
[0034] FIG7 is a dictionary tree of the remaining set of participant B after traversing all nodes in an embodiment of a dictionary tree-based secure intersection method provided by the present invention;
[0035] FIG8 is a schematic diagram of simultaneously calling multiple threads to perform parallel intersection in an embodiment of a tree-based secure intersection method provided by the present invention;
[0036] FIG9 is a structural block diagram of an embodiment of a tree-based secure intersection system provided by the present invention;
[0037] FIG10 is a structural block diagram of an electronic device provided by an embodiment of the present invention.
[0038] Icons: 1. Memory; 2. Processor; 3. Communication interface; 11. Encoding module; 12. Security intersection module; 13. Decoding module. Modes for Carrying Out the Invention
[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Generally, the components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.
[0040] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application. Example
[0041] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features thereof may be combined with each other.
[0042] Currently, mainstream secure intersection protocols often use asymmetric cryptographic tools to achieve intersection between sets. These protocols employ relatively primitive and inefficient methods for representing sets. After asymmetric encryption, the elements of a set are matched against the elements of the participating parties, ultimately retaining the shared elements to form the intersection. These mainstream secure intersection schemes often focus on asymmetric cryptographic and matching algorithms, without innovating in the underlying set representation methods.
[0043] In view of this, please refer to FIG1 , which is a flowchart of a safe intersection method based on a dictionary tree provided in an embodiment of the present application. The method includes the following steps:
[0044] Step S1: Encode the original set of all participants into a corresponding dictionary tree using the dictionary tree encoding method.
[0045] In the above steps, the first step is to consider which existing secure intersection protocol to use, such as the RSA-based secure intersection protocol or the OT-OPRF-based secure intersection protocol. The encoding parameters are then determined based on the selected secure intersection protocol. Based on the encoding parameters, the original sets of each participant are represented using distinct character strings. Finally, the strings in the original sets are encoded into a corresponding trie. By using the trie encoding method, sets represented by traditional methods, such as tables, arrays, hash tables, and linked lists, are encoded into a trie, thereby reducing memory usage and improving space utilization.
[0046] Specifically, referring to Figures 2 and 3, each participant's original set is first represented by a distinct string. For example, participant A's original set is {adce, adcf, adec, abcd, abec}, and participant B's original set is {aceg, abec, adec}. These sets are then encoded into two tries: the trie for participant A is shown in Figure 2, and the trie for participant B is shown in Figure 3. The leftmost blank node is the root node of the trie, and the rightmost node is a leaf node, representing a string in each set.
[0047] It should be noted that if the set required for a safe intersection is large, the trie can choose to split multiple letters when encoding. For example, if three letters are encoded at a time, the maximum size of the outgoing edge set for each node is 26*26*26=17576.
[0048] Step S2: Traverse all nodes of the dictionary tree in lexicographic order, and call the preset secure intersection protocol to perform secure intersection, to obtain a dictionary tree common to all participants.
[0049] In the above steps, when finding the intersection, starting from the root node of the dictionary tree, the preset safe intersection protocol is called to safely intersect the out-edge set of each node with the out-edge set of the other node. The shared out-edges are retained and the other out-edges are pruned. Then, the child nodes are traversed in lexicographic order. The above operation is repeated until all nodes of the dictionary tree are traversed, and the dictionary tree shared by all participants is obtained.
[0050] Specifically, this step mainly includes:
[0051] Step S2-1: Traverse all nodes of the dictionary tree in lexicographic order to obtain the out-edge set corresponding to the current node.
[0052] Step S2-2: Call the preset secure intersection protocol to perform secure intersection on the outgoing edge sets of the participants, retain the shared outgoing edges, and prune other outgoing edges.
[0053] Step S2-3: Recursively traverse the shared outgoing edges until all nodes are processed to obtain a dictionary tree shared by all participants.
[0054] In the above steps, we use the sets of participants A and B as an example to perform a safe intersection. First, we traverse from the root node to obtain the outgoing edge sets of the participant's root node. For example, as shown in Figures 2 and 3, the outgoing edge set of the root node of participant A is {a}, and the outgoing edge set of the root node of participant B is also {a}. After performing a safe intersection on the two, the resulting set is {a}, so the outgoing edge a is retained. At this point, the dictionary tree of participant A and participant B has not been pruned.
[0055] Afterwards, the traversal reaches child node a in lexicographic order. At this point, the outgoing edge set of participant A is {b, d}, and the outgoing edge set of participant B is {b, c, d}. After safely intersecting the two, the resulting set is {b, d}, so participant B needs to prune outgoing edge c. After this traversal and pruning, the resulting dictionary tree for participant A is shown in Figure 4, and the dictionary tree for participant B is shown in Figure 5.
[0056] Similarly, after traversing all child nodes, the dictionary trees of both sides are shown in Figure 6 and Figure 7. Obviously, these two dictionary trees are equivalent to each other and represent the intersection of the two sides.
[0057] In the above steps, using a trie to represent the set of participants improves space utilization compared to traditional set representations, especially when there are long common prefixes. Because each safe intersection protocol call only targets the set of outgoing edges of each node, the size of each safe intersection is very small and does not occupy a lot of memory space. Furthermore, the complexity of adding, deleting, and querying elements in the trie is 0 / 1, making it easy to maintain the set.
[0058] Step S3: Decode the common dictionary tree of all participants to obtain the intersection.
[0059] In the above steps, after the secure intersection, the participants will obtain the same dictionary tree, which represents the intersection of both parties. At this point, it can be decoded into a set represented by traditional methods, such as a table, array, hash table, linked list, etc.
[0060] Based on the first aspect, some embodiments of the present invention further include: when traversing the dictionary tree, based on the independent characteristics of the subtrees, enabling different threads to concurrently execute intersection of the subtrees under the same path.
[0061] In the above embodiment, it can be seen from the properties of the dictionary tree that the intersection between the subsets corresponding to different subtrees is an empty set. Therefore, when finding the intersection of the dictionary tree, there is no need to find the intersection between different subtrees on different paths, and only the intersection between the corresponding subtrees under the same path needs to be considered. Therefore, the intersection processes under different paths are completely independent of each other, and there is no need to share memory and data. Therefore, when finding the intersection on subtrees of different paths, different threads can be used, and there is almost no need for synchronization between threads. Such characteristics can maximize the use of multi-core multi-threaded resources and communication bandwidth to achieve the best parallel optimization effect.
[0062] For example, as shown in Figure 8, the two subtrees under the ab path can be intersected by calling thread 1, while the two subtrees under the ad path can be intersected by calling thread 2. Consequently, the traversal of child nodes can be performed concurrently by different threads or coroutines. Because the subtrees are independent, the granularity of concurrency is extremely low, resulting in significant advantages in parallel optimization.
[0063] Based on the same inventive concept, the present invention also proposes a tree-based secure intersection system. Please refer to FIG9 , which is a block diagram of a tree-based secure intersection system provided in an embodiment of the present application. The system includes:
[0064] The encoding module 11 is used to encode the original set of all participants into a corresponding dictionary tree using a dictionary tree encoding method;
[0065] The secure intersection module 12 is used to traverse all nodes of the dictionary tree in lexicographic order and call a preset secure intersection protocol to perform secure intersection to obtain a dictionary tree common to all participants;
[0066] The decoding module 13 is used to decode the common dictionary tree of all participants to obtain an intersection.
[0067] Please refer to Figure 10, which is a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device includes a memory 1, a processor 2 and a communication interface 3, and the memory 1, processor 2 and communication interface 3 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The memory 1 can be used to store software programs and modules, such as program instructions / modules corresponding to a dictionary tree-based security intersection system provided in an embodiment of the present application. The processor 2 executes various functional applications and data processing by executing the software programs and modules stored in the memory 1. The communication interface 3 can be used for signaling or data communication with other node devices.
[0068] The above description is merely a preferred embodiment of the present application and is not intended to limit the present application. Various modifications and variations are possible for those skilled in the art. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application shall be included within the scope of protection of the present application.
[0069] It will be apparent to those skilled in the art that the present application is not limited to the details of the exemplary embodiments described above and that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the present application is defined by the appended claims, not the foregoing description, and all variations within the meaning and range of equivalents of the claims are intended to be included therein. Any reference sign in a claim should not be construed as limiting the claim to which it relates.
Claims
1. A safe intersection method based on dictionary tree, characterized in that: include: Encode the original set of all participants into the corresponding dictionary tree using the dictionary tree encoding method; Traverse all nodes of the dictionary tree in lexicographic order, and call the preset safe intersection protocol to perform safe intersection, and obtain the dictionary tree common to all participants; Decode the common dictionary tree of all participants to obtain the intersection.
2. A safe intersection method based on a dictionary tree as claimed in claim 1, characterized in that: The step of encoding the original set of all participants into a corresponding dictionary tree by using the dictionary tree encoding method includes: Determine encoding parameters according to the selected secure intersection protocol; Based on the encoding parameters, different character strings are used to represent the original sets of each participant; Encode the strings in the original set into the corresponding dictionary tree.
3. A safe intersection method based on a dictionary tree as claimed in claim 1, characterized in that: The steps of traversing all nodes of the dictionary tree in lexicographic order and calling a preset secure intersection protocol to perform secure intersection to obtain a dictionary tree common to all participants include: Traverse all nodes of the dictionary tree in lexicographic order to obtain the outgoing edge set corresponding to the current node; Call the preset secure intersection protocol to perform secure intersection on the outgoing edge sets of the participants, retain the shared outgoing edges, and cut off other outgoing edges; Recursively traverse the shared outgoing edges until all nodes are processed and a common dictionary tree for all participants is obtained.
4. A safe intersection method based on a dictionary tree as claimed in claim 1, characterized in that: Also includes: When traversing the dictionary tree, based on the independent characteristics of the subtrees, different threads are enabled to concurrently perform intersection on the subtrees under the same path.
5. A safe intersection system based on dictionary tree, characterized in that: include: The encoding module is used to encode the original set of all participants into a corresponding dictionary tree using the dictionary tree encoding method; The secure intersection module is used to traverse all nodes of the dictionary tree in lexicographic order and call the preset secure intersection protocol to perform secure intersection to obtain a dictionary tree common to all participants; The decoding module is used to decode the common dictionary tree of all participants to obtain the intersection.
6. An electronic device, characterized in that: include: A memory for storing one or more programs; processor; When the one or more programs are executed by the processor, the method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Efficient use of trie data structure in databases
CN110637291A
Data processing method and device and device for data processing
CN112861175A
Safety intersection method and system based on dictionary tree
CN116595228A
Data sharing method
US11599655B1
Efficient Three-Party Private Set Intersection (PSI)
US20230102423A1
