Privacy set intersection method and device, electronic equipment and storage medium

By employing key encapsulation mechanisms and public-key encryption technology, the problem that existing privacy set intersection protocols cannot resist quantum computer attacks has been solved, achieving secure and efficient intersection computation.

CN118900172APending Publication Date: 2024-11-05TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310491103.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-04
Publication Date
2024-11-05

AI Technical Summary

Technical Problem

Existing privacy set intersection protocols are not resistant to quantum computer attacks, and their security and efficiency need to be improved.

Method used

A key encapsulation mechanism is used to encrypt and encapsulate the public keys generated by the two parties participating in the intersection protocol. By using double encryption of the public key and the data, combined with the parameter generation method of central binomial distribution and polynomial matrix, the intersection is calculated to resist quantum computer attacks.

Benefits of technology

It improves the security and efficiency of the privacy set intersection protocol, reduces communication overhead, and ensures that intersections can still be effectively computed in a quantum computing environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900172A_ABST
    Figure CN118900172A_ABST
Patent Text Reader

Abstract

The invention relates to a privacy set intersection method and device, electronic equipment and a storage medium, public parameters are sent and generated to a second user side through a first user side, and the first user side and the second user side generate a first public key ciphertext and a second public key ciphertext according to the public parameters respectively. And the first user side determines a second public key based on the second public key ciphertext, calculates a first number of pieces of ciphertext information according to the first private data set and the second public key, and sends the first public key ciphertext and the ciphertext information to the second user side. And the second user side analyzes the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determines an intersection of a second hash data set corresponding to the second private data set. According to the disclosure, the intersection of the privacy data sets of two parties participating in the intersection protocol is realized through an anti-quantum key encapsulation mechanism, so that the attack of a quantum computer is resisted. Meanwhile, in the intersection calculation process, calculation is simple, the number of communication times is small, and the efficiency of the whole privacy set intersection solving process is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of secure computing, and in particular to a privacy set intersection method, device, electronic device and storage medium. Background Art

[0002] The Private Set Intersection (PSI) problem allows two parties, each of whom has a private data set, to obtain the intersection of their private data sets without sharing their private data sets with each other, without revealing any information other than the elements of the intersection. When the elements in the private data sets of the two parties are equal, it is called a balanced PSI protocol, otherwise it is called an unbalanced PSI protocol. Currently, the PSI protocol constructed based on the traditional public key encryption system does not have the ability to resist quantum computer attacks, and cannot be constructed using the key encapsulation mechanism. Therefore, we need a more secure and efficient two-party private set intersection protocol that can resist quantum computer attacks. Summary of the invention

[0003] In view of this, the present disclosure proposes a privacy set intersection method, device, electronic device and storage medium, aiming to provide a two-party privacy set intersection protocol that is secure, efficient and resistant to quantum computer attacks.

[0004] According to a first aspect of the present disclosure, a privacy set intersection method is provided, which is applied to a first user terminal, and the method includes:

[0005] Generate public parameters, and send the public parameters to the second user terminal;

[0006] Generate a first public key according to the public parameters, and determine a corresponding first public key ciphertext according to the first public key;

[0007] Receiving a second public key ciphertext generated by the second client based on the public parameters;

[0008] Determine a second public key according to the second public key ciphertext;

[0009] Calculate a first number of ciphertext information according to a first private data set corresponding to the first client and the second public key, where the first number is the number of data included in the first private data set;

[0010] The first public key ciphertext and a ciphertext information set including the first number of ciphertext information are sent to the second user terminal, so that the second user terminal determines the first hash data corresponding to each of the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determines the intersection of the first hash data set and the second hash data set, wherein the second hash data set includes the second hash data corresponding to each of the second privacy data in the second privacy data set corresponding to the second user terminal.

[0011] In one possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information or the second ciphertext information.

[0012] In a possible implementation manner, generating a first public key according to the public parameter, and determining a corresponding first public key ciphertext according to the first public key includes:

[0013] Randomly determine a first private key and a first random vector from a central binomial distribution determined by the fifth parameter;

[0014] Obtaining a first public key by calculating the first private key and the first random vector;

[0015] Generate a corresponding first public key ciphertext based on the first public key and the sixth parameter according to a preset encryption function.

[0016] In a possible implementation manner, the calculating the first public key according to the first private key and the first random vector includes:

[0017] The sum of the product of the first private key and a preset matrix and the first random vector is calculated to obtain a first public key.

[0018] In a possible implementation manner, determining the second public key according to the second public key ciphertext includes:

[0019] The second public key of the second user terminal is determined based on the second public key ciphertext and the sixth parameter according to a preset decryption function.

[0020] In a possible implementation, the calculating a first number of ciphertext information according to a first private data set corresponding to the first user terminal and the second public key includes:

[0021] Determine first hash data corresponding to each first privacy data in the first privacy data set;

[0022] Randomly determine a second random vector corresponding to each first privacy data from a central binomial distribution determined by the fifth parameter;

[0023] The corresponding ciphertext information is calculated according to the first hash data, the second random vector, the first private key and the second public key corresponding to each of the first privacy data.

[0024] In a possible implementation, the calculating corresponding ciphertext information according to the first hash data, the second random vector, the first private key, and the second public key corresponding to each of the first privacy data includes:

[0025] Determine a first intermediate parameter corresponding to each first hash data according to the decryption function and a preset constant;

[0026] Calculate a corresponding second intermediate parameter according to the first intermediate parameter corresponding to each of the first privacy data, the second random vector, the first private key, and the second public key;

[0027] The corresponding ciphertext information is determined based on the seventh parameter and the second intermediate parameter according to a preset compression function.

[0028] In a possible implementation, the calculating the corresponding second intermediate parameter according to the first intermediate parameter corresponding to each first privacy data, the second random vector, the first private key, and the second public key includes:

[0029] Calculate the product of the first private key and the second public key to obtain a first product value;

[0030] The sum of the first intermediate parameter, the second random vector, and the first product value corresponding to each of the first privacy data is calculated to obtain the corresponding second intermediate parameter.

[0031] According to a second aspect of the present disclosure, a privacy set intersection method is provided, which is applied to a second user terminal, and the method includes:

[0032] Receiving public parameters sent by the first user terminal;

[0033] Generate a second public key according to the public parameters, and determine a corresponding second public key ciphertext according to the second public key;

[0034] Sending the second public key ciphertext to the first client, so that the first client generates a first number of ciphertext information according to the second public key ciphertext;

[0035] Receiving a first public key ciphertext and a ciphertext information set including a first number of ciphertext information sent by the first user terminal, where the first number of ciphertext information is calculated by the first user terminal according to the corresponding first private data set and the second public key, and the first number of data is the number of data included in the first private data set;

[0036] Determine the first hash data corresponding to each ciphertext information according to the first public key ciphertext to obtain a first hash data set;

[0037] Determine the second hash data corresponding to each of the second private data in the corresponding second private data set to obtain a second hash data set;

[0038] An intersection of the first hash data set and the second hash data set is calculated to obtain an intersection of the first private data set and the second private data set.

[0039] In one possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information and / or the second ciphertext information.

[0040] In a possible implementation manner, generating a second public key according to the public parameter, and determining a corresponding second public key ciphertext according to the second public key includes:

[0041] Randomly determine a second private key and a third random vector from a central binomial distribution determined by the fifth parameter;

[0042] Calculate a second public key according to the second private key and the third random vector;

[0043] Generate a corresponding second public key ciphertext based on the second public key and the sixth parameter according to a preset encryption function.

[0044] In a possible implementation manner, the step of calculating the second public key according to the second private key and the third random vector includes:

[0045] The sum of the product of the second private key and a preset matrix and the third random vector is calculated to obtain a second public key.

[0046] In a possible implementation, determining the first hash data corresponding to each ciphertext information according to the first public key ciphertext to obtain a first hash data set includes:

[0047] Determine the first public key of the first client based on the first public key ciphertext and the sixth parameter according to a preset decryption function;

[0048] Determine a corresponding fourth intermediate parameter based on each of the ciphertext information and the seventh parameter according to the decryption function;

[0049] Determine first hash data according to the fourth intermediate parameter, the first public key, and the second private key to obtain a first hash data set including a first number of first hash data.

[0050] In a possible implementation, determining the first hash data according to the fourth intermediate parameter, the first public key, and the second private key to obtain a first hash data set including a first number of first hash data includes:

[0051] Determine a third intermediate parameter according to the fourth intermediate parameter, the first public key and the second private key;

[0052] The corresponding first hash data is determined according to the encryption function based on the third intermediate parameter and a preset constant to obtain a first hash data set including a first number of first hash data.

[0053] In a possible implementation manner, determining a third intermediate parameter according to the fourth intermediate parameter, the first public key, and the second private key includes:

[0054] Calculate the product of the first public key and the second private key to obtain a second product value;

[0055] A difference between the fourth intermediate parameter and the second product value is calculated to obtain a third intermediate parameter.

[0056] In a possible implementation, determining the second hash data corresponding to each second private data in the corresponding second private data set to obtain the second hash data set includes:

[0057] The second hash data corresponding to each second privacy data is determined according to a preset hash function to obtain a second hash data set.

[0058] According to a third aspect of the present disclosure, a privacy set intersection device is provided, which is applied to a first user terminal, and the device includes:

[0059] A parameter generation module, used to generate common parameters and send the common parameters to the second user terminal;

[0060] A first public key generation module, used to generate a first public key according to the public parameters, and determine a corresponding first public key ciphertext according to the first public key;

[0061] A first public key receiving module, used to receive a second public key ciphertext generated by the second user terminal based on the public parameters;

[0062] A public key decryption module, used to determine the second public key according to the second public key ciphertext;

[0063] A first ciphertext calculation module, configured to calculate a first number of ciphertext information according to a first private data set corresponding to the first user terminal and the second public key, where the first number is the number of data included in the first private data set;

[0064] A ciphertext sending module is used to send the first public key ciphertext and a ciphertext information set including the first number of ciphertext information to the second user terminal, so that the second user terminal can determine the first hash data corresponding to each of the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determine the intersection of the first hash data set and the second hash data set, wherein the second hash data set includes the second hash data corresponding to each of the second privacy data in the second privacy data set corresponding to the second user terminal.

[0065] In one possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information or the second ciphertext information.

[0066] In a possible implementation, the first public key generation module is further used to:

[0067] Randomly determine a first private key and a first random vector from a central binomial distribution determined by the fifth parameter;

[0068] Obtaining a first public key by calculating the first private key and the first random vector;

[0069] Generate a corresponding first public key ciphertext based on the first public key and the sixth parameter according to a preset encryption function.

[0070] In a possible implementation, the first public key generation module is further used to:

[0071] The sum of the product of the first private key and a preset matrix and the first random vector is calculated to obtain a first public key.

[0072] In a possible implementation, the public key decryption module is further used to:

[0073] The second public key of the second user terminal is determined based on the second public key ciphertext and the sixth parameter according to a preset decryption function.

[0074] In a possible implementation, the first ciphertext calculation module is further configured to:

[0075] Determine first hash data corresponding to each first privacy data in the first privacy data set;

[0076] Randomly determine a second random vector corresponding to each first privacy data from a central binomial distribution determined by the fifth parameter;

[0077] The corresponding ciphertext information is calculated according to the first hash data, the second random vector, the first private key and the second public key corresponding to each of the first privacy data.

[0078] In a possible implementation, the first ciphertext calculation module is further configured to:

[0079] Determine a first intermediate parameter corresponding to each first hash data according to the decryption function and a preset constant;

[0080] Calculate a corresponding second intermediate parameter according to the first intermediate parameter corresponding to each of the first privacy data, the second random vector, the first private key, and the second public key;

[0081] The corresponding ciphertext information is determined based on the seventh parameter and the second intermediate parameter according to a preset compression function.

[0082] In a possible implementation, the first ciphertext calculation module is further configured to:

[0083] Calculate the product of the first private key and the second public key to obtain a first product value;

[0084] The sum of the first intermediate parameter, the second random vector, and the first product value corresponding to each of the first privacy data is calculated to obtain the corresponding second intermediate parameter.

[0085] According to a fourth aspect of the present disclosure, a privacy set intersection device is provided, which is applied to a second user terminal, and the device includes:

[0086] A parameter receiving module, used for receiving the public parameters sent by the first user terminal;

[0087] A second public key generation module, used to generate a second public key according to the public parameters, and determine a corresponding second public key ciphertext according to the second public key;

[0088] A public key sending module, used for sending the second public key ciphertext to the first user terminal, so as to generate a first number of ciphertext information according to the second public key ciphertext through the first user terminal;

[0089] A second public key receiving module is configured to receive a first public key ciphertext and a ciphertext information set including a first number of ciphertext information sent by the first user terminal, the first number of ciphertext information being calculated by the first user terminal according to the corresponding first private data set and the second public key, and the first number of data being included in the first private data set;

[0090] A ciphertext decryption module, used to determine the first hash data corresponding to each ciphertext information according to the first public key ciphertext, to obtain a first hash data set;

[0091] A data hash module, used to determine second hash data corresponding to each second private data in a corresponding second private data set, to obtain a second hash data set;

[0092] The data intersection module is used to calculate the intersection of the first hash data set and the second hash data set to obtain the intersection of the first private data set and the second private data set.

[0093] In one possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information and / or the second ciphertext information.

[0094] In a possible implementation, the second public key generation module is further used to:

[0095] Randomly determine a second private key and a third random vector from a central binomial distribution determined by the fifth parameter;

[0096] Calculate a second public key according to the second private key and the third random vector;

[0097] Generate a corresponding second public key ciphertext based on the second public key and the sixth parameter according to a preset encryption function.

[0098] In a possible implementation, the second public key generation module is further used to:

[0099] The sum of the product of the second private key and a preset matrix and the third random vector is calculated to obtain a second public key.

[0100] In a possible implementation, the ciphertext decryption module is further used to:

[0101] Determine the first public key of the first client based on the first public key ciphertext and the sixth parameter according to a preset decryption function;

[0102] Determine a corresponding fourth intermediate parameter based on each of the ciphertext information and the seventh parameter according to the decryption function;

[0103] Determine first hash data according to the fourth intermediate parameter, the first public key, and the second private key to obtain a first hash data set including a first number of first hash data.

[0104] In a possible implementation, the ciphertext decryption module is further used to:

[0105] Determine a third intermediate parameter according to the fourth intermediate parameter, the first public key and the second private key;

[0106] The corresponding first hash data is determined according to the encryption function based on the third intermediate parameter and a preset constant to obtain a first hash data set including a first number of first hash data.

[0107] In a possible implementation, the ciphertext decryption module is further used to:

[0108] Calculate the product of the first public key and the second private key to obtain a second product value;

[0109] A difference between the fourth intermediate parameter and the second product value is calculated to obtain a third intermediate parameter.

[0110] In a possible implementation, the data hash module is further used to:

[0111] The second hash data corresponding to each second privacy data is determined according to a preset hash function to obtain a second hash data set.

[0112] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0113] According to the sixth aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0114] According to a seventh aspect of the present disclosure, a computer program product is provided, comprising a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code, and when the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0115] In an embodiment of the present disclosure, a public parameter is generated by a first user terminal and sent to a second user terminal, and the first user terminal and the second user terminal generate a first public key ciphertext and a second public key ciphertext according to the public parameters, respectively. The first user terminal determines the second public key based on the second public key ciphertext, calculates a first number of ciphertext information according to the first private data set and the second public key, and sends the first public key ciphertext and the ciphertext information to the second user terminal. The second user terminal parses the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determines the intersection of the second hash data set corresponding to the second private data set. The present disclosure encrypts and encapsulates the public keys generated by each of the two parties participating in the intersection protocol through a key encapsulation mechanism to resist attacks from quantum computers. At the same time, the calculation is simple and the number of communications is small in the process of calculating the intersection, which improves the efficiency of the entire private set intersection process.

[0116] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0117] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0118] Figure 1 A flowchart showing a privacy set intersection method at a first user terminal side according to an embodiment of the present disclosure is shown;

[0119] Figure 2 A flowchart showing a privacy set intersection method on the second user side according to an embodiment of the present disclosure is shown;

[0120] Figure 3 A schematic diagram showing a privacy data set intersection process according to an embodiment of the present disclosure;

[0121] Figure 4 A schematic diagram showing another process of intersecting a privacy data set according to an embodiment of the present disclosure;

[0122] Figure 5 A schematic diagram showing a privacy set intersection device at a first user terminal according to an embodiment of the present disclosure;

[0123] Figure 6 A schematic diagram showing a privacy set intersection device at a second user terminal according to an embodiment of the present disclosure;

[0124] Figure 7 A schematic diagram showing an electronic device according to an embodiment of the present disclosure;

[0125] Figure 8 A schematic diagram showing another electronic device according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0126] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0127] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0128] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.

[0129] The privacy set intersection method of the embodiment of the present disclosure can be executed by an electronic device such as a terminal device or server used by the first user or the second user participating in the privacy set intersection calculation, that is, the terminal device or server can be used as the first user end and / or the second client. Among them, the terminal device can be any fixed or mobile terminal such as user equipment (User Equipment, UE), mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (Personal Digital Assistant, PDA), handheld device, computing device, vehicle-mounted device, wearable device, etc. The server can be a single server or a server cluster composed of multiple servers. Any electronic device can implement the privacy set intersection method of the embodiment of the present disclosure by a processor calling computer-readable instructions stored in a memory.

[0130] Alternatively, the embodiments of the present disclosure may also use an application installed on an electronic device such as a terminal device or a server as a user terminal used by the first user or the second user participating in the privacy set intersection calculation, and execute the privacy set intersection method of the embodiments of the present disclosure through the first user terminal and the second user terminal used by the first user and the second user respectively.

[0131] Figure 1A flowchart of a privacy set intersection method on the first user side according to an embodiment of the present disclosure is shown. Figure 1 As shown, a privacy set intersection method at the first user terminal side of the embodiment of the present disclosure may include the following steps S10-S60.

[0132] Step S10: Generate public parameters, and send the public parameters to the second user terminal.

[0133] In a possible implementation, the first user terminal and the second user terminal are hardware or software user terminals used by the first user and the second user who need to perform the privacy set intersection protocol. The first user terminal is a hardware or software user terminal used by the first user who is a protocol participant of the privacy set intersection method. The first user terminal can generate public parameters based on the preset requirements of the protocol and send the public parameters to the second user terminal used by another second user who participates in the protocol. The first user and the second user who are protocol participants respectively have a corresponding first private data set X = {x1,…,x n1} and the second private data set Y = {y1,…,y n2}, where n1 and n2 can be the same or different, and in different cases, n1 is greater than n2. The protocol participants need to perform secure multi-party computation based on public parameters to find the intersection X∩Y of the first private data set and the second private data set.

[0134] Optionally, the first user terminal may generate at least one required public parameter according to the requirements of the protocol. Exemplarily, the public parameters generated by the first user terminal may include a first parameter m, a second parameter k, a third parameter q, a fourth parameter λ, a fifth parameter η, a sixth parameter d p and the seventh parameter d k The first parameter m and the second parameter k can be used to limit the dimension of the preset matrix A and / or the polynomial matrix, the third parameter q can be a prime number greater than 2, the fourth parameter λ can be a security parameter for generating random vectors, the fifth parameter η can be a parameter of the central binomial distribution, and the sixth parameter d p and the seventh parameter d k It can be a polynomial matrix determined according to the second parameter, used to encrypt and / or decrypt the first ciphertext information.

[0135] Step S20: Generate a first public key according to the public parameters, and determine a corresponding first public key ciphertext according to the first public key.

[0136] In a possible implementation, after determining the public parameters, the first user terminal can generate a first public key according to the public parameters, and then encrypt the generated first public key to obtain a first public key ciphertext. Among them, the first user terminal can first generate a first private key according to the public parameters, and then generate a corresponding first public key according to the first private key, and encrypt the first public key according to a preset encryption function to obtain a first public key ciphertext. Optionally, the first private key can be randomly obtained from a central binomial distribution generated according to a fifth parameter, and the encryption function can encrypt the first public key according to a sixth parameter. Exemplarily, the first user terminal generates the first public key by randomly determining a first private key and a first random vector from a central binomial distribution determined by the fifth parameter, and then calculating the first public key according to the first private key and the first random vector, and then generating the corresponding first public key ciphertext based on the first public key and the sixth parameter according to a preset encryption function. Further, the first user terminal can obtain the first public key by calculating the product of the first private key and a preset matrix and the sum of the first random vector.

[0137] Exemplarily, the first user terminal, according to the fifth parameter ψ η After determining the central binomial distribution, the first private key S can be randomly selected according to the first parameter and the second parameter A and the first random vector e A The first public key P is calculated based on the first private key and the first random vector A ←AS A +e A . Then according to the preset encryption function Compress q (·) Encrypt the first public key according to the sixth parameter to obtain the first public key ciphertext

[0138] Furthermore, in the disclosed embodiment, the first user terminal randomly selects the first private key and the first random vector, generates the first public key according to the randomly selected first private key and the first random vector, and encrypts the first public key to obtain the first public key ciphertext, which can be encapsulated as a key generation algorithm KEM.Gen(). In actual application, the first user terminal can directly call the key generation algorithm after generating the public parameters to generate the first public key.

[0139] Step S30: Receive a second public key ciphertext generated by the second user terminal based on the public parameters.

[0140] In a possible implementation, after receiving the public parameters sent by the first user end, the second user end may also generate the corresponding second public key and the second public key ciphertext corresponding to the second public key according to the public parameters. After generating the second public key ciphertext corresponding to the second public key, the second user end may send the second public key ciphertext to the first user end for the next calculation process in the protocol. Among them, the process in which the second user end generates the second public key based on the public parameters, and encrypts the second public key to obtain the second public key ciphertext, may be the same as the process in which the first user end generates the first public key based on the public parameters, and encrypts the first public key to obtain the first public key ciphertext. For example, when the first user end calls the encapsulated key generation algorithm KEM.Gen() to generate the first public key and the first public key ciphertext corresponding to the first public key, the second user end may also call the key generation algorithm KEM.Gen() based on the received public parameters to generate the second public key and the second public key ciphertext.

[0141] Optionally, similar to the first user terminal, the second user terminal may also first generate a second private key according to the public parameters, then generate a corresponding second public key according to the second private key, and encrypt the second public key according to a preset encryption function to obtain a second public key ciphertext. Optionally, the second private key can be randomly obtained from a central binomial distribution generated according to the fifth parameter, and the encryption function can encrypt the second public key according to the sixth parameter. Exemplarily, the second user terminal generates the second public key by randomly determining the second private key and the third random vector from the central binomial distribution determined by the fifth parameter, then calculating the second public key according to the second private key and the third random vector, and then generating the corresponding second public key ciphertext based on the second public key and the sixth parameter according to a preset encryption function. Furthermore, the second user terminal can obtain the second public key by calculating the product of the second private key and a preset matrix and the sum of the product and the third random vector.

[0142] Exemplarily, the second user terminal, according to the fifth parameter ψ η After determining the central binomial distribution, the second private key S can be arbitrarily selected according to the first parameter and the second parameter B and the third random vector e B The second public key P is calculated based on the second private key and the third random vector B ←AS B +e B . Then according to the preset encryption function Compress q (·) Encrypt the first public key according to the sixth parameter to obtain the first public key ciphertext

[0143] Step S40: Determine the second public key according to the second public key ciphertext.

[0144] In a possible implementation, after receiving the second public key ciphertext, the first user terminal decrypts the second public key ciphertext to obtain the corresponding second public key. Optionally, the first user terminal may decrypt the second public key ciphertext using a preset decryption function to obtain the second public key. For example, when the preset decryption function is Decompress q (·) In the case of the first user end, the first user end can use the decryption function based on the sixth parameter to decrypt the received second public key ciphertext Decryption to obtain the second public key is

[0145] Step S50: Calculate a first number of ciphertext information according to a first private data set corresponding to the first user terminal and the second public key.

[0146] In one possible implementation, after the first user terminal obtains the second public key after decrypting the second public key ciphertext, it can encrypt each first private data in the first private data set through the second public key to obtain the ciphertext information corresponding to each first private data. That is, a first number of first ciphertext information is obtained by encryption, and the first number is the number of data included in the first private data set. Optionally, the process of encrypting the first private data by the first user terminal can be to first determine the first hash data corresponding to each first private data in the first private data set. Then randomly determine the second random vector corresponding to each first private data from the central binomial distribution determined by the fifth parameter. Calculate the corresponding ciphertext information according to the first hash data, the second random vector, and the first private key and the second public key corresponding to each first private data. Exemplarily, the first user terminal determines the first private data set X={x1,…,x n1} Each first private data x i (i∈[1, n1]), the corresponding first hash data H1(x i ). Then according to the fifth parameter ψ η After determining the central binomial distribution, a polynomial matrix can be arbitrarily selected according to the first parameter and the second parameter as the second random vector corresponding to the first private data. Further, the corresponding ciphertext information c is calculated according to the first hash data corresponding to the first privacy data, the second random vector, the first private key and the second public key. i .

[0147] Furthermore, the process of calculating the corresponding ciphertext information according to the first hash data, the second random vector, the first private key and the second public key corresponding to each first privacy data may also include first determining the first intermediate parameter corresponding to each first hash data based on a preset constant according to a decryption function. Then, the corresponding second intermediate parameter is calculated according to the first intermediate parameter, the second random vector, the first private key and the second public key corresponding to each first privacy data. The corresponding ciphertext information is determined based on the seventh parameter and the second intermediate parameter according to a preset compression function. Among them, the determination process of the second intermediate parameter can be to calculate the product of the first private key and the second public key to obtain a first product value. Then, the sum of the first intermediate parameter, the second random vector and the first product value corresponding to each first privacy data is calculated to obtain the corresponding second intermediate parameter.

[0148] Exemplarily, when the preset constant is 1, the first user terminal can determine the first intermediate parameter K corresponding to each first hash data based on the preset constant according to the decryption function. i ←Decompress q (H1(x i ), 1). Then calculate the first private key s A and the second public key P B The first product value is obtained by multiplying the first intermediate parameter, the second random vector and the first product value corresponding to each first privacy data to obtain the corresponding second intermediate parameter: Further, the first user terminal determines the corresponding ciphertext information based on the seventh parameter and the second intermediate parameter according to the preset compression function:

[0149] Step S60: Send the first public key ciphertext and the ciphertext information set including the first number of ciphertext information to the second user terminal.

[0150] In a possible implementation, after generating a first number of ciphertext information, the first user terminal packages the first number of ciphertext information into a ciphertext information set, and sends it together with the first public key ciphertext to the second user terminal. After receiving the first public key ciphertext and the ciphertext information set, the second user terminal determines the first hash data corresponding to each ciphertext information according to the first public key ciphertext to obtain the first hash data set. Furthermore, the second user terminal can also determine the corresponding second hash data according to each second private data in the second private data set to obtain the second hash data set, and obtain the intersection of the first private data set and the second private data set by calculating the intersection of the first hash data set and the second hash data set.

[0151] In different application scenarios, the intersection of the privacy data sets calculated by the first user terminal and the second user terminal in the embodiment of the present disclosure can play different roles. For example, it can be applied to any application scenario such as finding common patients between different medical institutions, searching for common items in databases between different security institutions, and finding the same person in different lists without leaking other information. That is, the first privacy data set and the second privacy data set corresponding to the first user terminal and the second user terminal can be a list of people, a list of items, and an information set in different scenarios.

[0152] Based on the above technical features, the disclosed embodiment can encrypt and encapsulate the public keys generated by the two parties participating in the intersection protocol through a key encapsulation mechanism to resist the attack of quantum computers. At the same time, the disclosed embodiment also encrypts the public keys of the two parties participating in the protocol, and further increases the security of the protocol through the double encryption of the public key and the data. The process of calculating the intersection is simple, which improves the efficiency of the entire privacy set intersection process.

[0153] Figure 2 A flowchart of a privacy set intersection method on the second user side according to an embodiment of the present disclosure is shown. Figure 2 As shown, the privacy set intersection method at the second user terminal side of the embodiment of the present disclosure may include the following steps S10'-S70'.

[0154] Step S10': receiving the public parameters sent by the first user terminal.

[0155] In a possible implementation, the first user terminal and the second user terminal are hardware or software user terminals used by the first user and the second user who need to perform the privacy set intersection protocol. The first user terminal is a hardware or software user terminal used by the first user who is a protocol participant of the privacy set intersection method. The first user terminal can generate public parameters based on the preset requirements of the protocol and send the public parameters to the second user terminal used by another second user who participates in the protocol. The first user and the second user who are protocol participants respectively have a corresponding first private data set X = {x1,…,x n1} and the second private data set Y = {y1,…,y n2}, where n1 and n2 can be the same or different, and in different cases, n1 is greater than n2. The protocol participants need to perform secure multi-party computation based on public parameters to find the intersection X∩Y of the first private data set and the second private data set.

[0156] Optionally, the public parameters generated by the first user terminal may include a first parameter m, a second parameter k, a third parameter q, a fourth parameter λ, and a fifth parameter ψ η 、The sixth parameter d p and the seventh parameter dk The first parameter m and the second parameter k can be used to limit the dimension of the preset matrix A and / or the polynomial matrix, the third parameter q can be a prime number greater than 2, the fourth parameter λ can be a security parameter for generating random vectors, and the fifth parameter ψ η The sixth parameter d can be the parameter of the central binomial distribution. p and the seventh parameter d k It can be a parameter for encrypting and / or decrypting the first ciphertext information.

[0157] Step S20': Generate a second public key according to the public parameters, and determine a corresponding second public key ciphertext according to the second public key.

[0158] In a possible implementation, after receiving the public parameters sent by the first user end, the second user end may also generate the corresponding second public key and the second public key ciphertext corresponding to the second public key according to the public parameters. After generating the second public key ciphertext corresponding to the second public key, the second user end may send the second public key ciphertext to the first user end for the next calculation process in the protocol. Among them, the process in which the second user end generates the second public key based on the public parameters, and encrypts the second public key to obtain the second public key ciphertext, may be the same as the process in which the first user end generates the first public key based on the public parameters, and encrypts the first public key to obtain the first public key ciphertext. For example, when the first user end calls the encapsulated key generation algorithm KEM.Gen() to generate the first public key and the first public key ciphertext corresponding to the first public key, the second user end may also call the key generation algorithm KEM.Gen() based on the received public parameters to generate the second public key and the second public key ciphertext.

[0159] Optionally, similar to the first user terminal, the second user terminal may also first generate a second private key according to the public parameters, then generate a corresponding second public key according to the second private key, and encrypt the second public key according to a preset encryption function to obtain a second public key ciphertext. Optionally, the second private key can be randomly obtained from a central binomial distribution generated according to the fifth parameter, and the encryption function can encrypt the second public key according to the sixth parameter. Exemplarily, the second user terminal generates the second public key by randomly determining the second private key and the third random vector from the central binomial distribution determined by the fifth parameter, then calculating the second public key according to the second private key and the third random vector, and then generating the corresponding second public key ciphertext based on the second public key and the sixth parameter according to a preset encryption function. Furthermore, the second user terminal can obtain the second public key by calculating the product of the second private key and a preset matrix and the sum of the product and the third random vector.

[0160] Exemplarily, the second user terminal, according to the fifth parameter ψ η After the central binomial distribution is determined, the polynomial matrix determined by the first parameter and the second parameter can be arbitrarily selected as the second private key SB and the third random vector e B The second public key P is calculated based on the second private key and the third random vector B ←AS B +e B . Then according to the preset encryption function Compress q (·) Encrypt the first public key according to the sixth parameter to obtain the first public key ciphertext

[0161] Step S30': sending the second public key ciphertext to the first user terminal.

[0162] In one possible implementation, after generating a second public key ciphertext, the second user terminal sends the second public key ciphertext to the first user terminal, so that the first user terminal decrypts the second public key ciphertext to obtain the second public key, and generates a first number of ciphertext information based on the second public key and the first privacy data set.

[0163] Step S40': receiving a first public key ciphertext and a ciphertext information set including a first number of ciphertext information sent by the first user terminal.

[0164] In a possible implementation, after generating the public parameters, the first user terminal also generates a first public key and a first public key ciphertext according to the public parameters. The process of generating the first public key ciphertext is the same as step S20 and will not be repeated here. At the same time, after receiving the second public key ciphertext, the first user terminal decrypts the second public key ciphertext to obtain the corresponding second public key. Optionally, the first user terminal can decrypt the second public key ciphertext using a preset decryption function to obtain the second public key. Exemplarily, when the preset decryption function is Decompress q (·) In the case of the first user end, the first user end can use the decryption function based on the sixth parameter to decrypt the received second public key ciphertext Decryption to obtain the second public key is

[0165] Furthermore, after the first user terminal obtains the second public key after decrypting the second public key ciphertext, it can encrypt each first privacy data in the first privacy data set through the second public key to obtain the ciphertext information corresponding to each first privacy data. That is, a first number of first ciphertext information is obtained by encryption, and the first number is the number of data included in the first privacy data set. Optionally, the process of encrypting the first privacy data by the first user terminal can be to first determine the first hash data corresponding to each first privacy data in the first privacy data set. Then randomly determine the second random vector corresponding to each first privacy data from the central binomial distribution determined by the fifth parameter. Calculate the corresponding ciphertext information according to the first hash data, the second random vector, and the first private key and the second public key corresponding to each first privacy data. Exemplarily, the first user terminal determines the first privacy data set X={x1,...,x n1} Each first private data x i (i∈[1, n1]), the corresponding first hash data H1(x i ). Then according to the fifth parameter ψ η After determining the central binomial distribution, a polynomial matrix can be arbitrarily selected according to the first parameter and the second parameter as the second random vector corresponding to the first private data. Further, the corresponding ciphertext information c is calculated according to the first hash data corresponding to the first privacy data, the second random vector, the first private key and the second public key. i .

[0166] Furthermore, the process of calculating the corresponding ciphertext information according to the first hash data, the second random vector, the first private key and the second public key corresponding to each first privacy data may also include first determining the third intermediate parameter corresponding to each first hash data based on a preset constant according to the decryption function. Then, the corresponding fourth intermediate parameter is calculated according to the third intermediate parameter, the second random vector, the first private key and the second public key corresponding to each first privacy data. The corresponding ciphertext information is determined based on the seventh parameter and the fourth intermediate parameter according to the preset compression function. Among them, the determination process of the fourth intermediate parameter can be to calculate the product of the first private key and the second public key to obtain a first product value. Then, the sum of the third intermediate parameter, the second random vector and the first product value corresponding to each first privacy data is calculated to obtain the corresponding fourth intermediate parameter.

[0167] Exemplarily, when the preset constant is 1, the first user terminal can determine the third intermediate parameter K corresponding to each first hash data based on the preset constant according to the decryption function. i ←Decompress q (H1(x i ), 1). Then calculate the first private key s A and the second public key PB The product of the first product value is obtained by calculating the sum of the third intermediate parameter, the second random vector and the first product value corresponding to each first privacy data to obtain the corresponding fourth intermediate parameter: Further, the first user terminal determines the corresponding ciphertext information based on the seventh parameter and the fourth intermediate parameter according to the preset compression function:

[0168] After the first public key ciphertext and the first number of ciphertext information are determined at the first user terminal, the first number of ciphertext information are packaged into a ciphertext information set, and sent to the second user terminal together with the first public key ciphertext.

[0169] Step S50': determine the first hash data corresponding to each ciphertext information according to the first public key ciphertext to obtain a first hash data set.

[0170] In one possible implementation, after the second user terminal receives the first public key ciphertext and the second number of ciphertext messages sent by the first user terminal, the second user terminal decrypts each ciphertext message based on the first public key ciphertext to obtain the corresponding first hash data, so as to obtain a first hash data set including the first number of first hash data. Among them, the second user terminal can first decrypt the first public key ciphertext once to obtain the first public key therein, and then decrypt each ciphertext message based on the first public key. Exemplarily, the second user terminal can determine the first public key of the first user terminal based on the first public key ciphertext and the sixth parameter according to a preset decryption function. According to the decryption function, the corresponding fourth intermediate parameter is determined based on each ciphertext message and the seventh parameter, and then the first hash data is determined based on the fourth intermediate parameter, the first public key and the second private key, to obtain a first hash data set including the first number of first hash data. When the preset decryption function is Decompress q (·) In the case of the second user terminal, the second user terminal can be based on the sixth parameter d P Decrypt the first public key ciphertext The first public key is Then according to the decryption function based on the seventh parameter d K For the ciphertext information C j (j∈[1, n1]) is decrypted to obtain the corresponding fourth intermediate parameter The first hash data is further determined based on the first public key, the fourth intermediate parameter and the second private key obtained by decryption.

[0171] Optionally, after determining the first public key and the fourth intermediate parameter corresponding to each ciphertext information, the second user terminal can determine the third intermediate parameter according to the fourth intermediate parameter, the first public key and the second private key. Then, the corresponding first hash data is determined based on the third intermediate parameter and the preset constant according to the encryption function to obtain a first hash data set including a first number of first hash data. Among them, the third intermediate parameter can be obtained by first calculating the product of the first public key and the second private key to obtain a second product value, and then calculating the difference between the fourth intermediate parameter and the second product value. That is, the product of the first public key and the second private key is first calculated to obtain a second product value of P A s B , calculate the difference between the fourth intermediate parameter and the second product value to obtain the third intermediate parameter: When the preset constant is 1, the second user terminal determines the corresponding first hash data according to the encryption function based on the third intermediate parameter and the preset constant as H1(xi)←Compress q (K j , 1) The second user terminal can determine the first hash data set based on all the first hash data

[0172] Furthermore, in the disclosed embodiment, the process of the second user end decrypting each ciphertext information based on the first public key ciphertext to obtain the corresponding first hash data can be encapsulated as a key decapsulation algorithm. In actual application, the first user end can directly call the key decapsulation algorithm after generating the public parameters to obtain the first hash data of each ciphertext information.

[0173] Step S60': determine the second hash data corresponding to each second privacy data in the corresponding second privacy data set to obtain a second hash data set.

[0174] In a possible implementation, the second user terminal may determine the second hash data corresponding to each second private data according to a preset hash function to obtain a second hash data set. j (j∈[1, n2]) inputs the preset hash function to obtain the corresponding second hash data H1(y j ). Further determine the second hash data set according to each second hash data

[0175] Step S70': Calculate the intersection of the first hash data set and the second hash data set to obtain the intersection of the first private data set and the second private data set.

[0176] In one possible implementation, after obtaining the first hash data set by decryption and obtaining the second hash data set by hashing, the second user terminal can directly calculate the intersection of the first hash data set and the second hash data set to obtain the intersection of the first private data set and the second private data set.

[0177] In different application scenarios, the intersection of the privacy data sets calculated by the first user terminal and the second user terminal in the embodiment of the present disclosure can play different roles. For example, it can be applied to any application scenario such as finding common patients between different medical institutions, searching for common items in databases between different security institutions, and finding the same person in different lists without leaking other information. That is, the first privacy data set and the second privacy data set corresponding to the first user terminal and the second user terminal can be a list of people, a list of items, and an information set in different scenarios.

[0178] Figure 3 FIG. 1 is a schematic diagram showing a privacy data set intersection process according to an embodiment of the present disclosure. Figure 3 As shown, the private data set intersection process of the embodiment of the present disclosure is used to determine the intersection between the first private data set X corresponding to the first user terminal (Alice) and the second private data set Y corresponding to the second user terminal (Bob). The intersection process includes five stages: initialization stage, key generation stage, key encapsulation stage, decapsulation stage and intersection calculation stage.

[0179] Figure 4 FIG. 2 is a schematic diagram showing another process of intersecting a privacy data set according to an embodiment of the present disclosure. Figure 4 As shown, in the process of finding the intersection of the first private data set X corresponding to the first user terminal (Alice) and the second private data set Y corresponding to the second user terminal (Bob), the public parameters are generated by the first user terminal in the initialization phase. In the key generation phase, the first user terminal generates a first public key and a first public key ciphertext, and the second user terminal generates a second public key and a second public key ciphertext, and the second user terminal sends the second public key ciphertext to the first user terminal. In the key encapsulation phase, the first user terminal is used to generate a first number of ciphertext information according to the second key obtained by decrypting the second public key ciphertext. The first user terminal sends the ciphertext information and the first public key ciphertext to the second user terminal. In the decapsulation phase, the second user terminal decrypts the first public key ciphertext to obtain the first public key, and determines the first hash data set corresponding to the ciphertext information according to the first public key. In the intersection calculation phase, the second hash data set is determined according to the second private data set Y, and the intersection of the first private data set X and the second private data set Y is determined according to the intersection of the first hash data set and the second hash data set.

[0180] Based on the above technical features, the disclosed embodiment can achieve the intersection of the private data sets of the two parties participating in the intersection protocol through the key encapsulation mechanism to resist the attack of quantum computers. At the same time, the disclosed embodiment also compresses and encrypts the public keys of the two parties participating in the protocol, further reducing the communication overhead of the protocol, and the process of calculating the intersection is simple, which improves the efficiency of the entire private set intersection process.

[0181] Figure 5 A schematic diagram of a privacy set intersection device at a first user terminal side according to an embodiment of the present disclosure is shown. Figure 5 As shown, the privacy set intersection device on the first user side of the embodiment of the present disclosure includes:

[0182] A parameter generation module 50, used to generate common parameters and send the common parameters to the second user terminal;

[0183] A first public key generation module 51, configured to generate a first public key according to the public parameters, and determine a corresponding first public key ciphertext according to the first public key;

[0184] A first public key receiving module 52, configured to receive a second public key ciphertext generated by the second user terminal based on the public parameters;

[0185] A public key decryption module 53, configured to determine a second public key according to the second public key ciphertext;

[0186] A first ciphertext calculation module 54, configured to calculate a first number of ciphertext information according to a first private data set corresponding to the first user terminal and the second public key, where the first number is the number of data included in the first private data set;

[0187] The ciphertext sending module 55 is used to send the first public key ciphertext and the ciphertext information set including the first number of ciphertext information to the second user terminal, so that the second user terminal can determine the first hash data corresponding to each of the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determine the intersection of the first hash data set and the second hash data set, wherein the second hash data set includes the second hash data corresponding to each of the second privacy data in the second privacy data set corresponding to the second user terminal.

[0188] In one possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information or the second ciphertext information.

[0189] In a possible implementation, the first public key generation module 52 is further configured to:

[0190] Randomly determine a first private key and a first random vector from a central binomial distribution determined by the fifth parameter;

[0191] Obtaining a first public key by calculating the first private key and the first random vector;

[0192] Generate a corresponding first public key ciphertext based on the first public key and the sixth parameter according to a preset encryption function.

[0193] In a possible implementation, the first public key generation module 52 is further configured to:

[0194] The sum of the product of the first private key and a preset matrix and the first random vector is calculated to obtain a first public key.

[0195] In a possible implementation, the public key decryption module 53 is further used to:

[0196] The second public key of the second user terminal is determined based on the second public key ciphertext and the sixth parameter according to a preset decryption function.

[0197] In a possible implementation, the first ciphertext calculation module is further configured to:

[0198] Determine first hash data corresponding to each first privacy data in the first privacy data set;

[0199] Randomly determine a second random vector corresponding to each first privacy data from a central binomial distribution determined by the fifth parameter;

[0200] The corresponding ciphertext information is calculated according to the first hash data, the second random vector, the first private key and the second public key corresponding to each of the first privacy data.

[0201] In a possible implementation, the first ciphertext calculation module 54 is further configured to:

[0202] Determine a first intermediate parameter corresponding to each first hash data according to the decryption function and a preset constant;

[0203] Calculate a corresponding second intermediate parameter according to the first intermediate parameter corresponding to each of the first privacy data, the second random vector, the first private key, and the second public key;

[0204] The corresponding ciphertext information is determined based on the seventh parameter and the second intermediate parameter according to a preset compression function.

[0205] In a possible implementation, the first ciphertext calculation module 54 is further configured to:

[0206] Calculate the product of the first private key and the second public key to obtain a first product value;

[0207] The sum of the first intermediate parameter, the second random vector, and the first product value corresponding to each of the first privacy data is calculated to obtain the corresponding second intermediate parameter.

[0208] Figure 6 A schematic diagram of a privacy set intersection device at the second user terminal side according to an embodiment of the present disclosure is shown. Figure 6 As shown, the privacy set intersection device on the second user side of the embodiment of the present disclosure includes:

[0209] The parameter receiving module 60 is used to receive the public parameters sent by the first user terminal;

[0210] A second public key generation module 61, configured to generate a second public key according to the public parameters, and determine a corresponding second public key ciphertext according to the second public key;

[0211] A public key sending module 62, configured to send the second public key ciphertext to the first user terminal, so that the first user terminal generates a first number of ciphertext information according to the second public key ciphertext;

[0212] A second public key receiving module 63 is configured to receive a first public key ciphertext and a ciphertext information set including a first number of ciphertext information sent by the first user terminal, the first number of ciphertext information being calculated by the first user terminal according to the corresponding first private data set and the second public key, and the first number of data being included in the first private data set;

[0213] A ciphertext decryption module 64, configured to determine first hash data corresponding to each ciphertext information according to the first public key ciphertext, to obtain a first hash data set;

[0214] A data hash module 65, configured to determine second hash data corresponding to each second private data in a corresponding second private data set, to obtain a second hash data set;

[0215] The data intersection module 66 is used to calculate the intersection of the first hash data set and the second hash data set to obtain the intersection of the first private data set and the second private data set.

[0216] In one possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information and / or the second ciphertext information.

[0217] In a possible implementation, the second public key generation module 61 is further configured to:

[0218] Randomly determine a second private key and a third random vector from a central binomial distribution determined by the fifth parameter;

[0219] Calculate a second public key according to the second private key and the third random vector;

[0220] Generate a corresponding second public key ciphertext based on the second public key and the sixth parameter according to a preset encryption function.

[0221] In a possible implementation, the second public key generation module 61 is further configured to:

[0222] The sum of the product of the second private key and a preset matrix and the third random vector is calculated to obtain a second public key.

[0223] In a possible implementation, the ciphertext decryption module 64 is further configured to:

[0224] Determine the first public key of the first client based on the first public key ciphertext and the sixth parameter according to a preset decryption function;

[0225] Determine a corresponding fourth intermediate parameter based on each of the ciphertext information and the seventh parameter according to the decryption function;

[0226] Determine first hash data according to the fourth intermediate parameter, the first public key, and the second private key to obtain a first hash data set including a first number of first hash data.

[0227] In a possible implementation, the ciphertext decryption module 64 is further configured to:

[0228] Determine a third intermediate parameter according to the fourth intermediate parameter, the first public key and the second private key;

[0229] The corresponding first hash data is determined according to the encryption function based on the third intermediate parameter and a preset constant to obtain a first hash data set including a first number of first hash data.

[0230] In a possible implementation, the ciphertext decryption module 64 is further configured to:

[0231] Calculate the product of the first public key and the second private key to obtain a second product value;

[0232] A difference between the fourth intermediate parameter and the second product value is calculated to obtain a third intermediate parameter.

[0233] In a possible implementation, the data hash module 65 is further configured to:

[0234] The second hash data corresponding to each second privacy data is determined according to a preset hash function to obtain a second hash data set.

[0235] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0236] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0237] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0238] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0239] Figure 7 A schematic diagram of an electronic device 800 according to an embodiment of the present disclosure is shown. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0240] Reference Figure 7 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0241] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0242] The memory 804 is configured to store various types of data to support operations on the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0243] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0244] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the electronic device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0245] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0246] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0247] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the electronic device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0248] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0249] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0250] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 804 including computer program instructions, which can be executed by a processor 820 of an electronic device 800 to perform the above method.

[0251] Figure 8 1 is a schematic diagram showing another electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Figure 8 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0252] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0253] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0254] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0255] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the foregoing. As used herein, a computer-readable storage medium is not to be interpreted as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0256] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0257] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.

[0258] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0259] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0260] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0261] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0262] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A privacy set intersection method, applied to a first user terminal, characterized in that: The method comprises: Generate public parameters, and send the public parameters to the second user terminal; Generate a first public key according to the public parameters, and determine a corresponding first public key ciphertext according to the first public key; Receiving a second public key ciphertext generated by the second client based on the public parameters; Determine a second public key according to the second public key ciphertext; Calculate a first number of ciphertext information according to a first private data set corresponding to the first client and the second public key, where the first number is the number of data included in the first private data set; The first public key ciphertext and a ciphertext information set including the first number of ciphertext information are sent to the second user terminal, so that the second user terminal determines the first hash data corresponding to each of the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determines the intersection of the first hash data set and the second hash data set, wherein the second hash data set includes the second hash data corresponding to each of the second privacy data in the second privacy data set corresponding to the second user terminal.

2. The method according to claim 1, characterized in that The public parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information or the second ciphertext information.

3. The method according to claim 2, characterized in that The generating a first public key according to the public parameter, and determining a corresponding first public key ciphertext according to the first public key, includes: Randomly determine a first private key and a first random vector from a central binomial distribution determined by the fifth parameter; Obtaining a first public key by calculating the first private key and the first random vector; Generate a corresponding first public key ciphertext based on the first public key and the sixth parameter according to a preset encryption function.

4. The method according to claim 3, characterized in that The calculating the first public key according to the first private key and the first random vector includes: The sum of the product of the first private key and a preset matrix and the first random vector is calculated to obtain a first public key.

5. The method according to claim 1, characterized in that The determining the second public key according to the second public key ciphertext includes: The second public key of the second user terminal is determined based on the second public key ciphertext and the sixth parameter according to a preset decryption function.

6. The method according to at least one of claims 2 to 4, characterized in that The calculating a first number of ciphertext information according to a first private data set corresponding to the first user terminal and the second public key includes: Determine first hash data corresponding to each first privacy data in the first privacy data set; Randomly determine a second random vector corresponding to each first privacy data from a central binomial distribution determined by the fifth parameter; The corresponding ciphertext information is calculated according to the first hash data, the second random vector, the first private key and the second public key corresponding to each of the first privacy data.

7. The method according to claim 6, characterized in that The calculating corresponding ciphertext information according to the first hash data corresponding to each of the first privacy data, the second random vector, the first private key, and the second public key includes: Determine a first intermediate parameter corresponding to each first hash data according to the decryption function and a preset constant; Calculate a corresponding second intermediate parameter according to the first intermediate parameter corresponding to each of the first privacy data, the second random vector, the first private key, and the second public key; The corresponding ciphertext information is determined based on the seventh parameter and the second intermediate parameter according to a preset compression function.

8. The method according to claim 7, characterized in that The calculating the corresponding second intermediate parameter according to the first intermediate parameter corresponding to each of the first privacy data, the second random vector, the first private key, and the second public key includes: Calculate the product of the first private key and the second public key to obtain a first product value; The sum of the first intermediate parameter, the second random vector, and the first product value corresponding to each of the first privacy data is calculated to obtain the corresponding second intermediate parameter.

9. A privacy set intersection method, applied to a second user terminal, characterized in that: The method comprises: Receiving public parameters sent by the first user terminal; Generate a second public key according to the public parameters, and determine a corresponding second public key ciphertext according to the second public key; Sending the second public key ciphertext to the first client, so that the first client generates a first number of ciphertext information according to the second public key ciphertext; Receiving a first public key ciphertext and a ciphertext information set including a first number of ciphertext information sent by the first user terminal, where the first number of ciphertext information is calculated by the first user terminal according to the corresponding first private data set and the second public key, and the first number of data is the number of data included in the first private data set; Determine the first hash data corresponding to each ciphertext information according to the first public key ciphertext to obtain a first hash data set; Determine the second hash data corresponding to each of the second private data in the corresponding second private data set to obtain a second hash data set; An intersection of the first hash data set and the second hash data set is calculated to obtain an intersection of the first private data set and the second private data set.

10. The method according to claim 9, characterized in that The public parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter, a sixth parameter and a seventh parameter, the first parameter and the second parameter are used to limit the dimension of a preset matrix and / or a polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating a random vector, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter and the seventh parameter are used to encrypt and / or decrypt the first ciphertext information and / or the second ciphertext information.

11. The method according to claim 10, characterized in that The generating a second public key according to the public parameter, and determining a corresponding second public key ciphertext according to the second public key, includes: Randomly determine a second private key and a third random vector from a central binomial distribution determined by the fifth parameter; Calculate a second public key according to the second private key and the third random vector; Generate a corresponding second public key ciphertext based on the second public key and the sixth parameter according to a preset encryption function.

12. The method according to claim 11, characterized in that The calculating the second public key according to the second private key and the third random vector includes: The sum of the product of the second private key and a preset matrix and the third random vector is calculated to obtain a second public key.

13. The method according to at least one of claims 10 to 12, characterized in that The determining, according to the first public key ciphertext, first hash data corresponding to each ciphertext information to obtain a first hash data set includes: Determine the first public key of the first client based on the first public key ciphertext and the sixth parameter according to a preset decryption function; Determine a corresponding fourth intermediate parameter based on each of the ciphertext information and the seventh parameter according to the decryption function; Determine first hash data according to the fourth intermediate parameter, the first public key, and the second private key to obtain a first hash data set including a first number of first hash data.

14. The method according to claim 13, characterized in that The determining of the first hash data according to the fourth intermediate parameter, the first public key and the second private key to obtain a first hash data set including a first number of first hash data includes: Determine a third intermediate parameter according to the fourth intermediate parameter, the first public key and the second private key; The corresponding first hash data is determined according to the encryption function based on the third intermediate parameter and a preset constant to obtain a first hash data set including a first number of first hash data.

15. The method according to claim 14, characterized in that The determining a third intermediate parameter according to the fourth intermediate parameter, the first public key, and the second private key includes: Calculate the product of the first public key and the second private key to obtain a second product value; A difference between the fourth intermediate parameter and the second product value is calculated to obtain a third intermediate parameter.

16. The method according to claim 14 or 15, characterized in that The determining the second hash data corresponding to each second private data in the corresponding second private data set to obtain the second hash data set includes: The second hash data corresponding to each second privacy data is determined according to a preset hash function to obtain a second hash data set.

17. A privacy set intersection device, applied to a first user terminal, characterized in that: The device comprises: A parameter generation module, used to generate common parameters and send the common parameters to the second user terminal; A first public key generation module, used to generate a first public key according to the public parameters, and determine a corresponding first public key ciphertext according to the first public key; A first public key receiving module, used to receive a second public key ciphertext generated by the second user terminal based on the public parameters; A public key decryption module, used to determine the second public key according to the second public key ciphertext; A first ciphertext calculation module, configured to calculate a first number of ciphertext information according to a first private data set corresponding to the first user terminal and the second public key, where the first number is the number of data included in the first private data set; A ciphertext sending module is used to send the first public key ciphertext and a ciphertext information set including the first number of ciphertext information to the second user terminal, so that the second user terminal can determine the first hash data corresponding to each of the ciphertext information according to the first public key ciphertext to obtain a first hash data set, and determine the intersection of the first hash data set and the second hash data set, wherein the second hash data set includes the second hash data corresponding to each of the second privacy data in the second privacy data set corresponding to the second user terminal.

18. A privacy set intersection device, applied to a second user terminal, characterized in that: The device comprises: A parameter receiving module, used for receiving the public parameters sent by the first user terminal; A second public key generation module, used to generate a second public key according to the public parameters, and determine a corresponding second public key ciphertext according to the second public key; A public key sending module, used for sending the second public key ciphertext to the first user terminal, so as to generate a first number of ciphertext information according to the second public key ciphertext through the first user terminal; A second public key receiving module is configured to receive a first public key ciphertext and a ciphertext information set including a first number of ciphertext information sent by the first user terminal, the first number of ciphertext information being calculated by the first user terminal according to the corresponding first private data set and the second public key, and the first number of data being included in the first private data set; A ciphertext decryption module, used to determine the first hash data corresponding to each ciphertext information according to the first public key ciphertext, to obtain a first hash data set; A data hash module, used to determine second hash data corresponding to each second private data in a corresponding second private data set, to obtain a second hash data set; The data intersection module is used to calculate the intersection of the first hash data set and the second hash data set to obtain the intersection of the first private data set and the second private data set.

19. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to implement the method described in any one of claims 1 to 16 when executing the instructions stored in the memory.

20. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 16 is implemented.