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

By using the key encapsulation mechanism to encrypt and encapsulate the public key in the quantum computing environment, the problem that the existing technology cannot resist quantum computer attacks is solved, and the secure and efficient intersection calculation of private data sets is achieved.

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

Patent Information

Application Number
CN202310492307.7
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

The existing privacy set interception protocol constructed by the public key encryption system cannot resist quantum computer attacks and cannot use the key encapsulation mechanism, resulting in security and efficiency problems.

Method used

By generating public parameters, calculating the public key, and encrypting the public key using the key encapsulation mechanism, ensuring that the intersection calculation of the privacy data set is performed in the quantum computing environment, reducing the number of communications and improving efficiency.

Benefits of technology

It realizes safe and efficient intersection calculation of private data sets in a quantum computing environment, resists quantum computer attacks, and improves the security and efficiency of the entire process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118900173A_ABST
    Figure CN118900173A_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 and a second public key according to the public parameters respectively and exchange the first public key and the second public key. The first user side calculates a first number of pieces of first ciphertext information according to the first private data set and the second public key, and the second user side calculates a second number of pieces of first ciphertext information according to the corresponding second private data set and the first public key. And the first user side sends the first ciphertext information to the second user side, and the second user side determines an intersection of the first ciphertext information and the second ciphertext information. According to the disclosure, the private data set information of the two parties participating in the intersection protocol is encrypted and packaged through the key packaging 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;

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

[0008] Calculate a first number of first 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;

[0009] The first public key and a first ciphertext information set including the first number of first ciphertext information are sent to the second user terminal, so as to determine, through the second user terminal, an intersection of the first ciphertext information set and a second ciphertext information set including a second number of second ciphertext information, where the second number of second ciphertext information is calculated by the second user terminal based on the corresponding second private data set and the first public key, and the second number is the number of data included in the second private data set.

[0010] In a possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter and a sixth 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 second ciphertext information, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter is used to encrypt and / or decrypt the first ciphertext information and the second ciphertext information.

[0011] In a possible implementation manner, generating a first public key according to the public parameter includes:

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

[0013] A first public key is calculated according to the first private key and the first random vector.

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

[0015] 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.

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

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

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

[0019] The corresponding first 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.

[0020] In a possible implementation, the calculating corresponding first 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:

[0021] Determine the first intermediate parameter corresponding to each first hash data based on the third parameter according to a preset decompression function;

[0022] 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;

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

[0024] 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:

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

[0026] 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.

[0027] In a possible implementation, determining the first intermediate parameter corresponding to each first hash data based on the third parameter according to a preset decompression function includes:

[0028] The product of each of the first hash data and one-half of the third parameter is calculated according to a preset decompression function, and the integer closest to the obtained result is taken to obtain the corresponding first intermediate parameter.

[0029] 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:

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

[0031] Generate a second public key according to the public parameters, and send it to the first user terminal;

[0032] receiving a first public key and a first ciphertext information set including a first number of first ciphertext information sent by the first client, where the first public key is generated by the first client based on the public parameter, and the first number of first ciphertext information is calculated by the first client based on the corresponding first private data set and the second public key, where the first number is the number of data included in the first private data set;

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

[0034] An intersection of the first ciphertext information set and the second ciphertext information set is calculated to obtain an intersection of the first private data set and the second private data set.

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

[0036] In a possible implementation manner, generating the second public key according to the public parameter includes:

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

[0038] A second public key is calculated according to the second private key and the third random vector.

[0039] 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:

[0040] 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.

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

[0042] Determine second hash data corresponding to each second private data in the second private data set;

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

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

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

[0046] Determine the third intermediate parameter corresponding to each of the second hash data based on the third parameter according to a preset decompression function;

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

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

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

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

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

[0052] In a possible implementation, determining the third intermediate parameter corresponding to each of the second hash data based on the third parameter according to a preset decompression function includes:

[0053] The product of each of the second hash data and one-half of the third parameter is calculated according to a preset decompression function, and the nearest integer to the obtained result is taken to obtain the corresponding third intermediate parameter.

[0054] 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:

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

[0056] A first public key generation module, used to generate a first public key according to the public parameters;

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

[0058] A first ciphertext calculation module, configured to calculate a first number of first 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;

[0059] A ciphertext sending module is used to send the first public key and a first ciphertext information set including the first number of first ciphertext information to the second user terminal, so as to determine the intersection of the first ciphertext information set and a second ciphertext information set including a second number of second ciphertext information through the second user terminal, where the second number of second ciphertext information is calculated by the second user terminal based on the corresponding second private data set and the first public key, and the second number is the number of data included in the second private data set.

[0060] In a possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter and a sixth 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 second ciphertext information, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter is used to encrypt and / or decrypt the first ciphertext information and the second ciphertext information.

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

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

[0063] A first public key is calculated according to the first private key and the first random vector.

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

[0065] 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.

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

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

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

[0069] The corresponding first 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.

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

[0071] Determine the first intermediate parameter corresponding to each first hash data based on the third parameter according to a preset decompression function;

[0072] 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;

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

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

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

[0076] 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.

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

[0078] The product of each of the first hash data and one-half of the third parameter is calculated according to a preset decompression function, and the integer closest to the obtained result is taken to obtain the corresponding first intermediate parameter.

[0079] 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:

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

[0081] A second public key generation module, used to generate a second public key according to the public parameters, and send it to the first user terminal;

[0082] A second public key receiving module is configured to receive a first public key and a first ciphertext information set including a first number of first ciphertext information sent by the first user terminal, wherein the first public key is generated by the first user terminal based on the public parameter, and the first number of first ciphertext information is calculated by the first user terminal based on the corresponding first private data set and the second public key, and the first number is the number of data included in the first private data set;

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

[0084] The intersection determination module is used to calculate the intersection of the first ciphertext information set and the second ciphertext information set to obtain the intersection of the first private data set and the second private data set.

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

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

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

[0088] A second public key is calculated according to the second private key and the third random vector.

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

[0090] 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.

[0091] In a possible implementation, the second ciphertext calculation module is further used to:

[0092] Determine second hash data corresponding to each second private data in the second private data set;

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

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

[0095] In a possible implementation, the second ciphertext calculation module is further used to:

[0096] Determine the third intermediate parameter corresponding to each of the second hash data based on the third parameter according to a preset decompression function;

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

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

[0099] In a possible implementation, the second ciphertext calculation module is further used to:

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

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

[0102] In a possible implementation, the second ciphertext calculation module is further used to:

[0103] The product of each of the second hash data and one-half of the third parameter is calculated according to a preset decompression function, and the nearest integer to the obtained result is taken to obtain the corresponding third intermediate parameter.

[0104] 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.

[0105] 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.

[0106] 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.

[0107] In an embodiment of the present disclosure, a public parameter is generated by a first user terminal and sent to a second user terminal. The first user terminal and the second user terminal respectively generate a first public key and a second public key according to the public parameter and exchange them. The first user terminal calculates a first number of first ciphertext information according to the first private data set and the second public key, and the second user terminal calculates a second number of first ciphertext information according to the corresponding second private data set and the first public key. The first user terminal sends the first ciphertext information to the second user terminal, and the second user terminal determines the intersection of the first ciphertext information and the second ciphertext information. 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 the attack of quantum computers. At the same time, the process of calculating the intersection is simple and the number of communications is small, which improves the efficiency of the entire private set intersection process.

[0108] 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

[0109] 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.

[0110] 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;

[0111] 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;

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

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

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

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

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

[0117] 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.

[0118] 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.

[0119] 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 subject matter of the present disclosure.

[0120] 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.

[0121] 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.

[0122] Figure 1 A 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-S50.

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

[0124] 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 corresponding first private data sets 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 private set intersection calculation based on public parameters to find the intersection X∩Y of the first private data set and the second private data set.

[0125] 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 η, and a sixth 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 the second ciphertext information, and the fifth parameter ψ η The sixth parameter d can be the parameter of the central binomial distribution. k It can be a parameter for encrypting and / or decrypting the first ciphertext information and the second ciphertext information.

[0126] Step S20: Generate a first public key according to the public parameters.

[0127] In a possible implementation, the first user terminal determines the public parameter PP = {m, k, q, λ, ψ η , d K}, the first public key P can be generated according to the public parameters A Among them, the first user terminal can first generate a first private key S according to the public parameters A , and then according to the first private key S A Generate the corresponding first public key P A , the first private key S A The central binomial distribution ψ generated according to the fifth parameter η Exemplarily, the first user terminal generates the first public key by randomly determining the first private key S from the central binomial distribution determined by the fifth parameter. A and the first random vector e A, and then according to the first private key S A and the first random vector e A Calculate the first public key P A .

[0128] Optionally, the first user terminal uses the first private key S A and the first random vector e A Calculate the first public key P A The process can be used to calculate the first private key S A The product of the preset matrix A and the first random vector e A The sum of , get the first public key P A ←AS A +e A .

[0129] Furthermore, in the embodiment of the present disclosure, the process in which the first user terminal randomly selects the first private key and the first random vector, and then generates the first public key according to the randomly selected first private key and the first random vector 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.

[0130] Step S30: Receive a second public key generated by the second client based on the public parameters.

[0131] In a possible implementation, upon receiving the public parameter PP={m, k, q, λ, ψ η , d K}, the corresponding second public key P can also be generated according to the public parameters B After generating the second public key, the second user terminal may send the second public key to the first user terminal for the next calculation process in the protocol. The process by which the second user terminal generates the second public key based on the public parameters may be the same as the process by which the first user terminal generates the first public key based on the public parameters. For example, when the first user terminal calls the encapsulated key generation algorithm KEM.Gen() to generate the first public key, the second user terminal may also call the key generation algorithm KEM.Gen() based on the received public parameters to generate the second public key P B .

[0132] Optionally, similar to the first client, the second client may also generate a second private key S B , then based on the second private key S B Generate the second public key P B , the first private key S B The central binomial distribution ψ generated according to the fifth parameter ηExemplarily, the second user terminal generates the second public key by randomly determining the second private key S from the central binomial distribution determined by the fifth parameter. B and the third random vector e B , and then according to the second private key S B and the third random vector e B Calculate the second public key P B The second user terminal uses the second private key S B and the third random vector e B Calculate the second public key P B The process can be used to calculate the second private key S B The product of the preset matrix A and the third random vector e B The sum of the two gets the second public key P B .

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

[0134] In a possible implementation, after receiving the second public key generated by the second user terminal, the first user terminal compresses and encrypts each first private data in the first private data set according to the second public key to obtain the corresponding first ciphertext information. Therefore, the first user terminal can calculate and generate a first number of first ciphertext information according to the 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.

[0135] Optionally, the first user terminal may first use a preset hash function to hash each first private data x in the first private data set X. i (i∈[1, n1]) is hashed to obtain the corresponding first hash data H1(x i ). Further based on each first hash data H1(x i ) performs encryption compression calculation to obtain the first ciphertext information corresponding to the first private data. Specifically, the first user terminal may first determine that each first private data x in the first private data set i The corresponding first hash data H1(x i ). Then the central binomial distribution ψ is determined from the fifth parameter η Each first private data x is randomly determined in i The corresponding second random vector According to each first privacy data x i The corresponding first hash data H1(x i ), the second random vector And the first private key S A and the second public key P BCalculate the corresponding first ciphertext information

[0136] Furthermore, the first user terminal can use a preset decompression function Decompress q (·) and the compression function compress q (·) Based on the first hash data H1(x i ), the second random vector And the first private key S A and the second public key P B Determine the corresponding first ciphertext information Exemplarily, the first user terminal may use a preset decompression function Decompress q (·) Determine each first hash data H1(x) based on the third parameter q i ) corresponds to the first intermediate parameter K i . According to each first private data x i The corresponding first intermediate parameter K i , the second random vector And the first private key S A and the second public key P B Calculate the corresponding second intermediate parameter Then according to the preset compression function compress q (·) Based on the sixth parameter d k and the second intermediate parameter Determine the corresponding first ciphertext information That is, the first user terminal can use the first hash data and a preset constant 1 as the input of the decompression function to obtain the corresponding first intermediate parameter K i ←Decompress q (H1(x i ), 1), the compression function can use the second intermediate parameter and the sixth parameter as the input of the compression function to obtain the corresponding first ciphertext information The decompression function can be calculated by calculating each first hash data H1(x i ) and half of the third parameter q, and then take the result to the nearest integer to get the corresponding first intermediate parameter K i ←Decompress q (H1(x i ), 1), where the decompression function is m i =H1(x i ).

[0137] Optionally, the first user terminal calculates the second intermediate parameter by first calculating the first private key S Aand the second public key P B The product of gets the first product value P B S A . Then calculate each first private data x i The corresponding first intermediate parameter K i , the second random vector and the first product value P B S A The sum of the corresponding second intermediate parameters

[0138] In a possible implementation, in the disclosed embodiment, the first user terminal compresses and encrypts each first private data in the first private data set according to the second public key, and the process of obtaining the corresponding first ciphertext information can be encapsulated as a key encapsulation algorithm KEM.enc(). In actual application, the first user terminal can directly call the key encapsulation algorithm to generate the first number of first ciphertext information.

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

[0140] In a possible implementation, when the first user terminal generates a first public key and a first number of first ciphertext information, the first ciphertext information may be packaged to obtain a first ciphertext information set. The first public key and the first ciphertext information set are further sent to the second user terminal. The second user terminal calculates the second ciphertext information based on the received first public key to obtain the second ciphertext information set C B , and obtain the intersection of the first private data set and the second private data set by calculating the intersection of the first ciphertext information set and the second ciphertext information set.

[0141] Optionally, after receiving the first public key, the second user terminal can compress and encrypt each second private data in the second private data set based on the first public key to obtain a second number of second ciphertext information, where the second number is the number of data included in the second private data. The process by which the second user terminal compresses and encrypts the second private data based on the first public key is similar to the process by which the first user terminal compresses and encrypts the first private data based on the second public key. Exemplarily, when the compression and encryption process can be encapsulated as a key encapsulation algorithm KEM.enc(), the second user terminal can obtain a second number of second ciphertext information directly based on the first public key and the second private data by calling the key encapsulation algorithm.

[0142] Optionally, the second user terminal may first use a preset hash function to hash each second private data y in the second private data set Y. j(j∈[1, n2]) is hashed to obtain the corresponding second hash data H1(y j ). Then, encryption compression calculation is further performed based on each second hash data to obtain second ciphertext information corresponding to the second private data. Specifically, the second user terminal can first determine each second private data y in the second private data set. j The corresponding second hash data H1(y j ). Then the central binomial distribution ψ is determined from the fifth parameter η Each second private data y is randomly determined in j The corresponding fourth random vector According to each second privacy data y j The corresponding second hash data, the fourth random vector, and the second private key S B and the first public key P A Calculate the corresponding second ciphertext information

[0143] Furthermore, the second user terminal can use a preset decompression function Decompress q (·) and the compression function Conpress q (·) Based on the second hash data H1(y j ), the fourth random vector And the second private key S B and the first public key P B Determine the corresponding second ciphertext information Exemplarily, the second user terminal may use a preset decompression function Decompress q (·) Determine each second hash data H1(y) based on the third parameter q j ) corresponds to the third intermediate parameter K j . According to each second privacy data y j The corresponding third intermediate parameter K j , the fourth random vector And the second private key S B and the first public key P A Calculate the corresponding fourth intermediate parameter Then according to the preset compression function Compress q (·) Based on the sixth parameter d k and the fourth intermediate parameter Determine the corresponding second ciphertext information That is, the second user terminal can use the second hash data and a preset constant 1 as the input of the decompression function to obtain the corresponding third intermediate parameter K j ←Decompress q (H1(y j), 1), the compression function can use the fourth intermediate parameter and the sixth parameter as the input of the compression function to obtain the corresponding second ciphertext information The decompression function can be calculated by calculating each second hash data H1(y j ) and half of the third parameter q to obtain the corresponding third intermediate parameter K j ←Decompress q (H1(y j ), 1), where

[0144] Optionally, the second user terminal calculates the fourth intermediate parameter by first calculating the second private key S B and the first public key P A The product of gets the second product value P A S B . Then calculate each second private data y j The third intermediate parameter K corresponding to (j∈[1,n2]) j , the fourth random vector and the second product value P A S B The sum of the corresponding fourth intermediate parameters

[0145] After determining the first ciphertext information sent by the first user terminal and the second ciphertext information set generated by the second user terminal, the second user terminal can directly obtain the intersection of the first private data set X and the second private data set Y by calculating the intersection of the first ciphertext information set and the second ciphertext information set.

[0146] 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.

[0147] Based on the above technical features, the disclosed embodiment can use the key encapsulation mechanism to allow the two parties participating in the intersection protocol to perform encryption encapsulation according to the public key generated by the other party to resist the attack of quantum computers. At the same time, the process of calculating the intersection in the disclosed embodiment is simple to calculate, and the first public key of the first user terminal is sent to the second user terminal together after the first ciphertext information is calculated, which reduces the number of communications in the entire intersection calculation process and improves the efficiency of the entire privacy set intersection process.

[0148] 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'-S50'.

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

[0150] 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 corresponding first private data sets 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.

[0151] 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 ψ η and the sixth 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 the second ciphertext information, and the fifth parameter can be a central binomial distribution ψ η Parameters, the sixth parameter d k It can be a parameter for encrypting and / or decrypting the first ciphertext information and the second ciphertext information.

[0152] Step S20': Generate a second public key according to the public parameters, and send it to the first user terminal.

[0153] In a possible implementation, upon receiving the public parameter PP={m, k, q, λ, ψ η , d K}, the corresponding second public key P can be generated according to the public parameters BThe process of the second user end generating the second public key based on the public parameters may be the same as the process of the first user end generating the first public key based on the public parameters in step S20. For example, when the first user end calls the encapsulated key generation algorithm KEM.Gen() to generate 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 P B .

[0154] Optionally, similar to the first client, the second client may also generate a second private key S B , then based on the second private key S B Generate the second public key P B , the first private key S B The central binomial distribution ψ generated according to the fifth parameter η Exemplarily, the second user terminal generates the second public key by randomly determining the second private key S from the central binomial distribution determined by the fifth parameter. B and the third random vector e B , and then according to the second private key S B and the third random vector e B Calculate the second public key P B The second user terminal uses the second private key S B and the third random vector e B Calculate the second public key P B The process can be used to calculate the second private key S B The product of the preset matrix A and the third random vector e B The sum of the two gets the second public key P B ←As B +e B .

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

[0156] In a possible implementation, after receiving the second public key sent by the second user end, the first user end compresses and encrypts each first private data in the first private data set according to the second public key to obtain the corresponding first ciphertext information. That is, the first user end can calculate and generate a first number of first ciphertext information according to the first private data set corresponding to the first user end and the second public key, where the first number is the number of data included in the first private data set. After generating the first public key and the first number of first ciphertext information, the first user end can package the first ciphertext information to obtain the first ciphertext information set. The first public key and the first ciphertext information set are further sent to the second user terminal.

[0157] Optionally, the process of generating the first ciphertext information by the first user terminal may be to first perform a hash operation on each first private data x in the first private data set X using a preset hash function. i (i∈[1, n1]) is hashed to obtain the corresponding first hash data H1(x i ). Further based on each first hash data H1(x i ) performs encryption compression calculation to obtain the first ciphertext information corresponding to the first private data. Specifically, the first user terminal may first determine that each first private data x in the first private data set i The corresponding first hash data H1(x i ). Then the central binomial distribution ψ is determined from the fifth parameter η Each first private data x is randomly determined in i The corresponding second random vector According to each first privacy data x i The corresponding first hash data H1(x i ), the second random vector And the first private key S A and the second public key P B Calculate the corresponding first ciphertext information

[0158] Furthermore, the first user terminal can use a preset decompression function Decompress q (·) and the compression function Compress q (·) Based on the first hash data H1(x i ), the second random vector And the first private key S A and the second public key P B Determine the corresponding first ciphertext information Exemplarily, the first user terminal may use a preset decompression function Decompress q (·) Determine each first hash data H1(x) based on the third parameter q i ) corresponds to the first intermediate parameter K i . According to each first private data x i The corresponding first intermediate parameter K i , the second random vector And the first private key S A and the second public key P B Calculate the corresponding second intermediate parameter Then according to the preset compression function Compress q (·) Based on the sixth parameter d k and the second intermediate parameter Determine the corresponding first ciphertext information That is, the first user terminal can use the first hash data and a preset constant 1 as the input of the decompression function to obtain the corresponding first intermediate parameter K i ←Decompress q (H1(x i ), 1), the compression function can use the second intermediate parameter and the sixth parameter as the input of the compression function to obtain the corresponding first ciphertext information The decompression function can be calculated by calculating each first hash data H1(x i ) and half of the third parameter q to obtain the corresponding first intermediate parameter K i ←Decompress q (H1(x i ),1),

[0159] Optionally, the first user terminal calculates the second intermediate parameter by first calculating the first private key S A and the second public key P B The product of gets the first product value P B S A . Then calculate each first private data x i The corresponding first intermediate parameter K i , the second random vector and the first product value P B S A The sum of the corresponding second intermediate parameters

[0160] In a possible implementation, in the disclosed embodiment, the first user terminal compresses and encrypts each first private data in the first private data set according to the second public key, and the process of obtaining the corresponding first ciphertext information can be encapsulated as a key encapsulation algorithm KEM.enc(). In actual application, the first user terminal can directly call the key encapsulation algorithm to generate the first number of first ciphertext information.

[0161] Step S40': calculate a second number of second ciphertext information according to a second private data set corresponding to the second user terminal and the first public key.

[0162] In one possible implementation, after receiving the first public key, the second user terminal can compress and encrypt each second private data in the second private data set based on the first public key to obtain a second number of second ciphertext information, where the second number is the number of data included in the second private data. The process by which the second user terminal compresses and encrypts the second private data based on the first public key is similar to the process by which the first user terminal compresses and encrypts the first private data based on the second public key. Exemplarily, when the compression and encryption process can be encapsulated as a key encapsulation algorithm KEM.enc(), the second user terminal can obtain a second number of second ciphertext information directly based on the first public key and the second private data by calling the key encapsulation algorithm.

[0163] Optionally, the second user terminal may first use a preset hash function to hash each second private data y in the second private data set Y. j (j∈[1, n2]) is hashed to obtain the corresponding second hash data H1(y j ). Then, encryption compression calculation is further performed based on each second hash data to obtain second ciphertext information corresponding to the second private data. Specifically, the second user terminal can first determine each second private data y in the second private data set. j The corresponding second hash data H1(y j ). Then the central binomial distribution ψ is determined from the fifth parameter η Each second private data y is randomly determined in j The corresponding fourth random vector According to each second privacy data y j The corresponding second hash data, the fourth random vector, and the second private key S B and the first public key P A Calculate the corresponding second ciphertext information

[0164] Furthermore, the second user terminal can use a preset decompression function Decompress q (·) and the compression function Compress q (·) Based on the second hash data H1(y j ), the fourth random vector And the second private key S B and the first public key P B Determine the corresponding second ciphertext information Exemplarily, the second user terminal may use a preset decompression function Decompress q (·) Determine each second hash data H1(y) based on the third parameter q j ) corresponds to the third intermediate parameter K j . According to each second privacy data yj The corresponding third intermediate parameter K j , the fourth random vector And the second private key S B and the first public key P A Calculate the corresponding fourth intermediate parameter Then according to the preset Compress q (·) Based on the sixth parameter d k and the fourth intermediate parameter Determine the corresponding second ciphertext information That is, the second user terminal can use the second hash data and a preset constant 1 as the input of the decompression function to obtain the corresponding third intermediate parameter K j ←Decompress q (H1(y j ), 1), the compression function can use the fourth intermediate parameter and the sixth parameter as the input of the compression function to obtain the corresponding second ciphertext information The decompression function can be calculated by calculating each second hash data H1(y j ) and half of the third parameter q to obtain the corresponding third intermediate parameter K j ←Decompress q (H1(y j ), 1), where

[0165] Optionally, the second user terminal calculates the fourth intermediate parameter by first calculating the second private key S B and the first public key P A The product of gets the second product value P A S B . Then calculate each second private data x i The corresponding third intermediate parameter K j , the fourth random vector and the second product value P A S B The sum of the corresponding fourth intermediate parameters

[0166] Step S50: Calculate the intersection of the first ciphertext information set and the second ciphertext information set to obtain the intersection of the first private data set and the second private data set.

[0167] In a possible implementation, after determining the first ciphertext information sent by the first user terminal and the second ciphertext information set generated by the second user terminal, the second user terminal can directly obtain the intersection of the first private data set X and the second private data set Y by calculating the intersection of the first ciphertext information set and the second ciphertext information set.

[0168] 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.

[0169] 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 first user terminal Alice has a corresponding first private data set, and the second user terminal Bob has a corresponding second private data set. In the case where the intersection of the first private data set and the second private data set needs to be calculated, the first user terminal and the second user terminal can complete the intersection calculation process through four stages: initialization stage, key generation stage, key encapsulation stage and intersection calculation stage. Among them, the initialization stage is initialized by the first user terminal to generate multiple public parameters. In the key generation stage, the first user terminal and the second user terminal respectively generate a first public key and a second public key based on the public parameters, and the first user terminal receives the second public key. In the key encapsulation stage, the first user terminal compresses and encrypts the first private data in the first private data set based on the second public key, and the first user terminal sends the first public key and the first ciphertext information set obtained by compression and encryption to the second user terminal. The second user terminal compresses and encrypts the second private data in the second private data set based on the first public key to obtain the second ciphertext information set. In the intersection calculation stage, the second user terminal calculates the intersection of the first ciphertext information set and the second ciphertext information set to obtain the intersection of the first private data set and the second private data set.

[0170] Based on the above technical features, the disclosed embodiment can use the key encapsulation mechanism to allow the two parties participating in the intersection protocol to perform encryption encapsulation according to the public key generated by the other party to resist the attack of quantum computers. At the same time, the process of calculating the intersection in the disclosed embodiment is simple to calculate, and the first public key of the first user terminal is sent to the second user terminal together after the first ciphertext information is calculated, which reduces the number of communications in the entire intersection calculation process and improves the efficiency of the entire privacy set intersection process.

[0171] Figure 4 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 4As shown, the privacy set intersection device on the first user side of the embodiment of the present disclosure may include a parameter generation module 40, a first public key generation module 41, a first public key receiving module 42, a first ciphertext calculation module 43 and a ciphertext sending module 44.

[0172] A parameter generation module 40, configured to generate common parameters and send the common parameters to the second user terminal;

[0173] A first public key generating module 41, configured to generate a first public key according to the public parameters;

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

[0175] A first ciphertext calculation module 43, configured to calculate a first number of first 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;

[0176] The ciphertext sending module 44 is used to send the first public key and the first ciphertext information set including the first number of first ciphertext information to the second user terminal, so as to determine the intersection of the first ciphertext information set and the second ciphertext information set including the second number of second ciphertext information through the second user terminal, where the second number of second ciphertext information is calculated by the second user terminal based on the corresponding second private data set and the first public key, and the second number is the number of data included in the second private data set.

[0177] In a possible implementation, the common parameters include a first parameter, a second parameter, a third parameter, a fourth parameter, a fifth parameter and a sixth 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 second ciphertext information, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter is used to encrypt and / or decrypt the first ciphertext information and the second ciphertext information.

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

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

[0180] A first public key is calculated according to the first private key and the first random vector.

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

[0182] 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.

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

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

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

[0186] The corresponding first 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.

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

[0188] Determine the first intermediate parameter corresponding to each first hash data based on the third parameter according to a preset decompression function;

[0189] 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;

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

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

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

[0193] 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.

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

[0195] The product of each of the first hash data and one-half of the third parameter is calculated according to a preset decompression function, and the integer closest to the obtained result is taken to obtain the corresponding first intermediate parameter.

[0196] Figure 5 A schematic diagram of a privacy set intersection device on the second user side according to an embodiment of the present disclosure is shown. Figure 5As shown, the privacy set intersection device on the second user side of the embodiment of the present disclosure may include a parameter receiving module 50, a second public key generating module 51, a second public key receiving module 52, a second ciphertext calculating module 53 and an intersection determining module 54.

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

[0198] A second public key generation module 51, configured to generate a second public key according to the public parameters, and send the second public key to the first user terminal;

[0199] A second public key receiving module 52 is configured to receive a first public key and a first ciphertext information set including a first number of first ciphertext information sent by the first user terminal, wherein the first public key is generated by the first user terminal based on the public parameter, and the first number of first ciphertext information is calculated by the first user terminal based on the corresponding first private data set and the second public key, and the first number is the number of data included in the first private data set;

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

[0201] The intersection determination module 54 is configured to calculate the intersection of the first ciphertext information set and the second ciphertext information set to obtain the intersection of the first private data set and the second private data set.

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

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

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

[0205] A second public key is calculated according to the second private key and the third random vector.

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

[0207] 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.

[0208] In a possible implementation, the second ciphertext calculation module 53 is further configured to:

[0209] Determine second hash data corresponding to each second private data in the second private data set;

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

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

[0212] In a possible implementation, the second ciphertext calculation module 53 is further configured to:

[0213] Determine the third intermediate parameter corresponding to each of the second hash data based on the third parameter according to a preset decompression function;

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

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

[0216] In a possible implementation, the second ciphertext calculation module 53 is further configured to:

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

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

[0219] In a possible implementation, the second ciphertext calculation module 53 is further configured to:

[0220] The product of each of the second hash data and one-half of the third parameter is calculated according to a preset decompression function, and the integer closest to the result is taken to obtain the corresponding third intermediate parameter. 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 embodiment, and its specific implementation can refer to the description of the above method embodiment, and for the sake of brevity, it will not be repeated here.

[0221] 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.

[0222] 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.

[0223] 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.

[0224] Figure 6 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.

[0225] Reference Figure 6 , 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 .

[0226] 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.

[0227] 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.

[0228] 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.

[0229] 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.

[0230] 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.

[0231] 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: a home button, a volume button, a start button, and a lock button.

[0232] 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.

[0233] 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.

[0234] 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.

[0235] 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.

[0236] Figure 7 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 7, 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.

[0237] 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.

[0238] 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.

[0239] 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.

[0240] 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.

[0241] 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.

[0242] 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 personalized 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.

[0243] 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.

[0244] 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.

[0245] 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.

[0246] 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.

[0247] 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; Receiving a second public key generated by the second client based on the public parameters; Calculate a first number of first 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 and a first ciphertext information set including the first number of first ciphertext information are sent to the second user terminal, so as to determine, through the second user terminal, an intersection of the first ciphertext information set and a second ciphertext information set including a second number of second ciphertext information, where the second number of second ciphertext information is calculated by the second user terminal based on the corresponding second private data set and the first public key, and the second number is the number of data included in the second private data set.

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 and a sixth 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 second ciphertext information, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter is used to encrypt and / or decrypt the first ciphertext information and 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 comprises: Randomly determine a first private key and a first random vector from a central binomial distribution determined by the fifth parameter; A first public key is calculated according to the first private key and the first random vector.

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 at least one of claims 2 to 4, characterized in that The calculating a first number of first ciphertext information according to the 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 first 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.

6. The method according to claim 5, characterized in that The calculating the corresponding first 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 the first intermediate parameter corresponding to each first hash data based on the third parameter according to a preset decompression function; 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 first ciphertext information is determined based on the sixth parameter and the second intermediate parameter according to a preset compression function.

7. The method according to claim 6, 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.

8. The method according to claim 6 or 7, characterized in that: The determining the first intermediate parameter corresponding to each first hash data based on the third parameter according to the preset decompression function includes: The product of each of the first hash data and one-half of the third parameter is calculated according to a preset decompression function, and the integer closest to the obtained result is taken to obtain the corresponding first 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 send it to the first user terminal; receiving a first public key and a first ciphertext information set including a first number of first ciphertext information sent by the first client, where the first public key is generated by the first client based on the public parameter, and the first number of first ciphertext information is calculated by the first client based on the corresponding first private data set and the second public key, where the first number is the number of data included in the first private data set; Calculate a second number of second ciphertext information according to a second private data set corresponding to the second user terminal and the first public key, where the second number is the number of data included in the second private data set; An intersection of the first ciphertext information set and the second ciphertext information 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 and a sixth parameter, the first parameter and the second parameter are used to limit the dimension of the public matrix and / or the polynomial matrix, the third parameter is a prime number greater than 2, the fourth parameter is a security parameter for generating second ciphertext information, the fifth parameter is a parameter of a central binomial distribution, and the sixth parameter is used to encrypt and / or decrypt the first ciphertext information and 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 comprises: Randomly determine a second private key and a third random vector from a central binomial distribution determined by the fifth parameter; A second public key is calculated according to the second private key and the third random vector.

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 calculating a second number of second ciphertext information according to the second private data set corresponding to the second user terminal and the first public key includes: Determine second hash data corresponding to each second private data in the second private data set; Randomly determine a fourth random vector corresponding to each second privacy data from a central binomial distribution determined by the fifth parameter; The corresponding second ciphertext information is calculated according to the second hash data corresponding to each second privacy data, the fourth random vector, the second private key and the first public key.

14. The method according to claim 13, characterized in that The calculating corresponding second ciphertext information according to the second hash data corresponding to each of the second privacy data, the fourth random vector, the second private key, and the first public key includes: Determine the third intermediate parameter corresponding to each of the second hash data based on the third parameter according to a preset decompression function; Calculate a corresponding fourth intermediate parameter according to the third intermediate parameter corresponding to each second privacy data, the fourth random vector, the second private key, and the first public key; The corresponding second ciphertext information is determined based on the sixth parameter and the fourth intermediate parameter according to a preset compression function.

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

16. The method according to claim 14 or 15, characterized in that The determining, based on the third parameter and according to the preset decompression function, the third intermediate parameter corresponding to each of the second hash data respectively includes: The product of each of the second hash data and one-half of the third parameter is calculated according to a preset decompression function, and the nearest integer to the obtained result is taken to obtain the corresponding third intermediate parameter.

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; A first public key receiving module, used to receive a second public key generated by the second user terminal based on the public parameters; A first ciphertext calculation module, configured to calculate a first number of first 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 and a first ciphertext information set including the first number of first ciphertext information to the second user terminal, so as to determine the intersection of the first ciphertext information set and a second ciphertext information set including a second number of second ciphertext information through the second user terminal, where the second number of second ciphertext information is calculated by the second user terminal based on the corresponding second private data set and the first public key, and the second number is the number of data included in the second private data set.

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 send it to the first user terminal; A second public key receiving module is configured to receive a first public key and a first ciphertext information set including a first number of first ciphertext information sent by the first user terminal, wherein the first public key is generated by the first user terminal based on the public parameter, and the first number of first ciphertext information is calculated by the first user terminal based on the corresponding first private data set and the second public key, and the first number is the number of data included in the first private data set; A second ciphertext calculation module, configured to calculate a second number of second ciphertext information according to a second private data set corresponding to the second user terminal and the first public key, where the second number is the number of data included in the second private data set; The intersection determination module is used to calculate the intersection of the first ciphertext information set and the second ciphertext information 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.