CN-116015597-B - Block chain data sharing method and system based on homomorphic encryption
Abstract
The embodiment of the application discloses a block chain data sharing method and system based on homomorphic encryption. The method comprises the steps that a client sends query keywords to a service providing end, the service providing end carries out homomorphic encryption on the query keywords, a data screening result is determined by utilizing the encrypted query keywords and is sent to the client, the client determines target ciphertext sharing data according to the data screening result, sends a generated data sharing request and client information to be verified to a blockchain network, the blockchain network determines whether to agree with the data sharing request according to the client information to be verified, when the blockchain network agrees with the data sharing request, homomorphic public keys are utilized to carry out homomorphic encryption on plaintext sharing data corresponding to target ciphertext sharing data, homomorphic encrypted sharing data are obtained, the homomorphic encrypted sharing data are sent to the client, and the client decrypts the homomorphic encrypted sharing data by utilizing homomorphic private keys, so that the safety of the sharing data can be improved.
Inventors
- WANG GUANNAN
- MA SHUAI
- YE CHEN
- YAO CONGCONG
- TANG WENJIA
Assignees
- 国网雄安金融科技集团有限公司
- 国网征信有限公司
- 国网数字科技控股有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221219
Claims (10)
- 1. A blockchain data sharing method based on homomorphic encryption, the method comprising: the client sends the query keywords to the service provider; The service providing end carries out homomorphic encryption on the query keyword to obtain an encrypted query keyword, and determines a data screening result from a homomorphic index table by utilizing the encrypted query keyword, wherein the homomorphic index table is provided by a blockchain network and comprises the homomorphic encrypted keyword and ciphertext sharing data corresponding to the homomorphic encrypted keyword, and the data screening result comprises ciphertext sharing data corresponding to the query keyword; the service providing end sends the data screening result to the client; The client determines target ciphertext sharing data according to the data screening result, and generates a data sharing request; The client sends the data sharing request and the client information to be verified to the blockchain network through the service providing end; The blockchain network determines whether to agree with the data sharing request according to the client information to be verified; When the blockchain network determines to agree with the data sharing request, the blockchain network uses a homomorphic public key to homomorphic encrypt plaintext sharing data corresponding to the target ciphertext sharing data to obtain homomorphic encrypted sharing data; the blockchain network sends the homomorphic encryption shared data to the client through the service providing end; And the client decrypts the homomorphic encryption shared data by using a homomorphic private key to obtain plaintext shared data, wherein the homomorphic private key is provided by the authentication center.
- 2. The method according to claim 1, wherein the method further comprises: The client signs the data sharing request by using a client private key to obtain a signed data sharing request; the blockchain network determines whether to agree to the data sharing request according to the client information to be verified, and the method comprises the following steps: the blockchain network verifies the signed data sharing request by using a client public key, wherein the client public key is provided by the authentication center; if the verification is passed, the blockchain network judges whether the client information consistent with the client information to be verified exists in the pre-stored client information; and if the pre-stored client information contains the client information consistent with the client information to be verified, the blockchain network determines to agree with the data sharing request.
- 3. The method according to claim 1, wherein the method further comprises: When the blockchain network determines to agree with the data sharing request, the blockchain network sends a message of successful establishment of sharing to the authentication center; The authentication center sets an encryption parameter of homomorphic encryption and generates a homomorphic public key and a homomorphic private key; The authentication center sends the encryption parameter, the homomorphic public key and the homomorphic private key to the service providing end; the service providing end sends the encryption parameter and the homomorphic public key to the blockchain network; and the service providing end sends the homomorphic private key to the client.
- 4. A method according to claim 3, wherein the message of successful establishment of the sharing carries the client information to be verified, the method further comprising: the authentication center determines a corresponding client public key according to the client information to be verified, encrypts the homomorphic private key by using the client public key, and obtains the encrypted homomorphic private key; The client decrypts the encrypted homomorphic private key by using a client private key to obtain the homomorphic private key, wherein the client private key is provided by the authentication center.
- 5. The method of claim 3, wherein the blockchain network homomorphic encrypts plaintext shared data corresponding to the target ciphertext shared data using a homomorphic public key to obtain homomorphic encrypted shared data, comprising: The blockchain network uses the homomorphic public key and the encryption parameter to homomorphic encrypt plaintext shared data corresponding to the target ciphertext shared data to obtain homomorphic encrypted shared data; The method further comprises the steps of: The service providing end calculates the homomorphic encryption shared data according to the encryption parameters to obtain calculated homomorphic encryption shared data; the service providing end sends the calculated homomorphic encryption shared data to the client; The client decrypts the homomorphic encryption shared data by using a homomorphic private key to obtain plaintext shared data, and the method comprises the following steps: and the client decrypts the calculated homomorphic encryption shared data by using the homomorphic private key to obtain plaintext shared data.
- 6. The method of claim 5, wherein the method further comprises: The block chain network carries out hash calculation on the homomorphic encryption shared data to obtain a first hash value, and the first hash value is sent to the service providing end; the service providing end carries out hash calculation on the homomorphic encryption shared data to obtain a second hash value; the service providing end judges whether the first hash value is consistent with the second hash value; If the first hash value is consistent with the second hash value, the service providing end calculates the homomorphic encryption shared data according to the encryption parameter to obtain the homomorphic encryption shared data after calculation; and if the first hash value is inconsistent with the second hash value, the service providing end sends a message for retransmitting data to the blockchain network.
- 7. The method of claim 5, wherein the method further comprises: The service providing end carries out hash calculation on the calculated homomorphic encryption shared data to obtain a third hash value, and the third hash value is sent to the client; the client performs hash calculation on the calculated homomorphic encryption shared data to obtain a fourth hash value; the client judges whether the third hash value is consistent with the fourth hash value; If the third hash value is consistent with the fourth hash value, the client decrypts the calculated homomorphic encryption shared data by using a homomorphic private key to obtain plaintext shared data; And if the third hash value is inconsistent with the fourth hash value, the client sends a message for retransmitting data to the service providing end.
- 8. The method according to claim 1, wherein the method further comprises: When new plaintext shared data is generated, the data providing end extracts keywords from the new plaintext shared data, homomorphic encryption is carried out on the keywords, and the homomorphic encrypted keywords are obtained; the data providing end encrypts the new plaintext shared data to obtain ciphertext shared data; The data providing end uploads the homomorphic encrypted keyword and the ciphertext sharing data to the blockchain network; and the blockchain network generates a homomorphic index table according to the homomorphic encrypted keyword and the ciphertext sharing data.
- 9. The method according to claim 1, wherein the method further comprises: The client sends authentication data to the authentication center, wherein the authentication data comprises client information; the authentication center carries out auditing on the authentication data; If the verification passes, the authentication center generates a client public key and a client private key, and the authentication data and the client public key are stored in the authentication center; The authentication center sends the client information and the client public key to the blockchain network through the service providing end; And the authentication center sends the client private key and the message of successful registration to the client through the service providing end.
- 10. A block chain data sharing system based on homomorphic encryption is characterized by comprising a client, a service providing end, a block chain network and an authentication center; the client is used for sending the query keywords to the service providing end; The service providing end is used for homomorphic encrypting the query keyword to obtain an encrypted query keyword, and determining a data screening result from a homomorphic index table by utilizing the encrypted query keyword, wherein the homomorphic index table is provided by a blockchain network and comprises homomorphic encrypted keyword and ciphertext sharing data corresponding to the homomorphic encrypted keyword, and the data screening result comprises ciphertext sharing data corresponding to the query keyword; the service providing end is further used for sending the data screening result to the client; The client is also used for determining target ciphertext sharing data according to the data screening result and generating a data sharing request; the client is further configured to send the data sharing request and the client information to be verified to the blockchain network through the service provider; The blockchain network is used for determining whether to agree with the data sharing request according to the client information to be verified; The block chain network is further used for carrying out homomorphic encryption on plaintext shared data corresponding to the target ciphertext shared data by using a homomorphic public key when determining to agree with the data sharing request to obtain homomorphic encrypted shared data; The block chain network is further used for sending the homomorphic encryption shared data to the client through the service providing end; The client is also used for decrypting the homomorphic encryption shared data by using a homomorphic private key to obtain plaintext shared data, and the homomorphic private key is provided by the authentication center.
Description
Block chain data sharing method and system based on homomorphic encryption Technical Field The application relates to the technical field of blockchains, in particular to a blockchain data sharing method and system based on homomorphic encryption. Background With the development of internet technology, the number of enterprises and users is increased, the data volume is increased, and a large amount of data brings great benefits for enterprise profit or research of scientific research institutions. But processing large data requires a large amount of computing resources and is costly. Therefore, a computing service with high complexity and relatively low cost is provided for a plurality of manufacturers, and a third party service can be directly used when enterprises, research institutions and the like perform large-scale data computation. In some situations, confidentiality of data needs to be guaranteed, for example, confidentiality of information of patients needs to be guaranteed in the situation of disease data sharing, and sensitive information of clients needs to be hidden when asset analysis is performed in the financial field. However, the third party computing service provider is not completely trusted, and if the service provider processes the plaintext data, the problem of user information leakage may be caused, and the security of the shared data cannot be ensured. Disclosure of Invention In view of the above, the embodiment of the application discloses a method and a system for sharing blockchain data based on homomorphic encryption, so as to improve the security of shared data. The technical scheme provided by the embodiment of the application is as follows: in a first aspect, an embodiment of the present application provides a method for sharing blockchain data based on homomorphic encryption, where the method includes: the client sends the query keywords to the service provider; The service providing end carries out homomorphic encryption on the query keyword to obtain an encrypted query keyword, and determines a data screening result from a homomorphic index table by utilizing the encrypted query keyword, wherein the homomorphic index table is provided by a blockchain network and comprises the homomorphic encrypted keyword and ciphertext sharing data corresponding to the homomorphic encrypted keyword, and the data screening result comprises ciphertext sharing data corresponding to the query keyword; the service providing end sends the data screening result to the client; The client determines target ciphertext sharing data according to the data screening result, and generates a data sharing request; The client sends the data sharing request and the client information to be verified to the blockchain network through the service providing end; The blockchain network determines whether to agree with the data sharing request according to the client information to be verified; When the blockchain network determines to agree with the data sharing request, the blockchain network uses a homomorphic public key to homomorphic encrypt plaintext sharing data corresponding to the target ciphertext sharing data to obtain homomorphic encrypted sharing data; the blockchain network sends the homomorphic encryption shared data to the client through the service providing end; And the client decrypts the homomorphic encryption shared data by using a homomorphic private key to obtain plaintext shared data, wherein the homomorphic private key is provided by the authentication center. In one possible implementation, the method further includes: The client signs the data sharing request by using a client private key to obtain a signed data sharing request; the blockchain network determines whether to agree to the data sharing request according to the client information to be verified, and the method comprises the following steps: the blockchain network verifies the signed data sharing request by using a client public key, wherein the client public key is provided by the authentication center; if the verification is passed, the blockchain network judges whether the client information consistent with the client information to be verified exists in the pre-stored client information; and if the pre-stored client information contains the client information consistent with the client information to be verified, the blockchain network determines to agree with the data sharing request. In one possible implementation, the method further includes: When the blockchain network determines to agree with the data sharing request, the blockchain network sends a message of successful establishment of sharing to the authentication center; The authentication center sets an encryption parameter of homomorphic encryption and generates a homomorphic public key and a homomorphic private key; The authentication center sends the encryption parameter, the homomorphic public key and the homomorphic private key to the service providing end;