A method and device for determining data intersection
Through the encryption processing of random numbers and dense state data, combined with the hash algorithm and elliptic curve public key cryptography, the problem of insufficient privacy data security when the data intersection is determined in the existing technology is solved, and the secure determination of the data intersection is achieved.
Patent Information
- Application Number
- CN202310802757.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2043-06-30
AI Technical Summary
When the existing technology determines the intersection of the data sets of both parties, it cannot effectively guarantee the security of the remaining private data, and it is easy to cause privacy leakage due to brute force cracking.
By using random numbers and dense state data for encryption processing, the first device determines the intersection data based on the second dense state data and the third dense state data, and performs secondary encryption through a hash algorithm and elliptic curve public key cryptography to ensure the security of the data. sex.
It is possible to determine the intersection of data from both parties while protecting the security of the remaining private data, preventing privacy leakage, and enhancing data security.
Smart Images

Figure CN116821936B
Abstract
Description
Technical Field
[0001] The present application relates to the field of information security technology, and in particular to a method and device for determining data intersection. Background Art
[0002] With the development of information security technology, people pay more and more attention to the protection of private data. Private Set Intersection (PSI) means that two parties holding data can obtain the intersection of their data sets by calculation without exposing any data set information outside the intersection. With the continuous development of privacy-preserving set intersection technology, people have higher and higher requirements for the security of private data. Therefore, how to ensure the security of the remaining private data while determining the intersection of the data sets of both parties has become the key point in the development of this technology. Summary of the invention
[0003] The embodiments of the present application provide a method and device for determining data intersection, so as to ensure the security of other private data while achieving the determination of data intersection of both parties.
[0004] In a first aspect, an embodiment of the present application provides a method for determining a data intersection, including: a first device determines second secret data based on a first random number and first secret data. The first random number corresponds to the first device, the first secret data is determined based on the second random number and the data of the second device, and the second random number corresponds to the second device. The first device receives third secret data from the second device. The third secret data is determined based on the second random number and the fourth secret data, and the fourth secret data is determined based on the first random number and the data of the first device. The first device determines first intersection data from the third secret data based on the second secret data. The first device determines second intersection data from the data of the first device based on the position of the first intersection data in the third secret data.
[0005] By adopting this method, the security of the remaining private data can be guaranteed while determining the intersection of the data of both parties.
[0006] In one possible design, the first device receives first secret data from the second device.
[0007] In one possible design, the first device performs a scalar multiplication on the first random number and the first secret data to obtain second secret data.
[0008] In one possible design, the first device determines the sequence number of the first intersection data in the third secret data according to the position of the first intersection data in the third secret data. The first device determines the second intersection data from the data of the first device according to the sequence number.
[0009] With this design, the first device can obtain the intersection of the plaintext data based on the intersection of the secret data, thereby obtaining the intersection of the private data without leaking the private data.
[0010] In one possible design, the first device encrypts the data of the first device by a hash algorithm to obtain fifth secret data. The first device multiplies the fifth secret data by the first random number, and then performs a scalar multiplication with the base point of the elliptic curve public key cryptography to obtain fourth secret data.
[0011] With this design, the data of the first device is encrypted twice, thereby ensuring the security of the data.
[0012] In one possible design, the first device sends fourth secret data to the second device.
[0013] In a second aspect, an embodiment of the present application provides a device for determining a data intersection, including:
[0014] A processing module is used to determine the second secret data according to the first random number and the first secret data. The first random number corresponds to the first device, the first secret data is determined according to the second random number and the data of the second device, and the second random number corresponds to the second device. A communication module is used to receive the third secret data from the second device. The third secret data is determined according to the second random number and the fourth secret data, and the fourth secret data is determined according to the first random number and the data of the first device. The processing module is also used to determine the first intersection data from the third secret data according to the second secret data. The processing module is also used to determine the second intersection data from the data of the first device according to the position of the first intersection data in the third secret data.
[0015] In one possible design, the communication module is also used to receive first encrypted data from the second device.
[0016] In one possible design, the processing module is specifically used to perform a scalar multiplication of the first random number and the first secret data to obtain the second secret data.
[0017] In a possible design, the processing module is specifically used to determine the sequence number of the first intersection data in the third secret data according to the position of the first intersection data in the third secret data, and determine the second intersection data from the data of the first device according to the sequence number.
[0018] In one possible design, the processing module is specifically used to encrypt the data of the first device through a hash algorithm to obtain fifth secret data; multiply the fifth secret data with the first random number, and then perform a scalar multiplication with the base point of the elliptic curve public key cryptography to obtain fourth secret data.
[0019] In one possible design, the communication module is also used to send fourth secret data to the second device.
[0020] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the method of the first aspect and the second aspect and any one of their designs is implemented.
[0021] In a fourth aspect, an embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the computer program is executed by the processor, the processor implements the first aspect and the second aspect and any one of the designed methods thereof.
[0022] The technical effects brought about by the second to fourth aspects and any one of their designs can refer to the technical effects brought about by the corresponding design in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0024] Figure 1 A flowchart of a method for determining a data intersection provided in an embodiment of the present application;
[0025] Figure 2 A schematic diagram of the structure of a device for determining data intersection provided in an embodiment of the present application;
[0026] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0027] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in detail in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0028] Next, a method for determining the intersection of privacy-preserving sets is introduced in combination with the prior art.
[0029] The scheme for determining the intersection of privacy-preserving sets in the current prior art is usually that both parties to the agreement use a pre-agreed cryptographic algorithm (such as a hash algorithm) to encrypt their respective data to obtain a ciphertext, and then send their own ciphertext to the other party. Furthermore, the two parties can determine the intersection data in their data based on the intersection data in their ciphertexts. Although this method can be used to determine the intersection of the data sets of both parties, since both parties use the same cryptographic algorithm, if the input domain of the data of both parties is small, one party can use brute force to obtain all the private data of the other party, resulting in privacy leakage and data security risks. Therefore, the scheme for determining the intersection of privacy-preserving sets in the current prior art cannot ensure the security of the remaining private data while determining the intersection of the data sets of both parties.
[0030] In order to solve the above technical defects, the present application provides a method and device for determining data intersection. In this method, the first device can obtain second secret data based on the first random number and the first secret data. The first secret data is obtained based on the second random number and the data of the second device. Optionally, the second device can also obtain third secret data based on the second random number and the fourth secret data. The fourth secret data is obtained based on the first random number and the data of the first device. The first device can also obtain first intersection data based on the second secret data and the third secret data, and then determine second intersection data based on the first intersection data, wherein the data of the second intersection is the intersection of the data of the first device and the data of the second device. That is to say, the second secret data is obtained by encrypting the first secret data according to the first random number. Since the first secret data is obtained by encrypting the data of the second device with the second random number, and the first device does not know the second random number, the first device cannot obtain all the data of the second device by brute force. Similarly, the third secret data is obtained by encrypting the fourth secret data according to the second random number. Since the fourth secret data is obtained by encrypting the data of the first device with the first random number, and the second device does not know the first random number, the second device cannot obtain all the data of the first device by brute force. Therefore, this method can ensure the security of the remaining private data while determining the intersection of the data of both parties. In addition, the first device and the second device can be computer systems, or devices in data devices for executing the method shown in this application, such as processors or processing modules, etc., which are not specifically limited in this application. The first device and the second device can communicate via wired and / or wireless methods to achieve information and / or data interaction.
[0031] Figure 1 A flowchart of a method for determining a data intersection provided by an embodiment of the present invention. Taking the first device as an example, the process may include the following steps:
[0032] S101, a first device determines second secret data according to a first random number and first secret data, wherein the first random number corresponds to the first device, the first secret data is determined according to a second random number and data of the second device, and the second random number corresponds to the second device.
[0033] Specifically, the first device holds its own random number, namely the first random number. The data of the first device is the private data set of the first device. Similarly, the second device also holds its own random number, namely the second random number. The data of the second device is the private data set of the second device.
[0034] The present application may also include a third device, which is a random number generation management device. The third device may generate a first random number and a second random number. The third device may also send the first random number to the first device. Accordingly, the first device receives the first random number from the third device. Similarly, the third device may also send the second random number to the second device. Accordingly, the second device receives the second random number from the third device.
[0035] Exemplarily, the first device may obtain the second secret data in the following manner:
[0036] In one or more embodiments, the first device may also encrypt the data of the first device by a hash algorithm to obtain fifth secret data. The first device multiplies the fifth secret data by the first random number, and then performs a scalar multiplication with the base point of the elliptic curve public key cryptography to obtain fourth secret data. Similarly, the second device may also encrypt the data of the second device by a hash algorithm to obtain sixth secret data. The second device multiplies the sixth secret data by the second random number, and then performs a scalar multiplication with the base point of the elliptic curve public key cryptography to obtain the first secret data.
[0037] In one or more embodiments, before the first device determines the second secret data based on the first random number and the first secret data, the first device may also receive the first secret data from the second device.
[0038] Specifically, the first secret data may be the first secret data sent by the second device to the first device according to the first request sent by the first device or other third-party devices (such as expansion devices). The first request may be a request for data intersection. Accordingly, the first device receives the first secret data from the second device.
[0039] In one or more embodiments, the first device may perform a scalar multiplication of the first random number and the first secret data to obtain second secret data.
[0040] For example, the first secret state data is obtained by encrypting all the data in the data of the second device according to the hash encryption algorithm to obtain the sixth secret state data. The sixth secret state data is then multiplied by the second random number, and then scalar multiplied by the base point of the elliptic curve public key cryptography to obtain the first secret state data. The data of the second device can be expressed as x = {x1, x2, x3, ..., x n}, the first secret data can be expressed as u={u1,u2,u3,…,u n}, the second random number can be expressed as d b , the base point of the elliptic curve public key cryptography can be expressed as G, then the data of the second device, the first secret data, the second random number and the base point of the elliptic curve public key cryptography satisfy:
[0041] u i =[H(x i )*d b ]G;
[0042] Where H(x) represents the hashing algorithm, [p]Q represents the scalar multiplication of p and Q, and i = 1, 2, 3, ..., n. i represents the i-th data in u, x i Represents the i-th data in x. i can represent the sequence number of a data in the data set.
[0043] The first random number can be expressed as d a , the second secret data can be expressed as U = {U1, U2, U3, ..., U n}, then the first random number, the first secret data and the second secret data satisfy:
[0044] U i =[d a ]u i ;
[0045] Among them, i=1,2,3,…,n. U i Represents the i-th data in the second secret data.
[0046] In one or more embodiments, the first device may also send fourth secret data to the second device.
[0047] Specifically, the first device may send the fourth secret data to the second device according to the second request sent by the second device or other third-party devices (such as extension devices). The second request may be a request for data intersection. Accordingly, the second device may receive the fourth secret data from the first device.
[0048] S102, the second device sends third encrypted data to the first device. Correspondingly, the first device receives the third encrypted data from the second device.
[0049] The third secret data is obtained based on the second random number and the fourth secret data, and the fourth secret data is determined based on the first random number and the data of the first device.
[0050] It is understandable that the timing of step S101 and step S102 in the present application is not specifically limited, and step S101 may be performed first, or step S102 may be performed first, or step S101 and step S102 may be performed simultaneously. In addition, the fourth secret data is sent to the second device before executing step S102. The way in which the second device obtains the fourth secret data can refer to the way in which the first device obtains the first secret data, which will not be repeated here.
[0051] In one or more embodiments, the second device may obtain the third secret data according to the method in which the first device obtains the second secret data. The specific method for obtaining the third secret data can be found in step S101, which will not be described in detail here.
[0052] S103, the first device determines first intersection data according to the second secret data and the third secret data, wherein the first intersection data is the intersection of the second secret data and the third secret data.
[0053] Specifically, the first device determines the intersection of the second secret state data and the third secret state data, thereby determining the first intersection data. The first intersection data is the data shared by the second secret state data and the third secret state data. For example, if the second secret state data is {123,456} and the third secret state data is {123,789}, then the first intersection data is {123}, that is, the shared data is "123".
[0054] Exemplarily, the second secret data can be expressed as U={U1,U2,U3,…,U n}, the third secret data can be expressed as V = {V1, V2, V3, ..., V m}, the first intersection data can be expressed as W, then the second secret data, the third secret data and the first intersection data satisfy: W = {U i},U i ∈U, where U i =V j ∈U∩V,V j ∈V, i=1,2,3,…,n, j=1,2,3,…,m, m and n are positive integers. It can be understood that U i represents the i-th data in U, so i can represent the position of the data in U; V j Represents the jth data in V, so j can represent the position of the data in V.
[0055] For example, U={1,2,3,4,5}, i.e. U1=1, U2=2, U3=3, U4=4, U5=5, V={4,5,6}, i.e. V1=4, V2=5, V3=6, then W={U4=V1=4, U5=V2=5}, i.e. the common data is {4,5}.
[0056] S104, the first device determines second intersection data from the data of the first device according to the position of the first intersection data in the third secret data, wherein the second intersection data is the intersection of the data of the first device and the data of the second device.
[0057] Specifically, the second intersection data is data that is shared by the data of the first device and the data of the second device. The first device may determine the second intersection data based on the position of the first intersection data in the third secret data. The position of the first intersection data in the third secret data is the same as the position of the second intersection data in the data of the first device. The same means that the i-th data in the third secret data is obtained based on the i-th data in the data of the first device. Therefore, the i-th data in the third secret data belongs to the first intersection data, which means that the i-th data in the data of the first device belongs to the second intersection data. Specifically, the first device determines the sequence number of the first intersection data in the third secret data. The first device determines the second intersection data from the data of the first device based on the sequence number, wherein the sequence number can be used to indicate the position of the first intersection data in the third secret data. For example, the first secret data is U i ∈U={U1,U2,U3}, i is the serial number of the data in the third secret data, and the data of the first device is {x1,x2,x3}, where i=1,2,3. If the first intersection data is {U2,U3}, the position of the first intersection data in the third secret data can be recorded as i=2,3.
[0058] As a possible example, the position of the first intersection data in the third secret data is the same as the position of the second intersection data in the data of the first device. Still using the above example, when i=2, 3, and the data of the first device is x={x1, x2, x3}, it can be determined that the second and third data in x are the data in the second intersection data, that is, the second intersection data is {x2, x3}.
[0059] Based on step S103 and step S104, the first device can obtain the first intersection data by calculating the intersection of the second secret data and the third secret data, and then obtain the intersection of the data of the first device and the data of the second device according to the first intersection data. In other words, the first device obtains the intersection of the data of the first device and the data of the second device by calculating the intersection of the second secret data and the third secret data. In addition, the second secret data is obtained based on the first random number and the first secret data, and the first secret data is obtained based on the second random number and the data of the second device. The first device does not know the information of the second random number. Therefore, the first device cannot obtain the remaining private data in the data of the second device according to the first secret data, thereby achieving the security of the remaining private data while determining the intersection of the data sets of both parties.
[0060] In one or more embodiments, the second device may determine the third intersection data according to the manner in which the first device determines the second intersection data. The third intersection data is the intersection of the data of the first device and the data of the second device. Alternatively, the first device may send the second intersection data to the second device. Accordingly, the second device may receive the second intersection data from the first device.
[0061] Based on the above content and the same concept, the present application provides a device for determining data intersection. Figure 2 As shown, the device includes a communication module 201 and a processing module 202 .
[0062] The processing module 202 is used to determine the second secret data according to the first random number and the first secret data. The first random number corresponds to the first device, the first secret data is determined according to the second random number and the data of the second device, and the second random number corresponds to the second device. The communication module 201 is used to receive the third secret data from the second device. The third secret data is determined according to the second random number and the fourth secret data, and the fourth secret data is determined according to the first random number and the data of the first device. The processing module 202 is also used to determine the first intersection data from the third secret data according to the second secret data. The first intersection data is the intersection of the third secret data and the second secret data. The processing module 202 is also used to determine the second intersection data from the data of the first device according to the position of the first intersection data in the third secret data. The second intersection data is the intersection of the data of the first device and the data of the second device.
[0063] In one possible design, the communication module 201 is also used to receive first encrypted data from the second device.
[0064] In one possible design, the processing module 202 is specifically configured to perform a scalar multiplication of the first random number and the first secret data to obtain the second secret data.
[0065] In a possible design, the processing module 202 is specifically configured to determine the sequence number of the first intersection data in the third secret data according to the position of the first intersection data in the third secret data, and determine the second intersection data from the data of the first device according to the sequence number.
[0066] In one possible design, the processing module 202 is specifically used to encrypt the data of the first device through a hash algorithm to obtain fifth secret data; multiply the fifth secret data with the first random number, and then perform a scalar multiplication with the base point of the elliptic curve public key cryptography to obtain fourth secret data.
[0067] In one possible design, the communication module 201 is also used for the device to send fourth secret data to the second device.
[0068] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown.
[0069] The electronic device in the embodiment of the present application may include a processor 301. The processor 301 is the control center of the device, and various interfaces and lines can be used to connect various parts of the device, by running or executing instructions stored in the memory 303 and calling data stored in the memory 303. Optionally, the processor 301 may include one or more processing units, and the processor 301 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 301. In some embodiments, the processor 301 and the memory 303 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0070] The processor 301 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The method steps disclosed in the embodiments of the present application may be directly executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0071] In the embodiment of the present application, the memory 303 stores instructions that can be executed by at least one processor 301. The at least one processor 301 can be used to execute the method steps disclosed in the embodiment of the present application by executing the instructions stored in the memory 303.
[0072] The memory 303 is a non-volatile computer-readable storage medium, which can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 303 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 303 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 303 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0073] In the embodiment of the present application, the device may further include a communication interface 302 , through which the electronic device may transmit data.
[0074] Optional, can be Figure 3 The processor 301 (or the processor 301 and the communication interface 302) implements Figure 2 The processing module 202 and / or the communication module 201 shown, that is, the actions of the processing module 202 and / or the communication module 201 can be executed by the processor 301 (or the processor 301 and the communication interface 302).
[0075] Based on the same inventive concept, the embodiment of the present application also provides a computer-readable storage medium, which may store instructions. When the instructions are executed on a computer, the computer executes the operation steps provided in the above method embodiment. The computer-readable storage medium may be Figure 3 The memory 303 is shown.
[0076] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0077] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0078] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0080] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for determining data intersection, characterized in that: The method comprises: The first device determines the second secret state data according to the first random number and the first secret state data, the first random number corresponds to the first device, the first secret state data is determined according to the second random number and the data of the second device, and the second random number corresponds to the second device; The first device receives third secret data from the second device, where the third secret data is determined based on the second random number and fourth secret data, and the fourth secret data is determined based on the first random number and data of the first device; The first device determines first intersection data from the third secret data according to the second secret data; The first device determines second intersection data from the data of the first device according to the position of the first intersection data in the third secret data; The data of the second device includes a plurality of data, and the first secret data satisfies: u i =[H(x i )*d b ]G; Among them, the u i represents the i-th data in the first secret data, the x i represents the i-th data in the data of the second device, i=1,2,3,…,n, H(x) represents the hashing algorithm, [p]Q represents the scalar multiplication of p and Q, and the d b is represented as the second random number, and G is represented as a base point of elliptic curve public key cryptography; The second secret data satisfies: U i =[d a ]u i ; Among them, the U i represents the second secret data, the d a represents the first random number; The data of the first device includes a plurality of data, and the fourth secret data satisfies: v j =[H(y j )*d a ]G; Among them, the v j represents the jth data in the fourth secret data, the y j represents the j-th data in the data of the second device, j=1, 2, 3, ..., m; The third secret data satisfies: V j =[d b ]v j ; Among them, the V j Represents the third secret data.
2. The method according to claim 1, characterized in that Before the first device determines the second secret data according to the first random number and the first secret data, the method further includes: The first device receives the first secret data from the second device.
3. The method according to claim 1, characterized in that The first device determines second intersection data from data of the first device according to a position of the first intersection data in the third secret data, including: The first device determines, according to a position of the first intersection data in the third secret data, a sequence number of the first intersection data in the third secret data; The first device determines the second intersection data from the data of the first device according to the sequence number.
4. The method according to claim 1, characterized in that The method further comprises: The first device sends the fourth secret data to the second device.
5. A device for determining data intersection, characterized in that: The device comprises: a processing module, configured to determine second secret data according to a first random number and first secret data, wherein the first random number corresponds to a first device, the first secret data is determined according to a second random number and data of the second device, and the second random number corresponds to the second device; a communication module, configured to receive third secret data from the second device, wherein the third secret data is determined based on the second random number and fourth secret data, and the fourth secret data is determined based on the first random number and data of the first device; The processing module is further used to determine first intersection data from the third secret data according to the second secret data; The processing module is further used to determine second intersection data from the data of the first device according to the position of the first intersection data in the third secret data; The data of the second device includes a plurality of data, and the first secret data satisfies: u i =[H(x i )*d b ]G; Among them, the u i represents the i-th data in the first secret data, the x i represents the i-th data in the data of the second device, i=1,2,3,…,n, H(x) represents the hashing algorithm, [p]Q represents the scalar multiplication of p and Q, and the d b is represented as the second random number, and G is represented as a base point of elliptic curve public key cryptography; The second secret data satisfies: U i =[d a ]u i ; Among them, the U i represents the second secret data, the d a represents the first random number; The data of the first device includes a plurality of data, and the fourth secret data satisfies: v j =[H(y j )*d a ]G; Among them, the v j represents the jth data in the fourth secret data, the y j represents the j-th data in the data of the second device, j=1, 2, 3, ..., m; The third secret data satisfies: V j =[d b ]v j ; Among them, the V j Represents the third secret data.
6. The device according to claim 5, characterized in that The communication module is also used to receive the first encrypted data from the second device.
7. The device according to claim 5, characterized in that The processing module is specifically used for: Determine the sequence number of the first intersection data in the third secret data according to the position of the first intersection data in the third secret data; The second intersection data is determined from the data of the first device according to the sequence number.
8. The device according to claim 5, characterized in that The communication module is also used to send the fourth encrypted data to the second device.
9. An electronic device, characterized in that: The electronic device comprises a processor, and the processor is used to implement the steps of any one of the methods as claimed in claims 1 to 4 when executing a computer program stored in a memory.
10. A computer-readable storage medium, characterized in that: The device stores a computer program, which implements the steps of the method according to any one of claims 1 to 4 when executed by a processor.
