Distributed data encryption method
Through the distributed data encryption method, the data to be encrypted is divided into multiple shards and multiple encryption obfuscated ciphertext encryption is used to solve the problem of third-party management keys of financial data among multiple institutions, and the searchability and searchability of encrypted data is realized. Comparable operations improve data analysis efficiency and security.
Patent Information
- Application Number
- CN202411370974.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In the prior art, financial data has problems with third-party management keys in the data analysis process between multiple institutions, resulting in waste of resources and delayed data analysis results. At the same time, encrypted data is difficult to achieve comparable and searchable operations at the same time.
Using distributed data encryption method, the data to be encrypted is divided into multiple shards, and the ciphertext is encrypted through multiple encryption obfuscated ciphertext. Multiple collaborative encryption and decryption agencies are used to jointly determine the encrypted ciphertext of each shard to ensure that the ciphertext has Find and compare features to avoid third-party management keys.
It realizes data encryption between multiple institutions without third-party management keys, ensuring that the encrypted data can be found and comparable between multiple institutions, improving data analysis efficiency and security.
Smart Images

Figure CN119094233A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a distributed data encryption method. Background Art
[0002] In many fields, such as finance, it is very important to protect customers’ sensitive information and transaction data. Financial data needs to be encrypted and protected, while massive amounts of data need to be searched and compared.
[0003] So how can we protect the data of different institutions from being leaked while enabling multiple institutions to jointly conduct data analysis operations?
[0004] The existing technology generally adopts the method of third-party management of keys, that is, each institution applies for key authorization from a third party every time it performs data analysis operations; the institution can only perform data analysis operations after obtaining key authorization. In this solution, each time an operation is performed, it is necessary to apply for authorization from a third party. Frequent authorization not only wastes resources, but also delays data analysis results. In addition, third-party management of keys also raises third-party trust issues.
[0005] Comparison and search are common requirements in data analysis, which often require ciphertext to satisfy both functions at the same time, while existing encryption schemes can only support one of them.
[0006] So, how to solve the problem of third-party key management and how to make encrypted data comparable and searchable at the same time remain to be solved. Summary of the invention
[0007] The present application provides a method for distributed data encryption, which can solve the problem of third-party key management among multiple institutions, and the encrypted data can be comparable and searchable at the same time.
[0008] In the first aspect, an embodiment of the present application provides a method for distributed data encryption, which is applicable to n collaborative encryption and decryption mechanisms. The method can be executed by a distributed data encryption device, which can be a terminal device or a module for a terminal device, or a server or a module for a server. The present application does not limit the execution subject of the method. The method includes: a first mechanism divides the data to be encrypted into multiple fragments in sequence; the data to be encrypted is the plaintext data in the first mechanism; the first mechanism is any one of the multiple collaborative encryption and decryption mechanisms; the first mechanism obtains the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th fragment, and encrypts the i-th fragment through the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th fragment; wherein i is a positive integer; based on the ciphertexts of the multiple fragments, the encrypted ciphertext of the data to be encrypted is obtained; wherein the i-1th multiple encrypted obfuscated ciphertext is obtained in the following manner: The first mechanism generates obfuscation parameters for the i-1th fragment, and sends the i-1th obfuscation parameters to the second mechanism; the second mechanism is an mechanism located after the first mechanism in the preset encryption and decryption order among the multiple collaborative encryption and decryption mechanisms; the second mechanism is used to encrypt the i-1th obfuscation parameter and send it to the next mechanism, until the n-1 obfuscated ciphertexts encrypted by the last mechanism in the preset encryption and decryption order are sent to the first mechanism; the first mechanism encrypts the n-1 obfuscated ciphertexts based on the i-1th obfuscation parameters to obtain the i-1th multi-encrypted obfuscated ciphertext.
[0009] In the above scheme, on the one hand, the i-1th multiple encrypted obfuscated ciphertext is jointly determined by n collaborative encryption and decryption institutions, and no institution can decrypt the encrypted data alone. Therefore, there is no need to adopt a third-party key management method, thereby solving the problem of third-party key management among multiple institutions; on the other hand, each slice of the data to be encrypted is encrypted separately. As long as the encrypted ciphertext corresponding to each slice has the characteristics of searchability and comparability, the encrypted ciphertext corresponding to the data to be encrypted can be searchable and comparable at the same time. The i-1th multiple encrypted obfuscated ciphertext corresponding to each slice is jointly determined by n collaborative encryption and decryption institutions, which makes each slice have a certain relative relationship while being encrypted, so that each slice can be searched. The i-th slice is encrypted using the i-1th multiple encrypted obfuscated ciphertext, which maintains the original size attribute of the i-th slice, thus making each slice comparable.
[0010] In one possible implementation method, the first mechanism obtains the hash value of the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the hash value of the i-1th multiple encrypted obfuscated ciphertext and the numerical value of the i-th shard to obtain the ciphertext of the i-th shard.
[0011] In the above scheme, the value of the i-th shard can ensure that the size of each shard remains unchanged. Therefore, the ciphertext of the i-th shard maintains the size relationship of the original value and can achieve comparable operations. The i-1th multi-encrypted obfuscated ciphertext corresponding to each shard is jointly determined by n collaborative encryption and decryption mechanisms, which makes each shard have a certain relative relationship while being encrypted, and can achieve searchable operations. Therefore, the ciphertext of the i-th shard can achieve both comparable and searchable operations.
[0012] In a possible implementation method, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th slice based on the i-1th slice ciphertext and the obfuscation parameter of the i-1th slice; wherein, when i=1, the i-1th slice ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted; and the initial obfuscated ciphertext corresponding to the i-1th slice is sent to the second mechanism.
[0013] In the above scheme, on the one hand, when i=1, the i-1th shard ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted, so that the initial obfuscated ciphertext corresponding to each shard contains the identifier information of the data to be encrypted, so that even data with the same value but different identifiers have different ciphertexts; for example, if the identifier is a user deposit, the value corresponding to the user deposit is 100; if the identifier is a user arrears, the value corresponding to the user arrears is also 100; then, since the identifiers of the data to be encrypted are different, although the values are both 100, the encrypted ciphertexts obtained are also different. On the other hand, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext and the obfuscation parameters of the i-1th shard, then, for two data, if the i-1th shard ciphertext corresponds to a different value, the ciphertexts of the subsequent shards of the two data will also be different, thereby achieving accurate and effective data comparison and search operations. For example, user A's deposit is 1234, and the corresponding shards are "1", "2", "3", and "4"; user B's deposit is 1534, and the corresponding shards are "1", "5", "3", and "4". Among them, the encrypted ciphertext of the first shard "1" of user A and user B is the same, and the encrypted ciphertext of the second shards "2" and "5" must be different; but the encryption of subsequent shards of user A and user B uses the ciphertext of the second shard. Since the encrypted ciphertext of the second shard is different, although the plaintext data of the third and fourth shards of user A and user B is the same, the encrypted ciphertext is also different.
[0014] In a possible implementation method, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext, the obfuscation parameter of the i-1th shard and the modular exponential operation; wherein the i-1th shard ciphertext is the base of the modular exponential operation; and the obfuscation parameter of the i-1th shard is the exponent of the modular exponential operation.
[0015] The above scheme can achieve accurate and effective determination of the initial obfuscated ciphertext, and the ciphertext of the data to be encrypted determined based on the initial obfuscated ciphertext has a searchable property.
[0016] In a possible implementation method, the first institution encrypts the n-1 obfuscated ciphertexts based on the i-1 obfuscation parameter and the first private key; wherein each collaborative encryption and decryption institution corresponds to a private key; the i-1 multiple encrypted obfuscated ciphertext contains the private keys corresponding to n collaborative encryption and decryption institutions; the first private key is a private key generated by the first institution; the second institution is used to encrypt the i-1 obfuscation parameter using the second private key and then send it to the next institution; the second private key is a private key generated by the second institution.
[0017] In the above scheme, each institution that collaborates in encryption and decryption corresponds to a private key, and the private key of any institution is kept confidential from other institutions. In other words, each institution keeps a part of the key, and no institution can decrypt the encrypted data alone. Therefore, there is no need to adopt a third-party management key method, thereby solving the problem of third-party management of keys among multiple institutions; and the private key of each collaborative encryption and decryption institution remains unchanged throughout the encryption process, so that the encrypted ciphertext can be searched and compared.
[0018] In a possible implementation method, the first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, the first private key and the modular exponential operation; wherein the n-1 obfuscated ciphertext is the base of the modular exponential operation; and the inverse of the first private key and the i-1th obfuscation parameter is the exponent of the modular exponential operation.
[0019] The above scheme makes the i-1th multi-encrypted obfuscated ciphertext contain the first private key, that is, the first institution also stores part of the key, and any institution cannot decrypt the encrypted data alone, so there is no need to use a third-party key management method, thereby solving the problem of third-party key management among multiple institutions; and the private key of each collaborative encryption and decryption institution is unchanged during the entire encryption process, so the encrypted ciphertext can be searched and compared. In addition, the inverse of the i-1th obfuscation parameter is used as the exponent of the modular exponential operation, which is exactly eliminated with the i-1th obfuscation parameter in the initial obfuscated ciphertext, removing the influence of the random generation characteristics of the obfuscation parameter on the encryption algorithm; thereby, the encrypted data with the same identifier and the same value have the same encrypted ciphertext, so the encrypted ciphertext can be searched and compared.
[0020] In a possible implementation method, if the first N bits of the first private key are 0, the first institution regenerates the first private key; wherein N is a multiple of 8.
[0021] The above scheme can ensure the validity of the first private key, so that the length of the first private key is fixed, and the length of the first private key will not be shortened due to the first N digits of the first private key being 0, thereby affecting the validity of the encryption algorithm.
[0022] In a possible implementation method, the encrypted ciphertext corresponding to the data to be encrypted is stored in a database; the database contains the encrypted ciphertext corresponding to the plaintext in n collaborative encryption and decryption mechanisms.
[0023] In the above scheme, the database contains the encrypted ciphertext corresponding to the plaintext in n collaborative encryption and decryption institutions, which can realize accurate and effective analysis of the data of each institution.
[0024] In one possible implementation method, a comparison request is received; the comparison request includes first indication information; based on the first indication information, a first comparison ciphertext corresponding to the first institution and a second comparison ciphertext corresponding to at least one collaborative encryption and decryption institution are obtained from the database; and a comparison result is determined based on the first comparison ciphertext and the second comparison ciphertext.
[0025] In the above scheme, since the encrypted data maintains the size relationship of the plaintext data, the ciphertext can be compared according to the comparison logic of the plaintext, and the specific information of the ciphertext is unknown, thus achieving comparability of confidential information of different institutions.
[0026] In one possible implementation method, a search request is received; the search request includes second indication information; based on the second indication information and private keys corresponding to n collaborative encryption and decryption mechanisms, the encrypted ciphertext corresponding to the second indication information is determined; based on the encrypted ciphertext corresponding to the second indication information, the data to be searched indicated by the second indication information is determined from the database.
[0027] In the above scheme, the encrypted ciphertext corresponding to the second indication information is also determined based on the private keys corresponding to the n institutions that collaborate in encryption and decryption. Therefore, the encrypted ciphertext corresponding to the second indication information has a certain correspondence with the encrypted ciphertext in the database, thereby achieving the searchability of confidential information of different institutions.
[0028] In a second aspect, an embodiment of the present application provides a device for distributed data encryption, comprising: a division unit and an encryption unit. The division unit is used to divide the data to be encrypted into multiple fragments in sequence; the data to be encrypted is the plaintext data in the first mechanism; the first mechanism is any one of the multiple collaborative encryption and decryption mechanisms; the encryption unit is used to obtain the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th fragment, and encrypt the i-th fragment by the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th fragment; wherein i is a positive integer; based on the ciphertexts of the multiple fragments, the encrypted ciphertext of the data to be encrypted is obtained; wherein the i-1th multiple encrypted obfuscated ciphertext is obtained in the following manner: The first mechanism generates obfuscation parameters for the i-1th slice, and sends the i-1th obfuscation parameters to the second mechanism; the second mechanism is an mechanism located after the first mechanism in the preset encryption and decryption order among the multiple collaborative encryption and decryption mechanisms; the second mechanism is used to encrypt the i-1th obfuscation parameter and send it to the next mechanism, until the n-1 obfuscated ciphertexts encrypted by the last mechanism in the preset encryption and decryption order are sent to the first mechanism; the first mechanism encrypts the n-1 obfuscated ciphertexts based on the i-1th obfuscation parameters to obtain the i-1th multi-encrypted obfuscated ciphertext.
[0029] In one possible implementation method, the encryption unit is used to obtain the hash value of the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypt the i-th shard using the hash value of the i-1th multiple encrypted obfuscated ciphertext and the numerical value of the i-th shard to obtain the ciphertext of the i-th shard.
[0030] In a possible implementation method, the encryption unit is used to determine the initial obfuscated ciphertext corresponding to the i-1th slice based on the i-1th slice ciphertext and the obfuscation parameter of the i-1th slice; wherein, when i=1, the i-1th slice ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted; and the initial obfuscated ciphertext corresponding to the i-1th slice is sent to the second mechanism.
[0031] In a possible implementation method, the encryption unit is used to determine the initial obfuscated ciphertext corresponding to the i-1th slice according to the i-1th slice ciphertext, the obfuscation parameter of the i-1th slice and the modular exponential operation; wherein the i-1th slice ciphertext is the base of the modular exponential operation; and the obfuscation parameter of the i-1th slice is the exponent of the modular exponential operation.
[0032] In a possible implementation method, the encryption unit is used to encrypt the n-1 obfuscated ciphertexts based on the i-1 obfuscation parameter and the first private key; wherein each collaborative encryption and decryption organization corresponds to a private key; the i-1 multiple encrypted obfuscated ciphertext contains the private keys corresponding to n collaborative encryption and decryption organizations; the first private key is a private key generated by the first organization; the second organization is used to encrypt the i-1 obfuscation parameter using the second private key and then send it to the next organization; the second private key is a private key generated by the second organization.
[0033] In a possible implementation method, the encryption unit is used to encrypt the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, the first private key and the modular exponential operation; wherein the n-1 obfuscated ciphertext is the base of the modular exponential operation; and the inverse of the first private key and the i-1th obfuscation parameter is the exponent of the modular exponential operation.
[0034] In a possible implementation method, the above-mentioned device also includes a generation unit, and if the first N bits of the first private key are 0, the generation unit is used to regenerate the first private key; wherein N is a multiple of 8.
[0035] In a possible implementation method, the above-mentioned device also includes a storage unit, which is used to store the encrypted ciphertext corresponding to the data to be encrypted in a database; the database contains the encrypted ciphertext corresponding to the plaintext in n collaborative encryption and decryption mechanisms.
[0036] In a possible implementation method, the above-mentioned device also includes a request processing unit, which is used to receive a comparison request; the comparison request includes first indication information; according to the first indication information, a first comparison ciphertext corresponding to the first organization and a second comparison ciphertext corresponding to at least one collaborative encryption and decryption organization are obtained from the database; and a comparison result is determined according to the first comparison ciphertext and the second comparison ciphertext.
[0037] In one possible implementation method, the request processing unit is used to receive a search request; the search request includes second indication information; based on the second indication information and the private keys corresponding to n collaborative encryption and decryption mechanisms, the encrypted ciphertext corresponding to the second indication information is determined; based on the encrypted ciphertext corresponding to the second indication information, the data to be searched indicated by the second indication information is determined from the database.
[0038] In a third aspect, an embodiment of the present application further provides a computing device, including:
[0039] A memory for storing program instructions;
[0040] The processor is used to call the program instructions stored in the memory, and execute any method of implementing the above-mentioned first aspect according to the obtained program instructions.
[0041] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which computer-readable instructions are stored. When a computer reads and executes the computer-readable instructions, any method of the above-mentioned first aspect is implemented.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising a computer program executable by a computer device, wherein when the program is run on the computer device, the computer device executes any method for implementing the above-mentioned first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A schematic diagram of a distributed data encryption system architecture provided in an embodiment of the present application;
[0044] Figure 2 A schematic diagram of a distributed data encryption method provided in an embodiment of the present application;
[0045] Figure 3 A flowchart of a method for determining a multi-encrypted obfuscated ciphertext provided in an embodiment of the present application;
[0046] Figure 4 A flowchart of a method for generating a private key provided in an embodiment of the present application;
[0047] Figure 5 A flowchart of a method for determining a multi-encrypted obfuscated ciphertext provided in an embodiment of the present application;
[0048] Figure 6 A schematic diagram of a distributed data encryption method provided in an embodiment of the present application;
[0049] Figure 7 A flowchart of a method for processing a comparison request provided in an embodiment of the present application;
[0050] Figure 8 A flowchart of a method for processing a search request provided in an embodiment of the present application;
[0051] Fig. 9 A schematic diagram of the structure of a distributed data encryption device provided in an embodiment of the present application;
[0052] Fig.10 A schematic diagram of the structure of a distributed data encryption device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] Figure 1 A system architecture diagram of a distributed data encryption method provided for an embodiment of the present application, the system architecture diagram includes n collaborative encryption and decryption mechanisms, namely, a first mechanism, a second mechanism to an n-th mechanism; wherein n is a positive integer greater than 2. The first mechanism, the second mechanism to the n-th mechanism respectively encrypt their respective data to be encrypted and store them in a database. The encrypted ciphertext stored in the database can simultaneously realize searchable and comparable operations. This application only takes the example of the first mechanism generating encrypted ciphertext from the data to be encrypted as an example. The distributed data encryption methods of other mechanisms are the same as those of the first mechanism, and will not be repeated here.
[0054] There are also some encryption algorithms in the prior art, such as Searchable Encryption (SSE) and Order-Preserving Encryption (OPE). Searchable encryption is a special type of encryption technology that allows search and matching operations in encrypted data without decrypting the entire data. SSE technology allows users to perform keyword search and matching operations in encrypted data by encrypting indexes or additional information while keeping the data encrypted. This method ensures the privacy and security of the data while providing search functions. Order-preserving encryption is used to encrypt data while keeping the order of the data unchanged. In traditional encryption methods, the encrypted data will lose the order information of the original data. The order-preserving encryption technology uses a special encryption algorithm to enable the encrypted data to still maintain the order of the original data. This method is very useful in some scenarios. For example, in sorting and comparison operations, encrypted data can still be used for orderly operations without decryption.
[0055] The encrypted ciphertext after searchable encryption can only implement searchable operations, and the encrypted ciphertext after order-preserving encryption can only implement comparable operations.
[0056] Figure 2 A flow chart of a method for distributed data encryption provided in an embodiment of the present application, the method can be executed by a distributed data encryption device, the distributed data encryption device can be a terminal device or a module for a terminal device, or a server or a module for a server. The present application does not limit the execution subject of the method.
[0057] The method comprises the following steps:
[0058] Step 201: The first mechanism divides the data to be encrypted into a plurality of fragments in sequence.
[0059] The data to be encrypted is plaintext data in the first mechanism; the first mechanism is any one of the multiple collaborative encryption and decryption mechanisms.
[0060] In a possible implementation method, the first mechanism divides the data to be encrypted into multiple slices in sequence, and encrypts each slice separately. The application does not limit the size of the slices. For example, the data to be encrypted is divided according to single characters in sequence. For example, if the data to be encrypted is "12345", the data to be encrypted is divided according to single characters in sequence, and the obtained multiple slices are "1", "2", "3", "4" and "5". In this way, the encrypted ciphertext and the data to be encrypted have the same number of bits. In particular, for digital encryption, the encrypted number has the same number of bits as the plaintext, so that when performing subsequent comparison or search operations, there will be no errors in comparison or search due to different number of bits.
[0061] In step 202, the first mechanism obtains the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard.
[0062] Wherein, i is a positive integer.
[0063] In a possible implementation method, the i-1th multi-encrypted obfuscated ciphertext is obtained by:
[0064] The first mechanism generates obfuscation parameters for the i-1th slice, and sends the i-1th obfuscation parameters to the second mechanism; the second mechanism is an mechanism located after the first mechanism in the preset encryption and decryption order among the multiple collaborative encryption and decryption mechanisms; the second mechanism is used to encrypt the i-1th obfuscation parameter and send it to the next mechanism, until the n-1 obfuscated ciphertexts encrypted by the last mechanism in the preset encryption and decryption order are sent to the first mechanism; the first mechanism encrypts the n-1 obfuscated ciphertexts based on the i-1th obfuscation parameters to obtain the i-1th multi-encrypted obfuscated ciphertext.
[0065] Step 203: Obtain the encrypted ciphertext of the data to be encrypted based on the ciphertexts of the multiple fragments.
[0066] In a possible implementation method, the ciphertexts of multiple fragments are combined in sequence to obtain the encrypted ciphertext of the data to be encrypted.
[0067] In the above scheme, on the one hand, the i-1th multiple encrypted obfuscated ciphertext is jointly determined by n collaborative encryption and decryption institutions. No single institution can decrypt the encrypted data alone, so there is no need to use a third-party key management method, thereby solving the problem of third-party key management among multiple institutions; on the other hand, each slice of the data to be encrypted is encrypted separately. As long as the encrypted ciphertext corresponding to each slice has the properties of being searchable and comparable, the encrypted ciphertext corresponding to the data to be encrypted can be searchable and comparable at the same time. The i-1th multiple encrypted obfuscated ciphertext corresponding to each slice is jointly determined by n collaborative encryption and decryption institutions, which makes each slice have a certain relative relationship while being encrypted, so that each slice can be searched. The i-th slice is encrypted using the i-1th multiple encrypted obfuscated ciphertext, which maintains the original size attribute of the i-th slice, thus making each slice comparable.
[0068] In a possible implementation method, in the above step 202, the first mechanism obtains the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard by using the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard, including:
[0069] The first mechanism obtains the hash value of the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the hash value of the i-1th multiple encrypted obfuscated ciphertext and the value of the i-th shard to obtain the ciphertext of the i-th shard.
[0070] Optionally, the i-th slice is encrypted according to the following formula (1).
[0071] S i =Hash(p i )+m i ……(1)
[0072] Among them, S i represents the ciphertext of the i-th fragment; p i Indicates the i-1th multiple encrypted obfuscated ciphertext; m i Represents the value of the i-th shard; Hash is a hash function.
[0073] In the above scheme, the value of the i-th shard can ensure that the size of each shard remains unchanged. Therefore, the ciphertext of the i-th shard maintains the size relationship of the original value and can achieve comparable operations. The i-1th multi-encrypted obfuscated ciphertext corresponding to each shard is jointly determined by n collaborative encryption and decryption mechanisms, which makes each shard have a certain relative relationship while being encrypted, and can achieve searchable operations. Therefore, the ciphertext of the i-th shard can achieve both comparable and searchable operations.
[0074] In a possible implementation method, in the above step 202, after the first mechanism generates the obfuscation parameters of the i-1th shard, it also includes: the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext and the obfuscation parameters of the i-1th shard; wherein, when i=1, the i-1th shard ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted.
[0075] Optionally, the identifier of the data to be encrypted is the business type of the data to be encrypted.
[0076] In a possible implementation method, the initial obfuscated ciphertext corresponding to the (i-1)th fragment is sent to the second institution.
[0077] In a possible implementation method, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext, the obfuscation parameter of the i-1th shard and the modular exponential operation; wherein the i-1th shard ciphertext is the base of the modular exponential operation; and the obfuscation parameter of the i-1th shard is the exponent of the modular exponential operation.
[0078] Optionally, a calculation method for determining the initial obfuscated ciphertext corresponding to the i-1th fragment is shown in the following formula (2).
[0079] M i-1 =(S i-1 )^r i-1 mod n……(2)
[0080] Among them, M i-1 represents the initial obfuscated ciphertext corresponding to the i-1th shard; S i-1 represents the ciphertext of the i-1th fragment; r i-1 Indicates the obfuscation parameter of the i-1th shard; n is a public parameter, usually a 2048-bit prime number. ^ is an exponential operation, and mod is a modular operation.
[0081] In one possible implementation method, the first mechanism randomly generates a certain length of obfuscation parameter r i-1 ; For example, the first organization randomly generates a 2048-bit obfuscation parameter.
[0082] In one possible implementation, if the obfuscation parameter r i-1 If the first N bits are 0, the obfuscation parameter r is regenerated. i-1 ; Optionally, N is equal to 8. This solution can ensure the validity of the obfuscation parameter, so that the length of the obfuscation parameter is fixed, and the length of the obfuscation parameter will not be shortened due to the first N digits of the obfuscation parameter being 0, thereby affecting the validity of the encryption algorithm.
[0083] In the above scheme, on the one hand, when i=1, the i-1th shard ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted, so that the initial obfuscated ciphertext corresponding to each shard contains the identifier information of the data to be encrypted, so that even data with the same value but different identifiers have different ciphertexts; for example, if the identifier is a user deposit, the value corresponding to the user deposit is 100; if the identifier is a user arrears, the value corresponding to the user arrears is also 100; then, since the identifiers of the data to be encrypted are different, although the values are both 100, the encrypted ciphertexts obtained are also different. On the other hand, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext and the obfuscation parameters of the i-1th shard, then, for two data, if the value corresponding to the i-1th shard ciphertext is different, the ciphertexts of the subsequent shards of the two data will also be different, thereby achieving accurate and effective data comparison and search operations. For example, user A's deposit is 1234, and the corresponding shards are "1", "2", "3", and "4"; user B's deposit is 1534, and the corresponding shards are "1", "5", "3", and "4". Among them, the encrypted ciphertext of the first shard "1" of user A and user B is the same, and the encrypted ciphertext of the second shards "2" and "5" must be different; the encryption of subsequent shards uses the ciphertext of the second shard. Since the encrypted ciphertext of the second shard is different, although the plaintext data of the third and fourth shards of user A and user B is the same, the encrypted ciphertext is also different.
[0084] In a possible implementation method, before the above step 201, each collaborative encryption and decryption organization randomly generates and stores its own corresponding private key. If the first N bits of the private key generated by any collaborative encryption and decryption organization are 0, the organization regenerates the corresponding private key.
[0085] In a possible implementation method, the length corresponding to the private key is a specified length. Exemplarily, the length of each private key is 2048 bits.
[0086] In a possible implementation method, in the above step 202, the first institution encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, including: the first institution encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter and a first private key; wherein each collaborative encryption and decryption institution corresponds to a private key; the i-1th multiple encrypted obfuscated ciphertext contains the private keys corresponding to n collaborative encryption and decryption institutions; and the first private key is a private key generated by the first institution.
[0087] In a possible implementation method, the second institution is used to encrypt the i-1th obfuscation parameter and send it to the next institution, including: the second institution is used to encrypt the i-1th obfuscation parameter using a second private key and send it to the next institution; the second private key is a private key generated by the second institution.
[0088] In a possible implementation method, the first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter and the first private key, including: the first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, the first private key and the modular exponential operation; wherein the n-1 obfuscated ciphertext is the base of the modular exponential operation; and the inverse of the first private key and the i-1th obfuscation parameter is the exponent of the modular exponential operation.
[0089] Optionally, the calculation method of the i-1th multiple encrypted obfuscated ciphertext is shown in the following formula (3).
[0090]
[0091] in, M represents the multiple encrypted obfuscated ciphertext of the i-1th shard; n-1 represents n-1 obfuscated ciphertext; key1 represents the first private key; r i-1 -1 Indicates the inverse of the obfuscation parameter of the i-1th slice; n is a public parameter, generally a 2048-bit large prime number. ^ is an exponential operation, and mod is a modular operation.
[0092] In the above scheme, each collaborative encryption and decryption organization corresponds to a private key, and the private key of any organization is kept confidential from other organizations, which is equivalent to each organization saving a part of the key. Any organization cannot decrypt the encrypted data alone, so there is no need to use a third party to manage the key, thereby solving the problem of third-party management of keys among multiple organizations; and the private key of each collaborative encryption and decryption organization remains unchanged throughout the encryption process, so the encrypted ciphertext can be searched and compared. In addition, the inverse of the i-1th confusion parameter is used as the exponent of the modular exponential operation, which is exactly eliminated with the i-1th confusion parameter in the initial confusion ciphertext, removing the influence of the random generation characteristics of the confusion parameter on the encryption algorithm; thereby, the encrypted data with the same identifier and the same value have the same encrypted ciphertext, so the encrypted ciphertext can be searched and compared.
[0093] In one embodiment, the method for n collaborative encryption and decryption mechanisms to jointly generate the i-1th multi-encrypted obfuscated ciphertext is as follows: Figure 3 As shown, the method comprises the following steps:
[0094] Step 301: n collaborative encryption and decryption organizations generate their own corresponding private keys respectively.
[0095] Taking the first institution as an example, the first institution randomly generates a private key of a specified length locally; if the first N bits of the first private key are 0, the first institution regenerates the first private key; illustratively, the generated first private key is 0100101000...; wherein N is a multiple of 8; for example, N is equal to 8 or 16. This solution can ensure the validity of the first private key, so that the length of the first private key is fixed, and the length of the first private key will not be shortened due to the first N bits of the first private key being 0, thereby affecting the validity of the encryption algorithm.
[0096] Step 302: The first mechanism randomly generates the (i-1)th obfuscation parameter.
[0097] Step 303: The first mechanism obfuscates the initial ciphertext corresponding to the i-1th shard.
[0098] In a possible implementation method, the first mechanism generates an initial obfuscated ciphertext corresponding to the i-1th slice according to the above formula (2). When i=1, the i-1th slice ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted.
[0099] Step 304: The first institution sends the initial obfuscated ciphertext corresponding to the (i-1)th fragment to the second institution.
[0100] Step 305: The second institution uses the second private key to encrypt the initial obfuscated ciphertext and sends the encrypted data to the next institution.
[0101] In a possible implementation method, the second institution uses the second private key to encrypt the initial obfuscated ciphertext and sends it to the next institution, until the n-1 obfuscated ciphertexts encrypted by the last institution in the preset encryption and decryption order are sent to the first institution.
[0102] Step 306: The first institution receives the n-1 obfuscated ciphertexts sent by the last institution.
[0103] Step 307: The first institution determines the i-1th multi-encrypted obfuscated ciphertext according to the first private key, the n-1th obfuscated ciphertext and the i-1th obfuscation parameter.
[0104] In a possible implementation method, the first mechanism determines the i-1th multi-encrypted obfuscated ciphertext according to the above formula (3).
[0105] In a possible implementation method, except for the first mechanism, the other n-1 mechanisms obtain a calculation method for n-1 obfuscated ciphertexts, as shown in the following formula (4).
[0106] M j =(M j-1 )^(key j)mod n……(4)
[0107] Among them, M j is the jth obfuscated ciphertext, key j is the private key corresponding to the jth organization; n is a public parameter, generally a 2048-bit prime number. ^ is an exponential operation, and mod is a modular operation. When j is equal to 1, M j-1 is the initial obfuscated ciphertext.
[0108] The following is a specific example to illustrate how to generate encrypted ciphertext of data to be encrypted; wherein the deposit of each user is the data to be encrypted.
[0109] For example, the first institution, Bank A, has user u_1, corresponding to a deposit of 11,111 yuan; and user u_2, corresponding to a deposit of 22,222 yuan.
[0110] The second institution, Bank B, has user u_3, corresponding to a deposit of 03,333 yuan; and user u_4, corresponding to a deposit of 14,444 yuan.
[0111] The third institution, Bank C, has user u_5, corresponding to a deposit of 00100 yuan; and user u_6, corresponding to a deposit of 12345 yuan.
[0112] The initial stage of each institution's private key is as follows Figure 4 As shown, the following steps are included:
[0113] Step 401, Bank A, Bank B, and Bank C locally randomly generate 2048-bit private keys keya, keyb, and keyc respectively.
[0114] Step 402: Bank A, Bank B, and Bank C respectively secretly save the private keys keya, keyb, and keyc locally.
[0115] Take bank B's user u_4 with a deposit of 14444 yuan as the encrypted data as an example. The generation process of the first multi-encryption obfuscated ciphertext is as follows: Figure 5 As shown, the following steps are included:
[0116] Step 501, Bank B randomly generates obfuscation parameter r1.
[0117] Step 502: Bank B determines the business type corresponding to the data to be encrypted.
[0118] In one possible implementation method, bank B determines that the business type corresponding to the data to be encrypted is user deposit.
[0119] Step 503: Bank B determines the initial obfuscated ciphertext.
[0120] In a possible implementation method, the initial obfuscated ciphertext M1 corresponding to bank B = hash(business type)^r1 modn.
[0121] Step 504: Bank B sends the initial obfuscated ciphertext to Bank C.
[0122] Step 505, Bank C encrypts the initial obfuscated ciphertext according to its own private key keyc to obtain the first obfuscated ciphertext.
[0123] In a possible implementation method, the first obfuscated ciphertext = initial obfuscated ciphertext^keyc mod n.
[0124] Step 506: Bank C sends the first obfuscated ciphertext to Bank A.
[0125] Step 507: Bank A encrypts the first obfuscated ciphertext according to its own private key keya to obtain a second obfuscated ciphertext.
[0126] In a possible implementation method, the second obfuscated ciphertext = the first obfuscated ciphertext^keya mod n.
[0127] Step 508: Bank A sends the second obfuscated ciphertext to Bank B.
[0128] Step 509, Bank B encrypts the second obfuscated ciphertext according to its own private key keyb to obtain the first multi-encrypted obfuscated ciphertext.
[0129] In a possible implementation method, the first multi-encrypted obfuscated ciphertext = the second obfuscated ciphertext^(keyb*r1^(-1)) mod n.
[0130] The method for determining the ciphertext corresponding to the data to be encrypted is as follows: Figure 6 As shown, the following steps are included:
[0131] Step 601: Bank B divides the data to be encrypted.
[0132] In a possible implementation method, bank B splits the number into characters m1="1" m2="4" m3="4" m4="4" m5="4" according to the deposit of user u_4 corresponding to 14444 yuan.
[0133] Step 602: Bank B generates an encrypted ciphertext corresponding to the first character m1.
[0134] In a possible implementation method, the encrypted ciphertext c1 corresponding to the first character m1=hash(the first multi-encrypted obfuscated ciphertext)+m1.
[0135] Step 603: Bank B randomly generates obfuscation parameter r2.
[0136] Step 604: Bank B determines the initial obfuscated ciphertext corresponding to the first character based on the encrypted ciphertext corresponding to the first character m1 and the determined obfuscation parameter r2.
[0137] In a possible implementation method, the initial obfuscated ciphertext corresponding to the first character = (encrypted ciphertext c1 corresponding to the first character m1)^r2 mod n.
[0138] Step 605: Bank B sends the initial obfuscated ciphertext corresponding to the first character to Bank C.
[0139] Step 606: Bank C encrypts the initial obfuscated ciphertext corresponding to the first character according to its own private key keyc to obtain a first obfuscated ciphertext corresponding to the first character.
[0140] Step 607: Bank C sends the first obfuscated ciphertext corresponding to the first character to Bank A.
[0141] In step 608, bank A encrypts the first obfuscated ciphertext corresponding to the first character according to its own private key keya to obtain the second obfuscated ciphertext corresponding to the first character.
[0142] Step 609: Bank A sends the second obfuscated ciphertext corresponding to the first character to Bank B.
[0143] Step 610, Bank B encrypts the second obfuscated ciphertext corresponding to the first character according to its own private key keyb to obtain the second multi-encrypted obfuscated ciphertext.
[0144] Step 611, Bank B generates an encrypted ciphertext corresponding to the second character m2.
[0145] In a possible implementation method, the encrypted ciphertext c2 corresponding to the second character m2=hash(the second multi-encrypted obfuscated ciphertext)+m2.
[0146] In a possible implementation method, repeat the above steps 602 to 611 to generate encrypted ciphertext c1 corresponding to m1, encrypted ciphertext c2 corresponding to m2, encrypted ciphertext c3 corresponding to m3, encrypted ciphertext c4 corresponding to m4, and encrypted ciphertext c5 corresponding to m5, respectively.
[0147] Determine the encrypted ciphertext corresponding to the data to be encrypted 14444 according to the encrypted ciphertexts c1, c2, c3, c4, c5.
[0148] Similarly, Bank A encrypts user u_1, corresponding to a deposit of 11111 yuan; user u_2, corresponding to a deposit of 22222 yuan; Bank B encrypts user u_3, corresponding to a deposit of 03333 yuan; user u_4, corresponding to a deposit of 14444 yuan; Bank C encrypts user u_5, corresponding to a deposit of 00100 yuan; and user u_6, corresponding to a deposit of 12345 yuan, using the above method and stores them in the database.
[0149] In one embodiment, n collaborative encryption and decryption agencies encrypt their own plaintext data and store them in a database, that is, the database contains the encrypted ciphertext corresponding to the plaintext in the n collaborative encryption and decryption agencies.
[0150] In one embodiment, when the first institution or database receives the comparison request, the processing process is as follows: Figure 7 As shown, the following steps are included:
[0151] Step 701: receiving a comparison request.
[0152] The comparison request includes first indication information, and the first indication information is used to indicate relevant information of the comparison data.
[0153] Step 702: According to the first indication information, a first comparison ciphertext corresponding to the first institution and a second comparison ciphertext corresponding to at least one collaborative encryption and decryption institution are obtained from the database.
[0154] Step 703: Determine a comparison result according to the first comparison ciphertext and the second comparison ciphertext.
[0155] In a possible implementation method, when the ciphertext corresponding to the kth character in the first comparison ciphertext and the second comparison ciphertext is different, the ciphertext corresponding to all characters after the kth character will be different. For example, user A's deposit is 11111 yuan, and the encrypted ciphertext is c1c2c3c4c5; user B's deposit is 12111 yuan, and the encrypted ciphertext is t1t2t3t4t5; c1 is the same as t1, c2 is different from t2, and then c3 is different from t3, c4 is different from t4, and c5 is different from t6, although the plaintexts corresponding to c3, c4, c5 and t3, t4, t5 are the same.
[0156] Exemplarily, the first indication information is to compare the size of the deposit corresponding to user u_1 and the size of the deposit corresponding to user u_4 in bank A.
[0157] According to the first instruction information, the encrypted ciphertext of the deposit corresponding to user u_1 and the encrypted ciphertext of the deposit corresponding to user u_4 are obtained from the database. Since the encrypted data can still maintain the size relationship of the original data, any bank can compare the ciphertext according to the comparison logic of the plaintext without knowing the specific information of the ciphertext.
[0158] For example, user u_1 has a deposit of 11111 yuan, and the encrypted ciphertext is c1c2c3c4c5; user u_4 has a deposit of 14444 yuan, and the encrypted ciphertext is t1t2t3t4t5. Since the encrypted ciphertext has the same size relationship as the plaintext, c1 is equal to t1, and c2 is less than t2. Therefore, the deposit of user u_1 is less than that of user u_4.
[0159] In the above scheme, since the encrypted data maintains the size relationship of the plaintext data, the ciphertext can be compared according to the comparison logic of the plaintext, and the specific information of the ciphertext is unknown, thus achieving comparability of confidential information of different institutions.
[0160] In one embodiment, when the first institution or database receives a search request, the processing process is as follows: Figure 8 As shown, the following steps are included:
[0161] Step 801, receiving a search request.
[0162] The search request includes second indication information, and the second indication information is used to indicate relevant information of the search range.
[0163] Step 802: Determine the encrypted ciphertext corresponding to the second indication information based on the second indication information and the private keys corresponding to n collaborative encryption and decryption organizations.
[0164] Step 803: Determine the to-be-searched data indicated by the second indication information from the database according to the encrypted ciphertext corresponding to the second indication information.
[0165] Exemplarily, the second indication information is to query users whose deposit amounts are in the range of 1XXXX.
[0166] According to the corresponding plain text character "1" in the second indication information and the above encryption algorithm, the encrypted ciphertext corresponding to the plain text character "1" is determined.
[0167] Filter out the deposit information of each user with the same prefix as the encrypted ciphertext corresponding to the plain text character "1" from the database. For example, user u_1, corresponding to a deposit of 11111 yuan; user u_4, corresponding to a deposit of 14444 yuan; user u_6, corresponding to a deposit of 12345 yuan.
[0168] In the above scheme, the encrypted ciphertext corresponding to the second indication information is also determined based on the private keys corresponding to the n institutions that collaborate in encryption and decryption. Therefore, the encrypted ciphertext corresponding to the second indication information has a certain correspondence with the encrypted ciphertext in the database, thereby achieving the searchability of confidential information of different institutions.
[0169] Based on the same technical concept, Fig. 9 An example of a distributed data encryption device 900 provided in an embodiment of the present application is shown. Fig. 9 As shown, a division unit 901 and an encryption unit 902. The division unit 901 is used to divide the data to be encrypted into multiple fragments in sequence; the data to be encrypted is the plaintext data in the first mechanism; the first mechanism is any one of the multiple collaborative encryption and decryption mechanisms; the encryption unit 902 is used to obtain the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th fragment, and encrypt the i-th fragment by the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th fragment; wherein i is a positive integer; based on the ciphertexts of the multiple fragments, the encrypted ciphertext of the data to be encrypted is obtained; wherein the i-1th multiple encrypted obfuscated ciphertext is obtained in the following manner The first mechanism generates the obfuscation parameters of the i-1th fragment, and sends the i-1th obfuscation parameters to the second mechanism; the second mechanism is the mechanism located after the first mechanism in the preset encryption and decryption order among the multiple collaborative encryption and decryption mechanisms; the second mechanism is used to encrypt the i-1th obfuscation parameters and send them to the next mechanism, until the n-1 obfuscated ciphertexts encrypted by the last mechanism in the preset encryption and decryption order are sent to the first mechanism; the first mechanism encrypts the n-1 obfuscated ciphertexts based on the i-1th obfuscation parameters to obtain the i-1th multi-encrypted obfuscated ciphertext.
[0170] In one possible implementation method, the encryption unit 902 is used to obtain the hash value of the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypt the i-th shard by the hash value of the i-1th multiple encrypted obfuscated ciphertext and the numerical value of the i-th shard to obtain the ciphertext of the i-th shard.
[0171] In a possible implementation method, the encryption unit 902 is used to determine the initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext and the obfuscation parameter of the i-1th shard; wherein, when i=1, the i-1th shard ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted; and the initial obfuscated ciphertext corresponding to the i-1th shard is sent to the second mechanism.
[0172] In a possible implementation method, the encryption unit 902 is used to determine the initial obfuscated ciphertext corresponding to the i-1th slice according to the i-1th slice ciphertext, the obfuscation parameter of the i-1th slice and the modular exponential operation; wherein the i-1th slice ciphertext is the base of the modular exponential operation; and the obfuscation parameter of the i-1th slice is the exponent of the modular exponential operation.
[0173] In a possible implementation method, the encryption unit 902 is used to encrypt the n-1 obfuscated ciphertexts based on the i-1 obfuscation parameter and the first private key; wherein each collaborative encryption and decryption organization corresponds to a private key; the i-1 multiple encrypted obfuscated ciphertext contains the private keys corresponding to n collaborative encryption and decryption organizations; the first private key is a private key generated by the first organization; the second organization is used to encrypt the i-1 obfuscation parameter using the second private key and send it to the next organization; the second private key is a private key generated by the second organization.
[0174] In a possible implementation method, the encryption unit 902 is used to encrypt the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, the first private key and the modular exponential operation; wherein the n-1 obfuscated ciphertext is the base of the modular exponential operation; and the inverse of the first private key and the i-1th obfuscation parameter is the exponent of the modular exponential operation.
[0175] In a possible implementation method, the above-mentioned device also includes a generation unit 903. If the first N bits of the first private key are 0, the generation unit 903 is used to regenerate the first private key; wherein N is a multiple of 8.
[0176] In a possible implementation method, the above-mentioned device also includes a storage unit 904, and the storage unit 904 is used to store the encrypted ciphertext corresponding to the data to be encrypted in a database; the database contains the encrypted ciphertext corresponding to the plaintext in n collaborative encryption and decryption mechanisms.
[0177] In a possible implementation method, the above-mentioned device also includes a request processing unit 905, and the request processing unit 905 is used to receive a comparison request; the comparison request includes first indication information; according to the first indication information, a first comparison ciphertext corresponding to the first organization and a second comparison ciphertext corresponding to at least one collaborative encryption and decryption organization are obtained from the database; according to the first comparison ciphertext and the second comparison ciphertext, a comparison result is determined.
[0178] In one possible implementation method, the request processing unit 905 is used to receive a search request; the search request includes second indication information; based on the second indication information and the private keys corresponding to n collaborative encryption and decryption mechanisms, the encrypted ciphertext corresponding to the second indication information is determined; based on the encrypted ciphertext corresponding to the second indication information, the data to be searched indicated by the second indication information is determined from the database.
[0179] Based on the same technical concept, the embodiment of the present application provides a distributed data encryption device 1000, which can be a computing device, for example. Fig.10As shown, a distributed data encryption device 1000 includes at least one processor 1001 and a memory 1002 connected to the at least one processor. The specific connection medium between the processor 1001 and the memory 1002 is not limited in the embodiment of the present application. Fig.10 For example, the processor 1001 and the memory 1002 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0180] In an embodiment of the present application, the memory 1002 stores instructions that can be executed by at least one processor 1001, and the at least one processor 1001 can execute the above-mentioned distributed data encryption method by executing the instructions stored in the memory 1002.
[0181] Among them, the processor 1001 is a control center of a distributed data encryption device 1000, which can use various interfaces and lines to connect various parts of the computer device, and perform resource settings by running or executing instructions stored in the memory 1002 and calling data stored in the memory 1002. Optionally, the processor 1001 may include one or more determination units, and the processor 1001 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, etc., and the modem processor mainly processes wireless communication. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1001. In some embodiments, the processor 1001 and the memory 1002 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on independent chips.
[0182] Processor 1001 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor to be executed, or can be executed by a combination of hardware and software modules in the processor.
[0183] The memory 1002 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 1002 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 1002 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 1002 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0184] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer-executable program. The computer-executable program is used to enable a computer to execute a distributed data encryption method listed in any of the above methods.
[0185] An embodiment of the present application provides a computer program product, including a computer program executable by a computer device. When the program is run on the computer device, the computer device executes a distributed data encryption method listed in any of the above-mentioned ways.
[0186] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0187] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0188] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0189] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0190] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A method for distributed data encryption, It is characterized in that Applicable to n collaborative encryption and decryption organizations, where n is a positive integer greater than 2; the method comprises: The first mechanism divides the data to be encrypted into multiple fragments in sequence; the data to be encrypted is the plaintext data in the first mechanism; the first mechanism is any one of the multiple collaborative encryption and decryption mechanisms; The first mechanism obtains the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard; wherein i is a positive integer; Based on the ciphertexts of the multiple fragments, obtaining the encrypted ciphertext of the data to be encrypted; The i-1th multi-encrypted obfuscated ciphertext is obtained by: The first mechanism generates an obfuscation parameter of the i-1th slice, and sends the i-1th obfuscation parameter to the second mechanism; the second mechanism is an mechanism located after the first mechanism in the preset encryption and decryption order among the multiple collaborative encryption and decryption mechanisms; the second mechanism is used to encrypt the i-1th obfuscation parameter and send it to the next mechanism, until the n-1 obfuscated ciphertext encrypted by the last mechanism in the preset encryption and decryption order is sent to the first mechanism; The first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter to obtain the i-1th multi-encrypted obfuscated ciphertext.
2. The method according to claim 1, It is characterized in that The first mechanism obtains the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard by using the i-1th multiple encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard, including: The first mechanism obtains the hash value of the i-1th multiple encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the hash value of the i-1th multiple encrypted obfuscated ciphertext and the value of the i-th shard to obtain the ciphertext of the i-th shard.
3. The method according to claim 1, It is characterized in that After the first mechanism generates the obfuscation parameters of the i-1th slice, the method further includes: The first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th slice according to the i-1th slice ciphertext and the obfuscation parameter of the i-1th slice; wherein, when i=1, the i-1th slice ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted; The sending the i-1th obfuscation parameter to the second mechanism comprises: The initial obfuscated ciphertext corresponding to the (i-1)th fragment is sent to the second institution.
4. The method according to claim 3, It is characterized in that The first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th shard according to the i-1th shard ciphertext and the obfuscation parameter of the i-1th shard, including: The first mechanism determines an initial obfuscated ciphertext corresponding to the i-1th shard based on the i-1th shard ciphertext, the obfuscation parameter of the i-1th shard and the modular exponential operation; wherein the i-1th shard ciphertext is the base of the modular exponential operation; and the obfuscation parameter of the i-1th shard is the exponent of the modular exponential operation.
5. The method according to claim 1, It is characterized in that The first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, including: The first institution encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter and the first private key; wherein each collaborative encryption and decryption institution corresponds to a private key; the i-1th multi-encrypted obfuscated ciphertext contains the private keys corresponding to n collaborative encryption and decryption institutions; the first private key is a private key generated by the first institution; The second mechanism is used to encrypt the i-1th obfuscation parameter and send it to the next mechanism, including: The second institution is used to encrypt the i-1th obfuscation parameter using a second private key and then send it to the next institution; the second private key is a private key generated by the second institution.
6. The method according to claim 5, It is characterized in that The first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter and the first private key, including: The first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, the first private key and the modular exponential operation; wherein the n-1 obfuscated ciphertext is the base of the modular exponential operation; and the inverse of the first private key and the i-1th obfuscation parameter is the exponent of the modular exponential operation.
7. The method according to claim 5, It is characterized in that The method further comprises: If the first N bits of the first private key are 0, the first institution regenerates the first private key; where N is a multiple of 8.
8. The method according to any one of claims 1 to 7, It is characterized in that The method further comprises: The encrypted ciphertext corresponding to the data to be encrypted is stored in a database; the database contains the encrypted ciphertext corresponding to the plaintext in n collaborative encryption and decryption mechanisms.
9. The method according to claim 8, It is characterized in that The method further comprises: receiving a comparison request; the comparison request including first indication information; According to the first indication information, obtaining from the database a first comparison ciphertext corresponding to the first institution and a second comparison ciphertext corresponding to at least one collaborative encryption and decryption institution; A comparison result is determined according to the first comparison ciphertext and the second comparison ciphertext.
10. The method according to claim 8, It is characterized in that The method further comprises: Receiving a search request; the search request includes second indication information; Determine, according to the second indication information and the private keys corresponding to the n collaborative encryption and decryption organizations, an encrypted ciphertext corresponding to the second indication information; According to the encrypted ciphertext corresponding to the second indication information, the to-be-searched data indicated by the second indication information is determined from the database.
Citation Information
Patent Citations
Encryption threshold signature method based on confusion technology
CN112511311A
File transmission method and device
CN113515766A
Data encryption and signature method and device, computer equipment and storage medium
CN114244517A
Ciphertext data outsourcing decryption system and method based on homomorphic encryption
CN115225250A
Data query method and device
CN117349486A
