A secure two-party numerical comparison method and apparatus based on scale transformation

By performing scaling and linear scaling locally on the participating nodes, combined with a secure two-party scalar product protocol, the problems of high computational complexity and information leakage in existing technologies are solved, achieving efficient and secure two-party numerical comparison and ensuring that data privacy is not leaked.

CN119323050BActive Publication Date: 2025-11-07BEIHANG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411354021.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-11-07
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

Existing secure two-party numerical comparison schemes suffer from high computational complexity, low efficiency, unfair output, and reliance on unreliable outsourced cloud service systems, posing a risk of information leakage.

Method used

A secure two-party numerical comparison method based on scaling transformation is adopted. By performing scaling transformation and linear scaling locally on the participating nodes, the real numbers are determined using a secure two-party scalar product protocol, and symbol information is shared locally to avoid information interaction and ensure data security.

Benefits of technology

It improves data security during the comparison of numerical values ​​between the two parties, ensures that participating nodes cannot obtain the other party's private data information, avoids leakage of intermediate results, and achieves efficient, secure, and reliable privacy computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323050B_ABST
    Figure CN119323050B_ABST
Patent Text Reader

Abstract

The application discloses a scale transformation-based secure two-party numerical comparison method and device, relates to the field of data security, and comprises the following steps: a computing request direction two-party node sends a two-party numerical comparison request; after receiving the two-party numerical comparison request, the two-party node locally performs scale transformation and linear scaling processing on private data in sequence to obtain an encrypted vector; the two-party node determines a real number locally according to the local encrypted vector by using a secure two-party scalar product protocol, and shares the real number with other two-party nodes; the two-party node respectively determines a numerical comparison symbol according to the obtained real number and sends the numerical comparison symbol to the computing request party; and the computing request party determines a comparison result of the private data of the two-party nodes according to the numerical comparison symbols sent by the two-party nodes. The application improves the security of private data in the two-party numerical comparison process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of data security, and particularly relates to a secure two-party numerical comparison method and device based on scale transformation. BACKGROUND

[0002] With the advent of cloud computing and general artificial intelligence model technology, the world has officially entered the era of "data-driven" information intelligence, and data has become an important strategic resource between countries, institutions and enterprises. Correspondingly, due to negligence and abuse of data privacy, privacy data leakage incidents have occurred frequently in recent years, such as in May 2016, the American professional social networking site LinkedIn announced that the email addresses and passwords of nearly 167 million users were leaked and sold by a hacker organization; In March 2018, the American social media Facebook admitted that the personal information of nearly 50 million users was illegally collected and leaked by a personality test software. In response to this series of incidents, in order to avoid the negative impact and economic losses caused by continuous privacy leakage, countries have also enacted and implemented corresponding privacy protection regulations and laws. However, it is far from enough to constrain the occurrence of privacy leakage from the legislative level, and it is necessary and cannot be ignored to introduce some privacy computing technology from the technical level to face the diversified business scenarios and problem challenges. SUMMARY

[0003] The purpose of the present application is to provide a secure two-party numerical comparison method and device based on scale transformation, which can improve the security of private data in the two-party numerical comparison process.

[0004] To achieve the above purpose, the present application provides the following solutions:

[0005] In a first aspect, the present application provides a secure two-party numerical comparison method based on scale transformation, comprising:

[0006] A computing request sends a two-party numerical comparison request to a first participant node and a second participant node; the first participant node holds first private data, and the second participant node holds second private data;

[0007] After the first participant node and the second participant node receive the two-party numerical comparison request, the first participant node performs scale transformation on the first private data to obtain a first multi-dimensional vector, and the second participant node performs scale transformation on the second private data to obtain a second multi-dimensional vector;

[0008] The first participant node performs linear scaling on the first multi-dimensional vector to obtain a first encrypted vector, and the second participant node performs linear scaling on the second multi-dimensional vector to obtain a second encrypted vector;

[0009] The first participant node and the second participant node respectively determine a first real number and a second real number based on a secure two-party scalar product protocol according to the first encryption vector and the second encryption vector; a sum of the first real number and the second real number is equal to a scalar product of the first encryption vector and the second encryption vector; the first participant node and the second participant node share the first real number and the second real number;

[0010] The first participant node and the second participant node respectively determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, and respectively send the first numerical comparison symbol and the second numerical comparison symbol to the computing requestor;

[0011] The computing requestor determines a comparison result of the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

[0012] In a second aspect, the present application provides a secure two-party numerical comparison device based on scale transformation, comprising a computing requestor, a first participant node and a second participant node; the first participant node holds first private data, and the second participant node holds second private data;

[0013] The computing requestor is configured to send a two-party numerical comparison request to the first participant node and the second participant node;

[0014] The first participant node is configured to perform scale transformation on the first private data to obtain a first multi-dimensional vector, perform linear scaling on the first multi-dimensional vector to obtain a first encryption vector, determine a first real number based on a secure two-party scalar product protocol according to the first encryption vector, and share the first real number with the second participant node;

[0015] The second participant node is configured to perform scale transformation on the second private data to obtain a second multi-dimensional vector, perform linear scaling on the second multi-dimensional vector to obtain a second encryption vector, determine a second real number based on a secure two-party scalar product protocol according to the second encryption vector, and share the second real number with the first participant node; a sum of the first real number and the second real number is equal to a scalar product of the first encryption vector and the second encryption vector;

[0016] The first participant node is further configured to determine a first numerical comparison symbol according to the first real number, and send the first numerical comparison symbol to the computing requestor;

[0017] The second participant node is further configured to determine a second numerical comparison symbol according to the second real number, and send the second numerical comparison symbol to the computing requestor;

[0018] The computing requester is further configured to determine a comparison result of the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

[0019] According to the specific embodiments provided in the application, the following technical effects are disclosed:

[0020] The application provides a secure two-party numerical comparison method and device based on scale transformation. The scale transformation and linear scaling processes of private data are both performed locally at two participant nodes, and do not involve any interaction of two-party information, so there is no risk of exposure of private data. The two participant nodes determine a first real number and a second real number based on a secure two-party scalar product protocol, and share the first real number and the second real number. For any participant node, only two real numbers can be obtained, but the private data of the other participant node cannot be derived from the two real numbers. The two participant nodes determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number respectively. The symbol conversion only serves to maintain the consistency of the symbol, and does not involve any interaction of two-party numerical values, so the process does not leak any original input information. The process of summarizing the result by the computing requester does not involve any interaction of the participant nodes, so there is no information leakage, and therefore the security of private data in the two-party numerical comparison process is improved. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the application or the prior art, the following will briefly introduce the drawings needed in the embodiments. Obviously, the drawings in the following description are only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained from these drawings without creative labor.

[0022] Figure 1 A flowchart of a secure two-party numerical comparison method based on scale transformation provided by an embodiment of the application is shown in the figure.

[0023] Figure 2 A principle diagram of a secure data obfuscation technology provided by an embodiment of the application is shown in the figure.

[0024] Figure 3 A schematic diagram of a secure two-party numerical comparison problem provided by an embodiment of the application is shown in the figure.

[0025] Figure 4 A flowchart of a secure two-party numerical comparison protocol provided by an embodiment of the application is shown in the figure.

[0026] Figure 5 A schematic diagram of a secure two-party scalar product problem provided by an embodiment of the application is shown in the figure.

[0027] Figure 6 A flow chart of a secure two-party scalar product computation protocol provided by an embodiment of the present application;

[0028] Figure 7 A schematic diagram of a secure two-party subtraction computation problem provided by an embodiment of the present application;

[0029] Figure 8 A flow chart of a secure two-party subtraction protocol provided by an embodiment of the present application;

[0030] Figure 9 A schematic diagram of a secure two-party numerical comparison device based on scale transformation provided by an embodiment of the present application. DETAILED DESCRIPTION

[0031] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0032] First, relevant terms are introduced:

[0033] Semi-honest model: a specific protocol assuming that all participating computing parties will honestly participate in privacy computation, strictly follow each step of the protocol, but there are some corrupted parties trying to speculate the privacy of other parties through the intermediate or final results of the protocol execution process.

[0034] Secure two-party scalar product protocol: assuming that there are two mutually distrustful participants, each of which holds a secret input vector x and y, and they jointly execute a two-party scalar product protocol f(x, y) = Output(v1, v2) = x ⊙ y, and finally each participant gets the corresponding output v1, v2, and the output satisfies v1 + v2 = x ⊙ y. During the entire computation process, each participant node only knows the input and output data involved in its own computation process, and cannot obtain any intermediate computation result about the other party.

[0035] Secure two-party numerical comparison protocol: assuming that there are two mutually distrustful participants, each of which holds a secret real number x and y as input, and they jointly execute a two-party comparison protocol and δ a = δ bSign(σ) = Output {-1, 0, 1}, and finally each participant knows the size relationship of each other, where "-1" represents x < y, "0" represents x = y, and "1" represents x > y. During the entire calculation process, each participant node only knows the input and output data involved in its own calculation process and cannot obtain any intermediate calculation results about other participants.

[0036] Secure data obfuscation technology: a data protection means for protecting the intermediate results of multi-party secure calculation, which randomly splits the calculation results by reasonably constructing the calculation protocol, so that the multi-party outputs together constitute the real target calculation result in the form of linear combination, and finally realizes the one-time one-micro data privacy protection effect.

[0037] Privacy computing technology: specifically refers to a series of information security technologies that break down data silos, cooperate with multi-party calculation, and ultimately realize complex calculation and modeling analysis on multi-source data under the premise of not exposing the privacy of each party's private data, ensuring that data elements are "available but invisible" in the circulation and integration process.

[0038] The "secure two-party comparison problem" originated from the millionaire problem proposed by Academician Yao Qizhi in 1982, which is to compare who is richer between two millionaires without revealing the wealth values of both parties. Academician Yao Qizhi proposed an initial research scheme for such secure comparison problems - secure two-party computing technology based on obfuscation circuit. In recent years, researchers have proposed a series of more secure, efficient, and practical schemes for this problem, and widely used this technology in privacy-protected machine learning, cloud computing, distributed large model training, etc. For example: in the data preprocessing and cleaning process, data alignment operations are usually performed through privacy comparison; in the large model training stage, the maximum pooling layer in the neural network layer also involves secure multi-party numerical comparison problems; in the scenario of using decision tree model and K-Nearest Neighbor (KNN) model for multi-party data classification, privacy comparison technology is also frequently used for data sorting and screening. Existing secure comparison technology schemes include the following:

[0039] 1) Obliv-C and ABY3 obfuscation circuit framework developed by Zahur, Hussain, Mohassel, etc. converts mathematical operations (addition and multiplication) into Boolean circuits and combines secure shuffling and Oblivious Transfer (OT) encryption technology to protect the corresponding circuit output of each input. Obliv-C and ABY3 framework are general secure two-party computing solutions based on obfuscation circuit, which can support secure two-party comparison. However, this type of scheme requires the construction of a large number of circuits, resulting in high computational and space complexity, low computational efficiency, and insufficient practicality.

[0040] 2) MPyC and SecureNN framework developed by Schoenmakers, Wagh, etc. uses the idea of Shamir secret sharing to hide secret values, and they randomly split each secret value into multiple slices through the interaction of various participants, and use a threshold number of nodes to reconstruct and combine when needed, to achieve the difference value solving of the values to be compared. MPyC and SecureNN framework hide the difference value of the two compared values based on the secret sharing idea, however, such a scheme involves a large amount of message exchange between multiple parties, which will cause the problem of low communication efficiency.

[0041] 3) Lin, Zhao, etc. combined ElGamal homomorphic encryption scheme and string set intersection size comparison method to compare the 0 and 1 encodings of two parties and combined Paillier primitive to propose a SOCI framework to solve the problem of outsourcing scene large integer ciphertext comparison, using public key encryption and calculating the ciphertext and then using private key decryption result, although it ensures the security of the calculation result, but due to the complexity of its own ciphertext calculation and its dependence on third-party cloud platform for calculation, there is a problem of large cost of calculation storage and communication overhead, and once the third-party cloud platform is attacked, there is a risk of data leakage.

[0042] 4) Veugen, Damgard, etc. proposed a method of converting a certain secret polynomial sharing into bit sharing, which realizes secure two-party difference calculation and comparison by calling GSV07 secret sharing protocol, although it reduces the calculation complexity compared with the homomorphic scheme, but due to the excessive protection of the output result, on the one hand, it reduces the efficiency of the final protocol execution, on the other hand, it introduces more calculation cost.

[0043] Most of the above schemes use the method of one party calculating the result and publishing it to the other party to get the final comparison result, so there are problems of result reliability and fairness. Once the party that gets the comparison result first exits the protocol or broadcasts the wrong result, the final correct comparison result cannot be obtained.

[0044] The present application mainly focuses on the problem of secure two-party numerical comparison, and realizes an efficient, secure and reliable privacy nonlinear numerical calculation method. Therefore, based on the above target, the technical problems to be solved by the present application are as follows:

[0045] 1) The existing solutions to the problem of secure two-party numerical comparison mostly use traditional basic cryptography primitives such as homomorphic encryption, secret sharing, and garbled circuit to develop calculation framework. These methods rely on ciphertext calculation with high time complexity and space complexity, which leads to the problem of low efficiency and insufficient practicality.

[0046] 2) The output of the existing security two-party numerical comparison protocol does not have fairness and consistency, and the calculation result is usually that one party obtains the comparison result first and then notifies the other party of the comparison result. This mode has the constraint problem that the output is too dependent on whether one party is trustworthy.

[0047] 3) The application scene of the existing security two-party numerical comparison scheme depends on the implementation of the outsourcing cloud service system, and the trustworthiness of the third-party cloud service computing platform is not high or is attacked by malicious nodes, which may cause leakage of intermediate calculation results or key information, further causing security risks of privacy leakage of the original data party.

[0048] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application will be further described in detail below in combination with the drawings and specific embodiments.

[0049] In an exemplary embodiment, as shown in Figure 1 a scale transformation-based security two-party numerical comparison method is provided, including the following steps 101 to 106. Among them:

[0050] Step 101, a two-party numerical comparison request is sent to a first participant node and a second participant node by a calculation request party. The first participant node holds first private data, and the second participant node holds second private data.

[0051] Step 102, after the first participant node and the second participant node receive the two-party numerical comparison request, the first participant node performs scale transformation on the first private data to obtain a first multi-dimensional vector, and the second participant node performs scale transformation on the second private data to obtain a second multi-dimensional vector.

[0052] Step 103, the first participant node performs linear scaling on the first multi-dimensional vector to obtain a first encrypted vector, and the second participant node performs linear scaling on the second multi-dimensional vector to obtain a second encrypted vector.

[0053] Step 104, the first participant node and the second participant node respectively determine a first real number and a second real number based on the first encrypted vector and the second encrypted vector according to a security two-party scalar product protocol.

[0054] The sum of the first real number and the second real number is equal to the scalar product of the first encrypted vector and the second encrypted vector. The first participant node and the second participant node share the first real number and the second real number.

[0055] Step 105, the first participant node and the second participant node respectively determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, and respectively send the first numerical comparison symbol and the second numerical comparison symbol to the calculation requestor.

[0056] Step 106, the calculation requestor determines the comparison result of the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

[0057] The scale transformation-based secure two-party numerical comparison method provided in the application is applied in a privacy set intersection scenario of a distributed database, a distributed large model training scenario, or a multi-party data classification scenario using a decision tree model.

[0058] In the privacy set intersection scenario of a distributed database, the first participant node is a computer device that owns a first privacy set, the second participant node is a computer device that owns a second privacy set, the first private data is data in the first privacy set, and the second private data is data in the second privacy set; the calculation requestor determines the intersection of the first privacy set and the second privacy set according to the comparison result of the first private data and the second private data.

[0059] In one exemplary instance, in the financial field, it is often necessary to match the deposit, loan, and salary flow records of a customer group in different banking institutions to evaluate the credit of the customer and divide the customer into different levels. The premise for solving this problem is to find the associated users through two-party database joint intersection before matching the data, and since different banking institutions have their own confidential database systems due to supervision and security policies, how to find the common customers distributed in the multi-party banking database without revealing the private data of each party is a typical privacy intersection problem.

[0060] Here, it is assumed that the private data table owned by bank A is Table A ={ID A ,ω A1 ,…,ω Am}, and the private data table owned by bank B is Table B ={ID B ,ω B1 ,…,ω Bn}. Where ID A and ID B represent the data sets containing user identity identifiers of bank A and bank B, respectively, and ω Am and ω Bnrepresent the rest of the financial attribute features of the customers of bank A and bank B respectively. Since the goal is to find the common customers jointly, we only need to find the same user IDs in the data columns containing user ID information ψ A = {ID A1 ,ID A2 ,…,ID Am} and ψ B = {ID B1 ,ID B2 ,…,ID Bn}, i.e., find the intersection of the user ID sets with privacy. Since the data privacy restriction prohibits the two parties from revealing any information of their respective local private data columns, we use the secure two-party numerical comparison method to find the elements with the same value in the sets ψ A and ψ B to solve the two-party data column intersection problem.

[0061] The specific process is as follows: first, the first party node (bank A) uniformly converts the string type data containing user ID information in its set ψ A into Hash numerical values The second party node (bank B) operates similarly Then the first party node compares the elements H Ai in its own set with the elements H Bi in the second party node one by one using secure two-party numerical comparison, which can be obtained by calling the secure two-party numerical comparison method S2PC(H Ai ,H Bj ) based on scale transformation to get the judgment result δ a (i,j) = δ b (i,j) = Sign(H Ai -H Bj ); Finally, the first party node and the second party node can obtain the result matrices S a and S b by calling the secure two-party numerical comparison protocol nm times, where the zero elements in the result matrix S a or S b corresponding to the index (i,j) = {S a (i,j) = 0 or S b (i,j) = 0 | i = 1 ~ m, j = 1 ~ n} represent that the i-th user of the first party node and the j-th user of the second party node are the same person. Similarly, the index set ID inretsection = {(i,j) | S a ​(i,j) = 0 && S b (i,j) = 0} represent the corresponding common users of the two banks.

[0062] In the training scenario of the distributed large model, the first participant node is a computer device that owns a first training sample set, and the second participant is a computer device that owns a second training sample set; the first private data is a sample in the first training sample set, and the second private data is a sample in the second training sample set; the computing request party performs data alignment on the samples in the first training sample set and the samples in the second training sample set according to the comparison result of the first private data and the second private data, to train the distributed large model based on the data-aligned samples.

[0063] The specific processing process is: in the distributed large model training scenario, first, data matching needs to be performed, which is essentially the same as the intersection problem in the above distributed database, and the same sample in different data sets needs to be queried first, and then data splicing is performed. The process of querying the same data sample is the process of finding the intersection according to the sample ID, but the input data at this time becomes the sample ID set ID a of the first participant data set and the sample ID set ID b of the second participant data set. The sample ID can be a common name or an identity number, or any other identity-identifying numerical data.

[0064] In the multi-party data classification scenario using the decision tree model, the first participant node is a computer device that owns a first data set to be classified, the second participant is a computer device that owns a second data set to be classified, the first private data is data in the first data set to be classified, and the second private data is data in the second data set to be classified; the computing request party classifies the data in the first data set to be classified and the second data set to be classified according to the comparison result of the first private data and the second private data.

[0065] The specific processing process is: in the decision tree model, the call of the privacy comparison protocol is common in the result prediction process. Here, a classic binary decision tree CART is taken as an example to illustrate the prediction process, in which the first participant holds the parameters of the decision tree model (including the split features and threshold values of each leaf node), denoted as T. The i-th node of the decision tree model is denoted as T i , if the node is a leaf node, the predicted label result is denoted as ; otherwise, the split feature stored in the node is denoted as , and the threshold value is denoted as This represents the threshold value stored at that node. If x represents a data sample, its i-th feature value is denoted as ω. i The decision tree algorithm predicts data in a top-down order, assigning the threshold value of the current node to each node. corresponding feature values ​​in the data sample Perform a safety comparison and select different branches to continue until the sample reaches a leaf node, obtaining the final prediction result.

[0066] Furthermore, the secure two-party numerical comparison method based on scale transformation provided in this application can also be applied to secret auction scenarios for items. In this scenario, the requesting party is the organization organizing the auction, the first participating node and the second participating node are the buyers participating in the auction, the first private data is the bid of the first participating node, and the second private data is the bid of the second participating node. During the auction process, the bids of the buyers participating in the auction are all private data and are not disclosed to the public. The secure two-party numerical comparison method based on scale transformation provided in this application is used to compare the two bids, and the requesting party determines the ownership of the item based on the bids, thereby improving the confidentiality of the item auction.

[0067] For most multi-party computations, achieving secure computation typically involves multiple interactive steps. An unavoidable challenge arises: how to ensure the security of intermediate results. For example, when using the product of two matrices as an intermediate result, either the first or second participating node, upon obtaining the final matrix result, could potentially deduce the other party's data. Therefore, privacy-preserving computation must guarantee not only the security of the initial input data but also the security of the intermediate results.

[0068] To address this problem, this application proposes a Secure Data Disguising Technology (SDDT), which involves decomposing any multi-ary operation into a new multi-ary addition to obfuscate the result of calculating intermediate values. To better illustrate its principle, this application uses a two-way operation type as an example, and its principle is as follows: Figure 2 As shown. Assume S k =F k (A i B i ), where F k A is the objective function for the k-th step. i B is the private input data belonging to the first participating node at step k. i S is the private input data belonging to the second participating node at step k. k This is an intermediate result from step k. During step k of the execution of the multi-party secure computation protocol, the intermediate result S...k The following constraints will be strictly followed: the first participant node only knows its own calculation result A k and the second participant node only knows its result B k , and A k +B k =S k . The formula [A i :B i ]→[A k :B k |A k +B k =F k (A i ,B i )] represents the transmission process of the intermediate value, and the first participant node and the second participant node are not allowed to exchange each other's data information, including the split A k and B k of the intermediate calculation result, throughout the process. Similarly, for the k+1 step, the input and are composed of the output A k and B k of the first participant node and the second participant node of the k step, and the output A k+1 and B k+1 of and satisfy The first participant node only knows its own calculation result A k+1 and the second participant node only knows its result B k+1 . Therefore, as long as the intermediate value is split into two random data items and stored separately in the two computing participants at each step of the calculation, it can be ensured that no one can reverse the original data item from the obfuscated encrypted data, so that the entire privacy calculation process has high security.

[0069] In a specific example, three protocols are involved: a secure two-party numerical comparison protocol (Secure 2-Party Comparison, S2PC), a secure two-party scalar product protocol (Secure 2-Party Dot Product, S2PDP), and a secure two-party subtraction calculation protocol (Secure 2-Party Subtraction, S2PS). The secure two-party subtraction calculation protocol is not used in the secure two-party numerical comparison method of the present application, but can be combined with the secure two-party subtraction calculation protocol according to the application scenario in actual application. The following describes the three protocols:

[0070] (1) Secure two-party numerical comparison protocol

[0071] The secure two-party numerical comparison problem is usually used in the privacy set intersection of distributed databases, online decision tree privacy sorting, and privacy protection deep neural network, and has wide research value. Therefore, without loss of generality, as shown in the formula (1), let the first private data held by the first participant node in the protocol be a∈R, and the second private data held by the second participant node be b∈R, R is a real number set, and the two participants jointly execute a two-party numerical comparison protocol f Figure 3 S2PC (a,b)=Sign(a-b)=δ a =δ b Finally, each computing participant node obtains the corresponding output indicator δ a , δ b ∈{1,0,-1}, and sends it to the computing requester to obtain the expected result of the two-party numerical comparison. During the calculation process, each participant node can only obtain the input and output information of itself during the calculation process, and cannot obtain the intermediate settlement result and the private data information held by the other participant. As shown in the formula (2), the process is as follows: Figure 4

[0072] Step 11: The first participant node locally performs scale transformation on the first private data a, and through the scale transformation, the first private data a is transformed from a 1-dimensional numerical domain {Dim1:a∈R} to a random vector in a 2n-dimensional vector space {Dim 2n :α∈R 2n}, to obtain a first multi-dimensional vector. The process can be formalized as or or wherein, is the first multi-dimensional vector, Dim1 represents the 1-dimensional numerical domain, and Dim 2n represents the 2n-dimensional vector space.

[0073] Step 12: The second participant node locally performs scale transformation on the second private data, and the process is represented as the second private data b being transformed from a 1-dimensional numerical space {Dim1:b∈R} to a random vector in a 2n-dimensional vector space {Dim 2n :β∈R 2n}, to obtain a second multi-dimensional vector. The process can be formalized as or or wherein, is the second multi-dimensional vector.

[0074] In a specific example, ​​

[0075] In another specific example,

[0076] In another specific example,

[0077] Step 13: The first participant node locally and secretly generates a large number k = g x ; wherein k is the first large number, g is a random prime number determined by the participant node and the second participant node in common negotiation, falling between [10 6 ~ 10 7 ], and x is a positive number randomly selected by the first participant node, with a value range of (1, 2). Then the first participant node linearly scales the first multi-dimensional vector to convert it into the first encrypted vector , which can be specifically expressed as

[0078] Step 14: The second participant node locally and secretly generates a large number p = g y ; wherein p is the second large number, and y is a positive number randomly selected by the second participant node, with a value range of (1, 2). Then the second participant node linearly scales the second multi-dimensional vector to convert it into the second encrypted vector , which can be specifically expressed as

[0079] In one specific example, (k, p) ∈ R + or (k, p) ∈ R - , R + is an integer set, and R - is a complex set.

[0080] Step 15: The first participant node and the second participant node respectively input the first encrypted vector and the second encrypted vector based on the S2PDP protocol, and after the S2PDP protocol is executed, the calculation results of this round are split into two random real numbers: the first real number W a and the second real number W b based on the random confusion mechanism, W a , W b ∈ R, and the two real numbers are returned to the first participant node and the second participant node respectively, and the two real numbers satisfy the relationship

[0081] Step 16: The first participant node sends the first real number W a to the second participant node, and the second participant node sends the second real number Wb Send to the first participating node.

[0082] Step 17: The first participating node receives the second real number W. b Then, the first participating node uses formula σ a =W a +W b Calculate the first sign test variable σ a Then, through the sign function Sign(σ) a Obtain the first numerical comparison sign result δ of the two numerical comparisons. a And send it to the computation requester. {-1,0,1},

[0083] Step 18: The second participating node receives the first real number W. a Then, the second participating node uses formula σ b =W a +W b Calculate the second sign test variable σ b Then, through the sign function Sign(σ) b Obtain the second numerical comparison sign result δ of the two-way numerical comparison. b And send it to the computation requester. Where δ b ∈{-1,0,1},

[0084] Step 19: Calculate the comparison results received by the requesting party from both parties, and compare them. If δ a =δ b If the result is correct, the calculation is correct; otherwise, the calculation is incorrect. The calculation process should be repeated until the result is correct.

[0085] The first encryption vector obtained after calculations in steps 11 to 14 Second encryption vector As input to the secure two-party scalar product protocol in step 15, the output W of the secure two-party scalar product protocol at this time a W b The following relationship must be satisfied: Here, ∝ indicates that the values ​​on both sides of the equation have the same sign. This is clearly due to W. a +W b =k p In ×(ab), kp=g x ·g y The constant greater than 0 is determined by the secure two-party scalar product protocol. The calculated scalar product result and the secure two-party numerical subtraction protocol fS2PS (a,b) = a - b essentially has the same sign.

[0086] The result σ = W a + W b of the secure two-party scalar product protocol is sign-converted by steps 16-18 using the sign function Sign( ). Therefore, the sign of the input (σ a ,σ b ) is not changed.

[0087] Step 19 further ensures the correctness of the computation by comparing the results δ a and δ b . Because when both parties strictly follow the protocol flow to compute, the final output σ a = σ b is always true, and the corresponding numerical comparison sign result δ a = δ b is also always true. If not, it means that there is an error in the calculation.

[0088] Therefore, as a whole, the secure two-party numerical comparison protocol converts the secure two-party numerical comparison problem f S2PC (a,b) = a - b into a secure two-party scalar product problem with the same sign as the two-party numerical difference. And the final comparison result is converted into the standard sign variable δ∈{-1,0,1} by the sign function Sign( ).

[0089] Next, the security of the S2PC protocol is analyzed from the perspectives of process security and result security.

[0090] Process security refers to the fact that during the entire execution of the protocol, the participants obtain the entire set of intermediate calculation results of the other participant and themselves based on the interaction between the two parties. If the participants cannot obtain any private information about the original input of the other party through the intermediate results, it is considered to meet the process security. Result security refers to the fact that after the entire execution of the protocol, the participants cannot infer the private information of the input of the other party based on their own output, and it is considered to meet the result security.

[0091] Process safety: For steps 11-14, the calculation process is executed locally at the first and second participant nodes, and no interaction of information between the two parties is involved, whether it is a dimensional transformation or linear scaling. In particular, for the public parameter g, since the power parameters x and y are unknown to both parties, it is also considered as no effective information interaction, so there is no risk of exposure of the original input information. Step 15 is a collaborative calculation process based on S2PDP, which will not cause the leakage of the original input information. For step 16, although the two parties respectively send the final scalar product results W a and W b to each other, for any participant, the result of is known at this time, but since any party only knows one parameter k or p, it is impossible to infer the true value of a-b from the result, so it is impossible to further infer the input privacy information of the other party. For steps 17-18, since the sign conversion function only serves to maintain the consistency of the numerical sign and does not involve the interaction of the numerical values of the two parties, this process will not leak any original input information. For step 19, the process of summarizing the results by the calculation requestor does not involve any interaction of the participants, so there is no information leakage in this step. Therefore, the S2PC protocol meets the process safety.

[0092] Result safety: Neither the first participant node nor the second participant node can infer the original input information of the other party from the final output information outputs(Pi)={δ a or δ b}. This is because f S2PC (a,b)=δ a or δ b =Sign(a-b), for any participant, it only knows a symbol mapping value δ∈{-1,0,1} corresponding to the comparison result, and does not involve any analysis information related to the input. Therefore, the protocol strictly meets the calculation result safety.

[0093] In summary, the S2PC protocol meets both process safety and result safety.

[0094] (II) Secure two-party scalar product protocol

[0095] As shown in Figure 5 , there are two computing parties: a first participant node and a second participant node, which are independent and mutually untrusted. The first participant node holds an n-dimensional private vector and the second participant node holds an n-dimensional private vector Two participant nodes wish to achieve by jointly executing a secure two-direction scalar product protocol a b , W b , and send to the computing requester to aggregate the desired two-party scalar product result. During the computation, each participant node can only know its own input and output information, and cannot obtain the intermediate calculation results and data information of other participants. As shown in Figure 6 , the process is as follows:

[0096] Step 21: The auxiliary computing node, also known as the commodity service node (Commodity Server, CS), generates two sets of random vector-value pairs, which are specifically the first random vector R a of dimension n, the second random vector Rx of dimension n, the first random number r a , and the second random number r b . These random variables must strictly satisfy the following constraints r a +r b =R a ⊙R b . Then the auxiliary computing node sends the random vector-value pair (R a , r a ) to the first participant node and the random vector-value pair (R b , r b ) to the second participant node.

[0097] Step 22: After receiving the corresponding random vector-value pair (R a , r a ), the first participant node internally calculates the third encrypted vector and sends it to the second participant node.

[0098] Step 23: After receiving the corresponding random vector-value pair (R b , r b ), the second participant node internally calculates the fourth encrypted vector and sends it to the first participant node.

[0099] Step 24: After receiving the third encrypted vector from the first participant node, the second participant node internally generates a random number as the second real number W b ∈R and locally secretly calculates the intermediate result and sends it to the first participant node.

[0100] Step 25: After receiving the intermediate result t, the first participant node locally secretly calculates the first real number

[0101] Step 26: The first participant node and the second participant node send their corresponding final obfuscated split results W a , W b to the computing requester, and the final product is obtained by the computing requester by summarizing the final obfuscated split results W

[0102] It can be verified that:

[0103] The security of the S2PDP protocol is analyzed from the perspectives of process security and result security.

[0104] Process security: first, according to steps 21-26, the private data information held by the first participant node and the second participant node in the entire process is classified, respectively. Among them, the first participant node obtains all the data sets from the second participant node according to the interaction, that is, The first participant node has private data about the second participant node, but it lacks the key parameter R b of the vector , so it can be considered that the first participant node cannot derive the input privacy information of the second participant node according to all the intermediate parameter information obtained from its perspective. Similarly, from the perspective of the second participant node, the data set of all intermediate calculation results it holds is Due to the lack of key information R a , it is also impossible to deduce the private input of the first participant node from Based on the above, for any participant, it is impossible to deduce the privacy of the input of the other party from all the intermediate calculation results, so it is considered that the protocol meets the process security.

[0105] Result security: neither the first participant node nor the second participant node can deduce the original input information of the other party from the final output information. This is because and any participant only holds part of the final result information, for example, the first participant node only has W a but not W b , so it cannot obtain the complete calculation result and further deduce the input information of the second participant node. On the other hand, even if the final result is exposed, since The final result is a numerical value, which means that for any participant, the accurate solution of the matrix equation system cannot be obtained under the premise that the coefficient matrix is not full rank, and the solution space is infinite. Therefore, the protocol strictly meets the calculation result security.

[0106] In summary, the S2PDP protocol meets both process security and result security.

[0107] (Three) secure two-party subtraction calculation protocol

[0108] As shown in Figure 7 , there are two known computing parties: the first participant node and the second participant node, which are independent of each other and do not trust each other, the first participant node holds a first private data a e R which is only stored in the first participant node, and the second participant node holds a second private data b e R which is only stored in the second participant node. Two participants cooperatively execute a secure two-party subtraction calculation protocol to realize f S2PS (a, b) = a - b = U a + U b , and each computing participant node finally obtains the corresponding output value U a , U b and sends it to the computing request party to aggregate the target difference value. During the calculation process, each participant node can only know its own input and output information, and cannot obtain the intermediate settlement result and the held data information of other participants. The problem is formalized as Figure 4 . As shown in Figure 8 , the process is as follows:

[0109] Step 31: The first participant node performs a scale transformation on the first private data a locally, and through the scale transformation, the first private data a is transformed from a 1-dimensional numerical domain {Dim1: a e R} to a random vector in a 2n-dimensional vector space {Dim 2n : a e R 2n}, to obtain a first multi-dimensional vector. The process can be formalized as or or wherein, is the first multi-dimensional vector, Dim1 represents a 1-dimensional numerical domain, and Dim 2n represents a 2n-dimensional vector space.

[0110] Step 32: The second participant node performs a scale transformation on the second private data locally, and the process is represented as the second private data b being transformed from a 1-dimensional numerical space {Dim1: b e R} to a random vector in a 2n-dimensional vector space {Dim 2n : b e R 2n}, to obtain a second multi-dimensional vector. The process can be formalized as or or wherein, is a second multi-dimensional vector.

[0111] Step 33: The first participant node and the second participant node respectively input the converted private random vectors of themselves based on the secure two-party scalar product protocol and perform secure two-party scalar product calculation. After the S2PDP protocol is executed, the calculation result of this round is split into two random real numbers W a and W b ∈R based on a random obfuscation mechanism, and is respectively stored in the first participant node and the second participant node, and the two private output matrices satisfy the relationship

[0112] Step 34: The first participant node and the second participant node respectively send their corresponding random real numbers W a and W b to the calculation requestor, and the calculation requestor obtains the final product by summarizing them.

[0113] It can be verified that:

[0114] a-b.

[0115] The security of the S2PS protocol is analyzed from the perspectives of process security and result security as follows.

[0116] Process security: Firstly, steps 31 and 32 are private calculation processes performed locally in the first participant node and the second participant node, and the scale transformation does not involve any interaction of two-party information, so there is no risk of exposure of the original input information; step 33 is a collaborative calculation process based on the S2PDP protocol which has been proved to be process secure, so this step will not cause leakage of the original input information, and step 34 is a process of summarizing the results by the calculation requestor, which does not involve any interaction of the participants, so the protocol S2PS meets the process security.

[0117] Result security: neither the first participant node nor the second participant node can reverse the original input information of the other party according to the final output information. This is because f S2PS (a,b)=W a + and any participant only holds part of the final result information, for example, the first participant node only has W a but not W bTherefore, the complete calculation result cannot be obtained, and the input information of the second participant node cannot be further speculated. Therefore, the protocol strictly meets the calculation result security.

[0118] In summary, the S2PS protocol meets the process security and result security at the same time.

[0119] Compared with the prior art, the beneficial effects of the present application at least include the following points:

[0120] (1) The present application first proposes a privacy protection solution for secure two-party subtraction, and the key technical point is to introduce a numerical splitting method to realize the scale transformation of input data. The splitting method ensures the correctness and security of the final comparison result, that is, a secure two-party subtraction calculation protocol based on scale transformation is proposed. The protocol realizes the conversion of input data from a low-dimensional numerical space to a high-dimensional vector space by decomposing and reconstructing the private data, and realizes the calculation of two-party numerical subtraction by combining a secure two-party scalar product protocol. Through this way, a secure, efficient and lightweight numerical subtraction protocol is realized by skillfully combining the secure two-party scalar product protocol. And since the calculation process does not need to rely on the third-party cloud service platform for hosting, the problem of privacy leakage caused by excessive dependence on the third-party platform in the existing cryptography scheme is avoided. This method has the advantages of high calculation precision, low communication overhead and low calculation complexity, and does not need to rely on any third-party cloud service platform, which lays a design foundation for the subsequent proposal of a secure two-party numerical comparison protocol.

[0121] (2) Based on the design idea of the secure two-party subtraction calculation protocol, the present application realizes the encryption of the original numerical value by performing scale transformation and linear scaling on the input data, and only needs to call the secure two-party scalar product protocol once to quickly obtain the result of two-party numerical comparison. This method solves the problems of high ciphertext calculation complexity, large communication overhead and low availability existing in the existing homomorphic encryption, secret sharing and obfuscation circuit schemes, and realizes an efficient and secure two-party numerical comparison scheme.

[0122] (3) The present application proposes a secure two-party numerical comparison protocol by introducing symbol conversion and combining linear scaling. This protocol not only ensures the consistency of the numerical subtraction symbol before and after scale transformation, but also makes the output parallelized so that the requester can improve the reliability of the calculation result by comparing the two output results. In particular, when the participant is the first participant node and the second participant node, both parties can obtain the final comparison result δ a orδ b=Sign(a-b), solves the output unfairness problem existing in the traditional method, realizes the transmission and fairness of the consistency of the sign of the comparison result of the two parties, ensures the security of "one-time one-key" without introducing any asymmetric key, and also takes into account the privacy protection and fair output of the comparison result of the two parties, and the parallel output enables the last requester to obtain the comparison result of the two parties at the same time, thereby improving the reliability of the calculation result.

[0123] (4) The application proposes a secure two-party scalar product protocol based on a semi-honest scenario based on secure data confusion technology. Compared with existing homomorphic encryption, secret sharing and confusion circuit schemes, the protocol reduces the calculation complexity to O(n) level, and the constant round (3 times) interaction times and intermediate transmission data are real numbers, which ensures that the communication overhead cost is controlled in a relatively low range, and the balance of the three impossible triangles of security, lightweight and efficiency is considered. The protocol has the characteristics of lightweight, low overhead and high calculation efficiency, and solves the problems of large communication overhead, high calculation complexity and low availability caused by the mixed calling of homomorphic encryption, secret sharing, careless transmission and confusion circuit in existing cryptography schemes.

[0124] The application also provides an application scenario of the secure two-party numerical comparison method based on scale transformation. Specifically, the secure two-party numerical comparison method based on scale transformation provided in the embodiment can be applied in a distributed large model training scenario. In the distributed large model training scenario, multiple different enterprises or organizations have their own private data. In the data preprocessing and cleaning process, the secure two-party numerical comparison method based on scale transformation provided in the application is used to align the private data owned by multiple different enterprises or organizations. Then, in the training stage of the distributed large model, the private data owned by multiple different enterprises or organizations are compared in the maximum pooling layer of the neural network to complete the training of the entire distributed large model and improve the accuracy of the distributed large model.

[0125] Based on the same inventive concept, the embodiment of the application also provides a device for implementing the secure two-party numerical comparison method based on scale transformation as described above. In one exemplary embodiment, as shown in Figure 9 Fig. 1, a secure two-party numerical comparison device based on scale transformation is provided, which includes a calculation requester, a first participant node and a second participant node. The first participant node holds first private data, and the second participant node holds second private data.

[0126] The calculation requester is a client. The first participant node and the second participant node are both nodes deployed on a distributed computing service network.

[0127] The computing requester is configured to send a two-party numerical comparison request to the first participant node and the second participant node.

[0128] The first participant node is configured to perform scale transformation on the first private data to obtain a first multi-dimensional vector, perform linear scaling on the first multi-dimensional vector to obtain a first encrypted vector, determine a first real number based on a secure two-party scalar product protocol according to the first encrypted vector, and share the first real number with the second participant node.

[0129] The second participant node is configured to perform scale transformation on the second private data to obtain a second multi-dimensional vector, perform linear scaling on the second multi-dimensional vector to obtain a second encrypted vector, determine a second real number based on a secure two-party scalar product protocol according to the second encrypted vector, and share the second real number with the first participant node; and a sum of the first real number and the second real number is equal to a scalar product of the first encrypted vector and the second encrypted vector.

[0130] The first participant node is further configured to determine a first numerical comparison symbol according to the first real number and send the first numerical comparison symbol to the computing requester.

[0131] The second participant node is further configured to determine a second numerical comparison symbol according to the second real number and send the second numerical comparison symbol to the computing requester.

[0132] The computing requester is further configured to determine a comparison result of the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

[0133] In one specific example, the first participant node and the second participant node are both deployed with a distributed framework. The distributed framework comprises a task acquisition module, a secure computing module, a rule generation module, a consensus computing module, and a data sending module.

[0134] The task acquisition module is configured to receive and decode a two-party numerical comparison request from a client.

[0135] The secure computing module is configured to automatically match a corresponding secure computing protocol according to the parsed two-party numerical comparison request.

[0136] The rule generation module is configured to implement computing task splitting according to an asynchronous instruction set of the secure computing protocol, and different participant nodes perform collaborative computing according to respective corresponding sub-rules.

[0137] The consensus computing module is configured to guarantee the synchronization and consistency of the computing after accepting the allocation of the sub-rules through a consensus protocol.

[0138] The data sending module is configured to collect the calculation results of the respective participant nodes and deliver the calculation results to the calculation requester after the calculation is completed.

[0139] In a specific embodiment, an external client sends a request for two-party numerical comparison to a network end where a distributed computing service is deployed via Hypertext Transfer Protocol (HTTP) or Google Remote Procedure Call Protocol (GRPC). When the task acquisition module of the network end receives the request for numerical comparison, it parses the request and starts the security computing service process of the first participant node and the second participant node. After the task acquisition module parses the corresponding calculation requirement, it transmits the requirement to the security computing module, which performs joint query through its internal interface, matches the corresponding security computing protocol, and synchronizes to the rule generation module in the two participant nodes. The rule generation module formulates different asynchronous parallel execution processes according to the different sub-tasks assumed by the two different participant nodes, and communicates with the consensus computing module at each step of execution. The consensus computing module broadcasts and maintains the consistency of the results of the distributed computing nodes on the chain and controls the stability of the execution process while the two participant nodes execute each step of the computing instruction. After the final computing protocol is executed and the two participant nodes obtain the sub-results of each other's calculation, the data sending module sends the two-party confused and split result sub-matrix to the calculation requester to obtain the correct calculation result.

[0140] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0141] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present application.

[0142] The principles and implementation modes of the present application are described by specific examples in this paper, and the above examples are only used to help understand the method and its core idea of the present application; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation mode and application range will be changed. In conclusion, the content of the present application should not be understood as a limitation.

Claims

1. A scale transformation based secure two-party numerical comparison method, characterized in that, The scale transformation-based secure two-party numerical comparison method comprises the following steps: A computing request direction first participant node and a second participant node send a two-party numerical comparison request; the first participant node holds first private data, and the second participant node holds second private data; After receiving the two-party numerical comparison request, the first participant node performs scale transformation on the first private data to obtain a first multi-dimensional vector, and the second participant node performs scale transformation on the second private data to obtain a second multi-dimensional vector; The first participant node performs linear scaling on the first multi-dimensional vector to obtain a first encrypted vector, and the second participant node performs linear scaling on the second multi-dimensional vector to obtain a second encrypted vector; The first participant node and the second participant node respectively determine a first real number and a second real number based on a secure two-party scalar product protocol according to the first encrypted vector and the second encrypted vector, specifically comprising the following steps: An auxiliary computing node generates a first random vector, a second random vector, a first random number and a second random number, and sends the first random vector and the first random number to the first participant node and sends the second random vector and the second random number to the second participant node; wherein the sum of the first random number and the second random number is equal to the scalar product of the first random vector and the second random vector; The first participating node uses the formula based on the first random vector and the first encryption vector. Calculate the third encryption vector and send the third encryption vector to the second participating node; The second participating node uses the formula based on the second random vector and the second encryption vector. Calculate the fourth encryption vector and send the fourth encryption vector to the first participating node; After receiving the third encryption vector, the second participant node randomly generates a second real number, adopts the formula calculates an intermediate result, and sends the intermediate result to the first participant node; After the first participant node receives the intermediate result, it calculates a first real number using the formula = (a + b) / 2 wherein is a first random vector, is a second random vector, is a first random number, is a second random number, is a first encrypted vector, is a second encrypted vector, is a third encrypted vector, is a fourth encrypted vector, is an intermediate result, is a first real number, is a second real number; a sum of the first real number and the second real number is equal to a scalar product of the first encrypted vector and the second encrypted vector; the first participant node and the second participant node share the first real number and the second real number; The first participant node and the second participant node respectively determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, and respectively send the first numerical comparison symbol and the second numerical comparison symbol to the computing request party; The first participant node and the second participant node respectively determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, specifically comprising the following steps: The first participant node employs a formula computes a first sign check variable and determines a sign of the first sign check variable using a sign function to obtain a first numerical comparison sign result; The second participant node employs a formula computes a second sign check variable and determines a sign of the second sign check variable using a sign function to obtain a second numerical comparison sign result; wherein is a first sign check variable, is a second sign check variable; The computing request party determines the comparison result of the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

2. The scale transform based secure two-party numerical comparison method according to claim 1, wherein, The first participant node performs scale transformation on the first private data to obtain a first multi-dimensional vector, and the second participant node performs scale transformation on the second private data to obtain a second multi-dimensional vector, specifically comprising the following steps: The first participant node transforms the first private data into a random vector in a 2 dimensional vector space by using the formula or to obtain a first multi-dimensional vector; wherein, n , is the first private data, and is the first multi-dimensional vector. The second participant node transforms the second private data into a random vector in a 2 dimensional vector space using the formula or or n to obtain a second multi-dimensional vector; wherein, , is the second private data, is the second multi-dimensional vector.

3. The scale transform based secure two-party numerical comparison method according to claim 1, wherein, The first participant node performs linear scaling on the first multi-dimensional vector to obtain a first encrypted vector, and the second participant node performs linear scaling on the second multi-dimensional vector to obtain a second encrypted vector, specifically comprising the following steps: The first participant node employs the formula Generate a first large number locally in secret; The first participant node adopts a formula according to the first large number Linearly scaling the first multi-dimensional vector to obtain a first encrypted vector; The second participant node employs the formula Generate a second large number locally in secret; The second participant node adopts a formula according to the second large number Linearly scaling the second multi-dimensional vector to obtain a second encrypted vector; wherein, is a first large number, is a second large number, is a random prime number determined by the first participant node and the second participant node in common negotiation, is a positive number randomly selected by the first participant node, is a positive number randomly selected by the second participant node, is a first multi-dimensional vector, is a second multi-dimensional vector.

4. The scale transform based secure two-party numerical comparison method according to claim 1, wherein, The computing request party is a client; the first participant node and the second participant node are both nodes deployed on a distributed computing service network.

5. The scale transform based secure two-party numerical comparison method according to claim 1, wherein, The scale transformation-based secure two-party numerical comparison method is applied in the privacy set intersection scene of a distributed database, the training scene of a distributed large model, or the scene of classifying multi-party data by using a decision tree model. In a privacy set intersection scenario of a distributed database, the first participant node is a computer device that owns a first privacy set, the second participant node is a computer device that owns a second privacy set, the first private data is data in the first privacy set, and the second private data is data in the second privacy set; the computing requester determines an intersection of the first privacy set and the second privacy set according to a comparison result of the first private data and the second private data; In a training scenario of a distributed large model, the first participant node is a computer device that owns a first training sample set, and the second participant is a computer device that owns a second training sample set; the first private data is a sample in the first training sample set, and the second private data is a sample in the second training sample set; the computing requester performs data alignment on the samples in the first training sample set and the samples in the second training sample set according to a comparison result of the first private data and the second private data, so as to train the distributed large model based on the data-aligned samples; In a multi-party data classification scenario using a decision tree model, the first participant node is a computer device that owns a first data set to be classified, the second participant is a computer device that owns a second data set to be classified, the first private data is data in the first data set to be classified, and the second private data is data in the second data set to be classified; The computing requester classifies the data in the first data set to be classified and the data in the second data set to be classified according to a comparison result of the first private data and the second private data.

6. A scale transform based secure two-party numerical comparison apparatus for the scale transform based secure two-party numerical comparison method of any one of claims 1-5, characterized by The secure two-party numerical comparison device based on scale transformation includes a computing requester, a first participant node, and a second participant node; the first participant node holds first private data, and the second participant node holds second private data; The computing requester is configured to send a two-party numerical comparison request to the first participant node and the second participant node; The first participant node is configured to perform scale transformation on the first private data to obtain a first multi-dimensional vector, perform linear scaling on the first multi-dimensional vector to obtain a first encrypted vector, determine a first real number based on a secure two-party scalar product protocol according to the first encrypted vector, and share the first real number with the second participant node; The second participant node is configured to perform scale transformation on the second private data to obtain a second multi-dimensional vector, perform linear scaling on the second multi-dimensional vector to obtain a second encrypted vector, determine a second real number based on a secure two-party scalar product protocol according to the second encrypted vector, and share the second real number with the first participant node; a sum of the first real number and the second real number is equal to a scalar product of the first encrypted vector and the second encrypted vector; The first participant node is further configured to determine a first numerical comparison symbol according to the first real number, and send the first numerical comparison symbol to the computing requester; The second participant node is further configured to determine a second numerical comparison symbol according to the second real number, and send the second numerical comparison symbol to the computing requester; The computing requester is further configured to determine a comparison result of the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

7. The scale transform based secure two-party numerical comparison device of claim 6, wherein, The computing requester is a client; and the first participant node and the second participant node are both nodes deployed on a network of a distributed computing service.

8. The scale transform based secure two-party numerical comparison device of claim 6, wherein, The first participant node and the second participant node are both deployed with a distributed framework.

Citation Information

Patent Citations

  • Safe two-party comparison method and system

    CN113792322A

  • Secure two-party inversion calculation method, system and device based on server assistance

    CN117459218A