A method of distributed data encryption
Through the distributed data encryption method, the data is sharded and multiple institutions jointly generate multiple encrypted obfuscated ciphertexts, which solves the key management problem among multiple institutions, makes the encrypted data comparable and searchable, and improves the efficiency and security of data analysis.
Patent Information
- Application Number
- CN202411370974.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In existing technologies, data encryption between multiple institutions requires a third party to manage keys, resulting in frequent waste of authorization resources and data analysis delays. At the same time, the encrypted data is difficult to be compared and searchable at the same time.
A distributed data encryption method is adopted to divide the data to be encrypted into multiple shards, and multiple encrypted obfuscated ciphertexts are jointly generated by multiple collaborative encryption and decryption agencies. The ciphertext of each shard is jointly determined by multiple agencies, maintaining a relative relationship to achieve comparability and searchability, and each agency stores part of the private key to avoid third-party key management.
It realizes data encryption without the need for third-party key management, can simultaneously support data comparability and searchability, and improves data analysis efficiency and security.
Smart Images

Figure CN119094233B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method for distributed data encryption. Background Art
[0002] In many fields, such as finance, protecting sensitive customer information and transaction data is crucial. Financial data needs to be encrypted and protected, while operations such as searching and comparing massive amounts of data are also required.
[0003] So how can we protect the data of different institutions from being leaked while enabling multiple institutions to conduct joint data analysis operations?
[0004] Existing technologies typically use a third-party method to manage keys. This means that each organization must apply for key authorization from a third party each time it performs data analysis. Only after obtaining key authorization can the organization proceed with data analysis. This solution requires a third-party authorization request for each operation. Frequent authorization not only wastes resources but also delays data analysis results. Furthermore, third-party key management raises trust issues.
[0005] Comparison and search are common requirements in data analysis, which often require ciphertext to meet both of the above functions at the same time, but 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] This 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 compared and searched 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 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 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. No single institution can decrypt the encrypted data alone, so 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 shard of the data to be encrypted is encrypted separately. As long as the encrypted ciphertext corresponding to each shard is 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 shard is jointly determined by n collaborative encryption and decryption institutions. This allows each shard to have a certain relative relationship while being encrypted, so that each shard can be searched. Using the i-1th multiple encrypted obfuscated ciphertext to encrypt the i-th shard maintains the original size attribute of the i-th shard, thus making each shard comparable.
[0010] In one possible implementation method, the first mechanism obtains the hash value of the i-1th multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the hash value of the i-1th multi-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 numerical value of the i-th shard ensures that the corresponding size of each shard remains unchanged. Therefore, the ciphertext of the i-th shard maintains the original numerical value relationship, enabling comparison operations. The i-1th multi-encrypted obfuscated ciphertext corresponding to each shard is jointly determined by n collaborative encryption and decryption mechanisms. This ensures that each shard maintains a certain relative relationship while being encrypted, enabling search operations. Therefore, the ciphertext of the i-th shard can achieve both comparison and search operations.
[0012] In one possible implementation method, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th fragment based on the i-1th fragment ciphertext and the obfuscation parameter of the i-1th fragment; wherein, when i=1, the i-1th fragment ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted; and sends the initial obfuscated ciphertext corresponding to the i-1th fragment 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 numerical value but different identifiers have different ciphertexts; for example, if the identifier is a user deposit, the numerical value corresponding to the user deposit is 100; if the identifier is a user arrears, the numerical value corresponding to the user arrears is also 100; then, since the identifiers of the data to be encrypted are different, even though the numerical values are both 100, the obtained encrypted ciphertexts 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 parameter of the i-1th shard. Then, for two data, if the numerical 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 shard "2" and "5" must be different; but the subsequent shards of user A and user B use the ciphertext of the second shard to encrypt. 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 are the same, the encrypted ciphertext is also different.
[0014] In one possible implementation method, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th slice based on 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.
[0015] The above solution can accurately and effectively determine 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 one possible implementation method, 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 the private key generated by the first institution; the second institution is used to encrypt the i-1th obfuscation parameter using the second private key and then send it to the next institution; the second private key is the 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 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 remains unchanged throughout the encryption process, so the encrypted ciphertext can be searched and compared.
[0018] In one 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 ensures that the i-1th multi-encrypted obfuscated ciphertext includes the first private key, meaning that the first institution also retains a portion of the key. No single institution can independently decrypt the encrypted data, eliminating the need for third-party key management, thereby resolving the issue of third-party key management across multiple institutions. Furthermore, the private key of each collaborative encryption and decryption institution remains unchanged throughout the encryption process, enabling the searchability and comparison of encrypted ciphertexts. Furthermore, the inverse of the i-1th obfuscation parameter is used as the exponent for the modular exponential operation, which cancels out the i-1th obfuscation parameter in the initial obfuscated ciphertext, eliminating the impact of the random generation of the obfuscation parameter on the encryption algorithm. This ensures that encrypted data with the same identifier and value have the same encrypted ciphertext, making the encrypted ciphertexts searchable and comparable.
[0020] In one possible implementation method, 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.
[0021] The above solution can ensure the validity of the first private key and make the length of the first private key fixed. 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 accurately and effectively analyze 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 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 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. At the same time, the specific information of the ciphertext is unknown, which enables the comparability of confidential information of different organizations.
[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 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.
[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 using 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 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.
[0029] In one possible implementation method, the encryption unit is used to obtain the hash value of the i-1th multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypt the i-th shard using the hash value of the i-1th multi-encrypted obfuscated ciphertext and the numerical value of the i-th shard to obtain the ciphertext of the i-th shard.
[0030] In one possible implementation method, the encryption unit is used to determine the initial obfuscated ciphertext corresponding to the i-1th fragment based on the i-1th fragment ciphertext and the obfuscation parameter of the i-1th fragment; wherein, when i=1, the i-1th fragment ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted; and the initial obfuscated ciphertext corresponding to the i-1th fragment is sent to the second mechanism.
[0031] In one possible implementation method, the encryption unit is used to determine the initial obfuscated ciphertext corresponding to the i-1th fragment based on the i-1th fragment ciphertext, the obfuscation parameter of the i-1th fragment and the modular exponential operation; wherein the i-1th fragment ciphertext is the base of the modular exponential operation; and the obfuscation parameter of the i-1th fragment is the exponent of the modular exponential operation.
[0032] In one possible implementation method, the encryption unit is used to encrypt 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 the private key generated by the first institution; the second institution is used to encrypt the i-1th obfuscation parameter using the second private key and then send it to the next institution; the second private key is the private key generated by the second institution.
[0033] In one 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 further 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 one 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 based on 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, the embodiments of the present application further provide a computing device, comprising:
[0039] a memory, configured to store program instructions;
[0040] a processor, configured to invoke the program instructions stored in the memory, and execute any method of the first aspect according to the obtained program instructions.
[0041] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, wherein computer readable instructions are stored, and when the computer reads and executes the computer readable instructions, any method of the first aspect is implemented.
[0042] In a fifth aspect, the embodiments of the present application provide a computer program product, comprising computer program executable by a computer device, and when the program runs on the computer device, the computer device executes any method of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0043] Figure 1 a system architecture diagram of the distributed data encryption provided by the embodiments of the present application;
[0044] Figure 2 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0045] Figure 3 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0046] Figure 4 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0047] Figure 5 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0048] Figure 6 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0049] Figure 7 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0050] Figure 8 a flowchart of the method of the distributed data encryption provided by the embodiments of the present application;
[0051] Figure 9 a structure diagram of the distributed data encryption device provided by the embodiments of the present application;
[0052] Figure 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 in an embodiment of the present application, wherein the system architecture diagram includes n collaborative encryption and decryption mechanisms, namely the first mechanism, the second mechanism to the nth mechanism; wherein n is a positive integer greater than 2. The first mechanism, the second mechanism to the nth mechanism respectively encrypt their respective data to be encrypted and store them in a database. The encrypted ciphertext stored in the database can be searched and compared at the same time. 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 that of the first mechanism and will not be repeated here.
[0054] There are also some encryption algorithms in the existing technology, 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 appending information while keeping the data encrypted. This method ensures data privacy and security while providing search functionality. Order-preserving encryption is used to encrypt data while maintaining the order of the data. In traditional encryption methods, the encrypted data loses the order information of the original data. However, order-preserving encryption technology uses a special encryption algorithm to ensure that the encrypted data still maintains the order of the original data. This method is very useful in certain scenarios. For example, in sorting and comparison operations, encrypted data can still be used for ordered 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 This is a flow chart of a distributed data encryption method provided in an embodiment of the present application. This method can be performed 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. This application does not limit the execution entity of this method.
[0057] The method comprises the following steps:
[0058] In 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 one possible implementation method, the first mechanism sequentially divides the data to be encrypted into multiple fragments and encrypts each fragment separately. This application does not limit the size of the fragments. For example, the data to be encrypted is sequentially divided according to individual characters. For example, if the data to be encrypted is "12345", the data to be encrypted is sequentially divided according to individual characters, and the resulting multiple fragments 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. In this way, subsequent comparisons or searches will not cause errors due to the difference in the number of bits.
[0061] In step 202, the first mechanism obtains the i-1th multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the i-1th multi-encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard.
[0062] Wherein, i is a positive integer.
[0063] In one possible implementation method, the i-1th multi-encrypted obfuscated ciphertext is obtained by:
[0064] 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 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.
[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 adopt a third-party key management method, thereby solving the problem of third-party key management among multiple institutions; on the other hand, each shard of the data to be encrypted is encrypted separately. As long as the encrypted ciphertext corresponding to each shard 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 shard is jointly determined by n collaborative encryption and decryption institutions. This allows each shard to have a certain relative relationship while being encrypted, so that each shard can be searched. Using the i-1th multiple encrypted obfuscated ciphertext to encrypt the i-th shard maintains the original size property of the i-th shard, thus making each shard comparable.
[0068] In one possible implementation method, in step 202, the first mechanism obtains the (i-1)th multi-encrypted obfuscated ciphertext corresponding to the (i-1)th shard, and encrypts the (i-1)th multi-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 multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the hash value of the i-1th multi-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 multi-encrypted obfuscated ciphertext; m i Represents the value of the i-th shard; Hash is a hash function.
[0073] In the above scheme, the numerical value of the i-th shard ensures that the corresponding size of each shard remains unchanged. Therefore, the ciphertext of the i-th shard maintains the original numerical value relationship, enabling comparison operations. The i-1th multi-encrypted obfuscated ciphertext corresponding to each shard is jointly determined by n collaborative encryption and decryption mechanisms. This ensures that each shard maintains a certain relative relationship while being encrypted, enabling search operations. Therefore, the ciphertext of the i-th shard can achieve both comparison and search operations.
[0074] In a possible implementation method, in the above step 202, after the first mechanism generates the obfuscation parameters of the i-1th fragment, it also includes: the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th fragment based on the i-1th fragment ciphertext and the obfuscation parameters of the i-1th fragment; wherein, when i=1, the i-1th fragment 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 one possible implementation method, the first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th slice based on 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.
[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 fragment; S i-1 represents the ciphertext of the i-1th fragment; r i-1 The obfuscation parameter for the i-1th slice. n is a public parameter, typically a 2048-bit prime number. ^ represents exponential arithmetic, and mod represents modular arithmetic.
[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 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 numerical value but different identifiers have different ciphertexts; for example, if the identifier is a user deposit, the numerical value corresponding to the user deposit is 100; if the identifier is a user arrears, the numerical value corresponding to the user arrears is also 100; then, since the identifiers of the data to be encrypted are different, even though the numerical values are both 100, the resulting encrypted ciphertexts 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 parameter of the i-1th shard. Then, for two data, if the numerical 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 shard "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 are the same, the encrypted ciphertext is also different.
[0084] In one possible implementation method, before 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 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.
[0087] In one 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 one 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 a 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 multi-encrypted obfuscated ciphertext is shown in the following formula (3).
[0090]
[0091] in, Represents the multi-encrypted obfuscated ciphertext of the i-1th fragment; M n-1 represents n-1 obfuscated ciphertext; key1 represents the first private key; r i-1 -1 Represents the inverse of the obfuscation parameter for the i-1th slice; n is a public parameter, typically a 2048-bit prime number. ^ represents exponential operation, and mod represents modular operation.
[0092] In the above scheme, each collaborative encryption and decryption organization corresponds to a private key. The private key of any organization is kept secret from other organizations, which is equivalent to each organization storing a portion of the key. No organization can decrypt the encrypted data alone. Therefore, there is no need to use a third-party key management method, thereby solving the problem of third-party key management among multiple organizations. Moreover, 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 obfuscation parameter is used as the exponent of the modular exponential operation, which is exactly eliminated from the i-1th obfuscation parameter in the initial obfuscated ciphertext, eliminating the influence of the random generation characteristics of the obfuscation parameter on the encryption algorithm. As a result, 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 includes the following steps:
[0094] In step 301, n collaborative encryption and decryption organizations generate their own corresponding private keys.
[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. For example, the generated first private key is 0100101000..., where N is a multiple of 8, such as 8 or 16. This solution ensures the validity of the first private key and keeps the length of the first private key fixed. The first private key will not be shortened due to the first N bits of the first private key being 0, thereby affecting the effectiveness 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 fragment.
[0098] In a possible implementation method, the first mechanism generates an initial obfuscated ciphertext corresponding to the i-1th fragment according to the above formula (2). Wherein, when i=1, the i-1th fragment ciphertext is the ciphertext corresponding to the identifier of the data to be encrypted.
[0099] In step 304, the first institution sends the initial obfuscated ciphertext corresponding to the (i-1)th fragment to the second institution.
[0100] In step 305, the second institution encrypts the initial obfuscated ciphertext using the second private key and sends the encrypted data to the next institution.
[0101] In one 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] In step 307 , the first institution determines the (i-1)th multi-encrypted obfuscated ciphertext according to the first private key, the (n-1)th obfuscated ciphertext and the (i-1)th 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 one possible implementation method, except for the first mechanism, the other n-1 mechanisms obtain n-1 obfuscated ciphertexts using a calculation method 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 the exponential operation, and mod is the 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 the 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] In step 401, Bank A, Bank B, and Bank C locally randomly generate 2048-bit private keys keya, keyb, and keyc respectively.
[0114] In step 402, Bank A, Bank B, and Bank C respectively secretly save the private keys keya, keyb, and keyc locally.
[0115] Take the case of user u_4 in Bank B, whose deposit is RMB 14444 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 an 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] In step 503, Bank B determines the initial obfuscated ciphertext.
[0120] In a possible implementation method, the initial obfuscated ciphertext M1 corresponding to bank B is hash(business type)^r1 modn.
[0121] In step 504, Bank B sends the initial obfuscated ciphertext to Bank C.
[0122] In step 505, bank C encrypts the initial obfuscated ciphertext using its own private key keyc to obtain the first level of obfuscated ciphertext.
[0123] In a possible implementation method, the first obfuscated ciphertext = initial obfuscated ciphertext ^keyc mod n.
[0124] In step 506, Bank C sends the first obfuscated ciphertext to Bank A.
[0125] In step 507, Bank A encrypts the first obfuscated ciphertext using 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] In step 508, Bank A sends the second obfuscated ciphertext to Bank B.
[0128] In step 509, Bank B encrypts the second obfuscated ciphertext using 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] In step 601, Bank B divides the data to be encrypted.
[0132] In one possible implementation method, bank B splits the characters of the number into m1="1" m2="4" m3="4" m4="4" m5="4" based on the deposit of 14444 yuan corresponding to user u_4.
[0133] In 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 an obfuscation parameter r2.
[0136] In 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] In step 605, Bank B sends the initial obfuscated ciphertext corresponding to the first character to Bank C.
[0139] In step 606, bank C encrypts the initial obfuscated ciphertext corresponding to the first character using its own private key keyc to obtain a first obfuscated ciphertext corresponding to the first character.
[0140] In 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 using its own private key keya to obtain a second obfuscated ciphertext corresponding to the first character.
[0142] In step 609, Bank A sends the second obfuscated ciphertext corresponding to the first character to Bank B.
[0143] In step 610, Bank B encrypts the second obfuscated ciphertext corresponding to the first character using its own private key keyb to obtain a second multi-encrypted obfuscated ciphertext.
[0144] In 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 one possible implementation method, repeat 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 based on the encrypted ciphertexts c1, c2, c3, c4, and 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 mechanisms encrypt their respective 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 mechanisms.
[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: Receive a comparison request.
[0152] The comparison request includes first indication information, wherein the first indication information is used to indicate relevant information of the comparison data.
[0153] Step 702: According to the first indication information, obtain 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.
[0154] Step 703: Determine a comparison result according to the first comparison ciphertext and the second comparison ciphertext.
[0155] In one possible implementation, if the ciphertext corresponding to the kth character in the first and second comparison ciphertexts differ, the ciphertext corresponding to all characters after the kth character will also differ. For example, if user A's deposit is 11111 yuan, the encrypted ciphertext is c1c2c3c4c5; if user B's deposit is 12111 yuan, the encrypted ciphertext is t1t2t3t4t5. If c1 and t1 are the same, but c2 and t2 are different, then c3 and t3 will be different, c4 and t4 will be different, and c5 and t6 will be different, even though the plaintext corresponding to c3, c4, c5 and t3, t4, and t5 are the same.
[0156] Exemplarily, the first indication information is comparing the sizes of the deposit corresponding to user u_1 and the deposit corresponding to user u_4 in bank A.
[0157] Based on the first instruction, the encrypted ciphertext of user u_1's and user u_4's deposits are retrieved from the database. Because the encrypted data maintains the size relationship of the original data, any bank can compare the ciphertexts using the same logic as for plaintext, without knowing the specific information contained in the ciphertexts.
[0158] For example, the user u_1 corresponds to a deposit of 11,111 yuan, and the encrypted ciphertext is c1c2c3c4c5; the user u_4 corresponds to a deposit of 14,444 yuan, and the encrypted ciphertext is t1t2t3t4t5. Since the same plaintext has the same size relationship, the encrypted ciphertext c1 is equal to t1, and c2 is less than t2. Therefore, the deposit corresponding to the user u_1 is less than the deposit corresponding to the user u_4.
[0159] 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, so that the secret information of different agencies is comparable.
[0160] In one embodiment, when the first agency or database receives the search request, the processing process is as shown in the following steps: Figure 8
[0161] Step 801, receiving a search request.
[0162] The search request includes second indication information. The second indication information is used to indicate the related information of the search range.
[0163] Step 802, determining the encrypted ciphertext corresponding to the second indication information according to the second indication information and the private key corresponding to the n agencies cooperating in encryption and decryption.
[0164] Step 803, determining the data to be searched indicated by the second indication information from the database according to the encrypted ciphertext corresponding to the second indication information.
[0165] For example, the second indication information is to query the user whose deposit amount is in the range of 1XXXX.
[0166] According to the encrypted algorithm, the encrypted ciphertext corresponding to the plaintext character "1" is determined according to the corresponding plaintext character "1" in the second indication information.
[0167] The deposit information of each user with the same prefix of the encrypted ciphertext corresponding to the plaintext character "1" is filtered out from the database. For example, the user u_1 corresponds to a deposit of 11,111 yuan; the user u_4 corresponds to a deposit of 14,444 yuan; and the user u_6 corresponds to a deposit of 12,345 yuan.
[0168] The above scheme, the encrypted ciphertext corresponding to the second indication information is also determined according to the private key corresponding to the n agencies cooperating in encryption and decryption, so that the encrypted ciphertext corresponding to the second indication information has a certain corresponding relationship with the encrypted ciphertext in the database, thereby realizing the searchable secret information of different agencies.
[0169] Based on the same technical concept, Figure 9 An apparatus 900 for distributed data encryption is exemplarily shown. As shown, the apparatus 900 includes a division unit 901 and an encryption unit 902. Figure 9 The division unit 901 is configured to sequentially divide to-be-encrypted data into a plurality of shards. The to-be-encrypted data is plaintext data in the first mechanism. The first mechanism is any one of the mechanisms for cooperative encryption and decryption. The encryption unit 902 is configured to obtain an (i-1)th multi-encrypted confusion ciphertext corresponding to an ith shard, and encrypt the ith shard by using the (i-1)th multi-encrypted confusion ciphertext to obtain ciphertext of the ith shard, where i is a positive integer. Encryption ciphertext of the to-be-encrypted data is obtained based on ciphertexts of the plurality of shards. The (i-1)th multi-encrypted confusion ciphertext is obtained in the following manner: the first mechanism generates a confusion parameter of the (i-1)th shard, and sends the (i-1)th confusion parameter to a second mechanism. The second mechanism is a mechanism located after the first mechanism in a preset encryption and decryption order among the mechanisms for cooperative encryption and decryption. The second mechanism is configured to encrypt the (i-1)th confusion parameter and send the encrypted (i-1)th confusion parameter to a next mechanism, until an (n-1)th confusion ciphertext after encryption by a last mechanism in the preset encryption and decryption order is sent to the first mechanism. The first mechanism encrypts the (n-1)th confusion ciphertext based on the (i-1)th confusion parameter to obtain the (i-1)th multi-encrypted confusion ciphertext.
[0170] In a possible implementation, the encryption unit 902 is configured to obtain a hash value of the (i-1)th multi-encrypted confusion ciphertext corresponding to the ith shard, and encrypt the ith shard by using the hash value of the (i-1)th multi-encrypted confusion ciphertext and a value of the ith shard to obtain ciphertext of the ith shard.
[0171] In a possible implementation, the encryption unit 902 is configured to determine an initial confusion ciphertext corresponding to the (i-1)th shard according to (i-1)th shard ciphertext and a confusion parameter of the (i-1)th shard. When i=1, the (i-1)th shard ciphertext is ciphertext corresponding to an identifier of the to-be-encrypted data. The initial confusion ciphertext corresponding to the (i-1)th shard is sent to the second mechanism.
[0172] In a possible implementation, the encryption unit 902 is configured to determine an initial confusion ciphertext corresponding to the (i-1)th shard according to (i-1)th shard ciphertext, a confusion parameter of the (i-1)th shard, and a modulus exponentiation operation. The (i-1)th shard ciphertext is a base number of the modulus exponentiation operation. The confusion parameter of the (i-1)th shard is an exponent of the modulus exponentiation operation.
[0173] In one possible implementation method, the encryption unit 902 is used to encrypt the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter and the first private key; wherein each collaborative encryption and decryption organization corresponds to a private key; the i-1th multi-encrypted obfuscated ciphertext contains the private keys corresponding to n collaborative encryption and decryption organizations; the first private key is the private key generated by the first organization; the second organization is used to encrypt the i-1th obfuscation parameter using the second private key and then send it to the next organization; the second private key is the private key generated by the second organization.
[0174] In one 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 further 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, 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.
[0177] In one possible implementation method, the above-mentioned device also includes a request processing unit 905, 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 based on the first comparison ciphertext and the second comparison ciphertext.
[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. Figure 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. Figure 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, and the like.
[0180] In an embodiment of the present application, the memory 1002 stores instructions that can be executed by at least one processor 1001. 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] The processor 1001 is the control center of the distributed data encryption device 1000. It can connect various components of the computer device using various interfaces and lines, and perform resource configuration 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. The processor 1001 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and application programs, and the modem processor primarily processes wireless communications. It is understood that the 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. In some embodiments, they may also be implemented on separate chips.
[0182] The processor 1001 may 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, or a discrete hardware component, and may implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0183] 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. 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. 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 methods.
[0186] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can 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 can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic 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 block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks 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 that can direct a computer or other programmable data processing device to work 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 The 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 operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0190] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A method for distributed data encryption, characterized in that: Applicable to n collaborative encryption and decryption mechanisms, where n is a positive integer greater than 2; the method includes: 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 multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the i-1th multi-encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard; wherein i is a positive integer; Obtaining an encrypted ciphertext of the data to be encrypted based on the ciphertexts of the multiple fragments; The i-1th multi-encrypted obfuscated ciphertext is obtained by: The first mechanism generates an obfuscation parameter for the i-1th slice and sends the i-1th obfuscation parameter to a second mechanism; the second mechanism is an mechanism located after the first mechanism in a 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-1th 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-1)th obfuscation parameter to obtain the (i-1)th multi-encrypted obfuscated ciphertext.
2. The method according to claim 1, wherein The first mechanism obtains the i-1th multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the i-1th multi-encrypted obfuscated ciphertext to obtain the ciphertext of the i-th shard, including: The first mechanism obtains the hash value of the i-1th multi-encrypted obfuscated ciphertext corresponding to the i-1th shard, and encrypts the i-th shard using the hash value of the i-1th multi-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, wherein After the first mechanism generates the obfuscation parameters of the (i-1)th slice, the method further includes: The first mechanism determines an initial obfuscated ciphertext corresponding to the i-1th slice based on the ciphertext of the i-1th slice and the obfuscation parameter of the i-1th slice; wherein, when i=1, the ciphertext of the i-1th slice is the ciphertext corresponding to the identifier of the data to be encrypted; The sending the (i-1)th obfuscation parameter to the second mechanism includes: The initial obfuscated ciphertext corresponding to the (i-1)th fragment is sent to the second institution.
4. The method according to claim 3, wherein The first mechanism determines, based on the ciphertext of the i-1th fragment and the obfuscation parameter of the i-1th fragment, an initial obfuscated ciphertext corresponding to the i-1th fragment, including: The first mechanism determines the initial obfuscated ciphertext corresponding to the i-1th slice based on 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.
5. The method according to claim 1, wherein The first mechanism encrypts the n-1 obfuscated ciphertext based on the i-1th obfuscation parameter, including: The first institution encrypts the n-1 multi-obfuscated ciphertext based on the (i-1)th obfuscation parameter and the first private key; wherein each collaborative encryption and decryption institution corresponds to a private key; the (i-1)th 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-1)th 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, wherein 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-1)th obfuscation parameter, the first private key, and a 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-1)th obfuscation parameter is the exponent of the modular exponential operation.
7. The method according to claim 5, wherein 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, wherein 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, wherein The method further comprises: receiving a comparison request, wherein the comparison request includes first indication information; According to the first instruction 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, wherein The method further comprises: receiving a search request, wherein the search request includes second indication information; Determining an encrypted ciphertext corresponding to the second instruction information based on the second instruction information and the private keys corresponding to the n collaborative encryption and decryption organizations; According to 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.
Citation Information
Patent Citations
Ciphertext data outsourcing decryption system and method based on homomorphic encryption
CN115225250A
Data query method and device
CN117349486A