An intrusion detection method and device for private set intersection
By judging whether the encrypted data is the power calculation result of a specified base number, the risk of the key being cracked during the privacy set interception is solved, and the secure transmission of data and privacy protection are achieved.
Patent Information
- Application Number
- CN202211740929.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2042-12-30
AI Technical Summary
In the prior art, during the privacy collection process, there is a risk that the attacking party impersonates the participant to initiate a request, resulting in the risk of the key being cracked and the problem of privacy data leakage.
By receiving encrypted data from other participants, it is determined whether it is the power calculation result of the specified base number. If so, it is determined that it is illegal and refuses to continue to execute the privacy set request service; if not, it is determined that it is legal and continue to execute the service.
Effectively detect and prevent malicious construction of special values, avoid privacy data leakage, and ensure data security.
Smart Images

Figure CN116318820B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the technical field of data security, and in particular, to an intrusion detection method and device for private set intersection. Background Art
[0002] The Private Set Intersection (PSI) technology is a pre-step in vertical federated learning. Before multiple data holders perform joint calculations, in order to avoid the leakage of private data, it is used to determine the data samples shared by multiple parties without exposing the unique data of each data holder. For example, assume that two service providers, Party A and Party B, cooperate to train a model, and the training model uses the business data of users as training samples. Generally, the users of Party A and Party B are different. If Party A and Party B use all the data to determine the training samples, then the trained model may leak the business data of non-shared users of both parties. To avoid information leakage, it is necessary to pre-determine the business data of the common users of both parties and determine the training samples based on the business data of the common users. That is, it is necessary to determine the intersection of the user sets of both parties. The PSI technology is to achieve the purpose of determining the shared data without exchanging the plaintext data of both parties. Usually, each participant who performs the private set intersection service will encrypt the same data multiple times successively, and moreover, the order of encrypting the same data multiple times does not affect the result of encrypting the data multiple times.
[0003] In the prior art, when multiple participants perform the private set intersection service, they often use specific mathematical operation methods to encrypt the data. When the attacker cracks the encrypted data, they usually face mathematical problems such as the discrete logarithm problem and the large integer factorization problem, which are difficult to crack.
[0004] However, if the attacker impersonates the participant's identity and initiates a private set intersection request, there is still a possibility of cracking the participant's key by setting specific values. Therefore, this specification provides an intrusion detection method and device for private set intersection. Summary of the Invention
[0005] This specification provides an intrusion detection method and device for private set intersection to partially solve the above problems existing in the prior art.
[0006] This specification adopts the following technical solutions:
[0007] The intrusion detection method for private set intersection provided by this specification, where the intrusion detection is applied to the participants performing private set intersection, and the method includes:
[0008] Receive the encrypted data sent by other participating parties, where the encrypted data is obtained by the other participating parties encrypting the data they hold using the first key corresponding to the other participating parties;
[0009] Based on the encrypted data, determine whether the encrypted data is the result of a power calculation with a specified base;
[0010] If so, determine that the other participating party is illegal and refuse to send the data held by itself to the other participating party;
[0011] If not, determine that the other participating party is legal and continue to perform the private set intersection service with the other participating party based on the encrypted data, the pre-generated second key, and the data held by itself.
[0012] The intrusion detection device for private set intersection provided in this specification includes:
[0013] A receiving module that receives the encrypted data sent by other participating parties, where the encrypted data is obtained by the other participating parties encrypting the data they hold respectively using the first key corresponding to the other participating parties;
[0014] A first detection module that, based on the encrypted data, determines whether the encrypted data is the result of a power calculation with a specified base. If so, determine that the other participating party is illegal and refuse to send the data held by itself to the other participating party. If not, determine that the other participating party is legal and continue to perform the private set intersection service with the other participating party based on the encrypted data, the pre-generated second key, and the data held by itself.
[0015] The computer-readable storage medium provided in this specification stores a computer program, and when the computer program is executed by a processor, it implements the above-mentioned intrusion detection method for private set intersection.
[0016] The electronic device provided in this specification includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, it implements the above-mentioned intrusion detection method for private set intersection.
[0017] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:
[0018] In the intrusion detection method for private set intersection provided in this specification, when a participating party in the private set intersection receives the encrypted data sent by other participating parties, based on the encrypted data, it determines whether the encrypted data is the result of a power calculation with a specified base. If so, it does not perform the subsequent steps of the private set intersection operation.
[0019] As can be seen from the above method, when other participants in the private set intersection transmit encrypted data, this method can detect whether there is a situation of malicious construction of special values, so as to determine whether other participants may crack their own keys. When it is determined that there is a cracking risk, the private set intersection service is not continued to avoid the leakage of private data. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings described herein are used to provide a further understanding of this specification and form a part of this specification. The illustrative embodiments of this specification and their descriptions are used to explain this specification and do not constitute an improper limitation of this specification. In the drawings:
[0021] Figure 1 is a schematic flow chart of a private set intersection in this specification;
[0022] Figure 2 is a schematic flow chart of the intrusion detection method for private set intersection provided in this specification;
[0023] Figure 3 is a schematic diagram of an intrusion detection device for private set intersection provided in this specification;
[0024] Figure 4 corresponds to the Figure 2 schematic diagram of an electronic device. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0025] To make the purpose, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with the specific embodiments of this specification and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this specification without creative efforts belong to the scope of protection requested by this specification.
[0026] During the process of private set intersection, in order to ensure that the data held by each participating party will not be leaked, and at the same time be able to obtain the result of the definite set intersection, each participating party needs to encrypt the data it holds respectively, and send the encrypted data obtained after encryption to other participating parties, and then each of the other participating parties encrypts the received encrypted data again. In order to reduce the possibility of its own encrypted data being cracked, currently when performing private set intersection, the participating party often uses a specific mathematical operation method to encrypt the data. When other participating parties crack the encrypted data, they usually face mathematical problems such as the discrete logarithm problem and the large integer factorization problem, and it is difficult to crack. One of the technical means is the private set intersection protocol based on Diffie-Hellman, which increases the difficulty of cracking the encrypted data through the discrete logarithm problem. When the value is appropriate, the cracking cost makes it almost impossible for the encrypted data to be cracked. The specific process is as Figure 1 shown.
[0027] Figure 1 This is the interaction process of each participating party of the DH-PSI protocol provided in this specification. As shown in the figure, there are two parties, A and B. Among them, the A server holds the data set X = {u1, u2,..., ui}, and the B server holds the data set Y = {u1, u2,..., uj}. First, as the initiator of the private set intersection, the A server generates a prime number p and sends it to the B server. After the A server and the B server determine the prime number p, they can respectively generate keys and their inverses locally. The key a and a -1 generated by the A server, and the key b and b-1 generated by the B server. Among them, a·a-1 ≡ 1 mod p, b·b-1 ≡ 1 mod p. Then, the A server encrypts according to the data X it holds respectively according to the key a to obtain the encrypted data E A . Similarly, the B server encrypts according to the data Y it holds respectively according to the key b to obtain the encrypted data E B . Among them, E A = (u i ) a mod p, E B = (u j ) b mod p. The A server holds i data by itself, denoted as u i , and the B server holds j data by itself, denoted as u j . Then, the A server sends the encrypted data it determines to the B server, and the B server calculates EE A = ((u i ) a mod p) b mod p, and sends E B and EEA Return to the first terminal. Subsequently, Server A calculates EE based on the received E B , and calculates EE B . Finally, by calculating EE A ∩ EE B , it is determined which data in the data it holds is also held by Terminal B, that is, the result of the private set intersection.
[0028] However, since the participating parties usually encrypt the data encrypted by other participating parties through their own keys using specific mathematical operation methods when performing the private set intersection service, and if the data encrypted by other participating parties is a specific value created for this specific mathematical operation method, then the keys of these participating parties may be cracked by other participating parties. Therefore, this specification provides an intrusion detection method and device for private set intersection.
[0029] The following describes in detail the technical solutions provided by the embodiments of this specification with reference to the accompanying drawings.
[0030] Figure 1 FIG. is a schematic flowchart of an intrusion detection method for private set intersection in this specification, specifically including the following steps:
[0031] S100: Receive the encrypted data sent by other participating parties.
[0032] In one or more embodiments of this specification, this intrusion detection method is applied to the participating parties performing private set intersection, enabling the participating parties to detect whether other participating parties are legitimate through this intrusion detection method, that is, whether there is a risk that other participating parties will obtain their own private data, so as to determine whether to continue to execute the private set intersection service.
[0033] Specifically, since the participating parties in private set intersection are generally service providers providing services for users, that is, the service providers are the participating parties in private set intersection, and the specific steps of private set intersection can be executed by the servers of each participating party. Therefore, this intrusion detection method in this specification can be executed by the servers of the service providers. For example, the intrusion detection method can be executed by the server of the participating party performing the private set intersection service, or the private set intersection service and the intrusion detection service for the private set intersection service can also be executed by different servers of the participating party, and this specification does not make any restrictions.
[0034] In addition, since there is usually a service initiator in the private set intersection service, inviting other service providers to participate in the private set intersection service, all parties participating in the private set intersection service in this specification are referred to as participating parties. For the invited participating parties, refer to Figure 1The interaction process of the private set intersection service shown. In addition to receiving prime numbers sent by the participating party initiating the service, this participating party can also receive encrypted data sent by the participating party initiating the service. Take Figure 1 as an example. That is, the B server can receive E A sent by the A server. For the participating party initiating the service, this participating party initiating the service can also receive encrypted data returned by other participating parties. Take Figure 1 as an example. That is, the A server can receive E B returned by the B server.
[0035] It can be seen that in this specification, regardless of which type of participating party, it can receive encrypted data sent by other participating parties. For the convenience of describing the subsequent steps in this specification, the invited participating party is used as an example for illustration. Of course, as mentioned before, the execution subject of this intrusion detection method is the server of the participating party.
[0036] It should be noted that this encrypted data is obtained by the other participating party encrypting the data held by the other participating party respectively according to the first secret key of the other participating party itself. For example, taking the private set intersection to determine the common suppliers of each participating party as an example, after each participating party determines its own key, it can use this key to encrypt the data of each supplier it holds respectively. The encrypted data of each supplier obtained forms the encrypted data described in this specification. It can be seen that the quantity of the encrypted data varies according to the actual situation. Generally speaking, there are multiple pieces of this encrypted data. Of course, even if there is only one piece of encrypted data, the intrusion detection provided in this specification can be executed, and the private set intersection can be performed.
[0037] Furthermore, in this specification, since the data content and data format held by different participating parties may vary, that is to say, even for the data of the same object, the data content held by different participating parties may be different. To avoid the situation where the accuracy of the private set intersection result is reduced due to the influence of data content, data format, etc., before performing the private set intersection, each participating party can also determine the data content that needs to be encrypted and transmitted.
[0038] Even further, if a certain participating party fails to hold the corresponding data, the participating party initiating the invitation can re-determine the data content and data format that need to be encrypted and transmitted, so that the data dimensions and data formats corresponding to the objects encrypted by each participating party are consistent, improving the accuracy of the private set intersection.
[0039] S102: According to the encrypted data, determine whether the encrypted data is the calculation result of the power of a specified base number. If so, execute step S104; if not, execute step S106.
[0040] In one or more embodiments of this specification, hereinafter simply referred to as the server. After receiving the encrypted data, based on the encrypted data, it can be determined whether the encrypted data is the calculation result of a power of a specified base number. If so, it indicates that the encrypted data may be malicious. Then, when performing the subsequent private set intersection process based on this encrypted data, there may be a risk of leaking its own second key, so step S104 can be executed. If not, it can be confirmed that there is no such risk, and step S106 can be continued to be executed.
[0041] Specifically, in one or more embodiments of this specification, if other participating parties use the private set intersection service for attacks, the keys of each participating party are generated in real time according to the prime numbers provided by the participating party initiating the service, and the key becomes invalid after the service is executed. Therefore, generally in order to quickly crack the key, other participating parties that usually carry out attacks will use a small positive integer as the specified base number to construct the calculation result of the power of this specified base number as the encrypted data. For example, construct the encrypted data in the form of m n , where m is the specified base number and n is a randomly selected power value. For the convenience of cracking, m is usually selected as 2. Of course, it is also possible to select other positive integers. If a non-integer or a large value is selected, then the possibility of cracking is greatly reduced. Therefore, when judging whether other participating parties are illegal, it only needs to be considered whether the encrypted data is the calculation result of a power of an easily cracked specified base number.
[0042] The server can first determine the verification value according to the difference between the encrypted data and the first preset value. Then, it is judged whether the result of the AND calculation of the encrypted data and the verification value is the second preset value. If so, it indicates that there is an attack behavior by other participating parties, and step S104 is executed. Otherwise, step S106 is executed to continue the private set intersection service.
[0043] To judge whether the encrypted data conforms to 2 n as an example, the first preset value is 1. Taking (u i ) to represent the i-th encrypted data, the server can determine the verification value as (u i -1). In order to judge whether the encrypted data sent by other participating parties is specially constructed data. When the encrypted data (u i ) y = 2 n , the result of the server's calculation of EE A is 2 nb . And if 2 nb <p, that is, less than the prime number provided by the participating party initiating the service, the second key b generated by the server is easily brute-forced. Therefore, in order to detect whether the encrypted data sent by other participating parties satisfies the form of 2 n , the (u i-1), continue to determine whether the result of the AND operation between the encrypted data and the verification value is a second preset value, and the second preset value is 0. That is, judge whether u i &(u i -1)==0. If the result is 0, it is determined that there is a risk in the encrypted data in the encryption result sent by the other party, and step S104 is executed; otherwise, step S106 is executed.
[0044] Specifically, u i is generally a decimal number. The server calculates (u i -1), that is, performs a subtraction operation on the encrypted data to obtain the verification value, and then converts both the verification value and the encrypted data into binary numbers. If the encrypted data is in the form of 2 n structure. For example, if u i =8, its binary number is 1000, and the verification value is (u i -1)=7, and the binary number is 0111. Perform an AND operation, that is, perform an AND operation on 1000 and 0111 bit by bit, and the result is 0000, that is, 0. If the encrypted data is not in the form of 2 n structure, the calculation result is not 0.
[0045] Of course, in order to handle the case where the calculation result of the power with other bases is used as the encrypted data, the server can also pre-configure a table of the calculation results of powers with different values. For example, construct a table of the calculation results of powers when n takes values from 1 to 10000, and determine whether the encrypted data is in the form of 3 n according to the matching result of the table and the encrypted data, and so on. n structure, etc.
[0046] S104: Determine that the other party is illegal and refuse to send the data held by itself to the other party.
[0047] In one or more embodiments of this specification, taking the example of judging whether the encrypted data is in the form of 2 n structure, the subsequent description continues. When it is determined that any encrypted data in the encryption result sent by the other party satisfies the form of 2 n , that is, the result of step S102 is yes, it is determined that performing the private set intersection operation with the other party exposes its own second key, resulting in a risk of leakage of the data held by itself. Then, refuse to return the encryption result after encrypting the data held by itself to the other party. Of course, the server may also not return the encryption result of encrypting the other party's encrypted data to the other party. For example, for server B, it does not return EE A to server A either, nor does it return E B .
[0048] S106: Determine that the other party is legitimate, and continue to perform the private set intersection service with the other party based on the encrypted data, the pre-generated second key, and the data held by itself.
[0049] In one or more embodiments of this specification, when it is determined that none of the encrypted data in the encrypted result sent by the other party satisfies the form of 2 n , that is, the judgment result of each encrypted data in step S102 is negative, it is determined that there is no risk of data leakage in performing the private set intersection service with this other party. The server can continue to perform the private set intersection service with the other party according to the encrypted result, the second key generated by itself, and the data held by itself. For example, for server B, determine E B and EE A and return to server A, so that server A can determine the private set intersection result.
[0050] Based on Figure 1 the intrusion detection method of private set intersection shown, for the parties participating in the private set intersection, after receiving the encrypted data sent by other parties, according to the encrypted data, judge whether the encrypted data is the calculation result of the power of the specified base number. If so, do not perform the subsequent steps of the private set intersection operation.
[0051] It can be seen from the above method that this method can detect whether there is a situation of maliciously constructing special values when other parties participating in the private set intersection transmit the encrypted result, so as to judge whether other parties may crack their own keys. And when it is determined that there is a cracking risk, then send data to other parties. Even if the data is encrypted by its own key, there is also a risk of leakage. Therefore, the private set intersection service is not continued to avoid the leakage of private data.
[0052] In addition, in one or more embodiments of this specification, before step S100, according to Figure 1 the process of DH-PSI shown, this participating party can also receive the private set intersection request sent by other parties initiating the service, and the prime number generated by this other party is carried in the private set intersection request.
[0053] In the process of DH-PSI constructed based on the intractability of discrete logarithms, if the prime number is small, the encrypted data can be decrypted by brute-force trial and error. Therefore, before the server determines that the other party is legitimate based on step S104 and continues to perform the private set intersection service, it can also judge whether the prime number is greater than the third preset value.
[0054] Specifically, the server can determine whether the number of digits of the prime number is greater than a third preset value, where the third preset value can be set to 1024 bits, that is, the number of digits of the prime number should be greater than 1024 bits. If so, it is determined that the encryption result obtained by encrypting based on the prime number is secure, and the private set intersection service can continue to be executed. If not, it is determined that the prime number is insecure and the private set intersection service is not continued. That is, the server can perform the operation of step S106.
[0055] In addition, since each party participating in the private set intersection usually pre-agrees on each party, it is also possible to pre-agree on the number of digits of the randomly generated prime number. When executing the service, judge whether the number of digits of the prime number carried in the service request is equal to the agreed number of digits of the prime number. If they are inconsistent, it is determined that the party initiating the service is illegal and may have been invaded, and the service is not continued. If they are consistent, the service is continued. That is, even if an attacker impersonates a party to initiate a private set intersection service, if the attacker does not know the pre-agreed number of digits of the prime number, other parties can also judge that there is a risk of being attacked and stop continuing to execute the service.
[0056] For example, taking the private set intersection to determine the common suppliers of each party as an example, generally when at least some of each party have the need to determine the common suppliers, it is possible to determine in advance which parties participate in the private set intersection, and at the same time, the size of the basic prime number required for encryption can be agreed. Suppose there are two parties M and N. Both parties need to predict the future production capacity of the suppliers based on the supplier data to determine the sales plan, and the weights of the data of the common suppliers and the non-common suppliers of the two parties may vary. Therefore, in order not to expose the supplier lists of both parties, the common suppliers of both parties can be determined through the private set intersection method. Since both parties M and N have the above needs, both parties can agree to perform the private set intersection service through server A of party M and server B of party N, and either party can initiate a private set intersection service request as needed. And if the number of digits of the prime number randomly generated by the party initiating the service is 1024 bits, then when any party receives the service request sent by the other party and determines that the number of digits of the prime number carried therein is not 1024 bits, it can determine that it may have been attacked and stop executing the service.
[0057] Furthermore, in one or more embodiments of the present specification, even if the server determines that the prime number is greater than the first setting and belongs to a large prime number, if the large prime number is specially constructed by an attacker, there is also a risk of data leakage in continuing the subsequent service based on the prime number.
[0058] Specifically, for any prime number p, if the prime number p satisfies the factorization result: Then, the data encrypted based on the prime number p may lead to the disclosure of data privacy when encountering a small subgroup attack,
[0059] cracking the key generated by the participating party and causing the leakage of data privacy.
[0060] Therefore, when the server receives the private set intersection request sent by the other participating party, it can determine that the prime number generated by the other participating party is carried in the private set intersection request. Then, it determines the difference between the prime number and the fourth preset value, and uses the difference as the dividend. Then, it calculates the quotient of the dividend divided by the preset divisor, and determines whether the quotient is a prime number. If so, it determines that the other participating party is legal, and continues to execute the subsequent steps based on the second key generated by itself, the data to be encrypted held by itself, and the prime number. Among them, the fourth preset value can be set to 1, and the divisor can be set to 2.
[0061] For example, for server B, the server B can determine p - 1 as the dividend according to the prime number p sent by server A, and determine whether (p - 1) / 2 is still a prime number. If so, it can calculate E B and EE A and return it to server A. Otherwise, it does not return the encryption result to server A.
[0062] In addition, it should be noted that for the participating party initiating the service, since it is the service initiator, it can determine the encryption result and send it to other participating parties on the premise that the prime number randomly generated by itself meets the security requirements. If the encryption result returned by other participating parties does not meet the requirements, it means that there is an abnormality in the encrypted data, and it is impossible to determine whether the result of the private set intersection is accurate. Therefore, the server may also not continue the subsequent steps. However, since the prime number generated by it is secure, through the Figure 1 encryption process shown, even if other participating parties are invaded, data leakage will not occur.
[0063] Furthermore, in this specification, for the calculation process of the private set intersection in this specification, the invading party can also construct incorrect data to make the calculation result incorrect. If the error cannot be detected in time, it will lead to an incorrect calculation result and may also expose the data of the participating party. For example, since the common data of each participating party is determined by intersecting the data, the risk of disclosing the common data among each participating party is relatively low. However, if the calculated result of the private set intersection is incorrect, it may expose the non-common data.
[0064] Therefore, the server can also determine whether there is a large amount of numerical fluctuation in each encrypted data in the encryption result. If so, the probability of abnormality in the encrypted data is relatively high, and the server can stop continuing to execute the service.
[0065] Specifically, first, the server can determine the data whose value is equal to the fifth preset value from each encrypted data included in the encryption result. Second, it accumulates the number of data equal to the fifth preset value and determines whether this number is greater than the preset quantity threshold. If so, it determines that there is a risk in the encryption result sent by other parties and stops executing the private set intersection service. Among them, the fifth preset value can be set to -1, 0, or 1.
[0066] In addition, in this specification, after the server determines that other parties are legal in step S108, it can continue to determine whether the encrypted data meets the small subgroup attack condition, that is, whether it becomes vulnerable to cracking due to a small subgroup. The server can, for each encrypted data included in the encryption result, determine the power of the encrypted data of the sixth preset value with respect to the sixth preset value as the modulo value according to the encrypted data and the sixth preset value. Among them, the sixth preset value can adopt the generator g of the prime number p in the DH algorithm. Then the determined modulo value can be represented by That is, the modulo value of the i-th encrypted data.
[0067] After that, the server can determine whether the result of taking the modulo of the modulo value with respect to the prime number is the seventh preset value, where the seventh preset value can be set to 1. That is, it determines whether holds.
[0068] If so, it determines that the other party is illegal and refuses to send the encrypted result after encrypting the data it holds to the other party. If not, it determines that the other party is legal.
[0069] Furthermore, in this specification, if the second key generated by the server is relatively simple, there may also be a possibility of being easily brute-forced. Therefore, after the server receives a request to determine the prime number, it generates a second key according to the prime number. It can also determine whether the number of bits of the second key is greater than the eighth preset value. If so, it determines that the second key is available and, when determining that other parties are legal in step S108, encrypts according to the second key to execute other steps of the private set intersection. If not, it regenerates the second key according to the prime number until the regenerated second key is greater than the eighth preset value.
[0070] Among them, the eighth preset value can be set to 160 bits, 250 bits, or 520 bits, etc., which are not limited in this specification. And the length of the second key can also be pre-agreed, and the second key is generated according to the pre-agreed length when generating the second key.
[0071] Further, in one or more embodiments of this specification, to avoid incorrect modulo results, after receiving the encrypted result, the server may also, for each encrypted data included in the encrypted result, determine the second key power of the encrypted data according to the second key as the operation value, and then, according to the prime number, determine whether the operation value is greater than the prime number. If so, it performs the private set intersection service with the other participating parties. If not, it refuses to send the encrypted data to the other participating parties. That is, the server may also determine whether (u j ) b is greater than p. If so, it continues to execute the subsequent steps. Otherwise, it determines that there is an abnormality and stops executing the private set intersection service.
[0072] The above is the intrusion detection method for private set intersection provided by one or more embodiments of this specification. Based on the same idea, this specification also provides a corresponding intrusion detection device for private set intersection, as Figure 3 shown.
[0073] Figure 3 FIG. is a schematic diagram of an intrusion detection device for private set intersection provided by this specification, specifically including:
[0074] A receiving module 200, which receives the encrypted data sent by other participating parties. The encrypted data is obtained by the other participating parties respectively encrypting the data held by the other participating parties using the first key corresponding to the other participating parties;
[0075] A first detection module 202, which determines whether the encrypted data is the calculation result of the power of a specified base number according to the encrypted data. If so, it determines that the other participating party is illegal and refuses to send the data held by itself to the other participating party. If not, it determines that the other participating party is legal and continues to perform the private set intersection service with the other participating party based on the encrypted data, the pre-generated second key, and the data held by itself.
[0076] Optionally, the first detection module 202 determines a verification value according to the difference between the encrypted data and a first preset value, and determines whether the result of the AND calculation of the encrypted data and the verification value is a second preset value. If so, it determines that the other participating party is illegal. If not, it determines that the other participating party is legal.
[0077] Optionally, the device further includes:
[0078] The second detection module 204 receives a private set intersection request sent by the other participating party and carrying a prime number generated by the other participating party, determines whether the prime number is greater than a third preset value. If so, it determines that the other participating party is legal, and continues to execute the private set intersection service with the other participating party based on a pre-generated second key, a number of data held by itself, and the prime number. If not, it determines that the other participating party is illegal and refuses to execute the private set intersection service with the other participating party.
[0079] Optionally, the device further includes:
[0080] The second detection module 204 receives a private set intersection request sent by the other participating party and carrying a prime number generated by the other participating party, determines the difference between the prime number and a fourth preset value as the dividend, and determines whether the quotient obtained by dividing the dividend by a preset divisor is a prime number. If so, it determines that the other participating party is legal, and continues to execute the private set intersection service with the other participating party based on a pre-generated second key, a number of data held by itself, and the prime number. If not, it determines that the other participating party is illegal and refuses to execute the private set intersection service with the other participating party.
[0081] Optionally, there are multiple pieces of encrypted data. The first detection module 202 determines the number of pieces of encrypted data whose values are equal to a fifth preset value from each piece of encrypted data, and determines whether the number is greater than a preset number threshold. If so, it determines that the participating party is illegal and refuses to execute the private set intersection service with the other participating party. If not, it determines that the other participating party is legal.
[0082] Optionally, there are multiple pieces of encrypted data. The first detection module 202, for each piece of encrypted data, determines the power of the sixth preset value to the power of this piece of encrypted data as the modulo value according to the encrypted data and the sixth preset value, and determines whether the result of taking the modulo of the modulo value with respect to the prime number is a seventh preset value according to the modulo value and the prime number. If so, it determines that the other participating party is illegal and refuses to execute the private set intersection service with the other participating party. If not, it determines that the other participating party is legal.
[0083] Optionally, the device further includes:
[0084] The generation module 206 randomly generates the second key according to the prime number, and determines whether the second key is greater than an eighth preset value. If so, when determining that the other participating party is legal, it interacts with the other participating party to execute the private set intersection service at least according to the second key. If not, it regenerates the second key according to the prime number until the regenerated second key is greater than the eighth preset value.
[0085] Optionally, there are multiple pieces of encrypted data. The first detection module 202, for each piece of encrypted data, determines the second key power of the encrypted data as the operation value according to a pre-generated second key, and determines whether the operation value is greater than the prime number according to the prime number. If so, it performs a private set intersection service with the other participating parties. If not, it refuses to perform the private set intersection service with the other participating parties.
[0086] This specification also provides a computer-readable storage medium that stores a computer program, and the computer program can be used to execute the above Figure 2 provided intrusion detection method for private set intersection.
[0087] This specification also provides Figure 4 a schematic structural diagram of the electronic device shown. As Figure 4 described, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory. Of course, it may also include other hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it to implement the above Figure 2 described intrusion detection method for private set intersection. Of course, in addition to the software implementation method, this specification does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, and can also be hardware or a logic device.
[0088] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software improvements (improvements to method flows). However, with the development of technology, many method flow improvements today can be regarded as direct improvements to hardware circuit structures. Designers almost always obtain the corresponding hardware circuit structure by programming the improved method flow into the hardware circuit. Therefore, it cannot be said that an improvement to a method flow cannot be implemented using a hardware entity module. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is an integrated circuit whose logic function is determined by the user programming the device. Designers can program themselves to "integrate" a digital system onto a single PLD, without having to ask a chip manufacturer to design and fabricate a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly implemented using "logic compiler" software, which is similar to the software compilers used in program development and writing. The original code before compilation also has to be written in a specific programming language, which is called a Hardware Description Language (HDL), and there is not just one kind of HDL, but many kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used ones currently are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also be aware that by simply performing a little logical programming on the method flow using the above-mentioned several hardware description languages and programming it into an integrated circuit, it is easy to obtain the hardware circuit that implements the logical method flow.
[0089] The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor and a computer-readable medium storing computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, an application specific integrated circuit (ASIC), a programmable logic controller, and an embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that, in addition to implementing the controller in the form of pure computer-readable program code, it is entirely possible to logically program the method steps to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.
[0090] The systems, devices, modules, or units illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0091] For the convenience of description, when describing the above devices, they are described separately as various units according to their functions. Of course, when implementing this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0092] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program code.
[0093] The present invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each flow and / or block of the flowchart illustrations and / or block diagrams, and combinations of flows and / or blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing apparatus create means for implementing the functions specified in the flowchart Figure 1 one flow or more flows and / or blocks Figure 1 or means for implementing the functions specified in one block or more blocks.
[0094] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means that implement the functions specified in the flowchart Figure 1 one flow or more flows and / or blocks Figure 1 or means for implementing the functions specified in one block or more blocks.
[0095] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart Figure 1 one flow or more flows and / or blocks Figure 1 or means for implementing the functions specified in one block or more blocks.
[0096] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.
[0097] The memory may include non-permanent memory in the form of computer-readable media, random access memory (RAM), and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of computer-readable media.
[0098] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0099] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0100] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, this specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0101] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0102] Each embodiment in this specification is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other, and the key point of each embodiment is to illustrate the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the relevant parts, reference can be made to the partial description of the method embodiment.
[0103] The above description is only for the embodiments of this specification and is not intended to limit this specification. For those skilled in the art, various modifications and changes can be made to this specification. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included within the scope of the claims of this application.
Claims
1. An intrusion detection method for private set intersection, where the intrusion detection is applied to the participating parties performing private set intersection, and the method includes: Receiving encrypted data sent by other participating parties, where the encrypted data is obtained by the other participating parties encrypting the data they hold using the corresponding first key of the other participating parties; Judging whether the encrypted data is the calculation result of the power of a specified base number according to the encrypted data; If so, determining that the other participating party is illegal and refusing to send the data held by itself to the other participating party; If not, determining that the other participating party is legal and continuing to perform the private set intersection service with the other participating party based on the encrypted data, the pre-generated second key, and the data held by itself.
2. The method according to claim 1, judging whether the encrypted data is the calculation result of the power of a specified base number according to the encrypted data, specifically including: Determining a verification value according to the difference between the encrypted data and a first preset value; Judging whether the result of the AND calculation of the encrypted data and the verification value is a second preset value.
3. The method according to claim 1, the method further includes: Receiving a private set intersection request sent by the other participating party, where the private set intersection request carries a prime number generated by the other participating party; Judging whether the prime number is greater than a third preset value; If so, determining that the other participating party is legal and continuing to perform the private set intersection service with the other participating party based on the pre-generated second key, several data held by itself, and the prime number; If not, determining that the other participating party is illegal and refusing to perform the private set intersection service with the other participating party.
4. The method according to claim 1, the method further includes: Receiving a private set intersection request sent by the other participating party, where the private set intersection request carries a prime number generated by the other participating party; Determining the difference between the prime number and a fourth preset value as the dividend; Judging whether the quotient of the dividend divided by a preset divisor is a prime number; If so, determining that the other participating party is legal and continuing to perform the private set intersection service with the other participating party based on the pre-generated second key, several data held by itself, and the prime number; If not, determining that the other participating party is illegal and refusing to perform the private set intersection service with the other participating party.
5. The method according to claim 1, where there are multiple pieces of encrypted data; Before determining that the other participating party is legal, the method further includes: Determining the number of encrypted data with a value equal to a fifth preset value from each piece of encrypted data; And judging whether the number is greater than a preset number threshold; If so, determining that the other participating party is illegal and refusing to perform the private set intersection service with the other participating party; If not, determining that the other participating party is legal.
6. The method according to claim 3 or 4, where there are multiple pieces of encrypted data; Before determining that the other participating party is legal, the method further includes: For each encrypted data, determine the power of the sixth preset value to the power of this encrypted data according to the encrypted data and the sixth preset value, as the modulo value; According to the modulo value and the prime number, determine whether the result of taking the modulo of the modulo value by the prime number is the seventh preset value; If so, determine that the other party is illegal and refuse to perform the private set intersection service with the other party; If not, determine that the other party is legal.
7. The method according to claim 3 or 4, the method further includes: Randomly generate the second key according to the prime number; Determine whether the second key is greater than the eighth preset value; If so, when determining that the other party is legal, at least interact with the other party to perform the private set intersection service according to the second key; If not, regenerate the second key according to the prime number until the regenerated second key is greater than the eighth preset value.
8. The method according to claim 3 or 4, where there are multiple encrypted data; Before performing the private set intersection service with the other party, the method further includes: For each encrypted data, determine the power of the second key to the power of this encrypted data according to the pre-generated second key, as the operation value; According to the prime number, determine whether the operation value is greater than the prime number; If so, perform the private set intersection service with the other party; If not, refuse to perform the private set intersection service with the other party.
9. An intrusion detection device for private set intersection, including: A receiving module, which receives encrypted data sent by other parties, where the encrypted data is obtained by encrypting the data held by the other parties respectively using the first key corresponding to the other parties; A first detection module, which determines whether the encrypted data is the calculation result of the power of a specified base number according to the encrypted data. If so, determine that the other party is illegal and refuse to send the data held by itself to the other party. If not, determine that the other party is legal and continue to perform the private set intersection service with the other party based on the encrypted data, the pre-generated second key, and the data held by itself.
10. The device according to claim 9, the first detection module determines a verification value according to the difference between the encrypted data and the first preset value, and determines whether the result of performing an AND calculation on the encrypted data and the verification value is the second preset value. If so, determine that the other party is illegal. If not, determine that the other party is legal.
11. The device according to claim 9, the device further includes: The second detection module receives a private set intersection request sent by the other participating party and carrying a prime number generated by the other participating party, and determines whether the prime number is greater than a third preset value. If so, it determines that the other participating party is legal, and continues to execute the private set intersection service with the other participating party based on a pre-generated second key, a number of data held by itself, and the prime number. If not, it determines that the other participating party is illegal and refuses to execute the private set intersection service with the other participating party.
12. The device according to claim 9, wherein the device further comprises: The second detection module receives a private set intersection request sent by the other participating party and carrying a prime number generated by the other participating party, determines the difference between the prime number and a fourth preset value as the dividend, and determines whether the quotient obtained by dividing the dividend by a preset divisor is a prime number. If so, it determines that the other participating party is legal, and continues to execute the private set intersection service with the other participating party based on a pre-generated second key, a number of data held by itself, and the prime number. If not, it determines that the other participating party is illegal and refuses to execute the private set intersection service with the other participating party.
13. The device according to claim 9, wherein there are multiple pieces of encrypted data, and the first detection module determines the number of encrypted data with values equal to a fifth preset value from each piece of encrypted data, and determines whether the number is greater than a preset number threshold. If so, it determines that the participating party is illegal and refuses to execute the private set intersection service with the other participating party. If not, it determines that the other participating party is legal.
14. The device according to claim 11 or 12, wherein there are multiple pieces of encrypted data, and for each piece of encrypted data, the first detection module determines the power of the sixth preset value to the power of this piece of encrypted data as the modulo value according to the encrypted data and the sixth preset value, and determines whether the result of taking the modulo of the modulo value with respect to the prime number is a seventh preset value according to the modulo value and the prime number. If so, it determines that the other participating party is illegal and refuses to execute the private set intersection service with the other participating party. If not, it determines that the other participating party is legal.
15. The device according to claim 11 or 12, wherein the device further comprises: A generation module randomly generates the second key according to the prime number, and determines whether the second key is greater than an eighth preset value. If so, when determining that the other participating party is legal, it interacts with the other participating party to execute the private set intersection service at least according to the second key. If not, it regenerates the second key according to the prime number until the regenerated second key is greater than the eighth preset value.
16. The device according to claim 11 or 12, wherein there are multiple pieces of encrypted data, and the first detection module, for each piece of encrypted data, determines the second key power of the encrypted data as an operation value according to a pre-generated second key, and determines whether the operation value is greater than the prime number according to the prime number. If so, perform a private set intersection service with the other participating parties. If not, refuse to perform the private set intersection service with the other participating parties.
17. A computer-readable storage medium storing a computer program, which when executed by a processor implements the method according to any one of claims 1 to 8 above.
18. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, it implements the method according to any one of claims 1 to 8 above.
Citation Information
Patent Citations
Challenge-response signatures and secure diffie-hellman protocols
CN101116281A
Identifier conversion method and device and privacy item conversion method and device
CN114465740A