A blockchain data security sharing method and device

By using encryption key splitting and key exchange algorithms, the problem of the inability to disclose blockchain data unidirectionally is solved, enabling secure sharing of blockchain data. Shared data is decrypted only by specific participants, reducing the risk of data leakage and leveraging the decentralized and immutable characteristics of blockchain.

CN115296793BActive Publication Date: 2026-05-15HANGZHOU RIVTOWER TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU RIVTOWER TECH CO LTD
Filing Date
2022-06-24
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

The transparency of transactions in blockchain technology makes it impossible to disclose data in a one-way manner. When the initiator wants to disclose data only to a specific transaction partner, targeted disclosure is not possible. For example, when disputes arise in multi-party collaborations involving electronic contracts, non-participating parties may obtain the original content of the contract.

Method used

By employing encryption key splitting and key exchange algorithms, the initiator generates an encryption key and splits it into secret shared messages. Participants then use the key exchange algorithm to calculate their local keys for decryption, ensuring that only specific participants can decrypt the plaintext shared data.

Benefits of technology

It enables secure sharing of blockchain data, where only the party holding the public key and the corresponding private key can decrypt the plaintext of the shared data, reducing the risk of data leakage. By leveraging the decentralized and immutable advantages of blockchain, it enhances the security of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115296793B_ABST
    Figure CN115296793B_ABST
Patent Text Reader

Abstract

The application discloses a kind of blockchain data security sharing method and device, wherein the method comprises: initiator generates encryption key, according to the total number of participants, the encryption key is split to generate secret sharing message;Using key exchange algorithm to obtain local key, and using local key to encrypt secret sharing message to generate secret sharing message ciphertext;According to the encryption key, the plaintext of shared data is encrypted to generate shared data ciphertext;After generating on-chain encryption shared data and submitting to blockchain, the corresponding transaction hash is obtained;Participants obtain on-chain encryption shared data and use key exchange algorithm to obtain local key, and the secret sharing message ciphertext is decrypted to obtain secret sharing message;Secret sharing message is reconstructed to obtain encryption key, and the shared data ciphertext is decrypted using the encryption key to obtain shared data plaintext.The application realizes that only ciphertext is transmitted on the chain, and only the participant who grasps the key corresponding to the public key can decrypt the shared data plaintext.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer software technology, and in particular to a method, apparatus, electronic device and storage medium for secure sharing of blockchain data. Background Technology

[0002] As blockchain technology is increasingly applied in real-world scenarios, its decentralized nature solves the "trust" problem in many applications, particularly providing consistency guarantees for projects involving multiple enterprises, organizations, and users. It also provides platform support for data security, data value-added services, and results verification, encouraging participants to collaborate more effectively and focus on the research itself, thus reducing the risk of data leaks. However, the transparency of blockchain transactions also has drawbacks. Initiator data is encapsulated in blockchain transaction information and broadcast to the blockchain network using a consensus algorithm, making it publicly visible to all nodes. However, if the initiator only wishes to disclose data to specific trading partners, one-way disclosure is not easily achieved. For example, when placing electronic contracts on the blockchain for multi-party collaboration, in case of disputes, a notary public can be required to verify the evidence through the blockchain, and non-participants on the blockchain should not be able to access the original contract content. Therefore, how to achieve secure sharing of blockchain data is a pressing technical problem that needs to be solved. Summary of the Invention

[0003] The purpose of the embodiments in this specification is to address the above-mentioned problems by providing a method, apparatus, electronic device, and storage medium for secure sharing of blockchain data.

[0004] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows:

[0005] Firstly, a method for secure data sharing on the blockchain is proposed, including:

[0006] After the initiator generates the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants. The participants are identified by participant codes.

[0007] The initiator uses a key exchange algorithm to calculate and obtain a local key, and uses the local key to encrypt the secret sharing message to generate secret sharing message ciphertext;

[0008] The initiator encrypts the plaintext shared data using the encryption key to generate ciphertext shared data.

[0009] The initiator generates encrypted shared data on the blockchain and submits it to the blockchain to obtain the corresponding transaction hash.

[0010] The participating party obtains the on-chain encrypted shared data and calculates the local key using the key exchange algorithm, then decrypts the ciphertext of the secret sharing message to obtain the secret sharing message.

[0011] The participating parties reconstruct the secret sharing message to obtain the encryption key, and use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0012] Secondly, a secure blockchain data sharing method is proposed, applicable to the initiator, including:

[0013] After generating the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants, and the participants are identified by participant codes;

[0014] A local key is calculated using a key exchange algorithm, and the secret sharing message is encrypted using the local key to generate the secret sharing message ciphertext.

[0015] The shared data plaintext is encrypted using the encryption key to generate shared data ciphertext.

[0016] After generating encrypted shared data on the blockchain and submitting it, the corresponding transaction hash is obtained.

[0017] Thirdly, a blockchain data security sharing method is proposed, applicable to participating parties, including:

[0018] After obtaining the encrypted shared data on the blockchain and calculating the local key using the key exchange algorithm, the encrypted secret shared message is decrypted to obtain the secret shared message.

[0019] The encryption key is reconstructed from the secret shared message, and the encryption key is used to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0020] Fourthly, a blockchain data security sharing device is proposed, comprising:

[0021] The first module is used to generate a secret sharing message by dividing the encryption key according to the total number of participants after the initiator generates the encryption key. The participants are identified by participant codes.

[0022] The second module is used by the initiator to calculate and obtain a local key using a key exchange algorithm, and to encrypt the secret sharing message using the local key to generate secret sharing message ciphertext.

[0023] The third module is used by the initiator to encrypt the plaintext shared data according to the encryption key to generate ciphertext shared data;

[0024] The fourth module is used by the initiator to generate encrypted shared data on the blockchain and submit it to the blockchain to obtain the corresponding transaction hash;

[0025] The fifth module is used for the participating party to obtain the on-chain encrypted shared data, and after calculating the local key using the key exchange algorithm, to decrypt the ciphertext of the secret sharing message to obtain the secret sharing message;

[0026] The sixth module is used by the participating parties to reconstruct the secret sharing message to obtain an encryption key, and to use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0027] Fifthly, a blockchain data security sharing device is proposed for use by the initiator, including:

[0028] The first module is used to generate an encryption key and then divide the encryption key into secret sharing messages according to the total number of participants, wherein the participants are identified by participant codes.

[0029] The second module is used to calculate and obtain a local key using a key exchange algorithm, and to encrypt the secret sharing message using the local key to generate secret sharing message ciphertext.

[0030] The third module is used to encrypt the shared plaintext data according to the encryption key to generate the shared ciphertext data.

[0031] The fourth module is used to generate encrypted shared data on the blockchain and obtain the corresponding transaction hash after submission.

[0032] Sixthly, a blockchain data security sharing device is proposed for use by participating parties, including:

[0033] The first module is used to obtain encrypted shared data on the blockchain, and after calculating the local key using the key exchange algorithm, to decrypt the ciphertext of the secret shared message to obtain the secret shared message.

[0034] The second module is used to reconstruct the secret sharing message to obtain an encryption key, and to use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0035] In a seventh aspect, an electronic device is proposed, comprising: a processor; and

[0036] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the first aspect.

[0037] Eighthly, an electronic device is proposed, comprising: a processor; and

[0038] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the second aspect.

[0039] Ninthly, an electronic device is proposed, comprising: a processor; and

[0040] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the third aspect.

[0041] In a tenth aspect, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method described in the first aspect.

[0042] Eleventhly, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the method described in the second aspect.

[0043] In a twelfth aspect, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the method described in the third aspect.

[0044] This manual can achieve at least the following technical effects:

[0045] This invention enables secure data sharing within a blockchain environment, leveraging the advantages of blockchain's decentralization, immutability, and reliable evidence storage. Furthermore, blockchain only transmits encrypted information, and only the party possessing the public key can decrypt the shared plaintext data. Utilizing mature encryption and decryption algorithms and a blockchain framework supporting smart contracts, it possesses a degree of technical versatility and effectively reduces the risk of data leakage during transmission. Attached Figure Description

[0046] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0047] Figure 1 This is one of the schematic diagrams of a blockchain data security sharing method provided in the embodiments of this specification.

[0048] Figure 2This is the second schematic diagram of the blockchain data security sharing method provided in the embodiments of this specification.

[0049] Figure 3 This is the third schematic diagram of the blockchain data security sharing method provided in the embodiments of this specification.

[0050] Figure 4 This is the fourth schematic diagram of the blockchain data security sharing method provided in the embodiments of this specification.

[0051] Figure 5 This is the fifth schematic diagram of the blockchain data security sharing method provided in the embodiments of this specification.

[0052] Figure 6 This is the sixth schematic diagram of the blockchain data security sharing method provided in the embodiments of this specification.

[0053] Figure 7 This is one of the schematic diagrams of a blockchain data security sharing device provided in the embodiments of this specification.

[0054] Figure 8 This is the second schematic diagram of a blockchain data security sharing device provided in the embodiments of this specification.

[0055] Figure 9 This is the third schematic diagram of a blockchain data security sharing device provided in the embodiments of this specification.

[0056] Figure 10 This is the fourth schematic diagram of a blockchain data security sharing device provided in the embodiments of this specification.

[0057] Figure 11 This is the fifth schematic diagram of a blockchain data security sharing device provided in the embodiments of this specification.

[0058] Figure 12 This is a schematic diagram of the structure of an electronic device provided as an embodiment of this specification. Detailed Implementation

[0059] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0060] The following section provides a detailed explanation of a scheme for creating a parent-child blockchain, as described in this manual, through specific examples.

[0061] Key terms

[0062] Blockchain technology is a novel distributed infrastructure and computing paradigm that utilizes a block-chain data structure to verify and store data, distributed node consensus algorithms to generate and update data, cryptography to ensure the security of data transmission and access, and smart contracts composed of automated script code to program and manipulate data. Essentially, it is a shared database where the data or information stored possesses characteristics such as being unforgeable, fully traceable, auditable, transparent, and collectively maintained. Based on these characteristics, blockchain technology lays a solid foundation of trust, creates a reliable cooperation mechanism, and has broad application prospects. According to access mechanisms, blockchains are classified into public blockchains, consortium blockchains, and private blockchains.

[0063] Blockchain data visibility: For public blockchains, anyone can write to and read the data stored in the blockchain; for consortium blockchains, the blockchain is jointly maintained by multiple parties, and only operators participating in the consortium can write to and read the data stored in the blockchain, controlling the visibility of the data according to the rules jointly agreed upon by the consortium; for private blockchains, only operators can write to and read the data stored in the blockchain, and operators can control the visibility of the data according to their own business needs.

[0064] Secret Sharing, proposed by Shamir and Blakey in 1979, has been widely recognized and studied in depth for over 40 years since then. The well-known (t, n) threshold scheme of secret sharing works as follows: Suppose a secret *s* is divided into *n* parts, each called a sub-secret and held by one holder. Sub-secrets held by *t* or more participants can reconstruct secret *s*, while sub-secrets held by fewer than *t* participants cannot reconstruct the secret and cannot provide any information about it.

[0065] Key Exchange: Key exchange algorithms solve the problem of securely transmitting keys over insecure channels, namely the Diffie-Hellman algorithm (DH algorithm for short). The DH algorithm enables key exchange without the two parties directly exchanging keys. It is one of the earliest key exchange methods put into practice in the field of cryptography, allowing two parties to reach a shared key over an insecure channel without any information about each other (private information). This key is used for symmetric encryption of subsequent information exchanges.

[0066] Example 1

[0067] The purpose of this invention is to overcome the drawbacks of the public nature of transaction data based on blockchain technology. Because the data-sharing initiator encapsulates the data within blockchain transaction information and broadcasts it to the blockchain network using a consensus algorithm, this data is publicly visible to all nodes. This makes it impossible for the data initiator to selectively disclose data only to their transaction counterparties, i.e., specific participants. For example, when placing an electronic contract on the blockchain for multi-party collaboration, in case of disputes, a notary public can be requested to verify the evidence through the blockchain. However, it is undesirable for non-participants unrelated to the contract to access the original contract content on the blockchain. It should be noted that, as... Figure 1 As shown, data sharing inevitably involves the initiator and participants of the data sharing process, with the blockchain serving as the medium. How the data to be shared is encrypted, uploaded to the blockchain, downloaded, and decrypted, and how the initiator and participants securely transmit the keys used for encryption and decryption, are precisely the technical problems this invention aims to solve. Therefore, based on the above problem analysis and combining key aspects such as key generation and transmission, and data encryption and decryption, the method of this invention's embodiments is formed, as described above. Figure 2 As shown, it includes:

[0068] Step 101: After the initiator generates the encryption key, it divides the encryption key into secret sharing messages according to the total number of participants. The participants are identified by participant codes.

[0069] An encryption key is a parameter input into algorithms that convert plaintext to ciphertext or vice versa. The encryption key is used by both the sender and receiver of data to perform encryption and decryption operations on plaintext using the same or a symmetric key. In one embodiment, it is assumed that the encryption key generated by the data sharing initiator is called `secretKey`, which consists of a public key and a private key. The encryption key generation algorithm can be specifically determined by the data sharing initiator and participants; it can be symmetric encryption, asymmetric encryption, or one-way encryption. This embodiment of the invention uses symmetric encryption for explanation. Since the solution of this invention involves encrypting data and then sharing it on the blockchain in a targeted manner, theoretically, all users on the blockchain can obtain the shared data after it is submitted. However, due to the encryption key, if some users obtain both the encrypted shared data and the encryption key, then these users are essentially data sharing participants of this invention. Therefore, the encryption key should be provided to the data sharing participants through secret sharing. According to the secret sharing technology, the encryption key should first be divided into multiple secret sharing messages. The number of divisions is determined by the total number of participants. For example, secretShares = SecretShare(t = 2, w = n, secretKey), where w is the number of divisions, which is the total number of data sharing participants n. And t = 2 means that only 2 participants need to provide the divided fragments of the encryption key to recover the secret.

[0070] Optionally, embodiments of the present invention employ the Shamir secret sharing algorithm to implement the segmentation of the encryption key by the data sharing initiator, so that subsequent data sharing participants can use a unified algorithm to reconstruct the secret sharing message into the encryption key. The participants need to be identified by participant codes to facilitate identification during reconstruction using the Shamir secret sharing algorithm. For example:

[0071] The secret share message ciphertext is encrypted using a symmetric secret algorithm (secretShares[i], secretShareKeys[i]), where i is the participant's code and secretShares[i] is the secret share message provided to the participant.

[0072] Step 102: The initiator uses a key exchange algorithm to calculate and obtain a local key, and uses the local key to encrypt the secret sharing message to generate ciphertext. Optionally, the input parameters of the key exchange algorithm used by the initiator include at least the initiator's private key, the initiator's public key, the participating party's public key, the modulus, and the base. For example:

[0073] Local key secretShareKeys[i] = key exchange algorithm key generation (P, G, initiator's private key, initiator's public key, participant's public key), where P is the modulus and G is the base as public parameters of the key generation algorithm, and i is the participant's code.

[0074] Step 103: The initiator encrypts the shared plaintext data using the encryption key to generate ciphertext data. Optionally, a symmetric encryption algorithm is used to encrypt the shared plaintext data, for example:

[0075] Shared data ciphertext = symmetric encryption algorithm encryption (shared data plaintext, encryption key secretKey).

[0076] Step 104: After the initiator generates encrypted shared data on the blockchain and submits it, it obtains the corresponding transaction hash. Optionally, the encrypted shared data on the blockchain includes at least the ciphertext of the shared data, the ciphertext of the secret shared message, and a table mapping public keys and participant codes. For example:

[0077] Transaction hash = on-chain encrypted shared data (shared data ciphertext, all secret shared messages ciphertext, the correspondence between the public key and the code of the sharing party, and the secret shared message ciphertext of the initiator).

[0078] Step 105: The participating party obtains the on-chain encrypted shared data and, after calculating the local key using the key exchange algorithm, decrypts the ciphertext of the secret sharing message to obtain the secret sharing message. Specifically, the on-chain encrypted shared data obtained by the participating party is the same as the on-chain encrypted shared data submitted by the initiator, including the shared data ciphertext, all secret sharing message ciphertexts, the correspondence between the public keys and codes of the sharing parties, and the secret sharing message ciphertext of the initiator, etc. Optionally, the input parameters for the participating party to calculate the local key using the key exchange algorithm include at least the initiator's public key, the participating party's public key, and the participating party's private key. For example:

[0079] The local key of the key exchange algorithm, secretShareKey, is generated by the key exchange algorithm (P, G, private key of the participants, public key of the participants, public key of the initiator), where P is the modulus and G is the base, which are public parameters of the algorithm.

[0080] Secretly shared message = symmetric decryption algorithm (secretShares[i], secretShareKey).

[0081] Step 106: The participating party reconstructs the secret-sharing message to obtain the encryption key, and uses the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data. For example:

[0082] The encryption key `secretKey` equals the secret sharing technology (the initiator's secret sharing message and the user's own secret sharing message).

[0083] Shared data plaintext = symmetric decryption algorithm (shared data ciphertext, encryption key secretKey).

[0084] This embodiment proposes another implementation scheme for a method of verifyable credential circulation and interaction in a blockchain system, such as... Figure 3 As shown, it also includes:

[0085] Step 107: The initiator deploys a smart contract for executing secure data sharing, so that the initiator and / or the participants can call the smart contract to complete the corresponding operations on the shared data.

[0086] When this invention is implemented using a smart contract, the above data is used as parameters of the corresponding method function of the smart contract, and the transaction hash is the transaction receipt of this smart contract. It should be understood that this invention can also be implemented using a simple evidence-based transaction method, where all content is the data content of the transaction, and the transaction hash is the transaction receipt of this evidence-based transaction.

[0087] Example 2

[0088] Reference Figure 4 The diagram shown illustrates the steps of a blockchain data security sharing method provided in this embodiment. The executing entity of this method is the data sharing initiator, and includes:

[0089] Step 401: After generating the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants, and the participants are identified by participant codes.

[0090] An encryption key is a parameter input into algorithms that convert plaintext to ciphertext or vice versa. The encryption key is used by both the sender and receiver of data to perform encryption and decryption operations on plaintext using the same or a symmetric key. In one embodiment, it is assumed that the encryption key generated by the data sharing initiator is called `secretKey`, which consists of a public key and a private key. The encryption key generation algorithm can be specifically determined by the data sharing initiator and participants; it can be symmetric encryption, asymmetric encryption, or one-way encryption. This embodiment of the invention uses symmetric encryption for explanation. Since the solution of this invention involves encrypting data and then sharing it on the blockchain in a targeted manner, theoretically, all users on the blockchain can obtain the shared data after it is submitted. However, due to the encryption key, if some users obtain both the encrypted shared data and the encryption key, then these users are essentially data sharing participants of this invention. Therefore, the encryption key should be provided to the data sharing participants through secret sharing. According to the secret sharing technology, the encryption key should first be divided into multiple secret sharing messages. The number of divisions is determined by the total number of participants. For example, secretShares = SecretShare(t = 2, w = n, secretKey), where w is the number of divisions, which is the total number of data sharing participants n. And t = 2 means that only 2 participants need to provide the divided fragments of the encryption key to recover the secret.

[0091] Optionally, embodiments of the present invention employ the Shamir secret sharing algorithm to implement the segmentation of the encryption key by the data sharing initiator, so that subsequent data sharing participants can use a unified algorithm to reconstruct the secret sharing message into the encryption key. The participants need to be identified by participant codes to facilitate identification during reconstruction using the Shamir secret sharing algorithm. For example:

[0092] The secret share message ciphertext is encrypted using a symmetric secret algorithm (secretShares[i], secretShareKeys[i]), where i is the participant's code and secretShares[i] is the secret share message provided to the participant.

[0093] Step 402: Calculate and obtain a local key using a key exchange algorithm, and encrypt the secret sharing message using the local key to generate ciphertext of the secret sharing message. Optionally, the input parameters for the initiator to calculate and obtain the local key using the key exchange algorithm include at least the initiator's private key, the initiator's public key, and the participating party's public key. For example:

[0094] Local key secretShareKeys[i] = key exchange algorithm key generation (P, G, initiator's private key, initiator's public key, participant's public key), where P is the modulus and G is the base as public parameters of the key generation algorithm, and i is the participant's code.

[0095] Step 403:

[0096] The shared plaintext data is encrypted using the encryption key to generate ciphertext data. Optionally, a symmetric encryption algorithm is used to encrypt the shared plaintext data, for example:

[0097] Shared data ciphertext = symmetric encryption algorithm encryption (shared data plaintext, encryption key secretKey).

[0098] Step 404: After generating the on-chain encrypted shared data and submitting it to the blockchain, the corresponding transaction hash is obtained. Optionally, the on-chain encrypted shared data includes at least the ciphertext of the shared data, the ciphertext of the secret shared message, and a table mapping public keys of participating parties to their codes. For example:

[0099] Transaction hash = On-chain encrypted shared data (shared data ciphertext, all secret shared messages ciphertext, the correspondence between the public key and the code of the sharing party, and the secret shared message ciphertext of the initiator).

[0100] This embodiment proposes another implementation scheme for a blockchain data security sharing method. The implementing entity of this method is the data sharing initiator, such as... Figure 5 As shown, it also includes:

[0101] Step 405: Deploy a smart contract for performing secure data sharing, so that the initiator and / or the participant can invoke the smart contract to complete the corresponding operations on the shared data.

[0102] When this invention is implemented using a smart contract, the above data is used as parameters of the corresponding method function of the smart contract, and the transaction hash is the transaction receipt of this smart contract. It should be understood that this invention can also be implemented using a simple evidence-based transaction method, where all content is the data content of the transaction, and the transaction hash is the transaction receipt of this evidence-based transaction.

[0103] Reference Figure 6 The diagram shown illustrates the steps of a blockchain data security sharing method provided in an embodiment of this specification. The executing entity of this method is the data sharing participant, including:

[0104] Step 601: The participating party obtains the on-chain encrypted shared data and, after calculating the local key using the key exchange algorithm, decrypts the ciphertext of the secret sharing message to obtain the secret sharing message. Specifically, the on-chain encrypted shared data obtained by the participating party is the same as the on-chain encrypted shared data submitted by the initiator, including the shared data ciphertext, all secret sharing message ciphertexts, the correspondence between the public keys and codes of the sharing parties, and the secret sharing message ciphertext of the initiator, etc. Optionally, the input parameters for the participating party to calculate the local key using the key exchange algorithm include at least the initiator's public key, the participating party's public key, and the participating party's private key. For example:

[0105] The local key of the key exchange algorithm, secretShareKey, is generated by the key exchange algorithm (P, G, private key of the participants, public key of the participants, public key of the initiator), where P is the modulus and G is the base, which are public parameters of the algorithm.

[0106] Secretly shared message = symmetric decryption algorithm (secretShares[i], secretShareKey).

[0107] Step 602: The participating party reconstructs the secret-sharing message to obtain the encryption key, and uses the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data. For example:

[0108] The encryption key `secretKey` equals the secret sharing technology (the initiator's secret sharing message and the user's own secret sharing message).

[0109] Shared data plaintext = symmetric decryption algorithm (shared data ciphertext, encryption key secretKey).

[0110] Example 3

[0111] Figure 7 This is a schematic diagram of a blockchain data security sharing device 700 provided as an embodiment of this specification. Please refer to... Figure 7 In one embodiment, a blockchain data security sharing device includes:

[0112] The first module 701 is used to generate a secret sharing message by dividing the encryption key according to the total number of participants after the initiator generates the encryption key, wherein the participants are identified by participant codes.

[0113] The second module 702 is used by the initiator to calculate and obtain a local key using a key exchange algorithm, and to encrypt the secret sharing message using the local key to generate secret sharing message ciphertext.

[0114] The third module 703 is used by the initiator to encrypt the plaintext of shared data according to the encryption key to generate ciphertext of shared data;

[0115] The fourth module 704 is used by the initiator to generate encrypted shared data on the blockchain and submit it to the blockchain to obtain the corresponding transaction hash;

[0116] The fifth module 705 is used for the participating party to obtain the on-chain encrypted shared data, and after calculating the local key using the key exchange algorithm, to decrypt the ciphertext of the secret sharing message to obtain the secret sharing message;

[0117] The sixth module 706 is used by the participating parties to reconstruct the secret sharing message to obtain an encryption key, and to use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0118] This embodiment proposes another implementation scheme for a blockchain data security sharing device, as follows: Figure 8 As shown, it also includes:

[0119] Module 707 is used by the initiator to deploy a smart contract for executing secure data sharing, so that the initiator and / or the participants can call the smart contract to complete the corresponding operations on the shared data.

[0120] It should be understood that the blockchain data security sharing device in the embodiments of this specification can also perform... Figures 1 to 6 The method executed by the blockchain data security sharing device (or equipment), and the implementation of the blockchain data security sharing device (or equipment) in... Figures 1 to 6 The functionality of the example shown will not be elaborated upon here.

[0121] Example 4

[0122] Figure 9 This is a schematic diagram of a blockchain data security sharing device 900 provided as an embodiment of this specification. Please refer to... Figure 9 In one implementation, a blockchain data security sharing device, applied to the initiator, includes:

[0123] The first module 901 is used to generate an encryption key and then divide the encryption key according to the total number of participants to generate a secret sharing message, wherein the participants are identified by participant codes.

[0124] The second module 902 is used to calculate and obtain a local key using a key exchange algorithm, and use the local key to encrypt the secret sharing message to generate secret sharing message ciphertext.

[0125] The third module 903 is used to encrypt the shared data plaintext according to the encryption key to generate the shared data ciphertext;

[0126] The fourth module, 904, is used to generate encrypted shared data on the blockchain and obtain the corresponding transaction hash after submission.

[0127] This embodiment proposes another implementation scheme for a blockchain data security sharing device, as follows: Figure 10 As shown, it also includes:

[0128] The fifth module 905 is used by the initiator to deploy a smart contract for executing secure data sharing, so that the initiator and / or the participants can call the smart contract to complete the corresponding operations on the shared data.

[0129] It should be understood that the blockchain data security sharing device in the embodiments of this specification can also perform... Figures 4 to 5 The method executed by the blockchain data security sharing device (or equipment), and the implementation of the blockchain data security sharing device (or equipment) in... Figures 4 to 5 The functionality of the example shown will not be elaborated upon here.

[0130] Figure 11 This is a schematic diagram of the structure of a blockchain data security sharing device 1100 provided as an embodiment of this specification. Please refer to... Figure 11 In one implementation, a blockchain data security sharing device is applied to participating parties, including:

[0131] The first module 1101 is used to obtain the encrypted shared data on the blockchain, and after calculating the local key using the key exchange algorithm, to decrypt the ciphertext of the secret shared message to obtain the secret shared message.

[0132] The second module 1102 is used to reconstruct the secret sharing message to obtain an encryption key, and to use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0133] It should be understood that the blockchain data security sharing device in the embodiments of this specification can also perform... Figure 11 The method executed by the blockchain data security sharing device (or equipment), and the implementation of the blockchain data security sharing device (or equipment) in... Figure 11 The functionality of the example shown will not be elaborated upon here.

[0134] Example 5

[0135] Figure 12 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 12At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0136] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 12 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0137] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0138] The processor reads the corresponding computer program from non-volatile memory into main memory and then executes it, forming a shared resource access control mechanism at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0139] After the initiator generates the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants. The participants are identified by participant codes.

[0140] The initiator uses a key exchange algorithm to calculate and obtain a local key, and uses the local key to encrypt the secret sharing message to generate secret sharing message ciphertext;

[0141] The initiator encrypts the plaintext shared data using the encryption key to generate ciphertext shared data.

[0142] The initiator generates encrypted shared data on the blockchain and submits it to the blockchain to obtain the corresponding transaction hash.

[0143] After the participating party obtains the on-chain encrypted shared data and calculates the local key using the key exchange algorithm, it decrypts the ciphertext of the secret sharing message to obtain the secret sharing message.

[0144] The participating parties reconstruct the secret sharing message to obtain the encryption key, and use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0145] or,

[0146] Applied to the initiator, including:

[0147] After generating the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants, and the participants are identified by participant codes;

[0148] A local key is calculated using a key exchange algorithm, and the secret sharing message is encrypted using the local key to generate the secret sharing message ciphertext.

[0149] The shared data plaintext is encrypted using the encryption key to generate shared data ciphertext.

[0150] After generating encrypted shared data on the blockchain and submitting it, the corresponding transaction hash is obtained.

[0151] or,

[0152] Applied to participating parties, including:

[0153] After obtaining the encrypted shared data on the blockchain and calculating the local key using the key exchange algorithm, the encrypted secret shared message is decrypted to obtain the secret shared message.

[0154] The encryption key is reconstructed from the secret shared message, and the encryption key is used to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0155] The above is as described in this instruction manual. Figures 1 to 6The blockchain data security sharing method disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this specification. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this specification can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0156] Of course, in addition to the software implementation, the electronic devices in the embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0157] Example 6

[0158] This specification also provides an embodiment of a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figures 1 to 7 The method of the illustrated embodiment is specifically used to perform the following method:

[0159] After the initiator generates the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants. The participants are identified by participant codes.

[0160] The initiator uses a key exchange algorithm to calculate and obtain a local key, and uses the local key to encrypt the secret sharing message to generate secret sharing message ciphertext;

[0161] The initiator encrypts the plaintext shared data using the encryption key to generate ciphertext shared data.

[0162] The initiator generates encrypted shared data on the blockchain and submits it to the blockchain to obtain the corresponding transaction hash.

[0163] The participating party obtains the on-chain encrypted shared data and calculates the local key using the key exchange algorithm, then decrypts the ciphertext of the secret sharing message to obtain the secret sharing message.

[0164] The participating parties reconstruct the secret sharing message to obtain the encryption key, and use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0165] or,

[0166] Applied to the initiator, including:

[0167] After generating the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants, and the participants are identified by participant codes;

[0168] A local key is calculated using a key exchange algorithm, and the secret sharing message is encrypted using the local key to generate the secret sharing message ciphertext.

[0169] The shared data plaintext is encrypted using the encryption key to generate shared data ciphertext.

[0170] After generating encrypted shared data on the blockchain and submitting it, the corresponding transaction hash is obtained.

[0171] or,

[0172] Applied to participating parties, including:

[0173] After obtaining the encrypted shared data on the blockchain and calculating the local key using the key exchange algorithm, the encrypted secret shared message is decrypted to obtain the secret shared message.

[0174] The encryption key is reconstructed from the secret shared message, and the encryption key is used to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

[0175] In summary, the above description is merely a preferred embodiment of this specification and is not intended to limit the scope of protection of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

[0176] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an electronic data carrier device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0177] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0178] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0179] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A method for securely sharing blockchain data, characterized in that, include: After the initiator generates the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants, and the participants are identified by participant codes; The initiator uses a key exchange algorithm to calculate and obtain a local key, and uses the local key to encrypt the secret sharing message to generate secret sharing message ciphertext; The initiator encrypts the plaintext shared data using the encryption key to generate ciphertext shared data. The initiator generates encrypted shared data on the blockchain and submits it to the blockchain to obtain the corresponding transaction hash. The participating party obtains the on-chain encrypted shared data and calculates the local key using the key exchange algorithm, then decrypts the secret sharing message ciphertext to obtain the secret sharing message; wherein, the on-chain encrypted shared data includes shared data ciphertext, all secret sharing message ciphertexts, the correspondence between the public key and the code of the sharing party, and the secret sharing message ciphertext of the initiator; The participating parties reconstruct the secret sharing message to obtain the encryption key, and use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

2. The method according to claim 1, characterized in that, The input parameters of the key exchange algorithm include at least the initiator's private key, the initiator's public key, the participant's public key, the modulus, and the base.

3. The method according to claim 1, characterized in that, The initiator divides the encryption key into the secret sharing message, and / or the participant reconstructs the secret sharing message into the encryption key, using a secret sharing algorithm including the Shamir algorithm.

4. The method according to claim 1, characterized in that, The secret sharing message is encrypted using the local key to generate ciphertext, and / or the shared data plaintext is encrypted using the encryption key to generate ciphertext, using a symmetric encryption algorithm.

5. The method according to claim 1, characterized in that, The input parameters for the local key calculated by the participating party using the key exchange algorithm include at least the initiator's public key, the participating party's public key, and the participating party's private key.

6. The method according to claim 1, characterized in that, The participating parties decrypt the ciphertext of the secret sharing message to obtain the secret sharing message, and / or decrypt the ciphertext of the shared data to obtain the plaintext of the shared data, using a decryption algorithm corresponding to symmetric encryption.

7. The method according to claim 1, characterized in that, It also includes the initiator deploying a smart contract for executing secure data sharing, so that the initiator and / or the participants can invoke the smart contract to complete the corresponding operations on the shared data.

8. A method for securely sharing blockchain data, characterized in that, Applied to the initiator, including: After generating the encryption key, the encryption key is divided into secret sharing messages according to the total number of participants, and the participants are identified by participant codes; A local key is calculated using a key exchange algorithm, and the secret sharing message is encrypted using the local key to generate secret sharing message ciphertext. The shared data plaintext is encrypted using the encryption key to generate shared data ciphertext. After the initiator generates encrypted shared data on the blockchain and submits it to the blockchain, it obtains the corresponding transaction hash. The encrypted shared data on the blockchain includes the shared data ciphertext, all secret shared message ciphertexts, the correspondence between the public key and the code of the sharing party, and the secret shared message ciphertext of the initiator.

9. The method according to claim 8, characterized in that, The input parameters of the key exchange algorithm include at least the initiator's private key, the initiator's public key, the participant's public key, the modulus, and the base.

10. The method according to claim 8, characterized in that, The encryption key is split into secret-sharing messages using a secret-sharing algorithm, including the Shamir algorithm.

11. The method according to claim 8, characterized in that, It also includes the initiator deploying a smart contract for executing secure data sharing, so that the initiator and / or the participants can invoke the smart contract to complete the corresponding operations on the shared data.

12. A method for securely sharing blockchain data, characterized in that, Applied to participating parties, including: After obtaining the on-chain encrypted shared data and calculating the local key using the key exchange algorithm, the secret sharing message ciphertext is decrypted to obtain the secret sharing message. The on-chain encrypted shared data includes the shared data ciphertext, all secret sharing message ciphertexts, the correspondence between the public key and the code of the sharing party, and the secret sharing message ciphertext of the initiator. The encryption key is reconstructed from the secret shared message, and the encryption key is used to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

13. The method according to claim 12, characterized in that, The input parameters of the key exchange algorithm include at least the initiator's private key, the initiator's public key, the participant's public key, the modulus, and the base.

14. The method according to claim 12, characterized in that, The secret-shared message is reconstructed into an encryption key using a secret-shared algorithm, including the Shamir algorithm.

15. The method according to claim 12, characterized in that, The secret sharing message is decrypted to obtain the secret sharing message, and / or the shared data is decrypted to obtain the shared data plaintext, using a decryption algorithm corresponding to symmetric encryption.

16. A blockchain data security sharing device, characterized in that, include: The first module is used to generate a secret sharing message by dividing the encryption key according to the total number of participants after the initiator generates the encryption key. The participants are identified by participant codes. The second module is used by the initiator to calculate and obtain a local key using a key exchange algorithm, and to encrypt the secret sharing message using the local key to generate secret sharing message ciphertext. The third module is used by the initiator to encrypt the plaintext shared data according to the encryption key to generate ciphertext shared data; The fourth module is used to obtain the corresponding transaction hash after the initiator generates on-chain encrypted shared data and submits it to the blockchain. The on-chain encrypted shared data includes shared data ciphertext, all secret shared message ciphertext, the correspondence between the public key and the code of the sharing party, and the secret shared message ciphertext of the initiator. The fifth module is used for the participating party to obtain the on-chain encrypted shared data, and after calculating the local key using the key exchange algorithm, to decrypt the ciphertext of the secret sharing message to obtain the secret sharing message; The sixth module is used by the participating parties to reconstruct the secret sharing message to obtain an encryption key, and to use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

17. The apparatus according to claim 16, characterized in that, It also includes a seventh module, which is used by the initiator to deploy a smart contract for executing secure data sharing, so that the initiator and / or the participants can call the smart contract to complete the corresponding operations on the shared data.

18. A blockchain data security sharing device, characterized in that, Applied to the initiator, including: The first module is used to generate an encryption key and then divide the encryption key into secret sharing messages according to the total number of participants, wherein the participants are identified by participant codes. The second module is used to calculate and obtain a local key using a key exchange algorithm, and to encrypt the secret sharing message using the local key to generate secret sharing message ciphertext. The third module is used to encrypt the shared plaintext data according to the encryption key to generate the shared ciphertext data. The fourth module is used to generate the corresponding transaction hash after the encrypted shared data is submitted to the blockchain. The encrypted shared data includes the shared data ciphertext, all secret shared message ciphertexts, the correspondence between the public key and the code of the sharing party, and the secret shared message ciphertext of the initiator.

19. The apparatus according to claim 18, characterized in that, It also includes a fifth module, which is used by the initiator to deploy a smart contract for executing secure data sharing, so that the initiator and / or the participants can call the smart contract to complete the corresponding operations on the shared data.

20. A blockchain data security sharing device, characterized in that, Applied to participating parties, including: The first module is used to acquire on-chain encrypted shared data, and after calculating the local key using a key exchange algorithm, decrypt the secret sharing message ciphertext to obtain the secret sharing message. The on-chain encrypted shared data includes shared data ciphertext, all secret sharing message ciphertexts, the correspondence between the public key and the code of the sharing party, and the secret sharing message ciphertext of the initiator. The second module is used to reconstruct the secret sharing message to obtain an encryption key, and to use the encryption key to decrypt the ciphertext of the shared data to obtain the plaintext of the shared data.

21. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 1 to 7.

22. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 8 to 11.

23. An electronic device, characterized in that, include: processor; And a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the method of any one of claims 12 to 15.

24. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 1 to 7.

25. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 8 to 11.

26. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the method of any one of claims 12 to 15.