Safe two-party numerical value comparison method and device based on scale transformation

By performing scale transformation and linear scaling locally on the participant nodes, combined with the secure two-party scalar product protocol, an efficient and secure two-party numerical comparison is achieved, and the problems of high computational complexity and output unfairness in the existing technology are solved. Improves privacy protection and reliability of calculation results.

CN119323050AActive Publication Date: 2025-01-17BEIHANG UNIV
View PDF 7 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing security two-party numerical comparison technology has high computational complexity, unfair output and relying on third-party cloud services, resulting in inefficient practicality and privacy leakage risks.

Method used

Using a secure two-party numerical comparison method based on scale transformation, by performing scale transformation and linear scaling locally on the participant nodes, the real number is determined using the secure two-party scalar product protocol, and numerical comparison is realized through symbol conversion to avoid information interaction and leakage. Improve the reliability and security of calculation results.

Benefits of technology

It realizes efficient, secure and reliable privacy numerical calculations, reduces calculation complexity and communication overhead, avoids the risk of privacy leakage of third-party cloud services, and improves the security and fairness of the numerical comparison between the two parties.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119323050A_ABST
    Figure CN119323050A_ABST
Patent Text Reader

Abstract

The invention discloses a secure two-party numerical value comparison method and device based on scale transformation, and relates to the field of data security, and the method comprises the steps: a calculation request sends a two-party numerical value comparison request to two participant nodes; after the participant node receives the two-party numerical value comparison request, scale transformation and linear scaling processing are sequentially carried out on private data locally, and an encryption vector is obtained; the participant node determines a real number locally by adopting a secure two-party scalar product protocol according to a local encryption vector, shares the real number with other participant nodes, and determines a numerical value comparison symbol according to the obtained real number and sends the numerical value comparison symbol to the calculation requester; and the calculation requester determines a comparison result of the private data of the two participant nodes according to the numerical value comparison symbols sent by the two participant nodes. According to the method, the security of the private data in the two-party numerical value comparison process is improved.
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 in particular to a method and device for secure two-way numerical comparison based on scale transformation. Background Art

[0002] With the epoch-making emergence of cloud computing and artificial intelligence general large model technology, the world has officially entered the "data-driven" information intelligence era, and data has become an important strategic resource among countries, institutions and enterprises. Correspondingly, due to the neglect and abuse of data privacy, privacy data leakage incidents have occurred frequently in recent years. For example, 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 publicly organized for sale by hacker organizations; 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 emergencies, in order to avoid the negative impact and economic losses caused by the continuous privacy leakage, various countries have also promulgated and implemented corresponding privacy protection regulations and laws. However, it is far from enough to restrict the occurrence of privacy leakage incidents only from the legislative level. In the face of diverse business scenarios and problem challenges, it is necessary and cannot be ignored to introduce some privacy computing technologies from the technical level. Summary of the invention

[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 objectives, this application provides the following solutions:

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

[0006] The calculation requester 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 a scale transformation on the first private data to obtain a first multidimensional vector, and the second participant node performs a scale transformation on the second private data to obtain a second multidimensional vector;

[0008] The first participant node linearly scales the first multidimensional vector to obtain a first encrypted vector, and the second participant node linearly scales the second multidimensional vector to obtain a second encrypted vector;

[0009] The first participant node and the second participant node determine a first real number and a second real number based on the secure two-party scalar product protocol according to the first encryption vector and the second encryption vector, respectively; the sum of the first real number and the second real number is equal to the 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 determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, respectively, and send the first numerical comparison symbol and the second numerical comparison symbol to the calculation requester, respectively;

[0011] The calculation requester determines a comparison result between 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 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;

[0013] The calculation requester is used to send a two-party numerical comparison request to the first participant node and the second participant node;

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

[0015] The second participant node is used to: perform a scale transformation on the second private data to obtain a second multidimensional vector; perform linear scaling on the second multidimensional vector to obtain a second encrypted vector; determine a second real number based on the second encrypted vector and a secure two-party scalar product protocol, and share the second real number with the first participant node; 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;

[0016] The first participant node is further used to determine a first numerical comparison symbol according to the first real number, and send the first numerical comparison symbol to the calculation requester;

[0017] The second participant node is further used to determine a second numerical comparison symbol according to the second real number, and send the second numerical comparison symbol to the calculation requester;

[0018] The calculation requester is further configured to determine a comparison result between 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 this application, this application discloses the following technical effects:

[0020] The present application provides a secure two-party numerical comparison method and device based on scale transformation. The processes of scale transformation and linear scaling of private data are both executed locally on the two participating nodes, and do not involve any information interaction between the two parties. Therefore, there is no risk of exposing private data. The two participating 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 participating node, only two real numbers can be obtained, but the private data of the other participating node cannot be deduced based on the two real numbers. The two participating nodes determine a first numerical comparison sign and a second numerical comparison sign based on the first real number and the second real number, respectively. The sign conversion only serves to retain the consistency of the sign, and does not involve any interaction of the two numerical values. Therefore, the process will not leak any original input information. The process of aggregating the results by the calculation requester does not involve any interactive behavior of the participating nodes, so there is no information leakage, thereby improving the security of private data in the two-party numerical comparison process. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0022] Figure 1 A schematic diagram of a flow chart of a secure two-party numerical comparison method based on scale transformation provided in one embodiment of the present application;

[0023] Figure 2 A schematic diagram of a security data obfuscation technology provided in one embodiment of the present application;

[0024] Figure 3 A schematic diagram of a secure two-party numerical comparison problem provided by an embodiment of the present application;

[0025] Figure 4 A flowchart of a secure two-party numerical comparison protocol provided in one embodiment of the present application;

[0026] Figure 5 A schematic diagram of a secure two-party scalar product problem provided by an embodiment of the present application;

[0027] Figure 6 A flowchart of a secure two-party scalar product calculation protocol provided in one embodiment of the present application;

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

[0029] Figure 8 A flowchart of a secure two-party subtraction protocol provided in one embodiment of the present application;

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

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0032] First, let’s introduce the relevant terms:

[0033] Semi-honest model: A specific protocol that assumes that all participants in the calculation will honestly participate in the privacy calculation and strictly follow each step of the process. However, there is a risk that some corrupted participants will try to infer the privacy of other participants through the intermediate or final results of the protocol execution process.

[0034] Secure Two-Party Scalar Product Protocol: Assume that there are two participants who do not trust each other, each of whom holds a secret input vector x and y, and jointly executes a two-party scalar product protocol f(x,y)=Output(v 1 ,v 2 )=x⊙y, and finally each participant gets the corresponding output v 1 ,v 2 , and the output satisfies v 1 +v 2 =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 of other participants.

[0035] Secure two-party numerical comparison protocol: Assume that there are two participants who do not trust each other, each of whom holds a secret real number x and y as input, and the two jointly execute a two-party comparison protocol And δ a= δ b = Sign(σ) = Output{-1, 0, 1}. Eventually, each participating party knows the size relationship with each other. Here, "-1" represents x < y, "0" represents x = y, and "1" represents x > y. During the entire calculation process, each participating party node only knows the input and output data involved in its own calculation process and cannot obtain any intermediate calculation results of other participating parties.

[0036] Secure data obfuscation technology: A data protection method for protecting the intermediate results of multi-party secure computing. By reasonably constructing a calculation protocol, the calculation results are randomly split, so that the multi-party outputs jointly constitute the real target calculation result in the form of a linear combination, and finally achieve the data privacy protection effect of one-time pad.

[0037] Privacy computing technology: Specifically refers to a series of information security technologies that break data islands and collaborate on multi-party computing without exposing the privacy of each party's private data, and finally achieve complex calculations and modeling analysis of multi-source data, ensuring that data elements are "usable but invisible" during the process of circulation and fusion.

[0038] The "secure two-party comparison problem" originated from the millionaire problem proposed by Academician Yao Qizhi in 1982, which is that two millionaires compare who is richer without revealing each other's wealth values. Academician Yao Qizhi proposed an initial research solution for this type of secure comparison problem - the secure two-party computing technology based on garbled circuits. In recent years, researchers have proposed a series of more secure, efficient and practical solutions for this problem and widely applied this technology to scenarios such as privacy-preserving machine learning, cloud computing, and distributed large model training. For example: During the preprocessing and cleaning process of data, data alignment operations usually need to be performed through private comparison; in the large model training stage, the max pooling layer in the neural network layer also involves secure multi-party numerical comparison problems; in the scenario of multi-party data classification using decision tree models and K-Nearest Neighbor (KNN) models, private comparison technology is also frequently used for data sorting and screening. The existing secure comparison technology solutions include the following:

[0039] 1) The Obliv-C and ABY3 garbled circuit frameworks developed by Zahur, Hussain, Mohassel, etc. transform mathematical operations (addition and multiplication) into Boolean circuits and combine encryption technologies such as secure shuffling and Oblivious Transfer to protect the circuit outputs corresponding to their respective inputs. Both the Obliv-C and ABY3 frameworks are general secure two-party computing solutions based on garbled circuits and can support secure two-party comparison. However, due to the requirement of constructing a large number of circuits, this type of solution has high computational and space complexity, low computational efficiency, and insufficient practicality.

[0040] 2) The MPyC and SecureNN frameworks developed by Schoenmakers, Wagh, and others use the idea of ​​Shamir secret sharing to hide secret values. They randomly split each secret value into multiple slices and use a threshold number of nodes to reconstruct and combine them when necessary through interactions among various participants to achieve the difference solution of the values ​​to be compared. The MPyC and SecureNN frameworks are based on the idea of ​​secret sharing to hide the difference between the values ​​compared by two parties. However, such schemes involve a large number of message exchanges between multiple parties, which will lead to low communication efficiency.

[0041] 3) Lin, Zhao et al. combined the ElGamal homomorphic encryption scheme with the size comparison method of finding the intersection of string sets, compared the 0 and 1 codes of both parties and combined with the Paillier primitive to propose a SOCI framework to solve the ciphertext comparison problem of large integers in outsourcing scenarios. Public key encryption is used to calculate the ciphertext and then the private key is used to decrypt the result. Although the security of the calculation result is guaranteed, due to the complexity of its own ciphertext calculation and its dependence on a third-party cloud platform for calculation, there is a problem of high computing storage and communication overhead costs, and once the third-party cloud platform is attacked, it may bring the risk of data leakage.

[0042] 4) Veugen, Damgard and others proposed a method to convert a specific secret polynomial sharing into bit sharing. By calling the GSV07 secret sharing protocol, they realized secure two-way difference calculation and comparison. Although it reduced the computational complexity compared with the homomorphic scheme, due to the excessive protection of the output results, it reduced the efficiency of the final protocol execution on the one hand and introduced more additional computational costs on the other.

[0043] Most of the above schemes adopt the method of one party calculating the result and then announcing it to the other party to obtain the final comparison result. Therefore, there are problems with the reliability and fairness of the results. Once the party that obtains the comparison result first withdraws from the protocol early or broadcasts an erroneous result, the final correct comparison result cannot be obtained.

[0044] This 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 objectives, the technical problems to be solved by the present invention are as follows:

[0045] 1) Existing solutions to the problem of secure two-party numerical comparison mostly use computing frameworks developed based on traditional basic cryptographic primitives such as homomorphic encryption, secret sharing, and obfuscated circuits. These methods rely on ciphertext calculations with extremely high time and space complexity, which leads to low practicality and efficiency.

[0046] 2) The output of existing protocols involving secure two-party numerical comparisons is neither fair nor consistent. Usually, one party obtains the comparison result first and then notifies the other party of the result. This model has the problem that the output is too dependent on whether one party is trustworthy.

[0047] 3) Existing application scenarios involving secure two-party numerical comparison schemes mostly rely on outsourced cloud service systems for implementation. However, the low credibility of third-party cloud service computing platforms or attacks by malicious nodes may cause the leakage of intermediate calculation results or key key information, further causing security risks of privacy leakage of the original data party.

[0048] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

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

[0050] Step 101: The calculation requester sends a two-party value 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.

[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 a scale transformation on the first private data to obtain a first multidimensional vector, and the second participant node performs a scale transformation on the second private data to obtain a second multidimensional vector.

[0052] Step 103: The first participant node linearly scales the first multidimensional vector to obtain a first encrypted vector, and the second participant node linearly scales the second multidimensional vector to obtain a second encrypted vector.

[0053] Step 104: The first participant node and the second participant node determine a first real number and a second real number based on the first encryption vector and the second encryption vector, respectively, based on a secure 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 determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, respectively, and send the first numerical comparison symbol and the second numerical comparison symbol to the calculation requester, respectively.

[0056] Step 106: The calculation requester determines a comparison result between the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

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

[0058] In a privacy set intersection scenario of a distributed database, the first participant node is a computer device having a first privacy set, the second participant node is a computer device having 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 requester determines the intersection of the first privacy set and the second privacy set based on a comparison result of the first private data and the second private data.

[0059] In an illustrative example, in the financial field, it is usually necessary to conduct credit assessment and classify customers based on the deposit, loan and salary records of customer groups in different banking institutions. The premise for solving this problem is to first find related users through the joint intersection of two databases before matching data. At the same time, different banking institutions have their own confidential database systems due to supervision and security policies. Therefore, how to find common customers distributed in multiple bank databases without leaking their private data is a typical privacy intersection problem.

[0060] Here we assume that the private data table held by Bank A is Table A ={ID A ,ω A1 ,…,ω Am}, the private data table held by Bank B is Table B ={ID B ,ω B1 ,…,ω Bn}. Where ID A and ID B Represents the data sets containing user identities of Bank A and Bank B respectively, ω Am and ω BnRepresent the other financial attribute characteristics of the customer samples of Bank A and Bank B respectively. Since the goal is to jointly find common customers, it is only necessary to perform a search on the data columns ψ containing user ID information in the two private data tables. A ={ID A1 ,ID A2 ,…,ID Am} and ψ B ={ID B1 ,ID B2 ,…,ID Bn}Find the same user ID, that is, to perform privacy intersection on the user ID set. Due to data privacy restrictions, the two participants are prohibited from leaking any information of their local private data columns. Therefore, a secure two-party numerical comparison method is used here to find the set ψ A and ψ B elements with the same value in order to solve the problem of intersection of two data columns.

[0061] The specific processing process is as follows: First, the first participant node (Bank A) sets its set ψ A The string data containing user ID information is uniformly converted into Hash values The second participant node (Bank B) operates similarly Then the first participant node takes the elements H in its own set in turn. Ai and the element H in the second participant node Bi Perform a secure two-way numerical comparison, here call the secure two-way numerical comparison method S2PC (H Ai ,H Bj ) can obtain the judgment result of whether the two are equal while protecting the private data security of each party. a (i,j)=δ b (i,j)=Sign(H Ai -H Bj ); Finally, the first participant node and the second participant node can obtain the result matrix S after all elements are compared pairwise by calling nm times the secure two-party numerical comparison protocol a and S b , where the result matrix S a or S b The index corresponding to the zero element in (i, j) = {S a (i,j)=0or S b (i,j)=0|i=1~m,j=1~n} means that the i-th user of the first participant node and the j-th user of the second participant node are the same person. Similarly, the index set ID of all zero elements inretsection ={(i,j)|S a(i,j)=0&&S b (i,j)=0} represents the common users of the two banks.

[0062] In the training scenario of a distributed large model, the first participant node is a computer device having a first training sample set, and the second participant is a computer device having a second training sample set; the first private data is samples in the first training sample set, and the second private data is samples in the second training sample set; the calculation requester aligns the samples in the first training sample set with the samples in the second training sample set according to the comparison result of the first private data and the second private data, so as to train the distributed large model based on the samples after data alignment.

[0063] The specific processing process is as follows: In the distributed large model training scenario, data matching must be done first, which is essentially the same as the intersection problem in the above distributed database. It is necessary to first "align data" for different data set samples. The "data alignment" process itself is to query the same samples scattered in different data sets, and then splice the data. The process of querying the same data sample is the process of finding the intersection based on the sample ID, but the input data at this time becomes the sample ID set ID of the first participant's data set. a and the sample ID set ID of the second party’s dataset b The ID of this sample can be a common name or identity number or any other identifying numerical data with identity recognition significance.

[0064] In a scenario where a decision tree model is used for multi-party data classification, the first participant node is a computer device having a first data set to be classified, the second participant node is a computer device having a second data set to be classified, the first private data is the data in the first data set to be classified, and the second private data is the data in the second data set to be classified; the calculation requester classifies the data in the first data set to be classified and the data in the second data set to be classified based on the comparison result of the first private data and the second private data.

[0065] The specific processing process is as follows: In the decision tree model, the call of the privacy comparison protocol is often used in the result prediction process. Here, the classic binary decision tree CART is used as an example to illustrate the prediction process, where the first participant holds the parameters of the decision tree model (including the splitting characteristics and thresholds of each leaf node), T represents the decision tree model, and T represents i Represents the i-th node of the decision tree. If the node is a leaf node, use Indicates the predicted label result; otherwise, Indicates the split feature stored in the node, with Indicates the threshold stored in the node. If x is used to represent a data sample, its i-th eigenvalue is recorded as ω i The prediction process of the decision tree algorithm is to follow the top-down order and set the threshold of the current node The corresponding eigenvalue in the data sample Perform a security comparison and select different branches based on the comparison results to continue moving forward until the sample reaches the leaf node and obtains the final prediction result.

[0066] In addition, the secure two-party numerical comparison method based on scale transformation provided by the present application can also be applied to the secret auction scenario of items. In this scenario, the calculation requester is the institution or organization that organizes the auction, the first participant node and the second participant node are the buyers participating in the auction, the first private data is the bid of the first participant node, and the second private data is the bid of the second participant 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 by the present application is used to compare the high and low bids of the two parties. The calculation requester determines the ownership of the item based on the high and low bids of the two parties, thereby improving the confidentiality of the item auction.

[0067] For most multi-party computations, the process of implementing secure computations usually involves multiple steps of interaction. Inevitably, we need to face a problem: how to ensure the security of intermediate results. For example, when the product of two matrices is used as the intermediate result of a computation, whether the first participant node or the second participant node obtains the result of the final matrix, it is possible to infer the data information of the other party. Therefore, in the privacy computing process, it is necessary not only to ensure the security of the initial input data, but also to ensure the security of the intermediate results of the computation.

[0068] To solve this problem, the present application proposes a secure data disguising technology (SDDT), which is to disassemble any multi-objective operation into a new multi-objective addition to obfuscate the result of calculating the intermediate value. To make it easier to explain its principle, the present application takes a two-party operation type as an example. The principle is as follows: Figure 2 Assume S k =F k (A i ,B i ), where F k is the target calculation function of the kth step, A i is the private input data of the first participant node in step k, B i is the private input data of the second participant node in step k, S k is the intermediate result of step k. When executing step k of the multi-party secure computation protocol, the intermediate result Sk The following constraints will be strictly followed: The first participant node only knows its own calculation result A k The second participant node only knows the result B k , and A k +B k =S k . Formula[A i :B i ]→[A k :B k |A k +B k =F k (A i ,B i )] represents the process of transferring the intermediate value. During the whole process, the first participant node and the second participant node are not allowed to exchange each other's data information, including the calculation of the intermediate result after the splitting of A k and B k Similarly, for the k+1th step, the input and The output A of the first participant node and the second participant node in step k k and B k The transmission structure, and and Its output A k+1 and B k+1 satisfy The first participant node only knows its own calculation result A k+1 The second participant node only knows the 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 guaranteed that no party can reverse the original data item from the obfuscated encrypted data, making the entire privacy computing process more secure.

[0069] In a specific example, three protocols are involved: Secure 2-Party Comparison (S2PC), Secure 2-Party DotProduct (S2PDP) and Secure 2-Party Subtraction (S2PS). This application does not use the secure two-party subtraction protocol in the secure two-party numerical comparison method, but in actual application, it can be used in combination with the secure two-party subtraction protocol according to the application scenario. The following introduces the three protocols respectively:

[0070] 1. Secure Two-Party Numeric Comparison Protocol

[0071] The problem of secure two-party numerical comparison usually occurs in application scenarios such as privacy set intersection in distributed databases, privacy sorting in online decision trees, and privacy-preserving deep neural networks, and has extensive research value. Therefore, in order to maintain generality, Figure 3 As shown, let the first private data held by the first participant node in the protocol be a∈R, 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 S2PC (a,b)=Sign(ab)=δ a =δ b , and finally each computing participant node obtains its corresponding output indicator δ a , δ b ∈{1,0,-1}, and sent to the calculation requester to obtain the expected result of the comparison of the two numerical values. During the calculation process, each participating node can only obtain its own input and output information during the calculation process, and cannot obtain the intermediate settlement results and private data information held by other participants. Figure 4 As shown, the process is as follows:

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

[0073] Step 12: The second participant node locally scales the second private data. The process is represented as the second private data b is scaled from the 1-dimensional numerical space {Dim 1 :b∈R} is transformed to a 2n-dimensional vector space {Dim 2n :β∈R 2n} to obtain a second multidimensional vector. The process can be formalized as or or in, is the second multidimensional vector.

[0074] In one specific example,

[0075] In another specific example,

[0076] In another specific example,

[0077] Step 13: The first participant node secretly generates a large number k=g locally x ; where k is the first largest number, g is a random prime number jointly determined by the first participant node and the second participant node, and falls within [10 6 ~10 7 ], x is a positive number randomly selected by the first participant node, and its value range is (1,2). Then the first participant node calculates the first multidimensional vector Perform linear scaling and convert it into the first encrypted vector Specifically, it can be expressed as

[0078] Step 14: The second participant node secretly generates a large number p=g locally y ; where p is the second largest number, and y is a positive number randomly selected by the second participant node, and its value range is (1,2). Then the second participant node calculates the second multidimensional vector Perform linear scaling and convert it into the second encrypted vector Specifically, it can be expressed as

[0079] In one specific example, (k,p)∈R + or (k,p)∈R - , R + is a set of integers, R - A plural set.

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

[0081] Step 16: The first participant node converts the first real number Wa Send it to the second participant node, and the second participant node sends the second real number W b Sent to the first participant node.

[0082] Step 17: The second real number W is received at the first participant node b After that, the first participant node adopts the formula σ a =W a +W b Calculate the first sign test variable σ a Then, through the symbol function Sign(σ a ) Get the first numerical comparison symbol result δ of the two numerical comparisons a , and send it to the computing requester. {-1,0,1},

[0083] Step 18: The first real number W is received at the second participant node a After that, the second participant node uses the formula σ b =W a +W b Calculate the second sign test variable σ b Then, through the symbol function Sign(σ b ) Get the second numerical comparison symbol result δ of the two numerical comparisons b , and send it to the computing requester. b ∈{-1,0,1},

[0084] Step 19: The calculation requester receives the comparison results from both parties and compares them. If δ a =δ b , it means the calculation is correct, otherwise, the calculation is wrong, re-execute the calculation process until it is correct.

[0085] The encrypted vector first encrypted vector obtained by calculation through steps 11 to 14 and the second encryption vector As the input of the secure two-party scalar product protocol in step 15, the output of the secure two-party scalar product protocol is W a , W b Satisfies the following relationship: Among them, ∝ means that the numbers on both sides of the equation have the same sign. Obviously, this is because W a +W b =k p ×(ab) kp=g x ·g y It is always greater than 0, so it is determined by the secure two-party scalar product protocol The calculated scalar product result is the same as the secure two-party numerical subtraction protocol f S2PS (a,b)=ab have essentially the same positive and negative properties.

[0086] Through steps 16 to 18, both parties use the sign function Sign() to perform the secure two-party scalar product protocol σ=W a +W b Perform symbol conversion, since this process is just a mapping from a real number field to a discrete set {-1,0,1} Therefore, it does not change the input (σ a ,σ b )’s positive and negative nature.

[0087] Step 19: By comparing the results of both parties δ a and δ b Comparison can further ensure the correctness of the calculation. Because when the two parties strictly follow the protocol process to calculate, the final output result σ a =σ b Always holds true, the corresponding numerical comparison sign result δ a =δ b If it is not true, it means that there is an error in the calculation.

[0088] Therefore, from the overall point of view, the secure two-party numerical comparison protocol converts the secure two-party numerical comparison problem into S2PC (a,b)=ab is transformed into a safe two-way scalar product problem with the same positive and negative values ​​as the difference between the two sides. The final comparison result is converted into the standard symbolic variable δ∈{-1,0,1} through the symbol function Sign() and output.

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

[0090] Process security refers specifically to the process in which a participant obtains a set of all intermediate computational results of another participant and itself through the interaction between the two parties during the execution of the entire computational protocol. When a participant cannot obtain any private information about the original input of the other party through the intermediate results, it is considered to meet process security. Result security refers specifically to the process in which a participant cannot infer the private information of the other party's input based on their own output after the execution of the entire computational protocol.

[0091] Process safety: Steps 11 to 14 are all calculation processes performed locally on the first participant node and the second participant node. No matter whether it is scale transformation or linear scaling, no information interaction between the two parties is involved (especially for the public parameter g, since the power parameters x and y of the exponential function are unknown to both parties, it is also considered that there is no effective information interaction). Therefore, there is no risk of exposing 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 nodes respectively send the final two-way scalar product result W a and W b Send them to each other separately. For any participant, they all know it at this time. However, since either party only knows one of the parameters kor p, it is impossible to deduce the true value of ab based on the result, and therefore it is impossible to further infer the other party's input privacy information; for steps 17 to 18, since the symbol conversion function only keeps the consistency of the numerical symbols and does not involve any interaction between the numerical values ​​of the two parties, the process will not leak any original input information; for step 19, the process of summarizing the results by the calculation requester does not involve any interactive behavior of any participating party, so there is no information leakage in this step. Therefore, the S2PC protocol meets the process safety.

[0092] Result security: Neither the first participant node nor the second participant node can use the final output information outputs(Pi) = {δ a or δ b} to infer the other party's original input information. This is because f S2PC (a,b)=δ a or δ b =Sign(ab), for any participant, all they know is the symbol mapping value δ∈{-1,0,1} corresponding to the comparison result, without involving any parsing information related to the input. Therefore, the protocol strictly complies with the calculation result security.

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

[0094] 2. Secure Two-Party Scalar Product Protocol

[0095] like Figure 5 As shown, it is known that there are two 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 an n-dimensional private vector The second participant node holds an n-dimensional private vector The two participating nodes hope to achieve this by jointly executing a secure two-way scalar product protocol. Finally, each computing participant node gets its corresponding output W a , W b , and sent to the calculation requester to aggregate and obtain the desired scalar product result of the two parties. During the calculation process, each participating node can only understand its own input and output information, and cannot obtain the intermediate calculation results and held data information of other participants. Figure 6 As shown, the process is as follows:

[0096] Step 21: The auxiliary computing node, also known as the commodity service node (CS), generates two sets of random vector-value pairs, which are specifically in the form of the first random vector R with dimension n a , 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: a +r b =R a ⊙R b . Then the auxiliary computing node converts the random vector-value pair (R a ,r a ) is sent to the first participant node, and the random vector-value pair (R b ,r b ) is sent to the second participant node.

[0097] Step 22: The first participant node receives the corresponding random vector-value pair (R a ,r a ), the third encryption vector is calculated internally And send it to the second participant node.

[0098] Step 23: The second participant node receives the corresponding random vector-value pair (R b ,r b ), the fourth encryption vector is calculated internally And send it to the first participant node.

[0099] Step 24: The second participant node receives the third encryption vector sent from the first participant node After that, the internal secret generates a random number as the second real number W b ∈R, and secretly compute the intermediate results locally Sent to the first participant node.

[0100] Step 25: After the first participant node receives the intermediate result t, the local secret calculation obtains the first real number

[0101] Step 26: The first participant node and the second participant node respectively generate their corresponding final obfuscated split results W a , W b Sent to the calculation requester, who then summarizes the final product

[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 to 26, the private data information held by the first participant node and the second participant node in the whole process is classified. Among them, the first participant node obtains the entire data set obtained by the interaction with the second participant node as follows: Although the first participant node has private data about the second participant node But there is no way to derive the vector The key parameter R b , so it can be considered that the first participant node cannot deduce the input privacy information of the second participant node based on all the intermediate parameter information obtained from its perspective. Similarly, from the perspective of the second participant node, the data set of all the intermediate calculation results it holds is Due to lack of key information a , so it is impossible to Derived from the private input of the first participant node In summary, no participant can infer any privacy about the other party’s input based on the information of all its intermediate calculation results, so the protocol is considered to comply with the computational process security.

[0105] Result security: Neither the first participant node nor the second participant node can infer the other party’s original input information based on the final output information. This is because Each participant only holds part of the final result information. For example, the first participant node only has W a Without W b Therefore, it is impossible to obtain the complete calculation results, and thus it is impossible to infer the input information of the second participant node. On the other hand, even if the final result is exposed, The final result is a numerical value, which means that for any participant, it is impossible to obtain an exact solution to the matrix equation system under the premise that the coefficient matrix is ​​not full rank. At this time, the solution space is an infinite solution system. Therefore, the protocol strictly complies with the calculation result security.

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

[0107] 3. Secure Two-Party Subtraction Protocol

[0108] like Figure 7 As shown, it is known that there are two computing parties: the first participant node and the second participant node, which are independent and do not trust each other. The first participant node holds a first private data a∈R that is only stored in its own computing node, and the second participant node holds a second private data b∈R that is only stored in its own computing node. The two participants jointly execute a secure two-party subtraction computing protocol to implement f S2PS (a,b)=ab=U a +U b , and finally each computing participant node obtains its corresponding output value U a , U b , and send it to the calculation requester for aggregation to obtain the target difference. During the calculation process, each participant node can only understand its own input and output information, and cannot obtain the intermediate settlement results and holding data information of other participants. The formal description of the problem can be found in Figure 4 .like Figure 8 As shown, the process is as follows:

[0109] Step 31: The first participant node locally performs a scale transformation on the first private data a, and transforms the first private data a from the 1-dimensional numerical domain {Dim 1 :a∈R} is transformed to a 2n-dimensional vector space {Dim 2n :α∈R 2n} to obtain the first multidimensional vector. The process can be formalized as or or in, is the first multidimensional vector, Dim 1 Represents a 1-dimensional numeric domain, Dim 2n Represents a 2n-dimensional vector space.

[0110] Step 32: The second participant node locally scales the second private data. The process is represented as the second private data b is scaled from the 1-dimensional numerical space {Dim 1 :b∈R} is transformed to a 2n-dimensional vector space {Dim 2n :β∈R2n} to obtain a second multidimensional vector. The process can be formalized as or or in, is the second multidimensional vector.

[0111] Step 33: The first participant node and the second participant node respectively input their own converted private random vectors 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 will be split into two random real numbers W based on the random confusion mechanism. a , W b ∈R, and are stored in the first participant node and the second participant node respectively, and these two private output matrices satisfy the relationship

[0112] Step 34: The first participant node and the second participant node respectively generate their corresponding random real numbers W a and W b Sent to the calculation requester, who then summarizes the final product

[0113] It can be verified that:

[0114] ab.

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

[0116] Process safety: First, for steps 31 and 32, both are private computing processes performed locally on the first participant node and the second participant node, and the scale transformation does not involve any information interaction between the two parties, so there is no risk of exposing the original input information; step 33 is a collaborative computing process based on the S2PDP protocol, which has been proven to have process safety, so this step will not cause the leakage of the original input information. Step 34 is the process of aggregating the results by the computing requester and does not involve any interactive behavior of the participants. Therefore, the protocol S2PS complies with process safety.

[0117] Result security: Neither the first participant node nor the second participant node can infer the other party’s original input information based on the final output information. This is because f S2PS (a,b)=W a + Each participant only holds part of the final result information. For example, the first participant node only has W a Without W b , so it is impossible to obtain the complete calculation results, and it is even more impossible to infer the input information of the second participant node. Therefore, this protocol strictly complies with the calculation result security.

[0118] In summary, the S2PS protocol satisfies both process safety and result safety.

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

[0120] (1) This application proposes for the first time a privacy protection solution for the secure two-party subtraction problem. The key technical point is that a numerical splitting method is introduced to achieve the scale transformation of the input data. This 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. This protocol decomposes and reconstructs the privacy data to achieve the conversion of the input data from a low-dimensional numerical space to a high-dimensional vector space, and combines the secure two-party scalar product protocol to achieve the calculation of two-party numerical subtraction. This method cleverly combines the secure two-party scalar product protocol to achieve a secure, efficient, and lightweight numerical subtraction protocol. In addition, since the calculation process does not need to rely on a third-party cloud service platform for hosting, it avoids the privacy leakage problem of the existing cryptographic scheme that relies too much on the third-party platform. This method has the advantages of high calculation accuracy, low communication overhead, and low calculation complexity, and does not need to rely on any third-party cloud service platform, laying a design foundation for the subsequent proposal of a secure two-party numerical comparison protocol.

[0121] (2) This application is based on the design concept of a secure two-party subtraction calculation protocol. By scaling and linearly scaling the input data, the original numerical value is encrypted, and the result of the two-party numerical comparison can be quickly obtained by calling the secure two-party scalar product protocol only once. This method solves the problems of high ciphertext calculation complexity, high communication overhead, and low availability in existing schemes based on homomorphic encryption, secret sharing, and obfuscated circuits, and realizes an efficient and secure two-party numerical comparison scheme.

[0122] (3) This application proposes a secure two-party numerical comparison protocol by introducing sign conversion and combining linear scaling. The protocol not only ensures the consistency of the numerical subtraction signs before and after the scale transformation, but also the parallel output enables the requesting party to improve the reliability of the calculation results by comparing the two output results. In particular, when the participants are the first participant node and the second participant node, both parties can obtain the final comparison result δ at the same time. a orδ b=Sign(ab), which solves the output unfairness problem of traditional methods and realizes the transmission and fairness of the symbol consistency of the numerical comparison results of the two parties. Without introducing any asymmetric secret keys, it ensures the security of "one-time one-pad" while taking into account the privacy protection and fair output of the comparison results of the two parties. The parallel output enables the final requesting party to obtain the comparison results of the two parties at the same time, which improves the reliability of the calculation results.

[0123] (4) Based on the secure data obfuscation technology, the present application proposes a secure two-party scalar product protocol in a semi-honest scenario. Compared with the existing homomorphic encryption, secret sharing, and obfuscated circuit schemes, the protocol reduces the computational complexity to the O(n) level. At the same time, the number of interactions in the constant round (3 times) and the intermediate transmission data are real numbers, ensuring that the communication overhead cost is controlled in a relatively low range, taking into account the balance of the three impossible triangle requirements of security, lightness, and high efficiency. The protocol has the characteristics of lightness, low overhead, and high computational efficiency, and solves the problems of large communication overhead, high computational complexity, and low availability caused by the mixed call of existing cryptographic schemes using technologies such as homomorphic encryption, secret sharing, oblivious transmission, and obfuscated circuits.

[0124] The present application also provides an application scenario, which applies the above-mentioned secure two-party numerical comparison method based on scale transformation. Specifically: the secure two-party numerical comparison method based on scale transformation provided in this embodiment can be applied in the training scenario of the distributed large model. In the training scenario of the distributed large model, multiple different enterprises or organizations have their own private data. During the preprocessing and cleaning of the data, the secure two-party numerical comparison method based on scale transformation provided in this 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 maximum pooling layer in the neural network performs numerical comparison on the private data owned by multiple different enterprises or organizations 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 present application also provides a device for implementing the above-mentioned secure two-way numerical comparison method based on scale transformation. In an exemplary embodiment, Fig. 9 As shown, a secure two-party numerical comparison device based on scale transformation is provided, including: 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 computing requester is a client. The first participant node and the second participant node are both nodes deployed on a distributed computing service group network.

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

[0128] The first participant node is used to: scale the first private data to obtain a first multidimensional vector; linearly scale the first multidimensional vector to obtain a first encrypted vector; determine a first real number based on the first encrypted vector and a secure two-party scalar product protocol, and share the first real number with the second participant node.

[0129] The second participant node is used to: scale the second private data to obtain a second multidimensional vector; linearly scale the second multidimensional vector to obtain a second encrypted vector; determine a second real number based on the second encrypted vector and a secure two-party scalar product protocol, and share the second real number with the first participant node; 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.

[0130] The first participant node is also used to determine a first numerical comparison symbol according to the first real number, and send the first numerical comparison symbol to the calculation requester.

[0131] The second participant node is also used to determine a second numerical comparison symbol according to the second real number, and send the second numerical comparison symbol to the calculation requester.

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

[0133] In a specific example, the first participant node and the second participant node are both deployed with a distributed framework, which includes a task acquisition module, a security calculation module, a rule generation module, a consensus calculation module, and a data transmission module.

[0134] The task acquisition module is used to receive and decode two-way numerical comparison requests from the client.

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

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

[0137] The consensus calculation module is used to ensure the synchronization and consistency of calculation results through the consensus protocol after receiving the assigned sub-rules.

[0138] The data sending module is used to collect and transmit the calculation results of each participant's node to the calculation requester after the calculation is completed.

[0139] The specific implementation plan is as follows: an external client sends a two-party numerical comparison request to the network end where the distributed computing service is deployed through the Hypertext Transfer Protocol (HTTP) or the open source remote procedure call protocol (GRPC) developed by Google. When the task acquisition module of the node on the network receives the request for numerical comparison, it parses it and starts the corresponding secure computing service process for the first participant node and the second participant node. When the task acquisition module parses the corresponding computing requirements, it passes them to the secure computing module, performs a joint query through its internal interface, and synchronizes to the rule generation module in the two participant nodes after matching the corresponding secure computing protocol; the rule generation module will formulate different asynchronous parallel execution processes according to the different subtasks undertaken by the two different participant nodes, and maintain communication with the consensus computing module at each step of the execution. While the two participant nodes execute each step of the computing instructions, the consensus computing module broadcasts and maintains the consistency of the results of the distributed computing nodes on the chain and the stability of the control execution process. After the final calculation protocol is executed, the two participating nodes obtain the sub-results of each other's calculations, and then send the result sub-matrices after the confusion and splitting of the two parties to the calculation requester through the data sending module to obtain the correct calculation results.

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

[0141] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0142] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A secure two-way numerical comparison method based on scale transformation, characterized in that: The secure two-party numerical comparison method based on scale transformation includes: The calculation requester 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; After the first participant node and the second participant node receive the two-party numerical comparison request, the first participant node performs a scale transformation on the first private data to obtain a first multidimensional vector, and the second participant node performs a scale transformation on the second private data to obtain a second multidimensional vector; The first participant node linearly scales the first multidimensional vector to obtain a first encrypted vector, and the second participant node linearly scales the second multidimensional vector to obtain a second encrypted vector; The first participant node and the second participant node determine a first real number and a second real number based on the secure two-party scalar product protocol according to the first encryption vector and the second encryption vector, respectively; the sum of the first real number and the second real number is equal to the 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; The first participant node and the second participant node determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, respectively, and send the first numerical comparison symbol and the second numerical comparison symbol to the calculation requester, respectively; The calculation requester determines a comparison result between the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

2. The secure two-way numerical comparison method based on scaling according to claim 1, characterized in that: The first participant node performs a scale transformation on the first private data to obtain a first multidimensional vector, and the second participant node performs a scale transformation on the second private data to obtain a second multidimensional vector, specifically including: The first participant node uses the formula or or The first private data is transformed into a random vector in a 2n-dimensional vector space to obtain a first multi-dimensional vector; wherein, a is the first private data, is the first multidimensional vector; The second participant node uses the formula or or The second private data is transformed into a random vector in a 2n-dimensional vector space to obtain a second multi-dimensional vector; wherein, b is the second private data, is the second multidimensional vector.

3. The secure two-way numerical comparison method based on scaling according to claim 1, characterized in that: The first participant node linearly scales the first multidimensional vector to obtain a first encrypted vector, and the second participant node linearly scales the second multidimensional vector to obtain a second encrypted vector, specifically including: The first participant node adopts the formula k=g x Generate the first largest number secretly locally; The first participant node uses the formula according to the first large number Linearly scaling the first multidimensional random vector to obtain a first encrypted vector; The second participant node adopts the formula p=g y Generate the second largest number secretly locally; The second participant node uses the formula according to the second largest number Linearly scaling the second multidimensional random vector to obtain a second encrypted vector; Wherein, k is the first largest number, p is the second largest number, g is a random prime number determined by the first participant node and the second participant node through negotiation, x is a positive number randomly selected by the first participant node, and y is a positive number randomly selected by the second participant node. is the first multidimensional vector, is the first encryption vector, is the second multidimensional vector, is the second encryption vector.

4. The secure two-way numerical comparison method based on scaling according to claim 1, characterized in that: The first participant node and the second participant node determine a first real number and a second real number based on the first encryption vector and the second encryption vector respectively based on a secure two-party scalar product protocol, specifically including: Generate a first random vector, a second random vector, a first random number, and a second random number through an auxiliary computing node, and send the first random vector and the first random number to the first participant node, and send 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 participant node uses the formula according to the first random vector and the first encryption vector Calculating a third encryption vector, and sending the third encryption vector to the second participant node; The second participant node uses the formula according to the second random vector and the second encryption vector Calculating a fourth encryption vector, and sending the fourth encryption vector to the first participant node; After receiving the third encryption vector, the second participant node randomly generates a second real number using the formula Calculate an intermediate result and send the intermediate result to the first participant node; After the first participant node receives the intermediate result, the formula Calculate the first real number; Among them, R a is the first random vector, R b is the second random vector, r a is the first random number, r b is the second random number, is the first encryption vector, is the second encryption vector, is the third encryption vector, is the fourth encrypted vector, t is the intermediate result, W a is the first real number, W b is the second real number.

5. The secure two-way numerical comparison method based on scaling according to claim 1, characterized in that: The first participant node and the second participant node determine a first numerical comparison symbol and a second numerical comparison symbol according to the first real number and the second real number, respectively, specifically including: The first participant node uses the formula σ according to the first real number and the second real number. a =W a +W b Calculating a first sign check variable and determining the sign of the first sign check variable using a sign function to obtain a first numerical comparison sign result; The second participant node uses the formula σ according to the first real number and the second real number. b =W a +W b Calculating a second sign check variable and determining the sign of the second sign check variable using a sign function to obtain a second numerical comparison sign result; Among them, σ a is the first sign test variable, σ b is the second sign test variable, W a is the first real number, W b is the second real number.

6. The secure two-way numerical comparison method based on scaling according to claim 1, characterized in that: The computing requester is a client; the first participant node and the second participant node are both nodes deployed on a distributed computing service group network.

7. The secure two-way numerical comparison method based on scaling according to claim 1, characterized in that: The secure two-party numerical comparison method based on scale transformation is applied in the privacy set intersection scenario of distributed database, the training scenario of distributed large model or the multi-party data classification scenario using decision tree model; In a privacy set intersection scenario of a distributed database, the first participant node is a computer device having a first privacy set, the second participant node is a computer device having 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 computation requester determines the intersection of the first privacy set and the second privacy set based on a comparison result of the first private data and the second private data; In a distributed large model training scenario, the first participant node is a computer device having a first training sample set, and the second participant is a computer device having 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 computation 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 samples after data alignment; In a scenario where a decision tree model is used for multi-party data classification, the first participant node is a computer device having a first data set to be classified, the second participant is a computer device having 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 calculation requester 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.

8. A secure two-way numerical comparison device based on scale transformation, characterized in that: 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 calculation requester is used to send a two-party numerical comparison request to the first participant node and the second participant node; The first participant node is used to: perform a scale transformation on the first private data to obtain a first multidimensional vector; perform linear scaling on the first multidimensional vector to obtain a first encrypted vector; determine a first real number based on the first encrypted vector and a secure two-party scalar product protocol, and share the first real number with the second participant node; The second participant node is used to: perform a scale transformation on the second private data to obtain a second multidimensional vector; perform linear scaling on the second multidimensional vector to obtain a second encrypted vector; determine a second real number based on the second encrypted vector and a secure two-party scalar product protocol, and share the second real number with the first participant node; 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 is further used to determine a first numerical comparison symbol according to the first real number, and send the first numerical comparison symbol to the calculation requester; The second participant node is further used to determine a second numerical comparison symbol according to the second real number, and send the second numerical comparison symbol to the calculation requester; The calculation requester is further configured to determine a comparison result between the first private data and the second private data according to the first numerical comparison symbol and the second numerical comparison symbol.

9. The secure two-way numerical comparison device based on scale transformation according to claim 8, characterized in that: The computing requester is a client; the first participant node and the second participant node are both nodes deployed on a distributed computing service group network.

10. The secure two-way numerical comparison device based on scale transformation according to claim 8, characterized in that: The first participant node and the second participant node are both deployed with a distributed framework.

Citation Information

Patent Citations

  • Key-value pair model safety training and reasoning method based on safety multi-party calculation

    CN113535808A

  • Safe two-party comparison method and system

    CN113792322A

  • Helmet wearing detection method based on implicit expression

    CN114463676A

  • Decision tree evaluation method and device based on secure multi-party computing, equipment and medium

    CN115842627A

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

    CN117459218A