Search

CN-116566678-B - Method and system for safely calculating data size relation in multi-party data

CN116566678BCN 116566678 BCN116566678 BCN 116566678BCN-116566678-B

Abstract

The application relates to a method and a system for safely calculating the data size relation in multiparty data, which belongs to the field of safe multiparty calculation, wherein the method comprises the steps that a referee acquires a request instruction sent by an application party, calls a group of prime numbers p and q, and sends public keys to the application party and a participator; the party encrypts the data d i according to the random value r i and the public key to obtain a first encryption result c i , and sends the first encryption result c i to the applicant party. The applicant encrypts the data d 0 according to the random value r 0 and the public key to obtain a second encryption result c 0 , compares the encryption results of any two parties to obtain a ratio, judges the judge party to obtain a decryption value according to the ratio and the decryption model, and the applicant party knows the size relationship of the data of the two parties according to the decryption value. The application has the effect of calculating the size relation of the data of any two parties under the condition that the data of any one party is not disclosed.

Inventors

  • LIAO FANGPING
  • ZHENG WEIHAI
  • LI CHENG

Assignees

  • 北京龙腾佳讯科技股份公司

Dates

Publication Date
20260512
Application Date
20230513

Claims (7)

  1. 1. A method for safely calculating the data size relation in multi-party data is characterized by setting judge party, participators and application party applying for calculating the data size relation, wherein k number of participators is greater than or equal to 1, and the data of participators are recorded as , wherein, The data of the applicant is recorded as The method comprises the following steps: the referee obtains a request instruction sent by the applicant, and the referee is used for calling a group of prime numbers p and q, determining a public key (n, G) according to the prime numbers p and q, n=pq, G e G, And is also provided with Is an integer, wherein, , , Is a least common multiple function, the referee sends the public key (n, g) to the applicant and the participant respectively, and the referee is used for obtaining a group of prime numbers p and q and functions according to the called prime numbers Generating a private key , wherein, , The referee is also used for determining a numerical value A according to the request instruction and the estimation rule, and the determining step comprises the following steps: the request instruction includes a data type; according to the data type, matching w groups of arrays corresponding to the data type in a database, wherein the arrays comprise a plurality of numerical values, and the numerical values are used for processing the data type, , ; Calculating the difference value of any two values in each group of arrays; extracting the precision value corresponding to the minimum difference value of the w-group array to construct a precision value sequence ; Acquiring the precision value sequence A first mode, a first duty ratio corresponding to the first mode, a second mode and a second duty ratio corresponding to the second mode, wherein the first mode refers to an accuracy value sequence The second mode refers to the precision value with the second ratio being only smaller than the precision value with the first ratio; when the first duty ratio reaches a first preset value, taking the first mode as a target value t; When the first duty ratio is lower than a first preset value, judging whether the sum of the first duty ratio and the second duty ratio is larger than the first preset value; If yes, taking the average value of the first mode and the second mode as a target value t; If not, the precision value sequence is determined The precision value with the duty ratio higher than the second preset value corresponding to the middle precision value is used as a target precision value; Taking the average value of the target precision values as a target value t; calculate the value a=10 t ; the participants adopt the value A to data Encryption is performed to generate an encryption value Based on the random value And the received public key (n, g) pair encryption value Encrypting to obtain a first encryption result And sends the first encryption result To the applicant's side of the present invention, ; The applicant adopts the value A to data Encryption is performed to generate an encryption value Based on the random value And the received public key (n, g) pair encryption value Encrypting to obtain a second encryption result , The applicant is also used for receiving the first encryption result sent by the participant In time, according to the second encryption result And a first encryption result Structural ratio ,α≠β, And, in addition, the method comprises the steps of, , And sending the ratio f to a referee; the referee inputs the ratio f into a decryption model Obtaining a decryption value y and returning the decryption value y to the applicant party, wherein 。
  2. 2. The method for securely computing a data size relationship among multiple parties as defined in claim 1, wherein the minimum value of the difference takes an absolute value.
  3. 3. The method for securely computing a data size relationship among multiple parties to a data stream as set forth in claim 1 wherein said party employs a value A for the data stream Encryption is performed to generate an encryption value Comprising the participation party transmitting data After A times expansion, the integer part is taken to obtain the encryption value 。
  4. 4. The method for securely computing a data size relationship in a multi-party data according to claim 1, wherein said step of determining a random value is performed based on said random value And the received public key (n, g) pair encryption value Encrypting to obtain a first encryption result Comprising the following steps: 。
  5. 5. The method for securely computing a data size relationship among multiple parties of data according to claim 1, wherein said applicant employs value A for data Encryption is performed to generate an encryption value Includes applying party to apply for data After A times expansion, the integer part is taken to obtain the encryption value 。
  6. 6. The method for securely computing a data size relationship in a multi-party data according to claim 1, wherein said step of determining a random value is performed based on said random value And the received public key (n, g) pair encryption value Encrypting to obtain a second encryption result Comprising the following steps: 。
  7. 7. A system for securely calculating a data size relation in multi-party data for performing the method according to any of claims 1-6, characterized by comprising a plurality of terminal devices (1), said plurality of terminal devices (1) acting as said participants in said method.

Description

Method and system for safely calculating data size relation in multi-party data Technical Field The application relates to the field of secure multiparty computing, in particular to a method and a system for securely computing the size relationship of data in multiparty data. Background The Secure Multiparty Computing (SMC) is used for solving the cooperative computing problem of protecting privacy among a group of mutually-untrusted participants, ensuring the independence of input and the correctness of computation, and simultaneously not revealing input values to other members participating in computation, and mainly aims at solving the problem of how to safely compute a contract function under the condition of no trusted third party, wherein the secure multiparty computing has important roles in the scenes of electronic election, electronic voting, electronic auction, secret sharing, threshold signature and the like. Therefore, how to calculate the size relationship of data of any two parties without disclosing the data of any one party is a problem to be solved. Disclosure of Invention The application provides a method and a system for safely calculating the data size relationship in multi-party data, which have the characteristic of calculating the size relationship of the data of any two parties under the condition that the data of any one party is not disclosed. The application aims at providing a method for safely calculating the data size relation in multi-party data. The first object of the present application is achieved by the following technical solutions: A method for securely calculating a data size relationship in multi-party data, provided a referee, a participant and an applicant for applying for calculating the data size relationship, the participant has k, k is greater than or equal to 1, the data of the participant is denoted as d i, wherein I e I, i= { I e N * and I is less than or equal to k, the data of the applicant is denoted as d 0, the method comprising: The referee obtains a request instruction sent by the applicant, and the referee is configured to call a set of primes p and q, determine a public key (N, G) according to the primes p and q, n=pq, G e G, g= { g|g e N, G < N 2 and (L (G λmodn2))-1 is an integer, Λ=lcm (p-1, q-1), lcm (,) being a least common multiple function }, the referee sending the public key (n, g) to the applicant and the participant, respectively, the referee being adapted to generate a private key (λ, μ) from the fetched set of prime numbers p and q and a function L (x), wherein μ=l (x 1)-1modn,x1=gλmodn2; the referee being further adapted to determine a value a from the request instruction and the estimation rule; The method comprises the steps that a party encrypts data d i by using a value A to generate an encrypted value m i, encrypts the encrypted value m i according to a random value r i and a received public key (n, g) to obtain a first encrypted result c i, and sends the first encrypted result c i to an application party, wherein r i∈H,H={ri|ri∈N* and r i are smaller than n; The applicant party encrypts the data d 0 by the value A to generate an encrypted value m 0, encrypts the encrypted value m 0 according to the random value r 0 and the received public key (n, g) to obtain a second encrypted result c 0,r0 E H, and is further used for constructing a ratio according to the second encrypted result c 0 and the first encrypted result c i when receiving the first encrypted result c i sent by the party Α+.β, α= { α|α∈n * and α+.k+1 }, β= { β|β∈n * and β+.k+1 }, and sending the ratio f to the referee; The referee inputs the ratio f into a decryption model y= (L (x 2) mu) mod n to obtain a decryption value y, and the decryption value y is returned to the applicant, wherein x 2=fλmodn2 is the sum of the decryption value y and the decryption value y. The application may in a preferred example be further arranged that said referee is further adapted to determine the value a based on said request instruction and on an evaluation rule comprising: the request instruction includes a data type; According to the data type, matching W groups of arrays corresponding to the data type in a database, wherein the arrays comprise a plurality of numerical values, W epsilon W, W= { w|w epsilon N * and W is more than or equal to 2; Calculating the difference value of any two values in each group of arrays; extracting an accuracy value corresponding to the minimum difference value of the w-group array to construct an accuracy value sequence (t 1,…,tw); acquiring a first mode in the precision value sequence (t 1,…,tw), a first duty ratio corresponding to the first mode, a second mode and a second duty ratio corresponding to the second mode, wherein the first mode is a precision value with the highest duty ratio in the precision value sequence (t 1,…,tw), and the second mode is a precision value with the second duty ratio being only smaller than the first duty ratio; when the