Method and system for secure multi-party computation of data extrema

CN116614224BActive Publication Date: 2026-08-11LONGTEL INC
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-10
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0004]本申请提供一种安全多方计算数据最值的方法和系统,其能够解决在不存在可信第三方的情况下计算数据最值的问题

Benefits of technology

1.参与方将数据di放大指定倍A后得到mi,再对mi进行加密得到第一加密结果ci,提高了第一加密结果ci的破解难度,从而解决了在不存在可信第三方的情况下计算数据最大值最小值的问题;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116614224B_ABST
    Figure CN116614224B_ABST
Patent Text Reader

Abstract

This invention relates to a method and system for securely calculating the maximum and minimum values ​​of data by multiple parties. The method includes a referee obtaining a request instruction sent by an applicant and sending a public key to both the applicant and participating parties; the participating parties then calculate the maximum and minimum values ​​of the data based on the requested data. i The encryption yields the first encryption result c. i The data is then sent to the applicant; the applicant encrypts the data d0 to obtain a second encrypted result c0; the applicant also constructs a ratio sequence and sends the ratio sequence to the adjudicator; the adjudicator obtains a decryption sequence based on the ratio sequence and the decryption model; y0 is set to 0; y0 is added to the decryption sequence to form a new decryption sequence; the maximum and minimum values ​​in the new decryption sequence are obtained, and the maximum and minimum values ​​are sent to the applicant; the applicant receives the maximum and minimum values ​​and calculates the actual maximum and minimum values. This invention has the effect of calculating the maximum and minimum values ​​in the data of the participants and the applicant without disclosing the original data of the participants and the applicant.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of secure multi-party computation, and in particular to a method and system for securely calculating the maximum and minimum values ​​of data. Background Technology

[0002] Secure multi-party computation (SMC) addresses the problem of privacy-preserving collaborative computation among a group of untrusted participants. SMC ensures the independence of inputs and the correctness of computation while preventing the disclosure of input values ​​to other participants. It primarily addresses the challenge of securely computing an agreed-upon function in the absence of a trusted third party. SMC plays a crucial role in scenarios such as electronic elections, electronic voting, electronic auctions, secret sharing, and threshold signatures.

[0003] The existing technical solutions mentioned above have the following drawbacks: how to calculate the maximum or minimum value of data in the absence of a trusted third party. Summary of the Invention

[0004] This application provides a secure multi-party computation method and system for calculating the maximum and minimum values ​​of data, which can solve the problem of calculating the maximum and minimum values ​​of data in the absence of a trusted third party.

[0005] In a first aspect of this application, a secure multi-party method for calculating the maximum and minimum values ​​of data is provided. The method includes a referee, participating parties, and an applicant requesting the calculation of the maximum and minimum values ​​of data. There are k participating parties, where k ≥ 1, and the data of each participating party is denoted as d. i , where i∈I, I={i|i∈N * And i≤k}, the applicant's data is denoted as d0, the method includes: The adjudicator receives the request instruction sent by the applicant, retrieves a set of prime numbers p and q, and sends the public key (n, g) to the applicant and the participating parties, where n = pq, g ∈ G, and G = {g | g ∈ N}. * g <n 2 And (L(g) λ modn 2 )) -1 Let be an integer, where, λ = lcm(p-1, q-1), where lcm(,) is the least common multiple function; the adjudicator also uses it to determine the value A based on the request instructions and estimation rules; The participants base their decisions on the numerical value A and the data d. i Encryption generates encrypted value m i Then based on the random value r i The received public key (n, g) is used to encrypt the value m. i The encryption yields the first encryption result c. i And send it to the applicant, r i ∈H, H={ri |r i ∈N * And r i <n}; The applicant encrypts the numerical value A and the data d0 to generate an encrypted value m0, and then encrypts the encrypted value m0 with a random value r0 and the received public key (n, g) to obtain a second encrypted result c0, where r0∈H; the applicant is also used to receive the first encrypted result c0 sent by the participating party. i At that time, based on the second encryption result c0 and the first encryption result c i Construct a ratio sequence (f1, f2, ..., f k ), and the ratio sequence (f1,f2,…,f k Send to the referee; The referee, based on the aforementioned ratio sequence (f1, f2, ..., f k The decryption sequence (y1, y2, ..., y) is obtained from the decryption model. k ); Set y0 = 0; Add y0 to the decryption sequence (y1, y2, ..., y k This forms a new decryption sequence (y0, y1, y2, ..., y). k ); Obtain the new decryption sequence (y0, y1, y2, ..., y k The maximum value y in ) max and minimum value y min , the maximum value y max and the minimum value y min Send to the applicant; The applicant received the maximum value y max and the minimum value y min Then, calculate the actual maximum value = (m0 - y) max ) / A, actual minimum value = (m0 - y min ) / A.

[0006] As can be seen from the above technical solution, after the applicant sends a request instruction to the adjudicator, the adjudicator establishes a public key (n,g) and sends it to both the applicant and the participating parties, while also building a decryption model. When a participating party obtains the public key (n,g), it encrypts its own data before transmitting it to the applicant. The applicant, upon obtaining the public key (n,g), not only encrypts its own data but also constructs a ratio sequence based on its encrypted data and the encrypted data sent by the participating parties. This ratio sequence is then sent to the adjudicator. The adjudicator obtains a decryption sequence based on the ratio sequence and the decryption model, generates a data sequence based on the decryption sequence, and selects the maximum and minimum values ​​from the data sequence to send to the applicant. The applicant decrypts the values ​​returned by the adjudicator again to obtain the maximum and minimum values ​​of the data from all participating parties, including the applicant. Therefore, the maximum and minimum values ​​of the data from all participating parties, including the applicant, can be obtained without leaking any party's data during the calculation process, solving the problem of calculating the maximum and minimum values ​​of data in the absence of a trusted third party.

[0007] In one possible implementation, the adjudicator is further configured to determine the numerical value A based on the request instruction and estimation rules, including: The request instruction includes data types; Based on the data type, match w arrays corresponding to the data type in the database. Each array includes multiple values, where w ∈ W, and W = {w | w ∈ N}. · And w≥2}; Calculate the difference between any two values ​​in each array; Extract the precision value corresponding to the minimum difference of w arrays and construct a precision value sequence (t1, t2, t3, ..., t w ); Obtain the precision value sequence (t1, t2, t3, ..., t w The first mode, the first proportion corresponding to the first mode, the second mode, and the second proportion corresponding to the second mode are given in the precision value sequence (t1, t2, t3, ..., t). w The second mode is the precision value with the highest percentage among the values ​​in the first mode; the second mode is the precision value with the second percentage value that is only smaller than the first percentage value. When the first percentage value reaches the first preset value, the first mode is taken as the target value t; When the first percentage value is lower than the first preset value, determine whether the sum of the first percentage value and the second percentage value is greater than the first preset value; If so, the average of the first mode and the second mode is rounded down to obtain the target value t; If not, the precision value sequence (t1, t2, t3, ..., tw The accuracy value whose percentage value is higher than the second preset value is taken as the target accuracy value. The average of the target precision values ​​is rounded down to obtain the target value t. Calculate the value A = 10 t .

[0008] In one possible implementation, the participants base their decisions on numerical value A and data d. i Encryption generates encrypted value m i Includes: m i =[Ad i ].

[0009] In one possible implementation, the method based on the random value r i The received public key (n, g) is used to encrypt the value m. i The encryption yields the first encryption result c. i include:

[0010] In one possible implementation, the referee bases the decision on the ratio sequence (f1, f2, ..., f...). k The decryption sequence (y1, y2, ..., y) is obtained from the decryption model. k Before that, a decryption model needs to be established, including: Based on the function Construct the function μ=(L(g) λ modn 2 )) -1 mod n, where λ = lcm(p-1, q-1), and lcm(,) is the least common multiple function; The private key (λ, μ) is obtained based on the functions μ and λ. The decryption model is obtained based on the private key (λ, μ).

[0011] In one possible implementation, the applicant encrypts and generates an encrypted value m0 based on the numerical value A and the data d0, including: m0 = [Ad0].

[0012] In one possible implementation, encrypting the encrypted value m0 according to the random value r0 and the received public key (n, g) to obtain the second encrypted result c0 includes:

[0013] In one possible implementation, the method further includes the adjudicator also determining the range of anomalies: Calculate the first range and the second range of each array in the w arrays. The first range is the difference between the maximum value and the minimum value. The second range is the difference between the largest value after the maximum value and the smallest value after the minimum value. Calculate the ratio of the second range to the first range in each array sequentially. When the ratio is less than the preset percentage, the maximum and minimum values ​​corresponding to the first range are abnormal. Obtain the maximum and minimum values ​​of the array that are abnormal. Take the minimum value among the maximum values ​​that are abnormal as the maximum abnormal value, and take the maximum value among the minimum values ​​that are abnormal as the minimum abnormal value. The range between the minimum abnormal value and the maximum abnormal value is the abnormal range; The adjudicator will send the abnormal range to the applicant.

[0014] In one possible implementation, the method further includes the applicant determining whether the actual maximum value and the actual minimum value exceed an abnormal range: When the actual maximum value exceeds the abnormal range, the actual maximum value is marked as abnormal; When the actual minimum value exceeds the abnormal range, the actual minimum value is marked as abnormal.

[0015] In a second aspect of this application, a system for securely calculating the maximum or minimum value of data by multiple parties is provided. The system includes multiple user terminals configured to perform the method for securely calculating the maximum or minimum value of data by multiple parties, wherein the multiple user terminals are participants in the method.

[0016] In summary, this application includes at least one of the following beneficial technical effects: 1. The participants will submit data d i After magnifying A by a specified factor, we get m. i Then for m i Encryption is performed to obtain the first encrypted result c. i This improved the first encryption result c. i This reduces the difficulty of cracking the code, thus solving the problem of calculating the maximum and minimum values ​​of data in the absence of a trusted third party; 2. The applicant amplifies the data d0 by a specified factor A to obtain m0, and then encrypts m0 to obtain the second encrypted result c0, which increases the difficulty of cracking the second encrypted result c0, thereby solving the problem of calculating the maximum and minimum values ​​of data in the absence of a trusted third party; 3. When the adjudicator uses the decryption model, it does not directly decrypt the data of the applicant and the parameter provider. Therefore, the decryption process will not leak the original data of either party, thus solving the problem of calculating the maximum and minimum values ​​of data in the absence of a trusted third party. Attached Figure Description

[0017] Figure 1 An environmental schematic diagram of a system for securely calculating the maximum and minimum values ​​of data according to an embodiment of this application is shown.

[0018] Figure 2 A flowchart of a method for securely calculating the maximum and minimum values ​​of data according to an embodiment of this application is shown.

[0019] Figure 3 A schematic diagram of the structure of a smart terminal according to one embodiment of this application is shown.

[0020] Explanation of reference numerals in the attached figures: 110, User terminal; 111, Referee terminal; 112, Participant terminal; 113, Applicant terminal; 200, System for securely calculating the maximum and minimum values ​​of multi-party data; 301, CPU; 302, ROM; 303, RAM; 304, I / O interface; 305, Input section; 306, Output section; 307, Storage section; 308, Communication section; 309, Driver; 310, Removable medium. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0022] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0023] This application provides a secure method and system for calculating the maximum and minimum values ​​of multi-party data. It ensures that the data of all involved parties is not leaked, and the algorithm is simple, efficient, practical, and reliable. In this embodiment, the involved parties include the adjudicator, participants, and the applicant. The adjudicator can be any one of the participants or a third party other than the participants and the applicant.

[0024] This application provides a system for securely calculating the maximum and minimum values ​​of multi-party computation data, with reference to... Figure 1The system 100 includes multiple user terminals 110, which are interconnected and can exchange data with any other user terminal 110. The communication connection between the user terminals 110 can be via a local area network, the Internet, mobile communication networks, satellite communication networks, or communication methods such as WiFi modules or LoRa modules; the specific communication method is not limited. Each user terminal 110 has a terminal identifier to ensure that the source of data transmitted by each user terminal 110 can be determined.

[0025] In System 100, a user terminal 110 can be any of three roles: referee, participant, or applicant. In System 100, there is one referee, multiple participants, and one applicant. The applicant is actually one of the participants; however, within System 100, the applicant can trigger the referee to calculate the maximum and minimum values ​​of the participants' and applicant's data. Therefore, from the referee's perspective, the applicant's role may change to that of a participant in the next calculation of the maximum and minimum values ​​of multiple parties' data.

[0026] It is understood that each user terminal 110 contains a set of privacy data. When a user terminal 110 needs to determine the maximum value of the privacy data, it is necessary to first select the scope of participants, that is, which user terminals 110 participate in the calculation, and then calculate the maximum value of the data.

[0027] Based on the above scenario involving referees, participants, and applicants, this application provides a method for securely calculating the maximum value of data across multiple parties. This method can... Figure 1 It runs in the system.

[0028] The main process of the method is described below.

[0029] Let there be a referee, participants, and applicants requesting the calculation of the maximum and minimum data values. Let the applicant's data be denoted as d0. There are k participants, k≥1, and their data is denoted as d0. i , where i∈I, I={i|i∈N * , and i≤k}.

[0030] like Figure 2 As shown: S101: The applicant sends a request instruction.

[0031] When the applicant needs to obtain the maximum and minimum values in the sequence composed of the data of multiple participants and its own data, a request instruction is sent to the above-mentioned multiple participants and the referee. The above request instruction includes the data type and the request content. The above request content indicates that the applicant needs to calculate the maximum and minimum values, and the above data type indicates the data type of the data that the applicant wants to calculate. For example, salary, turnover or sales volume. When the data type is salary, it means that the applicant needs to calculate the maximum and minimum values of the salary.

[0032] S102: The referee obtains the request instruction sent by the applicant and sends the public key (n, g) to the applicant and the participants.

[0033] Where n = pq, g ∈ G, G = {g|g ∈ N * , g < n 2 And (L(g λ mod n 2 )) -1 is an integer, λ = lcm(p - 1, q - 1), lcm(,) is the least common multiple function}.

[0034] Specifically, when the user receives the request instruction, a group of prime numbers p and q will be retrieved, and the public key corresponding to this application will be determined according to the above formula and the prime numbers p and q, and the above public key will be sent to the applicant and the participants.

[0035] S103: The participant receives the public key (n, g), encrypts the data d i to obtain the first encrypted result c i , and sends it to the applicant.

[0036] Specifically, in order to prevent the data d i it owns from being leaked, the participant encrypts and generates the encrypted value m i according to the numerical value A and the data d i , and then encrypts the encrypted value m i with the random value r i and the received public key (n, g) to obtain the first encrypted result c i , and sends it to the applicant, r i ∈ H, H = {r i |r i ∈ N * and r i < n}. Where m i = [Ad i , that is, m i is the floor value after expanding d i by A times. The function y = [x] is called the floor function. The calculation formula of c i is

[0037] A = 10 t By m i From the determination process, it can be seen that if t takes any value, when the value of t approaches positive infinity, it will lead to m i The large volume of data can reduce the computational efficiency of subsequent calculations to some extent; when the value of t approaches 0, it can lead to m i It may equal d i This means it cannot encrypt the data, so further encryption of m is not possible. i Rounding down may result in multiple participants having the same rounded value, which can affect subsequent calculation results. Therefore, this application also proposes a method for determining the t-value, whereby the aforementioned t-value, or A-value, is determined by the adjudicator based on the request instructions and estimation rules.

[0038] The method for determining the value of t includes: the request instruction includes a data type; matching w arrays corresponding to the data type in the database, where each array contains multiple values, where w ∈ W, and W = {w | w ∈ N}. * And w≥2}; calculate the difference between any two values ​​in each array; extract the precision value corresponding to the minimum difference of the w arrays and construct a precision value sequence (t1, t2, t3, ..., t w ); Obtain the above precision value sequence (t1, t2, t3, ..., t w The first mode, the first proportion corresponding to the first mode, the second mode, and the second proportion corresponding to the second mode in the precision value sequence (t1, t2, t3, ..., t) are given. w The second mode is the precision value with the highest proportion in the sequence (t1, t2, t3, ..., t). When the first proportion reaches a first preset value, the first mode is used as the target value t. When the first proportion is lower than the first preset value, it is determined whether the sum of the first and second proportions is greater than the first preset value. If yes, the average of the first and second modes is rounded down to the nearest integer as the target value t. If no, the precision value sequence (t1, t2, t3, ..., t...) is used as the target value t. w The percentage of the accuracy value corresponding to the accuracy value is higher than the second preset value, which is taken as the target accuracy value; the average of the target accuracy values ​​is rounded down to obtain the target value t; the value A = 10 is calculated. t The above w-group arrays are grouped according to the different sources and data types of the data. Specifically, data with the same data type as the data type in the request instruction is retrieved from the database, and then grouped according to their source to obtain the w-group arrays. For example, the first group of data is from Company A, and the second group is from Company B.

[0039] The aforementioned database can be constructed by acquiring data from the network through web crawling technology, or by constructing a database using data already known to the user, or by constructing a database using both data from the network and the user's known data.

[0040] In one implementation, there are five arrays, each containing five data points. One array is [π, 5, 1.2, 1.34, 3]. The difference between any two values ​​is calculated, and the minimum difference is obtained. For the array, the minimum difference is 0.14, which has two significant decimal places, so the precision value corresponding to the minimum difference is 2. If the significant decimal places are zero, the precision value corresponding to the minimum difference is 0. The precision value of the minimum difference for each array is calculated, and a precision value sequence is constructed. In this implementation, the first preset value is 80%, the second preset value is 8%, and the precision value sequence is (0, 1, 1, 1, 2). The mode in the above precision value sequence is 1, that is, the first mode is 1, and the first proportion is 3 / 5 = 60%. The first proportion is the number of times the mode appears divided by the total number of precision values ​​in the precision value sequence. The second mode is 0 and 2, and the second proportion is 20%. Since the first proportion is less than the first preset value, the sum of the second and first proportions is calculated. Because there are two second modes, the sum needs to be added twice when comparing the proportion to the first preset value. Therefore, the sum of the first and second proportions is 60% + 20% + 20% = 100%, which is greater than the first preset value. The average of the first and second modes is then calculated as (0 + 1 + 2) / 3 = 1, meaning the t-value is 1. When the sum of the first and second proportions is less than the preset value, the modes of all corresponding proportions greater than the second preset value are obtained and their averages are calculated. For example, the first mode 1 corresponds to a first proportion of 40%, the second mode 2 corresponds to a proportion of 30%, the third mode 3 corresponds to a third proportion of 15%, the fourth mode 4 corresponds to a fourth proportion of 8%, and the fifth mode 5 corresponds to a fifth proportion of 7%. In this case, the proportions corresponding to the fifth and fourth modes are both less than or equal to the second preset value, so the average of the first, second, and third modes is calculated as the t-value. Determining the value of t means determining the value of A.

[0041] S104: The applicant receives the public key (n, g) and encrypts the data d0 to obtain the second encryption result c0.

[0042] Specifically, to prevent the leakage of its own data d0, the applicant encrypts the data d0 using the numerical value A and the encrypted value m0. Then, it encrypts the encrypted value m0 using a random value r0 and the received public key (n, g) to obtain a second encrypted result c0, where r0 ∈ H. Here, m0 = [Ad0], meaning m0 is d0 multiplied by A and then rounded down. The formula for calculating c0 is...

[0043] S105: The applicant, based on the second encryption result c0 and the first encryption result c... i Construct a ratio sequence and send the ratio sequence to the referee.

[0044] Specifically, the ratio sequence (f1, f2, ..., f k () represents the second encryption result c0 and the first encryption result c i The ratio, i.e. The ratio sequence is then sent to the referee.

[0045] S106: The referee, based on the ratio sequence (f1, f2, ..., f... k The decryption sequence (y1, y2, ..., y) is obtained from the decryption model. k Set y0 = 0; add y0 to the decryption sequence (y1, y2, ..., y...). k This forms a new decryption sequence (y0, y1, y2, ..., y). k ); Obtain the new decryption sequence (y0, y1, y2, ..., y k The maximum value y in ) max and minimum value y min , to the maximum value y max and minimum value y min Send it to the applicant.

[0046] Specifically, before obtaining the decryption sequence, a decryption model needs to be established, including: Based on functions Construct the function μ=(L(g) λ modn 2 )) -1 mod n, where λ = lcm(p-1, q-1), and lcm(,) is the least common multiple function; based on the above functions μ and λ, the private key (λ, μ) is obtained; based on the above private key (λ, μ), the decryption model is obtained. The referee will use the ratio sequence (f1, f2, ..., f) k By substituting the data from y1, y2, ..., y2 into the decryption model, the decryption sequence (y1, y2, ..., y3) can be obtained. k The relative magnitudes of the k values ​​in the decryption sequence and the values ​​from d1 to d2. k The relative magnitudes of the k values ​​are consistent, that is, d1 is greater than d. k Then y1 is greater than y k .

[0047] To add the requester's data to the decryption sequence, set y0 = 0; add y0 to the decryption sequence (y1, y2, ..., y...). kThis forms a new decryption sequence (y0, y1, y2, ..., y). k ); In the new decryption sequence, y0 to y k The relationship between the size of the k+1 data points and d0 to d i The k+1 data items have the same size relationship. Obtain the new decryption sequence (y0, y1, y2, ..., y...). k The maximum value y in ) max and minimum value y min , to the maximum value y max and minimum value y min Send to the applicant. (f) i Substituting into the decryption model, we get y i f i The ratio of the encrypted data of other participants to the encrypted data of the applicant is y, obtained through the decryption model. i This represents the difference between the data of other participants multiplied by A and the data of the applicant multiplied by A. It can be understood that y0 should be the difference between the data of the applicant multiplied by A and the data of the applicant multiplied by A, which is 0.

[0048] S107: The requester received the maximum value y. max and minimum value y min Then, calculate the actual maximum value = (m0 - y) max ) / A, actual minimum value = (m0 - y min ) / A.

[0049] Specifically, because the applicant and participating parties amplified their respective data by a specified factor A and then took the integer part when sending it to the adjudicator, the y obtained by the applicant... min It is not the minimum value of the k+1 squared data, but the y obtained by the applicant. max It is not the maximum value of the k+1 squared data. It needs to be restored, that is, the actual maximum value needs to be calculated as (m0 - y). max ) / A, actual minimum value = (m0 - y min Only after ) / A can we obtain the actual maximum and minimum values.

[0050] In the process of obtaining the maximum and minimum values ​​in the original data sequence composed of the original data from multiple participating parties and the applicant, no party has obtained the original data from the others. Therefore, the reliability of the final obtained actual maximum and minimum values ​​cannot be determined. In order to alert the applicant when there are data anomalies, the method for secure multi-party calculation of data maximum and minimum values ​​also includes determining the anomaly range. The determination of the anomaly range is calculated by the adjudicator. Based on the w arrays corresponding to the data types in the aforementioned request instruction, obtained by the adjudicator from the database, the first range and the second range of each array in the w arrays are calculated. The first range is the difference between the maximum and minimum values, and the second range is the difference between the largest value after the maximum value and the smallest value after the minimum value. The difference represents the absolute value of the difference between the two values, i.e., the difference is greater than or equal to zero. The ratio of the second range to the first range in each array is calculated sequentially. When the ratio is less than a preset percentage, the maximum and minimum values ​​corresponding to the first range are abnormal. The maximum and minimum values ​​with abnormalities in the arrays are obtained. The minimum value among the abnormal maximum values ​​is taken as the abnormal maximum value, and the maximum value among the abnormal minimum values ​​is taken as the abnormal minimum value. The range between the abnormal minimum value and the abnormal maximum value is the abnormal range. The adjudicator sends the abnormal range to the applicant.

[0051] In the first implementation example, if the applicant wants to obtain the maximum and minimum salaries of employees at the same job level, they retrieve the salaries for different months for the corresponding job level from the database, forming an array for each month's salary. The preset percentage is 60%, and w is 6, meaning there are 6 arrays. One array is [1000, 5000, 6000, 5500, 7000, 8000, 100000]. The first range of this array is 100000 - 1000 = 9900; the second range is 8000 - 5000 = 3000. The ratio of the second range to the first range = second range / first range = 3000 / 9900 = 30.3% < 60%. Therefore, the maximum and minimum values ​​corresponding to the first range are abnormal. The other five arrays are evaluated sequentially. Four of these arrays have a second range ratio greater than 60% to their first range, while the ratio for the remaining array is less than 60%. Therefore, the maximum and minimum values ​​for the remaining array are abnormal. The maximum value for this remaining array is 80000, and the minimum value is 2000. The maximum value among the abnormal minimum values ​​is taken as the abnormal minimum. Since 2000 is greater than 1000, it is considered the abnormal minimum. Similarly, the abnormal maximum values ​​are 80000 and 100000. Since 80000 is greater than 100000, it is considered the abnormal maximum. Therefore, the abnormal range is from 2000 to 80000.

[0052] The method for securely calculating the maximum and minimum values ​​of data also includes methods used by the applicant to determine whether the actual maximum and minimum values ​​exceed the abnormal range: Specifically, after receiving the abnormal range from the adjudicator, the applicant judges the calculated actual maximum and minimum values. If the actual maximum value exceeds the abnormal range, an abnormality is marked for the actual maximum value; if the actual minimum value exceeds the abnormal range, an abnormality is marked for the actual minimum value. When the actual maximum value and / or actual minimum value have abnormality markings, it indicates that the data is not highly reliable, serving as a reminder to the applicant that the data may have encountered problems during transmission or that the data sent by the participating party is incorrect.

[0053] In the first implementation example above, when the actual maximum value is greater than 80000 or less than 2000, the actual maximum value is marked as abnormal, and when the actual minimum value is greater than 80000 or less than 2000, the actual minimum value is marked as abnormal.

[0054] In summary, the implementation principle of the secure multi-party computation method for calculating the maximum and minimum values ​​of data in this application is as follows: when the applicant needs to calculate the maximum and minimum values ​​of the data, it sends a request instruction to the referee. After receiving the request instruction, the referee retrieves a set of prime numbers p and q according to the request instruction to establish a public key (n, g) and a private key (λ, μ). On the one hand, the public key (n, g) is sent to the applicant and the participants respectively. On the other hand, a decryption model is built based on the private key (λ, μ). When a participant obtains the public key (n, g), it encrypts its own data before transmitting it to the applicant. The applicant, in turn, not only encrypts its own data upon receiving the public key (n, g), but also constructs a ratio sequence based on its encrypted data and the encrypted data sent by the participants. This ratio sequence is then sent to the adjudicator. The adjudicator, using the ratio sequence and a decryption model, obtains a decryption sequence. The adjudicator then adds the applicant's corresponding decrypted data to this new decryption sequence, selecting the maximum and minimum values ​​from this new sequence and sending them to the applicant. The applicant decrypts the values ​​returned by the adjudicator again to obtain the maximum and minimum values ​​of the data from all participants, including the applicant. As can be seen from this real-time principle, the original data of any party is not leaked during the computation process, thus enabling the applicant to obtain the maximum and minimum values ​​of the data from all participants, including the applicant, solving the problem of secure multi-party computation of data maximum and minimum values.

[0055] Figure 3 A schematic diagram of the structure of a smart terminal suitable for implementing the embodiments of this application is shown.

[0056] like Figure 3As shown, the smart terminal includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 302 or programs loaded from storage section 307 into random access memory (RAM) 303. The RAM 303 also stores various programs and data required for system operation. The CPU 301, ROM 302, and RAM 303 are interconnected via a bus. An input / output (I / O) interface 304 is also connected to the bus.

[0057] The following components are connected to I / O interface 304: an input section 305 including a keyboard, mouse, etc.; an output section 306 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 307 including a hard disk, etc.; and a communication section 308 including a network interface card such as a LAN card, modem, etc. The communication section 308 performs communication processing via a network such as the Internet. A drive 309 is also connected to I / O interface 304 as needed. A removable medium 310, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 309 as needed so that computer programs read from it can be installed into storage section 307 as needed.

[0058] Specifically, according to embodiments of this application, the flowchart above refers to... Figure 2 The described process can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a machine-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 308, and / or installed from removable medium 310. When the computer program is executed by central processing unit (CPU) 301, it performs the functions defined in the apparatus of this application.

[0059] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0060] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which includes one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0061] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions claimed in this application.

Claims

1. A method for securely calculating the maximum and minimum values ​​of data from multiple sources, characterized in that: Let there be a referee, participating parties, and a party requesting the calculation of the maximum value of data. There are k participating parties, k≥1, and the data of the participating parties is denoted as... ,in, The applicant's data is recorded as The method includes: The adjudicator receives the request instruction sent by the applicant, retrieves a set of prime numbers p and q, and sends the public key to the applicant and participating parties. ,in, , Let be an integer, where, , It is the least common multiple function; the adjudicator also uses it to determine the value A based on the request instruction and estimation rules; The participants based their decisions on value A and data. Encryption generates encrypted value Then based on the random value and the received public key For encrypted values Encryption yields the first encryption result. And send it to the applicant. ; The applicant bases the data on value A. Encryption generates encrypted value Then based on the random value and the received public key For encrypted values Encryption yields a second encryption result , The applicant is also used to receive the first encrypted result sent by the participating party. At that time, based on the second encryption result And the first encryption result Construct a ratio sequence and the ratio sequence Send to the referee; The referee, based on the aforementioned ratio sequence The decryption sequence is obtained from the decryption model. ; set up ; Will Add the decryption sequence Form a new decryption sequence ; Obtain the new decryption sequence The maximum value in and minimum value , the maximum value and the minimum value Send to the applicant; The applicant received the maximum value. and the minimum value Then, calculate the actual minimum value = Actual maximum value = ; The adjudicator is also used to determine value A based on the request instructions and estimation rules, including: The request instruction includes data types; Based on the data type, match w arrays corresponding to the data type in the database. Each array contains multiple values. ; Calculate the difference between any two values ​​in each array; Extract the precision value corresponding to the minimum difference of w arrays to construct a precision value sequence. ; Obtain the precision value sequence The first mode, the first proportion corresponding to the first mode, the second mode, and the second proportion corresponding to the second mode are given in the sequence. The first mode refers to the precision value sequence. The second mode is the precision value with the highest proportion, and the second mode is the precision value with the second proportion value being only less than the first proportion value. When the first percentage value reaches the first preset value, the first mode is taken as the target value t; When the first percentage value is lower than the first preset value, determine whether the sum of the first percentage value and the second percentage value is greater than the first preset value; If so, the average of the first mode and the second mode is rounded down to obtain the target value t; If not, the precision value sequence The accuracy value whose proportion is higher than the second preset value is taken as the target accuracy value; The average of the target precision values ​​is rounded down to obtain the target value t. Calculate numerical values ; The method also includes the adjudicator further defining the range of anomalies: Calculate the first range and the second range of each array in the w arrays. The first range is the difference between the maximum value and the minimum value. The second range is the difference between the largest value after the maximum value and the smallest value after the minimum value. Calculate the ratio of the second range to the first range in each array sequentially. When the ratio is less than the preset percentage, the maximum and minimum values ​​corresponding to the first range are abnormal. Obtain the maximum and minimum values ​​of the array that are abnormal. Take the minimum value among the maximum values ​​that are abnormal as the maximum abnormal value, and take the maximum value among the minimum values ​​that are abnormal as the minimum abnormal value. The range between the minimum abnormal value and the maximum abnormal value is the abnormal range; The adjudicator will send the abnormal range to the applicant. The method also includes the applicant determining whether the actual maximum value and the actual minimum value exceed an abnormal range: When the actual maximum value exceeds the abnormal range, the actual maximum value is marked as abnormal; When the actual minimum value exceeds the abnormal range, the actual minimum value is marked as abnormal.

2. The method for securely calculating the maximum and minimum values ​​of data according to claim 1, characterized in that: The participants, based on value A and data Encryption generates encrypted value include: .

3. The method for securely calculating the maximum and minimum values ​​of data according to claim 1, characterized in that: The random value and the received public key For encrypted values Encryption yields the first encryption result. include: .

4. The method for securely calculating the maximum and minimum values ​​of data according to claim 1, characterized in that, The referee, based on the ratio sequence The decryption sequence is obtained from the decryption model. Previously, a decryption model needed to be established, including: Based on the function Build functions ,in, , It is a least common multiple function; The private key (λ, μ) is obtained based on the functions μ and λ. The decryption model is obtained based on the private key (λ, μ). .

5. The method for securely calculating the maximum and minimum values ​​of data according to claim 1, characterized in that: The applicant, based on numerical value A and data Encryption generates encrypted value include: .

6. The method for securely calculating the maximum and minimum values ​​of data according to claim 1, characterized in that: The random value and the received public key For encrypted values Encryption yields a second encryption result include: .

7. A system for securely calculating the maximum and minimum values ​​of data from multiple parties, characterized in that: The system includes multiple user terminals and is used to perform the method as described in any one of claims 1 to 6, wherein the multiple user terminals are participants in the method.

Citation Information

Patent Citations

  • Method and system for secure multi-party calculation of median in data

    CN116094695A