A numerical security sorting method and system based on ciphertext
By using ciphertext-based encryption technology and cloud server merge sorting method in multi-party numerical sorting, the problems of data privacy leakage and calculation overhead are solved, and efficient and secure multi-party numerical sorting is achieved.
Patent Information
- Application Number
- CN202111309861.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-07
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2041-11-07
AI Technical Summary
The prior art has problems such as data privacy leakage risks, insufficient security, and large computing overhead in the multi-party numerical sorting process, which cannot effectively protect sensitive data privacy and improve sorting efficiency.
Using ciphertext-based numerical security sorting method, multi-party privacy data is encrypted through distributed encryption keys, and cloud servers are used to compare and merge the ciphertext data size to ensure that the data is sorted in an undecrypted state and reduce the Interaction and computational overhead between participants.
It realizes the security of protecting sensitive data privacy in the multi-party numerical sorting process, while reducing calculation overhead and number of interactions between participants, and improving sorting efficiency.
Smart Images

Figure CN114168977B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of information security technology, and in particular relates to a ciphertext-based numerical security sorting method and system. Background Art
[0002] At present, in order to realize an efficient multi-party numerical ranking scheme, the existing technology is that users collect local data and then upload the obtained plaintext data to a third-party trusted organization, which calculates the data and generates the ranking results. However, during the sorting process, the third party will obtain the plaintext data involved in the sorting and the final ranking results, which will threaten the privacy data of the data owner (such as grades, account balances, contact information, etc.) and there is a risk of sensitive information leakage.
[0003] Specifically, for example, the patent "A Data Sorting Method and Device" (application number 202011174485.8, application publication number CN 112182660 A) of Shenzhen Qianhai Weizhong Bank Co., Ltd. can solve at least one of the problems of high computational overhead and data insecurity in existing data security sorting systems. The shortcomings of this method are: data comparison is performed on one user end to achieve the effect of obtaining user data rankings, but only one user can obtain the ranking results of the data held at a time. If other participants want to obtain rankings, they need to perform re-sorting calculations. At the same time, users holding private keys can decrypt and obtain the plaintext data involved in the sorting, which results in data security that cannot be guaranteed. At the same time, each user needs to perform repeated calculations to obtain rankings, which increases the computational overhead.
[0004] Specifically, for example, the patent "A method and system for secure multi-party calculation of private data" (application number 201911290265.9 application publication number CN 111046409 A) applied by Alipay (Hangzhou) Information Technology Co., Ltd. discloses a method and system for secure multi-party calculation of private data, which is used to compare the size of two-party data. The system ensures the security of the data, but is only applicable to the size comparison of two-party ciphertext data, and cannot be well applied to multi-party data sorting. Therefore, a new numerical security sorting method and system are urgently needed to make up for the defects of the existing technology.
[0005] Through the above analysis, the problems and defects of the prior art are as follows:
[0006] (1) In the prior art, during the sorting process, a third party will obtain the plaintext data involved in the sorting and the final ranking results, which threatens the privacy of the data owner and poses a risk of sensitive information leakage.
[0007] (2) The current data security sorting scheme has insufficient security and is only applicable to the size comparison of ciphertext data between two parties, and cannot support the security sorting of data between multiple parties.
[0008] (3) Most current solutions require multiple interactions among the participants, which leads to excessive repeated calculations, increases computational overhead, and affects system efficiency.
[0009] The difficulty of solving the above problems and defects is: how to design an efficient multi-party numerical security sorting method that can protect the privacy of sensitive data.
[0010] The significance of solving the above problems and defects is: to address data security issues in distributed scenarios, an efficient and privacy-preserving numerical security sorting algorithm is designed for a secure multi-party sorting model, which can ensure the security of sensitive information in the multi-party data sorting process, while reducing the number of interactions between participants and reducing computing overhead, thereby improving sorting efficiency and effectively promoting the vigorous development of big data related technologies. Summary of the invention
[0011] In view of the problems existing in the existing secure sorting systems in terms of data privacy and sorting efficiency, the present invention provides a numerical secure sorting method and system based on ciphertext, and more particularly relates to a numerical secure sorting method, system, device and data processing terminal based on ciphertext.
[0012] The present invention is implemented in this way: a numerical security sorting method based on ciphertext, the numerical security sorting method based on ciphertext comprising:
[0013] The numerical security sorting algorithm based on ciphertext uses distributed encryption keys to encrypt the private data held by multiple parties. The ciphertext data is sent to the cloud server, which compares the ciphertext data according to the data size comparison protocol and then combines the merge sorting algorithm to sort the ciphertext data.
[0014] Users pre-process and encrypt the data at the beginning, and then send the encrypted data to the cloud server for processing; users do not need to perform repeated data sorting operations, and the cloud service provider completes the secure sorting of the ciphertext data; rankings are generated based on the sorting results, and the corresponding data rankings are finally fed back to the participants.
[0015] Furthermore, the ciphertext-based numerical security sorting method comprises the following steps:
[0016] Step 1: System initialization and key distribution. This stage is used to generate and distribute distributed encryption keys and ciphertext data comparison keys. The key distribution center selects the required security parameters according to the data scale and generates public and private keys based on Benaloh homomorphic encryption. The private key is split and combined with the public key to generate a distributed encryption key, which is distributed to each participant. The other part of the private key is used as the ciphertext data comparison key and sent to the cloud server for comparing the size of ciphertext data.
[0017] Step 2: Local collection data encryption. This stage is used to encrypt the collected local sample data. The participants collect local sample data and pre-sort the data to generate an ordered sample data set. The data is encrypted using a distributed encryption key to generate an ordered ciphertext data set, and the ciphertext data set is sent to the cloud server.
[0018] Step 3: Ciphertext data collection and ciphertext data sorting. This stage is used to merge and sort the received ciphertext data. After receiving the ciphertext data from all participants, the cloud server uses the ciphertext comparison key to compare the ciphertext data, and combines merge sorting to generate an ordered ciphertext set.
[0019] Step 4: Data ranking feedback. This stage is used to feed back the ranking of the ciphertext data to the participants; generate corresponding ranking results for the ordered ciphertext set, and send the rankings corresponding to all data to the participants.
[0020] Further, in step 1, the system initialization and key distribution include:
[0021] (1) Assume that the plaintext space is Z r ={0, 1, ..., r / 2-1}, r is a positive integer;
[0022] (2) The key distribution center selects two large prime numbers p and q such that p and q satisfy r|(p-1). And gcd(r,q-1)=1, and let n=pq,
[0023] (3) Optional key distribution center satisfy gcd(s,r)=1 and At the same time, a hash function h(·) is randomly selected;
[0024] (4) The key distribution center calculates Due gcd(s,r)=1 and The set of contains r-1 different values; for any i, if and only if When , the condition 0<i<r / 2 is satisfied;
[0025] (5) The key distribution center generates a public key pk=(y, n, h(·), U) and a private key pk according to steps 1) to 4). The public key and a part of the public key s are sent to the participants as the distributed encryption key (pk, s); at the same time, the other part of the private key Sent to the server as the ciphertext data comparison key for ciphertext data comparison.
[0026] Furthermore, in step 2, the local collection data encryption includes:
[0027] (1) The data collected by each participant is represented as a set Then the data set collected by each participant is expressed as Where k = 1, 2, 3..., l, k is the kth participant, there is 1 participant in total, each participant first sorts its own set data to obtain an ordered set, and adds an ID number to each data for identification;
[0028] (2) For each set of aggregate data, each participant uses a distributed encryption key to encrypt; the participant performs the encryption operation as follows:
[0029] 1) Given a plaintext m∈Z r , distributed encryption key (pk, s), the plaintext m is encrypted to obtain c = E (m, u) = y sm u r mod n,
[0030] 2) Using step 1), for each participant’s set Encryption is performed, and after encryption,
[0031] (3) Each participant sends the encrypted data and the corresponding ID number to the cloud server.
[0032] Furthermore, in step 3, the ciphertext data collection and ciphertext data sorting include:
[0033] (1) The cloud server determines whether it has received the ciphertext set data of one participant. If it has received the ciphertext set data of all participants, it sorts the data;
[0034] (2) Sorting based on the size comparison of ciphertexts, using the properties of the data comparison protocol to compare the size of ciphertexts, including:
[0035] 2.1) Given plaintext data m1, m2∈Z r , at the same time Given two encrypted data c1 and c2, the ciphertext data compares the key The server compares m1 and m2 according to the following steps:
[0036] 2.2) Calculation
[0037] 2.3) If c = 1, then m1 = m2; if h(c)∈U, 0<m2-m1<r / 2, that is, m2>m1; otherwise, if h(c -1 )∈U, m1>m2;
[0038] 2.4) Using steps 2.1) to 2.3), the two ciphertext data are compared to obtain the magnitude relationship between the two ciphertext values;
[0039] (3) After comparing the ciphertext sizes, merge sort is used to sort the data of the l participants. Merge sort is an effective and stable sorting algorithm based on the merge operation. It merges the ordered subsequences to obtain a completely ordered sequence. Merging two ordered lists into one ordered list is called a two-way merge, which includes:
[0040] 3.1) Given two ciphertext sequences x = {x1, x2, ..., x p} and y = {y1, y2, ..., y q}, where the number of elements in set x is p, the number of elements in set y is q, and the plaintexts of the two sequences are already in order;
[0041] 3.2) Apply for a space whose size is the sum of the sizes of the sorted sequences, that is, p+q. This space is used to store the merged sequences.
[0042] 3.3) Set two pointers, whose initial positions are the starting positions of the two sorted sequences;
[0043] 3.4) Compare the elements pointed to by the two pointers, and select the relatively smaller element to put into the merge space;
[0044] 3.5) Repeat step 3.4) until one of the pointers exceeds the end of the sequence, and copy all the remaining elements of the other sequence directly to the end of the merged sequence;
[0045] 3.6) Continue to select another set and repeat steps 3.1) to 3.5) with the sorted set until only one set is left.
[0046] Furthermore, in step 4, the data ranking feedback includes:
[0047] The ciphertext data uploaded by multiple participants have been sorted. A ranking attribute rank is added to the ordered ciphertext set. Assume that there are n data records after sorting, and each sorted record is R i ={ID i , data, rank}, 0<i≤n, data is the ciphertext data, R i The data is returned to the corresponding participants, who can then obtain the ranking of the data for subsequent processing.
[0048] Another object of the present invention is to provide a numerical security sorting system using the ciphertext-based numerical security sorting method, the numerical security sorting system comprising:
[0049] The key initialization module based on the Benaloh homomorphic encryption algorithm includes a security parameter selection submodule and a key splitting and distribution submodule. It is used in the system initialization phase. After the key distribution center generates a distributed encryption key and a ciphertext data comparison key, it distributes the distributed encryption key to the participants and distributes the ciphertext data comparison key to the cloud server.
[0050] The data pre-sorting module based on two-way merge sorting includes a data collection submodule and a data merge sorting submodule, which is used for multiple participants to collect data that need to be ranked respectively, and sort the collected data respectively by merge sorting to obtain an ordered data set; the data collection submodule means that each participant selects the data that needs to be sorted from the local sample data to generate the original sample data; the data merge sorting submodule means that after sorting the original sample data by two-way merge sorting to generate the ordered sample data, a specified ID is generated for each sample data, and the ID is used to identify the participant to whom the data belongs;
[0051] The data encryption module based on the data comparison protocol is used to receive the distributed encryption key distributed by the key distribution center and use the key to encrypt the ordered sample data. The ordered sample data is Given plaintext Distributed encryption key (pk, s), plaintext After encryption, we get c=E(m,u)=y sm u r mod n, Thus, we get an ordered ciphertext data set After all participants encrypt and generate a ciphertext data set, they send the ciphertext data set to the cloud server;
[0052] The ciphertext merge sorting module based on the data comparison protocol includes a ciphertext data comparison submodule and a ciphertext merge sorting submodule. After the cloud server receives the data from all participating ciphertext parties, it uses merge sorting to sort all ciphertext data to generate an ordered ciphertext data set, ranks and marks the data, and finally feeds back the ranking corresponding to the data to the corresponding participating parties.
[0053] Furthermore, the key initialization module based on the Benaloh homomorphic encryption algorithm includes:
[0054] The security factor selection submodule is used to select the security factor required by the Benaloh homomorphic encryption algorithm according to the size of the data, and calculate and generate n and Using n and Generate y, s and r, randomly select a hash function h(·); the key distribution center uses the data to calculate Generate public key pk = (y, n, h(·), U), private key
[0055] The key splitting and distribution submodule is used to split the generated private key into two parts, combine the public key pk with a part of the private key s to generate a distributed encryption key (pk, s), and distribute it to the participants for data encryption; the other part of the private key As the ciphertext data comparison key, it is distributed to the cloud server for ciphertext data size comparison.
[0056] The ciphertext merging and sorting module based on the data comparison protocol includes:
[0057] The ciphertext data comparison submodule is used to compare the size of ciphertext data during the sorting process of ciphertext data on the cloud server. Given two ciphertext data c1 and c2, corresponding to plaintext data m1 and m2, the distributed encryption key calculate If c = 1, then m1 = m2; if h(c)∈U, 0<m2-m1<r / 2, that is, m2>m1; if h(c -1 )∈U, m1>m2, to achieve the comparison of the size of ciphertext data;
[0058] The ciphertext merge sort submodule, after receiving the data from m participants, uses merge sort to sort the ciphertext data to obtain an ordered ciphertext set. For the m ciphertext data sets received, any two sets x = {x1, x2, ..., x p} and y = {y1, y2, ..., y q}; Apply for a space to store the merged sequence; Set two pointers, whose initial positions are the starting positions of the two sorted sequences; Compare the elements pointed by the two pointers, and select the relatively small element to put into the merged space; Repeat the above steps to obtain the ordered ciphertext data set z = {z1, z2, ..., z s}, s is the number of all data involved in the sorting, and a ranking attribute rank is added to the set, then each data record of the set is represented by R i ={ID i , z i , rank}, 0<i≤s, according to the ID number, R i The ranking is fed back to the corresponding participants.
[0059] Another object of the present invention is to provide a computer device, the computer device comprising a memory and a processor, the memory storing a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
[0060] The numerical security sorting algorithm based on ciphertext uses distributed encryption keys to encrypt the private data held by multiple parties. The ciphertext data is sent to the cloud server, which compares the ciphertext data according to the data size comparison protocol and then combines the merge sorting algorithm to sort the ciphertext data.
[0061] Users pre-process and encrypt the data at the beginning, and then send the encrypted data to the cloud server for processing; users do not need to perform repeated data sorting operations, and the cloud service provider completes the secure sorting of the ciphertext data; rankings are generated based on the sorting results, and the corresponding data rankings are finally fed back to the participants.
[0062] Another object of the present invention is to provide an information data processing terminal, which is used to implement the numerical security sorting system.
[0063] The advantages and positive effects of a numerical security sorting method and system based on ciphertext are as follows: in order to protect the local sensitive data of the participants, the numerical security sorting method provided by the present invention requires the user to preprocess and encrypt the data at the very beginning, and hand over the encrypted data to the cloud server for processing. The user does not need to perform repeated data sorting operations. The cloud service provider completes the secure sorting of the ciphertext data, and then generates a ranking for the sorting results, and finally feeds back the corresponding data ranking to the participants.
[0064] In response to data security issues in distributed scenarios, an efficient and privacy-preserving numerical security sorting algorithm is designed for a secure multi-party sorting model. This can ensure the security of sensitive information in the multi-source data sorting process and effectively promote and drive the vigorous development of big data related technologies.
[0065] The innovation of the present invention lies in: 1) constructing a data comparison protocol based on a private key splitting method to ensure data privacy; 2) utilizing a merge sorting mechanism to achieve efficient ciphertext sorting.
[0066] The invention provides a numerical security sorting algorithm based on ciphertext for privacy protection and high efficiency.
[0067] (1) Privacy protection.
[0068] In order to protect the user's local training data, an improved data comparison protocol is proposed based on the Benaloh encryption scheme. In this protocol, the participants encrypt the local data after preprocessing to obtain a ciphertext data set, and then send the ciphertext data set to the cloud server, so that the cloud server can safely sort the user's private data without obtaining the user's plaintext data. While achieving secure multi-party sorting, the private data of the participants is protected from being leaked, and the final sorting result is obtained.
[0069] (2) Efficiency.
[0070] Multiple participants send a set of encrypted data to the cloud server, which uses merge sort to complete the secure sorting process and feeds back the ranking to the user after sorting. This process only requires the participants to interact with the cloud server, not between the participants, and each participant can get the ranking results of the data they hold, which can save repeated computing overhead and improve the efficiency of sorting by combining merge sort.
[0071] This system pre-processes and encrypts local data to obtain a ciphertext data set, and then sends the ciphertext data set to the server. The cloud server uses merge sort to complete the subsequent secure sorting process, and finally feeds back the ranking to the user. This process only requires interaction between the participants and the server, and does not require interaction between the two users. On the basis of realizing multi-party data sorting, it saves repeated computing overhead and improves the efficiency of secure multi-party sorting.
[0072] In order to protect the privacy of users' training data, a data comparison protocol based on the Benaloh encryption scheme is used. After users preprocess and encrypt local data to obtain a ciphertext data set, the ciphertext data set is sent to the cloud server. This process ensures that after the cloud server obtains the ciphertext set data, it can securely sort the user's ciphertext set data without directly obtaining the user's local plaintext data. In this way, it is possible to obtain the data sorting results while protecting user data. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0074] Figure 1 It is a flow chart of a ciphertext-based numerical security sorting method provided by an embodiment of the present invention.
[0075] Figure 2 It is a schematic diagram of a ciphertext-based numerical security sorting method provided in an embodiment of the present invention.
[0076] Figure 3 is a structural block diagram of a numerical security sorting system provided by an embodiment of the present invention;
[0077] In the figure: 1. Key initialization module based on Benaloh homomorphic encryption algorithm; 2. Data pre-sorting module based on two-way merge sorting; 3. Data encryption module based on data comparison protocol; 4. Ciphertext merge sorting module based on data comparison protocol.
[0078] Figure 4 It is a structural principle diagram of a numerical security sorting system provided by an embodiment of the present invention.
[0079] Figure 5 It is a system initialization sub-flow chart provided by an embodiment of the present invention.
[0080] Figure 6 It is a sub-flow chart of ciphertext merging and sorting provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0081] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0082] In view of the problems existing in the prior art, the present invention provides a numerical secure sorting method and system based on ciphertext, which can be used in electronic auctions, confidential auctions, anonymous voting, and secure data mining. The electronic voting scheme using secure multi-party sorting can obtain the voting results without leaking the privacy information of the participants; in the medical diagnosis process, medical research needs to rely on a large amount of medical information records to analyze the condition, and the patient's personal information cannot be leaked. The use of secure multi-party sorting can achieve the purpose of patient information sharing while protecting user privacy; in the process of ranking query in the primary and secondary school student ranking system, the student's ranking can be checked without infringing the student's privacy.
[0083] like Figure 1 As shown, the numerical security sorting method provided by the embodiment of the present invention includes the following steps:
[0084] S101, system initialization and key distribution: the key distribution center selects the required security parameters according to the data scale, generates public and private keys based on Benaloh homomorphic encryption; splits the private key, combines it with the public key to generate a distributed encryption key, and distributes the key to each participant; the other part of the private key is used as the ciphertext data comparison key and sent to the cloud server for comparison of the ciphertext data size;
[0085] S102, local set data encryption: the participant collects local sample data, and pre-sorts the data to generate an ordered sample data set; encrypts the data using a distributed encryption key to generate an ordered ciphertext data set, and sends the ciphertext data set to the cloud server;
[0086] S103, ciphertext data collection and ciphertext data sorting: after receiving the ciphertext data from all participants, the cloud server uses the ciphertext comparison key to compare the ciphertext data, and combines merge sorting to generate an ordered ciphertext set;
[0087] S104, data ranking feedback: Generate corresponding ranking results for the ordered ciphertext set, and send the rankings corresponding to all data to the participants.
[0088] The principle diagram of the numerical security sorting method provided by the embodiment of the present invention is as follows: Figure 2 shown.
[0089] like Figure 3 As shown, the numerical security sorting system provided by the embodiment of the present invention includes:
[0090] The key initialization module 1 based on the Benaloh homomorphic encryption algorithm includes a security parameter selection submodule and a key splitting and distribution submodule, which is used for the key distribution center to generate a distributed encryption key and a ciphertext data comparison key in the system initialization phase, and then distribute the distributed encryption key to the participants and the ciphertext data comparison key to the cloud server;
[0091] The data pre-sorting module 2 based on two-way merge sorting includes a data collection submodule and a data merge sorting submodule, which is used for multiple participants to collect data that need to be ranked respectively, and sort the collected data respectively by merge sorting to obtain an ordered data set; the data collection submodule means that each participant selects the data that needs to be sorted from the local sample data to generate the original sample data; the data merge sorting submodule means that after sorting the original sample data by two-way merge sorting to generate the ordered sample data, a specified ID is generated for each sample data, and the ID is used to identify the participant to whom the data belongs;
[0092] The data encryption module 3 based on the data comparison protocol is used to receive the distributed encryption key distributed by the key distribution center and use the key to encrypt the ordered sample data. The ordered sample data is Given plaintext Distributed encryption key (pk, s), plaintext After encryption, we get c=E(m,u)=y sm u r mod, Thus, we get an ordered ciphertext data set After all participants encrypt and generate a ciphertext data set, they send the ciphertext data set to the cloud server;
[0093] The ciphertext merge sorting module 4 based on the data comparison protocol includes a ciphertext data comparison submodule and a ciphertext merge sorting submodule, which is used to sort all the ciphertext data by merge sorting to generate an ordered ciphertext data set after the cloud server receives the data of all participating ciphertext parties, rank and mark the data, and finally feed back the ranking corresponding to the data to the corresponding participating parties.
[0094] The structural principle diagram of the numerical security sorting system provided by the embodiment of the present invention is as follows: Figure 4 shown.
[0095] The system initialization sub-flow chart provided by the embodiment of the present invention is as follows Figure 5 As shown, the ciphertext merging and sorting sub-flow chart provided by the embodiment of the present invention is as follows Figure 6 shown.
[0096] The technical solution of the present invention is further described below in conjunction with specific embodiments.
[0097] Example 1
[0098] The purpose of the present invention is to propose a numerical security sorting method based on ciphertext in view of the deficiencies of the existing security sorting system in terms of data privacy and sorting efficiency. In order to protect the local sensitive data of the participants, the present invention proposes a numerical security sorting method based on ciphertext. The user needs to pre-process and encrypt the data at the beginning, and hand over the encrypted data to the cloud server for processing. The user does not need to perform repeated data sorting operations. The cloud service provider completes the secure sorting of the ciphertext data, and then generates a ranking for the sorting results, and finally feeds back the corresponding data ranking to the participants.
[0099] In order to protect the privacy of data in the process of secure multi-party numerical sorting, the present invention proposes a ciphertext numerical security sorting method based on a data comparison protocol. The specific process is as follows:
[0100] The first step is system initialization and key distribution. The key distribution center selects the required security parameters according to the data scale and generates public and private keys based on Benaloh homomorphic encryption. The private key is split and combined with the public key to generate a distributed encryption key, which is distributed to each participant. The other part of the private key is used as the ciphertext data comparison key and sent to the cloud server for comparing the size of the ciphertext data.
[0101] The second step is to encrypt local set data. The participants first collect local sample data and pre-sort the data to generate an ordered sample data set. Then, they use the distributed encryption key to encrypt the data to generate an ordered ciphertext data set, and send the ciphertext data set to the cloud server.
[0102] The third step is the collection and sorting of ciphertext data. After receiving the ciphertext data from all participants, the cloud server uses the ciphertext comparison key to compare the size of the ciphertext data, and combines it with merge sort to generate an ordered ciphertext set.
[0103] The fourth step is data ranking feedback, generating corresponding ranking results for the ordered ciphertext set and sending the rankings corresponding to all data to the participants.
[0104] Example 2
[0105] The embodiment of the present invention provides a method for secure sorting of numerical values based on ciphertext, comprising the following steps:
[0106] Step 1: System initialization and key distribution.
[0107] (1.1) Assume that the plaintext space is Z r ={0, 1, ..., r / 2-1}, r is a positive integer.
[0108] (1.2) The key distribution center first selects two large prime numbers p and q such that p and q satisfy r|(p-1). And gcd(r,q-1)=1, and let n=pq,
[0109] (1.3) Optional key distribution center satisfy gcd(s,r)=1 and At the same time, a hash function h(·) is randomly selected;
[0110] (1.4) The key distribution center calculates because gcd(s,r)=1 and The set of contains r-1 different values. For any i, if and only if When , the condition 0<i<r / 2 is satisfied;
[0111] (1.5) The key distribution center generates the public key pk = (y, n, h(·), U) and the private key The public key and part of the public key s are then sent to the participants as the distributed encryption key (pk, s); at the same time, the other part of the private key Sent to the server as the ciphertext data comparison key for ciphertext data comparison.
[0112] Step 2: Encrypt local collection data.
[0113] (2.1) The data collected by each participant is represented as a set Then the data set collected by each participant is expressed as Where k = 1, 2, 3..., l, k is the kth participant, there is 1 participant in total, each participant first sorts its own set data to obtain an ordered set, and adds an ID number to each data for identification;
[0114] (2.2) For each set of data, each participant uses a distributed encryption key to encrypt the data. The encryption operation performed by the participant is as follows:
[0115] a. Given a plaintext m∈Z r , the public key pk and a part of the private key s, the plaintext m can be encrypted to get c = E (m, u) = y sm u r mod n,
[0116] b. Using the above steps, for each participant's set After encryption, we get
[0117] 3) Each participant sends the encrypted data and the corresponding ID number to the cloud server.
[0118] Step three: ciphertext data collection and ciphertext data sorting.
[0119] (3.1) The cloud server determines whether it has received the ciphertext set data of one participant. If it has received the ciphertext set data of all participants, it sorts the data;
[0120] (3.2) Sorting is based on the size comparison of ciphertexts, so it is necessary to use the properties of the data comparison protocol to compare the size of ciphertexts. The specific steps are as follows:
[0121] a. Given plaintext data m1, m2∈Z r , at the same time Given two encrypted data c1 and c2, the ciphertext data compares the key The server can compare m1 and m2 according to the following steps:
[0122] b. Calculation
[0123] c. If c = 1, then m1 = m2. If h(c)∈U, 0<m2-m1<r / 2, that is, m2>m1. Otherwise, if h(c -1 )∈U, m1>m2.
[0124] The above steps can be used to compare two ciphertext data to obtain the size relationship between the two ciphertext values;
[0125] (3.3) After comparing the ciphertext sizes, merge sort is used to sort the data of one participant. Merge sort is an effective and stable sorting algorithm based on the merge operation. It merges ordered subsequences to obtain a completely ordered sequence. The merging of two ordered lists into one ordered list is called a two-way merge. The specific implementation steps are as follows:
[0126] a. Given two ciphertext sequences x = {x1, x2, ..., x p} and y = {y1, y2, .., y q}, where the number of elements in set x is p, the number of elements in set y is q, and the plaintexts of the two sequences are already in order;
[0127] b. Apply for a space whose size is the sum of the sizes of the sorted sequences, that is, p+q. This space is used to store the merged sequences.
[0128] c. Set two pointers, whose initial positions are the starting positions of the two sorted sequences;
[0129] d. Compare the elements pointed to by the two pointers and select the relatively smaller element to put into the merge space;
[0130] e. Repeat step d until one of the pointers exceeds the end of the sequence, and copy all remaining elements of the other sequence directly to the end of the merged sequence.
[0131] f. Continue to select another set and repeat the above steps with the sorted set until only one set is left.
[0132] Step 4: Data ranking feedback.
[0133] The ciphertext data uploaded by multiple participants have been sorted. A ranking attribute rank is added to the ordered ciphertext set. Assuming that there are n data records after sorting, each sorted record is R i ={ID i , data, rank}, 0<i≤n, R i It is returned to the corresponding party so that the party can get the ranking of the specified ID for subsequent processing.
[0134] Example 3
[0135] Another object of the present invention is to provide a ciphertext-based numerical security sorting system for implementing the ciphertext-based numerical security sorting method, the ciphertext-based numerical security sorting system comprising:
[0136] Key initialization module based on Benaloh homomorphic encryption algorithm, data pre-sorting module based on two-way merge sorting, data encryption module based on data comparison protocol, ciphertext merge sorting module based on data comparison protocol;
[0137] The key initialization module based on the Benaloh homomorphic encryption algorithm includes a security parameter selection submodule and a key splitting and distribution submodule. It is used in the system initialization phase for the key distribution center to generate distributed encryption keys and ciphertext data comparison keys, and then distribute the distributed encryption keys to the participants and the ciphertext data comparison keys to the cloud server.
[0138] The data pre-sorting module based on two-way merge sorting includes a data collection submodule and a data merge sorting submodule, which is used for multiple participants to collect data that need to be ranked respectively, and sort the collected data respectively by merge sorting to obtain an ordered data set; the data collection submodule means that each participant selects the data that needs to be sorted from the local sample data to generate the original sample data; the data merge sorting submodule means that the original sample data is sorted by two-way merge sorting to generate ordered sample data, and then a specified ID is generated for each sample data, and the ID can identify the participant to whom the data belongs;
[0139] The data encryption module based on the data comparison protocol is used to receive the distributed encryption key distributed by the key distribution center and use the key to encrypt the ordered sample data. The ordered sample data is Given plaintext Distributed encryption key (pk, s), plaintext After encryption, we can get c=E(m,u)=y sm u r mod n, Thus, we get an ordered ciphertext data set After all participants encrypt and generate a ciphertext data set, they send the ciphertext data set to the cloud server;
[0140] The ciphertext merge sorting module based on the data comparison protocol includes a ciphertext data comparison submodule and a ciphertext merge sorting submodule. After the cloud server receives the data from all participating ciphertext parties, it uses merge sorting to sort all the ciphertext data to generate an ordered ciphertext data set, further ranks and marks the data, and finally feeds back the ranking corresponding to the data to the corresponding participants.
[0141] Further, the key initialization module based on the Benaloh homomorphic encryption algorithm includes:
[0142] The security factor selection submodule is used to select the security factor required by the Benaloh homomorphic encryption algorithm according to the size of the data. First, n and Using n and Generate y, s and r, and randomly select a hash function h(·); the key distribution center uses the above data to calculate Generate public key pk = (y, n, h(·), U), private key
[0143] The key splitting and distribution submodule is used to split the generated private key into two parts, combine the public key pk with a part of the private key s to generate a distributed encryption key (pk, s), and distribute it to the participants for data encryption; the other part of the private key As the ciphertext data comparison key, it is distributed to the cloud server for ciphertext data size comparison.
[0144] Furthermore, the ciphertext merging and sorting module based on the data comparison protocol includes:
[0145] The ciphertext data comparison submodule compares the size of ciphertext data during the sorting process of the ciphertext data on the cloud server. Given two ciphertext data c1 and c2, corresponding to the plaintext data m1 and m2, the distributed encryption key calculate If c = 1, then m1 = m2; if h(c)∈U, 0<m2-m1<r / 2, that is, m2>m1; if h(c -1 )∈U, m1>m2, the above steps can be used to compare the size of ciphertext data;
[0146] The ciphertext merge sort submodule, after receiving the data from one participant, uses merge sort to sort the ciphertext data to obtain an ordered ciphertext set. For the received ciphertext data set, any two sets x = {x1, x2, ..., x p} and y = {y1, y2, ..., y q ); apply for a space to store the merged sequence; set two pointers, the initial positions of which are the starting positions of the two sorted sequences; compare the elements pointed to by the two pointers, select the relatively small element and put it into the merged space; repeat the above steps, and we can get the ordered ciphertext data set z = {z1, z2, ..., z s}, s is the number of all data involved in the sorting, and a ranking attribute rank is added to the set, then each data record of the set can be expressed as R i ={ID i , z i , rank}, 0<i≤s, according to the ID number, R i The ranking is fed back to the corresponding participants.
[0147] The technical solution of the present invention is further described below in conjunction with simulation experiments.
[0148] The present invention can realize efficient data processing while ensuring data security and correct sorting. In an actual test in an environment with a processor Intel(R) Core(TM) i7-5500U CPU@2.40GHZ and a security parameter of 1024 bits, a single data encryption takes 2.356ms, two ciphertext data comparisons take 4.839ms, 10 data are merged and sorted in ciphertext in 0.015s, 100 data are merged and sorted in ciphertext in 0.338s, and 1000 data are merged and sorted in ciphertext in 5.315s.
[0149] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When the use is implemented in whole or in part in the form of a computer program product, the computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL) or wireless (e.g., infrared, wireless, microwave, etc.) mode) to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc.
[0150] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principle of the present invention should be covered by the protection scope of the present invention.
Claims
1. A numerical security sorting method based on ciphertext, characterized in that: The ciphertext-based numerical security sorting method is based on a ciphertext numerical security sorting algorithm and uses a distributed encryption key to encrypt the private data held by multiple participants; The ciphertext data is sent to the cloud server. The cloud server compares the ciphertext data using the data size comparison protocol and then sorts the ciphertext data using the merge sort algorithm. The user pre-processes and encrypts the data at the beginning, and then sends the encrypted data to the cloud server for processing; the user does not need to perform repeated data sorting operations, and the cloud service provider completes the secure sorting of the ciphertext data; Generate rankings based on the sorting results, and finally feed back the corresponding data rankings to the participants; The ciphertext-based numerical security sorting method comprises the following steps: Step 1: System initialization and key distribution: The key distribution center selects the required security parameters according to the data scale and generates public and private keys based on Benaloh homomorphic encryption; splits the private key and combines it with the public key to generate a distributed encryption key, which is distributed to each participant; the other part of the private key is used as the ciphertext data comparison key and sent to the cloud server for comparison of the ciphertext data size; Step 2: Encryption of local set data: The participants collect local sample data and pre-sort the data to generate an ordered sample data set; encrypt the data using a distributed encryption key to generate an ordered ciphertext data set, and send the ciphertext data set to the cloud server; Step 3: Ciphertext data collection and ciphertext data sorting: After receiving the ciphertext data from all participants, the cloud server uses the ciphertext data comparison key to compare the ciphertext data, and combines merge sorting to generate an ordered ciphertext set; Step 4: Data ranking feedback: Process the ordered ciphertext set to generate the corresponding ranking results, and send the rankings corresponding to all data to the participants; In step 1, the system initialization and key distribution include: (1) Assume that the plaintext space is Z r ={0,1,...,r / 2-1}, r is a positive integer; (2) The key distribution center selects two large prime numbers p and q such that p and q satisfy r|(p-1). And gcd(r,q-1)=1, and let n=pq, (3) Optional key distribution center satisfy gcd(s,r) = 1 and At the same time, a hash function h(·) is randomly selected; (4) The key distribution center calculates because gcd(s,r)=1 and The set of contains r-1 different values; for any i, if and only if When , the condition 0<i<r / 2 is satisfied; (5) The key distribution center generates a public key pk=(y, n, h(·), U) and a private key pk according to steps 1) to 4). The public key and part of the public key s are sent to the participants as the distributed encryption key (pk,s); at the same time, the other part of the private key Sent to the server as a ciphertext data comparison key for ciphertext data comparison; In step 2, the local collection data is encrypted, including: (1) The data collected by each participant is represented as a set Then the data set collected by each participant is expressed as Where k = 1, 2, 3..., l, k is the kth participant, there are l participants in total, each participant first sorts its own set data to obtain an ordered set, and adds an ID number to each data for identification; (2) For each set of aggregate data, each participant uses a distributed encryption key to encrypt; the participant performs the encryption operation as follows: 1) Given a plaintext m∈Z r , the public key pk and part of the private key s, the plaintext m is encrypted 2) Using step 1), for each participant’s set Encryption is performed, and after encryption, (3) Each participant sends the encrypted data and the corresponding ID number to the cloud server; In step 3, the ciphertext data collection and ciphertext data sorting include: (1) The cloud server determines whether it has received the ciphertext set data of l participants. If it has received the ciphertext set data of all participants, it sorts the data; (2) Sorting based on the size comparison of ciphertexts, using the properties of the data comparison protocol to compare the size of ciphertexts, including: 2.1) Given plaintext data m1, m2∈Z r , at the same time Given two encrypted data c1 and c2, the ciphertext data compares the key The server compares c1 and c2 according to the following steps: 2.2) Calculation 2.3) If c = 1, then m1 = m2; if h(c)∈U, 0<m2-m1<r / 2, that is, m2>m1; otherwise, if h(c -1 )∈U, m1>m2; 2.4) Using steps 2.1) to 2.3), the two ciphertext data are compared to obtain the magnitude relationship between the two ciphertext values; (3) After comparing the ciphertext sizes, merge sort is used to sort the data of the l participants. Merge sort is an effective and stable sorting algorithm based on the merge operation. It merges the ordered subsequences to obtain a completely ordered sequence. Merging two ordered lists into one ordered list is called a two-way merge, which includes: 3.1) Given two ciphertext sequences x = {x1, x2, ..., x p } and y = {y1, y2, ..., y q }, where the number of elements in set x is p, the number of elements in set y is q, and the plaintexts of the two sequences are already in order; 3.2) Apply for a space whose size is the sum of the sizes of the sorted sequences, that is, p+q. This space is used to store the merged sequences. 3.3) Set two pointers, whose initial positions are the starting positions of the two sorted sequences; 3.4) Compare the elements pointed to by the two pointers, and select the relatively smaller element to put into the merge space; 3.5) Repeat step 3.4) until one of the pointers exceeds the end of the sequence, and copy all the remaining elements of the other sequence directly to the end of the merged sequence; 3.6) Continue to select another set and repeat steps 3.1) to 3.5) with the sorted set until only one set is left; In step 4, the data ranking feedback includes: After the ciphertext data uploaded by multiple parties has been sorted, add a ranking attribute rank to the ordered ciphertext set. Suppose there are n data records after sorting, and each sorted record is R i ={ID i , data, rank}, 0 < i ≤ n, data is the ciphertext data, and return R i to the corresponding party, and the party can obtain the ranking of the data and thus perform subsequent processing.
2. A numerical security sorting system implementing the ciphertext-based numerical security sorting method according to claim 1, characterized in that: The numerical safety ranking system comprises: The key initialization module based on the Benaloh homomorphic encryption algorithm includes a security parameter selection submodule and a key splitting and distribution submodule. It is used in the system initialization phase. After the key distribution center generates a distributed encryption key and a ciphertext data comparison key, it distributes the distributed encryption key to the participants and distributes the ciphertext data comparison key to the cloud server. The data pre-sorting module based on two-way merge sorting includes a data collection submodule and a data merge sorting submodule, which is used for multiple participants to collect data that need to be ranked respectively, and sort the collected data respectively by merge sorting to obtain an ordered data set; the data collection submodule means that each participant selects the data that needs to be sorted from the local sample data to generate the original sample data; the data merge sorting submodule means that after sorting the original sample data by two-way merge sorting to generate the ordered sample data, a specified ID is generated for each sample data, and the ID is used to identify the participant to which the data belongs; The data encryption module based on the data comparison protocol is used to receive the distributed encryption key distributed by the key distribution center and use the key to encrypt the ordered sample data. The ordered sample data is Given plaintext Distributed encryption key (pk, s), plaintext Encrypted Thus, we get an ordered ciphertext data set After all participants encrypt and generate a ciphertext data set, they send the ciphertext data set to the cloud server; The ciphertext merge sorting module based on the data comparison protocol includes a ciphertext data comparison submodule and a ciphertext merge sorting submodule. After the cloud server receives the data from all participating ciphertext parties, it uses merge sorting to sort all ciphertext data to generate an ordered ciphertext data set, ranks and marks the data, and finally feeds back the ranking corresponding to the data to the corresponding participating parties.
3. The numerical security sorting system according to claim 2, characterized in that: The key initialization module based on the Benaloh homomorphic encryption algorithm includes: The security factor selection submodule is used to select the security factor required by the Benaloh homomorphic encryption algorithm according to the size of the data, and calculate and generate n and Using n and Generate y, s and r, randomly select a hash function h(·); the key distribution center uses the data to calculate Generate public key pk = (y, n, h(·), U), private key The key splitting and distribution submodule is used to split the generated private key into two parts, combining the public key pk with a part of the private key s to generate a distributed encryption key (pk, s), which is distributed to the participants for data encryption; the other part of the private key As the ciphertext data comparison key, it is distributed to the cloud server for ciphertext data size comparison; The ciphertext merging and sorting module based on the data comparison protocol includes: The ciphertext data comparison sub-module is used to compare the sizes of ciphertext data during the sorting of ciphertext data by the cloud server. Given two ciphertext data c1 and c2, corresponding to the plaintext data m1 and m2, and the distributed encryption key Calculate If c = 1, then m1 = m2; if h(c) ∈ U, 0 < m2 - m1 < r / 2, that is, m2 > m1; if h(c -1 ) ∈ U, m1 > m2, to realize the comparison of the sizes of ciphertext data; The ciphertext merge sort submodule, after receiving the data from m participants, uses merge sort to sort the ciphertext data to obtain an ordered ciphertext set. For the m ciphertext data sets received, any two sets x = {x1, x2, ..., x p } and y = {y1, y2, ..., y q }; Apply for a space to store the merged sequence; Set two pointers, whose initial positions are the starting positions of the two sorted sequences; Compare the elements pointed by the two pointers, and select the relatively small element to put into the merged space; Repeat the above steps to obtain the ordered ciphertext data set z = {z1, z2, ..., z s }, s≤p+q is the number of all data involved in the sorting, and a ranking attribute rank is added to the set, then each data record of the set is represented by R i ={ID i , z i , rank}, 0<i≤s, according to the ID number, R i The ranking is fed back to the corresponding participants.
4. A computer device, characterized in that: The computer device includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the ciphertext-based numerical security sorting method as described in claim 1 below.
5. An information data processing terminal, characterized in that: The information data processing terminal is used to implement the numerical security sorting system as described in any one of claims 2 to 3.
Citation Information
Patent Citations
Private data multi-party secure calculation method and system
CN111046409A
Data sorting method and device
CN112182660A
A method and device for sorting data
CN112182660B
Quasi-fully homomorphic ciphertext data operation method and system
CN107592195A
An outsourcing cloud environment privacy protection ciphertext sorting retrieval method
CN109885650A