A method and device for determining shared data for protecting data privacy
By introducing an intermediate method into the privacy set interception algorithm, decrypting and comparing plaintext data to determine the shared data set, the problem of high computing and communication costs in the prior art is solved, and a safe and efficient privacy data interception operation is achieved.
Patent Information
- Application Number
- CN202210413672.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-19
- Publication Date
- 2025-02-28
- Estimated Expiration
- 2042-04-19
AI Technical Summary
In the process of multi-party joint privacy submission, the existing privacy set submission algorithm increases the calculation cost and communication cost, and it is difficult to effectively protect the security of the privacy data of all parties.
Through the method executed by the intermediate party, each party sends the encrypted privacy data to the intermediate party, the intermediate party decrypts and compares the plain text data, determines the shared data set, and sends the encrypted shared data set back to each party.
While protecting the security of private data, it reduces the computing and communication costs in the process of determining shared data, and does not require the support of special environments, saving equipment costs.
Smart Images

Figure CN114785497B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of privacy protection technology, and more particularly to a method and device for determining shared data for protecting data privacy. Background Art
[0002] The privacy set intersection algorithm is usually used for data alignment in vertical federated machine learning, or for friend discovery through address books in social software. At present, there are many privacy set intersection algorithms. For example, in order to ensure privacy, the participants who perform the intersection of private data sets use multi-party secure computing technologies such as oblivious transmission, encrypted circuits, and homomorphic encryption to find the intersection of their private data, that is, the shared data. In this type of method, each participant needs to perform additional communication during the calculation process (i.e., the intersection process), which increases the calculation cost and communication cost.
[0003] Therefore, it is hoped to provide an improved solution that can protect the security of the privacy data of all parties and reduce the amount of calculation during the process of joint privacy intersection among multiple parties. Summary of the invention
[0004] One or more embodiments of the present specification provide a method and apparatus for determining shared data for protecting data privacy, so as to reduce the amount of computation in the shared data determination process while protecting the security of private data, without requiring support from a special environment, and thus saving equipment costs.
[0005] According to a first aspect, a method for determining shared data for protecting data privacy is provided, the method being performed by an intermediary, comprising:
[0006] Obtaining respective encrypted data from the first party and the second party, wherein the encrypted data is obtained by each party encrypting the private data set held by the party using its respective target key, and the first party and the second party both set the intermediary as a trusted intermediary;
[0007] Decrypt the encrypted data of each party to obtain the plaintext of the privacy data set of each party;
[0008] Compare the plaintexts of the privacy data sets of both parties to determine the common data set of the plaintexts of the privacy data sets of both parties;
[0009] Using the target keys of each party respectively, encrypt the shared data set to obtain the ciphertext of the shared data set corresponding to each party;
[0010] The ciphertext of the shared data set corresponding to each party is sent to each party respectively, so that each party can determine the shared data between them.
[0011] In one possible implementation, it also includes:
[0012] Using a preset key generation algorithm, generate corresponding target keys for each party respectively;
[0013] The target keys corresponding to each party are sent to each party respectively.
[0014] In one possible implementation, the preset key generation algorithm is a symmetric key generation algorithm or an asymmetric key generation algorithm.
[0015] In one possible implementation, when the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different.
[0016] In one possible implementation, determining the shared data set of the plaintext of the private data sets of both parties includes:
[0017] For each party’s privacy dataset plaintext, sort the party’s privacy dataset plaintext in ascending order to obtain the party’s ascending dataset:
[0018] Take any party as the target party, compare the first data in the first ascending data set of the target party with the data in the second ascending data set of the other party from top to bottom; if the first data is greater than the first n data in the second ascending data set, delete the first n data from the second ascending data set to obtain a third ascending data set;
[0019] Compare the second data at the end of the first ascending data set with the data in the third ascending data set from bottom to top; if the second data is smaller than the last m data of the third ascending data set, delete the last m data from the third ascending data set to obtain a fourth ascending data set;
[0020] Each data of the first ascending data set is compared with each data of the fourth ascending data set to determine the common data set.
[0021] According to a second aspect, a method for determining shared data for protecting data privacy is provided, the method being performed by a first party, a second party, and an intermediary party, the method comprising:
[0022] The first party and the second party encrypt the private data sets they hold using their respective target keys to obtain their respective encrypted data, and send the encrypted data to the intermediary party;
[0023] The middle party decrypts the encrypted data of each party to obtain the plaintext of the private data set of each party; compares the plaintext of the private data set of both parties to determine the common data set of the plaintext of the private data set of both parties; encrypts the common data set using the target key of each party to obtain the ciphertext of the common data set corresponding to each party; and sends the ciphertext of the common data set corresponding to each party to each party;
[0024] The first party and the second party obtain their respective shared data set ciphertexts, and determine the shared data set plaintext between the two parties based on the shared data set ciphertexts.
[0025] In one possible implementation, it also includes:
[0026] The middle party generates corresponding target keys for each party respectively using a preset key generation algorithm;
[0027] The target keys corresponding to each party are sent to each party respectively.
[0028] In one possible implementation, the preset key generation algorithm is a symmetric key generation algorithm or an asymmetric key generation algorithm;
[0029] When the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different.
[0030] According to a third aspect, a shared data determination device for protecting data privacy is provided, wherein the device is deployed at an intermediary and comprises:
[0031] an acquisition module configured to acquire encrypted data from the first party and the second party respectively, wherein the encrypted data is obtained by each party encrypting the private data set held by the party using its own target key, and the first party and the second party both set the intermediary as a trusted intermediary;
[0032] A decryption module, configured to decrypt the encrypted data of each party to obtain the plaintext of the privacy data set of each party;
[0033] A comparison and determination module is configured to compare the plaintexts of the privacy data sets of both parties and determine a common data set of the plaintexts of the privacy data sets of both parties;
[0034] An encryption module, configured to encrypt the shared data set using the target keys of each party respectively, to obtain the ciphertext of the shared data set corresponding to each party;
[0035] The first sending module is configured to send the ciphertext of the shared data set corresponding to each party to each party respectively, so that each party can determine the shared data between the two parties.
[0036] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.
[0037] According to a fifth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in the first aspect is implemented.
[0038] According to the method and device provided in the embodiments of this specification, the intermediary set as a trusted intermediary by the first party and the second party, after obtaining the encrypted data of each of the first party and the second party, decrypts the encrypted data of each party, so as to determine the common data set of both parties based on the plaintext of the privacy data set of each party, and encrypts the determined common data set with the target key of each party and sends it to each party, so that each party determines the common data between the two parties. Among them, the first party and the second party rely on the intermediary they both trust (will not disclose or maliciously use the privacy data of both parties) to determine the common data (intersection) of their privacy data sets, and the intermediary determines the common data set of both parties based on the plaintext. The first party and the second party encrypt and transmit the data with the intermediary, which can avoid the leakage of privacy data during the transmission process (guarantee the privacy of privacy data), while reducing the cost of calculation and communication in the process of determining the common data, and the intermediary C does not need the support of a special environment, saving equipment costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0040] Figure 1 A schematic diagram of an implementation framework of an embodiment disclosed in this specification;
[0041] Figure 2 A schematic flow chart of a method for determining shared data for protecting data privacy provided in an embodiment;
[0042] Figure 3 A schematic flow chart of a method for determining shared data for protecting data privacy provided in an embodiment;
[0043] Figure 4 A schematic block diagram of a common data determination device for protecting data privacy provided by an embodiment. DETAILED DESCRIPTION
[0044] The technical solutions of the embodiments of this specification will be described in detail below with reference to the accompanying drawings.
[0045] The embodiments of this specification disclose a method and device for determining shared data to protect data privacy. The following first introduces the application scenarios and technical concepts of the method, which are as follows:
[0046] At present, in the scenario of finding the intersection of private sets, in order to ensure the privacy of the private data of each participant, the participants generally use multi-party secure computing technologies such as oblivious transmission, encrypted circuits, homomorphic encryption, etc. to find the intersection of their private data, that is, the shared data. In the above method, each participant needs to perform additional communication during the intersection process, which increases the computing cost and communication cost.
[0047] In view of this, the inventor proposes a shared data determination method for protecting data privacy. Figure 1 A schematic diagram of an implementation scenario according to an embodiment disclosed in this specification is shown. In this implementation scenario, participants A, B and C are schematically shown, and each participant can be specifically embodied as a device, platform, server or device cluster with computing and processing capabilities. Participants A and B respectively have a first privacy data set X(N) and a second privacy data set Y(M) that require intersection. Both parties hope to determine their common data, i.e., the intersection between the first privacy data set and the second privacy data set, on the premise of ensuring the privacy of their private data. Participant C is set as a trusted intermediary by both parties A and B. Participants A and B trust intermediary C and believe that intermediary C will not leak or maliciously use their private data. Intermediary C is used to assist participants A and B in determining the common data.
[0048] To this end, according to the embodiments of this specification, in order to perform a secure privacy data intersection operation, the participants A and B and the middle party C first perform an initial preparation phase to prepare for the specific process of the subsequent privacy set intersection operation.
[0049] The initial preparation stage may include that Party A and Party B first determine their respective private data sets for which they need to perform secure private set intersection operations, Party A determines its first private data set X(N), and Party B determines its second private data set Y(M). The first private data set X(N) includes multiple private data X(N) i , the second privacy data set Y(M) includes multiple pieces of privacy data Y j . In one case, each piece of privacy data may include at least a data identifier, which may be a user identifier (e.g., UID, mobile phone number, etc.) or an item identifier (e.g., item serial number, etc.). In one case, each piece of privacy data may also include other data corresponding to the data identifier, for example: when the data identifier is a user identifier, each piece of privacy data may also include various types of user privacy data of the corresponding user, such as occupation, salary, education level, and crowd label, etc.; when the data identifier is an item identifier, each piece of privacy data may also include various types of item privacy data of the corresponding item, such as basic attributes and price of the item, etc.
[0050] Based on the above situation, when subsequently determining the shared data set, the intermediary party C may determine the privacy data with the same corresponding data identifier in the first privacy data set X(N) and the second privacy data set Y(M) as the shared data of the first privacy data set X(N) and the second privacy data set Y(M).
[0051] Afterwards, if Figure 1 As shown, the intermediary C distributes encryption keys (1) to the participants A and B. Specifically, it can generate corresponding target keys for the participants A and B respectively, and send the corresponding target keys of the participants A and B to the participants A and B respectively.
[0052] Next, in the process of determining the shared data, if Figure 1 As shown, participant A encrypts its first private data set X(N)(2). Specifically, it uses the target key it holds to encrypt the first private data set X(N) to obtain its corresponding encrypted data (referred to as the first encrypted data for the sake of clarity), and sends the first encrypted data to the intermediary C, as shown in FIG. Figure 1 In step (3) shown in , accordingly, participant B encrypts its second private data set Y(M)(2). Specifically, it uses the target key it holds to encrypt the second private data set Y(M) to obtain its corresponding second encrypted data, and sends the second encrypted data to the intermediary C, as shown in Figure 1 Step (3) shown in .
[0053] The middle party C obtains the first encrypted data and the second encrypted data, and decrypts the encrypted data of each party (4). Specifically, the first encrypted data and the second encrypted data are decrypted respectively to obtain the first privacy data set plaintext and the second privacy data set plaintext. Then, the middle party C obtains the intersection of the privacy data set plaintexts of each party (5). Specifically, the first privacy data set plaintext and the second privacy data set plaintext are compared to determine the common data between the participants A and B. The determined common data constitute the common data set. Then, the middle party C uses the target key of each party to encrypt the intersection result (6) and sends the ciphertext of the intersection result to each party (7). Specifically, the target key of the participant A is used to encrypt the common data set, and the encrypted ciphertext of the common data set is sent to the participant A; the target key of the participant B is used to encrypt the common data, and the encrypted ciphertext of the common data set is sent to the participant B.
[0054] like Figure 1 As shown, the parties determine the shared data set (8). Specifically, party A determines the shared data (i.e., the intersection) between the first private data set and the second private data set based on the shared data set ciphertext it receives. Party B determines the shared data between the first private data set and the second private data set based on the shared data set ciphertext it receives.
[0055] In the above process, participants A and B rely on the intermediary C, whom they both trust (who will not disclose or maliciously use the private data of both parties), to determine the common data (intersection) of their private data sets, and the intermediary C determines the common data set of both parties based on plain text. The data is encrypted and transmitted between participants A and B and the intermediary C, which can avoid the leakage of private data during the transmission process (ensuring the privacy of private data), while reducing the calculation and communication costs of the common data determination process, and the intermediary C does not require the support of a special environment, saving equipment costs.
[0056] The shared data determination method for protecting data privacy provided in this specification is described in detail below in conjunction with specific embodiments.
[0057] Figure 2 A flowchart of a method for determining shared data to protect data privacy in one embodiment of the specification is shown. The method is performed by an intermediary, which can be implemented by any device, equipment, platform, device cluster, etc. with computing and processing capabilities.
[0058] It should be noted that the method also involves the first party A and the second party B, and the premise for the implementation of the method is that the first party A and the second party B both set the intermediary C as a trusted intermediary, that is, the first party and the second party both trust the intermediary C and believe that the intermediary C will not leak or maliciously use their private data. The first party A and the second party B can set the intermediary C as a trusted intermediary through a specific program, or their managers can manually set the intermediary C as a trusted intermediary (for example, adding the intermediary C to the trusted list stored by each party). In practice, the first party A and the second party B can determine the mutually trusted intermediary C through some protocols or agreements based on preset factors or conditions. The above-mentioned preset factors or conditions may include requiring the intermediary device to be a node device with an associated relationship in the social relationship network of both parties, requiring the intermediary device to be in a secure network environment, for example, a device of an official agency, and so on.
[0059] In the process of determining shared data, Figure 2 As shown, the method includes the following steps S210-S250:
[0060] In step S210, the intermediary C obtains the encrypted data from the first party A (Party A) and the second party B (Party B), respectively. The encrypted data is obtained by each party using its own target key to encrypt the privacy data set it holds. The first privacy data set held by the first party A may include multiple pieces of privacy data, and the second privacy data set held by the second party B may also include multiple pieces of privacy data.
[0061] In one embodiment, the target keys held by the first party A and the second party B may be generated by the intermediary party C in the initial preparation stage and sent to the first party A and the second party B. In one case, before step S210, the intermediary party C may also generate target keys for each party. Specifically, the intermediary party C generates target keys corresponding to each party using a preset key generation algorithm, and sends the target keys corresponding to each party to each party.
[0062] In one embodiment, the aforementioned preset key generation algorithm may be a symmetric key generation algorithm or an asymmetric key generation algorithm. The symmetric key generation algorithm may include but is not limited to the AES (Advanced Encryption Standard) algorithm, the DES (Data Encryption Standard) algorithm, etc. The asymmetric key generation algorithm may include but is not limited to the RSA algorithm.
[0063] In one embodiment, in order to ensure the security of the private data sets of the first party A and the second party B, it is necessary to ensure that the plaintext of the private data of the first party A and the second party B is only available to the intermediary party C trusted by each of them, and other parties cannot obtain the plaintext of the private data of the first party A or the second party B, wherein the first party A cannot obtain the plaintext of the private data of the second party B, and the second party B cannot obtain the plaintext of the private data of the first party A. Accordingly, when the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different, that is, the target key KeyA held by the first party A and the target key KeyB held by the second party B are different.
[0064] In one case, when the preset key generation algorithm is a symmetric key generation algorithm, after the first party A and the second party B each generate their target keys, they may send their respectively generated target keys to the intermediary party C, so that the intermediary party C may obtain the target keys KeyA and KeyB of the first party A and the second party B respectively.
[0065] Subsequently, after the intermediary party C obtains the encrypted data of each party from the first party and the second party respectively, in step S220, the intermediary party C decrypts the encrypted data of each party to obtain the plaintext of the privacy data set of each party. In one embodiment, when the target keys held by the first party A and the second party B are keys generated based on a symmetric key generation algorithm, the intermediary party C can use the target key KeyA of the first party A to decrypt the encrypted data obtained from the first party A to obtain the corresponding plaintext of the first privacy data set; and use the target key KeyB of the second party B to decrypt the encrypted data obtained from the second party B to obtain the corresponding plaintext of the second privacy data set.
[0066] In another embodiment, when the target keys held by the first party A and the second party B are keys generated based on an asymmetric key generation algorithm, the target keys held by the first party A and the second party B may be the target public key PK of the intermediary, and the target private key SK corresponding to the target public key PK is privately held by the intermediary C. Accordingly, after the intermediary C obtains the respective encrypted data from the first party and the second party, it can use the target private key SK to decrypt the encrypted data obtained from the first party A and the second party B respectively, and obtain the plaintexts of the privacy data sets of each party, that is, the first privacy data set plaintext of the first party A and the second privacy data set plaintext of the second party B.
[0067] Then, in step S230, the middle party C compares the plaintext of the privacy data sets of both parties to determine the common data set of the plaintext of the privacy data sets of both parties. Among them, each piece of privacy data in the privacy data set of each party may at least include a data identifier, which may be a user identifier (for example: UID, mobile phone number, etc.) or an item identifier (for example: item serial number, etc.). In one case, each piece of privacy data may also include other data corresponding to the data identifier, for example: when the data identifier is a user identifier, each piece of privacy data may also include various types of user privacy data of the corresponding user, such as occupation, salary, education, and crowd labels, etc.; when the data identifier is an item identifier, each piece of privacy data may also include various types of item privacy data of the corresponding item, such as basic attributes and price of the item, etc.
[0068] Correspondingly, the middle party C compares the plaintext of the privacy data sets of both parties, which may be to compare the data identifier of the privacy data of the first privacy data set X(N) with the data identifier of the privacy data of the second privacy data set Y(M), and determine the privacy data with the same data identifier as the common data of the first privacy data set X(N) and the second privacy data set Y(M).
[0069] The process of the middle party C determining the common data set of the plaintext of the private data sets of both parties can be to compare each data in the plaintext of the first private data set with each data in the plaintext of the second private data set, or to compare them by other comparison methods, which are all possible. In one implementation, the process of the middle party C determining the common data set of the plaintext of the private data sets of both parties can be specifically set as follows: in step 11, for the plaintext of the private data sets of each party, the plaintext of the private data set of the party is sorted in ascending order to obtain the ascending data set of the party.
[0070] In step 12, any party is taken as the target party, and the first data in the first ascending data set of the target party is compared with the data in the second ascending data set of the other party from top to bottom.
[0071] In step 13, if the first data is greater than the first n data in the second ascending data set, the first n data are deleted from the second ascending data set to obtain a third ascending data set.
[0072] In step 14, the second data at the last position in the first ascending data set is compared with the data in the third ascending data set from bottom to top.
[0073] In step 15, if the second data is smaller than the last m data of the third ascending data set, the last m data are deleted from the third ascending data set to obtain a fourth ascending data set.
[0074] In step 16, each data of the first ascending data set is compared with each data of the fourth ascending data set to determine a common data set.
[0075] In this implementation, in order to reduce the amount of calculation in the comparison process, the middle party C first sorts the plaintext of the privacy data set of each party in ascending order to obtain the ascending data set of the party, where the first party A corresponds to the first ascending data set [X1, X2, ... X N ], the second party B corresponds to the second ascending data set [Y1, Y2, ... M ], where h(X i ) represents the private data X i The hash value, h(Y j ) represents the private data Y j Hash value. Afterwards, any party is taken as the target party, for example, the first party A is taken as the target party, and the first data X1 in the first ascending data set of the first party A is compared with the data in the second ascending data set of the second party B from top to bottom (starting from Y1), wherein, when data not less than the first data X1 appears in the second ascending data set, the comparison is stopped; subsequently, if the first data X1 is greater than the first n data in the second ascending data set, for example, the first data X1 is greater than the first 5 data in the second ascending data set (i.e., Y1, Y2, Y3, Y4, and Y5), and the sixth data Y6 in the second ascending data set is not less than the first data X1, the first n data (i.e., the first 5 data) will be deleted from the second ascending data set to obtain a third ascending data set.
[0076] The second data X at the end of the first ascending data set N The data in the third data set are in ascending order from bottom to top (from Y M Start) to compare, where when the third ascending data set appears not greater than the second data X N , then stop the comparison; subsequently, if the second data X N Less than the last m data of the third ascending data set, for example, the second data XN Less than the last 10 data of the third ascending data set (i.e. from Y M-9 To Y M ), delete the last m data from the third ascending data set, and get the fourth ascending data set [Y6, Y7, Y8...Y M-10 ].
[0077] Then the first ascending data set [X1, X2, ... X N ] and the fourth ascending data set [Y6, Y7, Y8...Y m-10 ] to determine the common data set. This can make the first ascending data set X2 to X N There is no need to compare with the first n data (such as Y1, Y2, Y3, Y4 and Y5) in the second ascending data set, and make X1 to X5 in the first ascending data set N-1 No need to compare with the last m data in the second ascending data set (for example, Y M-9 To Y M ) for comparison, which can reduce the amount of comparison data to a certain extent.
[0078] After the intermediary party C determines the shared data set of the plaintext of the private data sets of both parties, in step S240, the intermediary party C uses the target keys of each party to encrypt the shared data set to obtain the ciphertext of the shared data set corresponding to each party. Specifically, the shared data set is encrypted using the target key of the first party A to obtain the ciphertext of the shared data set corresponding to the first party A; the shared data set is encrypted using the target key of the second party B to obtain the ciphertext of the shared data set corresponding to the second party B.
[0079] Afterwards, in step S250, the intermediary C sends the ciphertext of the shared data set corresponding to each party to each party, so that each party can determine the shared data between the two parties. In this step, the intermediary C sends the ciphertext of the shared data set corresponding to the first party A to the first party A, and sends the ciphertext of the shared data set corresponding to the second party B to the first party A.
[0080] Subsequently, when the target keys held by the first party A and the second party B are symmetric keys, the first party A and the second party B respectively use their respective target keys KeyA and KeyB to decrypt the received ciphertext of the shared data set to obtain the shared data between them.
[0081] In the case where the target keys held by the first party A and the second party B are asymmetric keys PK, it can be understood that the first party A has the private data X in the first private data set because it has previously encrypted the first private data set with PK. iThe correspondence between plaintext and ciphertext (called the first correspondence), the second party B has each piece of private data Y in it because it has previously encrypted the second private data set using PK j The correspondence between plaintext and ciphertext (referred to as the second correspondence). Accordingly, taking the first party A as an example, the first party A can determine the plaintext of the shared data between it and the second party B based on the ciphertext of each shared data in the ciphertext of the shared data set it receives and the first correspondence. The process of the second party B determining the plaintext of the shared data can refer to the process of the first party A determining the plaintext of the shared data, which will not be repeated here.
[0082] In this embodiment, the intermediary party C determines the common data set of both parties based on plain text, and the data is encrypted and transmitted between the first party A and the second party B and the intermediary party C, thereby avoiding the leakage of private data during the transmission process (ensuring the privacy of private data), while reducing the calculation and communication costs of the common data determination process, and the intermediary party C does not need the support of a special environment, saving equipment costs.
[0083] The foregoing describes certain embodiments of the present specification, and other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in an order different from that in the embodiments, and the desired results may still be achieved. In addition, the processes depicted in the accompanying drawings do not necessarily have to be performed in the specific order or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0084] Corresponding to the above method embodiment, the present specification embodiment also provides a method for determining shared data for protecting data privacy, such as Figure 3 As shown, the method is performed by the first party A310, the second party B320 and the middle party C330, and the method includes:
[0085] The first party A310 and the second party B320 use their respective target keys to encrypt the private data sets they hold, obtain their respective encrypted data, and send them to the intermediary party C330;
[0086] The middle party C330 decrypts the encrypted data of each party to obtain the plaintext of the private data set of each party; compares the plaintext of the private data set of both parties to determine the common data set of the plaintext of the private data set of both parties; encrypts the common data set using the target key of each party to obtain the ciphertext of the common data set corresponding to each party; and sends the ciphertext of the common data set corresponding to each party to each party;
[0087] The first party A310 and the second party B320 obtain their respective shared data set ciphertexts, and determine the shared data set plaintexts between the two parties based on the shared data set ciphertexts.
[0088] In one embodiment, the method further comprises:
[0089] The intermediary C330 generates target keys corresponding to each party respectively by using a preset key generation algorithm; and sends the target keys corresponding to each party respectively to each party.
[0090] In one possible implementation, the preset key generation algorithm is a symmetric key generation algorithm or an asymmetric key generation algorithm.
[0091] In one possible implementation, when the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different.
[0092] In one possible implementation, determining the shared data set of the plaintext of the private data sets of both parties includes:
[0093] For each party’s privacy dataset plaintext, sort the party’s privacy dataset plaintext in ascending order to obtain the party’s ascending dataset:
[0094] Take any party as the target party, compare the first data in the first ascending data set of the target party with the data in the second ascending data set of the other party from top to bottom; if the first data is greater than the first n data in the second ascending data set, delete the first n data from the second ascending data set to obtain a third ascending data set;
[0095] Compare the second data at the end of the first ascending data set with the data in the third ascending data set from bottom to top; if the second data is smaller than the last m data of the third ascending data set, delete the last m data from the third ascending data set to obtain a fourth ascending data set;
[0096] Each data of the first ascending data set is compared with each data of the fourth ascending data set to determine the common data set.
[0097] Corresponding to the above method embodiment, the present specification embodiment provides a shared data determination device 400 for protecting data privacy, and its schematic block diagram is as follows: Figure 4 As shown, the device is deployed at an intermediate party and includes:
[0098] The acquisition module 410 is configured to acquire encrypted data from the first party and the second party respectively, wherein the encrypted data is obtained by each party encrypting the private data set held by the party using its own target key, and the first party and the second party both set the intermediary as a trusted intermediary;
[0099] A decryption module 420 is configured to decrypt the encrypted data of each party to obtain the plaintext of the private data set of each party;
[0100] A comparison and determination module 430 is configured to compare the plaintexts of the privacy data sets of both parties and determine a common data set of the plaintexts of the privacy data sets of both parties;
[0101] The encryption module 440 is configured to encrypt the shared data set using the target key of each party respectively to obtain the shared data set ciphertext corresponding to each party;
[0102] The first sending module 450 is configured to send the ciphertext of the shared data set corresponding to each party to each party respectively, so that each party can determine the shared data between the two parties.
[0103] In one possible implementation, the device further comprises:
[0104] A generation module (not shown in the figure) is configured to generate a target key corresponding to each party using a preset key generation algorithm;
[0105] The second sending module (not shown in the figure) is configured to send the target keys corresponding to each party to each party respectively.
[0106] In one possible implementation, the preset key generation algorithm is a symmetric key generation algorithm or an asymmetric key generation algorithm.
[0107] In one possible implementation, when the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different.
[0108] In one possible implementation, the comparison and determination module 430 is specifically configured to sort the plaintext of the privacy data set of each party in ascending order to obtain the ascending data set of the party;
[0109] Take any party as the target party, compare the first data in the first ascending data set of the target party with the data in the second ascending data set of the other party from top to bottom; if the first data is greater than the first n data in the second ascending data set, delete the first n data from the second ascending data set to obtain a third ascending data set;
[0110] Compare the second data at the end of the first ascending data set with the data in the third ascending data set from bottom to top; if the second data is smaller than the last m data of the third ascending data set, delete the last m data from the third ascending data set to obtain a fourth ascending data set;
[0111] Each data of the first ascending data set is compared with each data of the fourth ascending data set to determine the common data set.
[0112] The above device embodiments correspond to the method embodiments. For specific descriptions, please refer to the description of the method embodiments, which will not be repeated here. The device embodiments are obtained based on the corresponding method embodiments and have the same technical effects as the corresponding method embodiments. For specific descriptions, please refer to the corresponding method embodiments.
[0113] The embodiments of the present specification also provide a computer-readable storage medium having a computer program stored thereon. When the computer program is executed in a computer, the computer is caused to execute the method for determining shared data for protecting data privacy provided in the present specification.
[0114] An embodiment of the present specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method for determining shared data for protecting data privacy provided in the present specification is implemented.
[0115] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the storage medium and computing device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0116] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present invention may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0117] The specific implementation methods described above further describe the purpose, technical solutions and beneficial effects of the embodiments of the present invention in detail. It should be understood that the above description is only a specific implementation method of the embodiments of the present invention and is not intended to limit the scope of protection of the present invention. Any modification, equivalent replacement, improvement, etc. made on the basis of the technical solution of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A method for determining shared data for protecting data privacy, the method being performed by an intermediary, comprising: Obtaining respective encrypted data from the first party and the second party, wherein the encrypted data is obtained by each party encrypting the private data set held by the party using its respective target key, and the first party and the second party both set the intermediary as a trusted intermediary; Decrypt the encrypted data of each party to obtain the plaintext of the privacy data set of each party; Compare the plaintexts of the private data sets of both parties to determine the common data set of the plaintexts of the private data sets of both parties; wherein the determining the common data set of the plaintexts of the private data sets of both parties includes: For each party's privacy data set plaintext, sort the party's privacy data set plaintext in ascending order to obtain the party's ascending data set; Take any party as the target party, compare the first data in the first ascending data set of the target party with the data in the second ascending data set of the other party from top to bottom; if the first data is greater than the first n data in the second ascending data set, delete the first n data from the second ascending data set to obtain a third ascending data set; Compare the second data at the end of the first ascending data set with the data in the third ascending data set from bottom to top; if the second data is smaller than the last m data of the third ascending data set, delete the last m data from the third ascending data set to obtain a fourth ascending data set; Compare each data of the first ascending data set with each data of the fourth ascending data set to determine the common data set; Using the target keys of each party respectively, encrypt the shared data set to obtain the ciphertext of the shared data set corresponding to each party; The ciphertext of the shared data set corresponding to each party is sent to each party respectively, so that each party can determine the shared data between them.
2. The method of claim 1, further comprising: Using a preset key generation algorithm, generate corresponding target keys for each party respectively; The target keys corresponding to each party are sent to each party respectively.
3. The method of claim 2, wherein: The preset key generation algorithm is a symmetric key generation algorithm or an asymmetric key generation algorithm.
4. The method of claim 3, wherein: When the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different.
5. A method for determining shared data for protecting data privacy, the method being performed by a first party, a second party, and an intermediary party, the method comprising: The first party and the second party encrypt the private data sets they hold using their respective target keys to obtain their respective encrypted data, and send the encrypted data to the intermediary party; The middle party decrypts the encrypted data of each party and obtains the plaintext of each party’s private data set; Compare the plaintexts of the privacy data sets of both parties to determine the common data set of the plaintexts of the privacy data sets of both parties; Using the target keys of each party respectively, encrypt the shared data set to obtain the ciphertext of the shared data set corresponding to each party; The ciphertexts of the shared data sets corresponding to each party are sent to each party respectively; wherein the shared data set of the plaintexts of the private data sets of both parties is determined, including: For each party's privacy data set plaintext, sort the party's privacy data set plaintext in ascending order to obtain the party's ascending data set; Take any party as the target party, compare the first data in the first ascending data set of the target party with the data in the second ascending data set of the other party from top to bottom; if the first data is greater than the first n data in the second ascending data set, delete the first n data from the second ascending data set to obtain a third ascending data set; Compare the second data at the end of the first ascending data set with the data in the third ascending data set from bottom to top; if the second data is smaller than the last m data of the third ascending data set, delete the last m data from the third ascending data set to obtain a fourth ascending data set; Compare each data of the first ascending data set with each data of the fourth ascending data set to determine the common data set; The first party and the second party obtain their respective shared data set ciphertexts, and determine the shared data set plaintext between the two parties based on the shared data set ciphertexts.
6. The method of claim 5, further comprising: The middle party generates corresponding target keys for each party respectively using a preset key generation algorithm; The target keys corresponding to each party are sent to each party respectively.
7. The method of claim 6, wherein: The preset key generation algorithm is a symmetric key generation algorithm or an asymmetric key generation algorithm; When the preset key generation algorithm is a symmetric key generation algorithm, the target keys of the parties are different.
8. A shared data determination device for protecting data privacy, the device being deployed at an intermediary, comprising: an acquisition module configured to acquire encrypted data from the first party and the second party respectively, wherein the encrypted data is obtained by each party encrypting the private data set held by the party using its own target key, and the first party and the second party both set the intermediary as a trusted intermediary; A decryption module, configured to decrypt the encrypted data of each party to obtain the plaintext of the privacy data set of each party; A comparison and determination module is configured to compare the plaintexts of the privacy data sets of both parties to determine the common data set of the plaintexts of the privacy data sets of both parties; wherein the comparison and determination module is specifically configured to sort the plaintexts of the privacy data sets of each party in ascending order to obtain the ascending data set of the party; taking any party as the target party, comparing the first data in the first ascending data set of the target party with the data in the second ascending data set of the other party from top to bottom; if the first data is greater than the first n data in the second ascending data set, deleting the first n data from the second ascending data set to obtain a third ascending data set; comparing the second data in the last position in the first ascending data set with the data in the third ascending data set from bottom to top; if the second data is less than the last m data in the third ascending data set, deleting the last m data from the third ascending data set to obtain a fourth ascending data set; comparing each data in the first ascending data set with each data in the fourth ascending data set to determine the common data set; An encryption module, configured to encrypt the shared data set using the target keys of each party respectively, to obtain the ciphertext of the shared data set corresponding to each party; The first sending module is configured to send the ciphertext of the shared data set corresponding to each party to each party respectively, so that each party can determine the shared data between the two parties.
9. A computing device comprising a memory and a processor, wherein: The memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Method and device for matching data
CN107196919A