A fair data trading method based on blockchain
By using conversion key and ciphertext group link encryption technology on the blockchain data trading platform, the problem of validity verification of the decryption key is solved, and the fairness and security of data transactions are achieved.
Patent Information
- Application Number
- CN202111462550.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2041-12-02
AI Technical Summary
The existing blockchain-based data trading platform cannot effectively verify the validity of the decryption key, resulting in data buyers being unable to ensure the correctness of the data decrypted through the key, affecting the fairness of the transaction.
Using conversion key and ciphertext group link encryption technology, the secret factor and conversion key are shared twice through blockchain transactions. The data buyer generates a decryption key and performs key validity through the characteristics of ciphertext group link encryption. verify.
It ensures that the data buyer obtains a decryption key that is guaranteed to be valid, the data owner obtains money, and after the transaction is completed, the data buyer can obtain all data, which improves the fairness and security of data transactions.
Smart Images

Figure CN114266658B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of fair data trading, and specifically relates to a fair data trading method based on blockchain. Background Art
[0002] With the advent of the big data era, data resources have experienced explosive growth. With the emergence of new equipment and new technologies, data growth is further accelerating. In order to ensure the normal circulation and use of data and give full play to the value of big data, many scholars have focused on the field of fair data trading in recent years.
[0003] At present, the research on data trading platforms without trusted third parties based on blockchain is a hot topic in the field. Due to the characteristics of blockchain and the complexity of transaction data, the mode of storing encrypted data off-chain and conducting data transactions on-chain is widely adopted. In this mode, the content of the exchange between the two parties changes from data and money to decryption keys and money, which further increases the risk for data buyers. However, the guarantee of fairness in the transaction process involved in existing research only covers the period from the data owner providing the decryption key, and the validity of the decryption key is not verified, that is, it cannot be guaranteed that the data buyer can decrypt the correct data through this key. Therefore, it is necessary to provide a reasonable method to ensure that at the end of the transaction, the data buyer obtains a decryption key that can guarantee validity, and the data owner obtains money. Otherwise, the transaction is considered a failure and both parties suffer no loss. Summary of the invention
[0004] To solve the above problems, the present invention discloses a fair data transaction method based on blockchain, which particularly includes verification of the validity of decryption keys. The method is based on conversion keys and ciphertext group link encryption technology. First, the secret factor and conversion key are shared with the data buyer twice in the form of blockchain transactions, and the data buyer generates a decryption key based on this; then the cloud storage platform randomly selects a ciphertext group and sends it to the data buyer, and uses the characteristics of ciphertext group link encryption to verify the validity of the key. After the transaction is completed, the data buyer can request all the data from the cloud storage platform.
[0005] To achieve the above object, the technical solution of the present invention is as follows:
[0006] A fair data transaction method based on blockchain improves a blind verifiable encryption signature method into a fair key sharing method, and combines it with a ciphertext group link encryption method. Based on the atomicity of transactions on the blockchain, it ensures that the data decryption keys and money of both parties are exchanged at the same time, and provides key validity verification to ensure the fairness of transactions between the two parties. It mainly includes the following steps:
[0007] S1. Initialize the system and generate an additive cyclic group G1, with P as the generator and a large prime number q as the order of G1. Generate a cyclic multiplicative group G2, which has the same order as G1. e: G1×G1→G2 as a bilinear pairing and select a cryptographic hash function Generate a pair of public and private keys for each user who joins the blockchain. For example, A’s public key is y A , the private key is x A , where y A =x A P.
[0008] S2. The data owner pre-processes the data, generates a specific key, and then uses the ciphertext link block encryption algorithm to encrypt the data. The generated n ciphertext groups are uploaded to the cloud storage platform and marked as ID x ;
[0009] S3. The data buyer browses the data information and selects the corresponding data set to initiate a transaction request. A tradable data set in the trading platform will correspond to a set of ciphertext groups in the cloud storage platform;
[0010] S4. The underlying blockchain system runs smart contracts to process transaction requests, executes fair data transaction methods, uses the transaction atomicity of the blockchain to ensure the fairness of information exchange between the two parties, and provides key validity verification for data buyers, ultimately achieving fair data transactions.
[0011] Furthermore, step S2 specifically includes the following steps:
[0012] S21. The data owner calculates a symmetric encryption key, which is generated by the data owner based on the hash value of the data plaintext and a random number, and is used to encrypt the traded data.
[0013]
[0014] Among them, H(m) is the hash value of the data plaintext m, k is a random number, and P is the generator when the system is initialized.
[0015] S22. The data owner groups the plaintext data according to a fixed number of bits and calculates an initialization vector. The input of the ciphertext group chain encryption algorithm is the XOR of the current plaintext group and the previous ciphertext group. Finally, all ciphertext groups are stored in a third-party storage platform.
[0016] Furthermore, in step S4, the data owner and the data buyer enter into an information exchange process, which mainly includes the following steps:
[0017] S41. After receiving the transaction request, the data owner randomly selects a number α and calculates the secret factor s.
[0018] s=e(y A ,y B ) α
[0019] Among them, y A is the public key of the data owner, y B is the public key of the data buyer, and e is the bilinear pair generated in step S1. The data owner publishes the parameter group [αP, sy A ].
[0020] S42. After receiving the above parameter group, the data buyer recovers the secret factor according to his private key and verifies sy A =s′y A , after verification, the correctness of the secret factor is determined.
[0021]
[0022] S43. The data owner generates a conversion key δ based on the secret factor key .
[0023]
[0024] Through the form of transactions, release [δ key ,sH(m),sθ k ]. Among them, θ k =kP, k is the random number used by the data owner to calculate the key.
[0025] S44. The data buyer uses the private key to recover the decryption key;
[0026]
[0027] At this point, the data buyer has obtained the decryption key, but has not obtained valid data and the validity of the key is unknown. The next step is to verify the validity of the key and obtain all the data.
[0028] S45. The data buyer sends the corresponding data set ID to the cloud storage platform x , the cloud storage platform randomly selects a ciphertext group numbered t and sends it to the data buyer. According to the characteristics of the ciphertext group link encryption algorithm, the ciphertext group numbered t-1 and the plaintext group numbered t are XORed to obtain the ciphertext group numbered t. Therefore, after decrypting the ciphertext group numbered t, the XOR value of the ciphertext group numbered t-1 and the plaintext group numbered t is obtained:
[0029]
[0030] S46. The data buyer publishes a blockchain transaction, and the output condition is the XOR value obtained in step S45. When the data owner provides the corresponding XOR value, the transaction is completed. The data buyer sends a transaction completion certificate to the cloud storage platform to obtain all ciphertext groups and the initialization vector for link encryption of the ciphertext groups, and finally decrypts to obtain all plaintext.
[0031] The beneficial effects of the present invention are:
[0032] The blockchain-based fair data transaction method described in the present invention further strengthens the protection of the interests of data buyers and improves the fairness of data transactions between the two parties. The fair data transaction method proposed in the present invention adds a key validity verification mechanism, which can not only ensure that the decryption keys and money of the data are fairly exchanged between the two parties, but also effectively prevent the data owner from maliciously sharing invalid decryption keys to deceive data buyers, thereby enhancing fairness. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 It is a key sharing flow chart of the fair data transaction method involved in the present invention;
[0034] Figure 2 It is a swim-lane diagram of key validity verification of the fair data transaction method involved in the present invention;
[0035] Figure 3 It is a ciphertext group link encryption and decryption model diagram involved in the present invention. DETAILED DESCRIPTION
[0036] The present invention will be further explained below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the following specific embodiments are only used to illustrate the present invention and are not used to limit the scope of the present invention.
[0037] This embodiment provides a fair data transaction method based on blockchain. The process runs in the blockchain system, and an additional key validity verification mechanism is added, which specifically includes the following steps:
[0038] S1. Initialize the system and generate an additive cyclic group G1, with P as the generator and a large prime number q as the order of G1. Generate a cyclic multiplicative group G2, which has the same order as G1. e: G1×G1→G2 as a bilinear pairing and select a cryptographic hash function Generate a pair of public and private keys for each user who joins the blockchain. For example, A’s public key is y A , the private key is x A , where y A =x A P.
[0039] S2. The data owner pre-processes the data, generates a specific key, and then uses the ciphertext link block encryption algorithm to encrypt the data. The generated n ciphertext groups are uploaded to the cloud storage platform and marked as ID x ;
[0040] S3. The data buyer browses the data information and selects the corresponding data set to initiate a transaction request. A tradable data set in the trading platform will correspond to a set of ciphertext groups in the cloud storage platform;
[0041] S4. The underlying blockchain system runs smart contracts to process transaction requests, executes fair data transaction methods, uses the transaction atomicity of the blockchain to ensure the fairness of information exchange between the two parties, and provides key validity verification for data buyers, ultimately achieving fair data transactions.
[0042] When a user joins the platform, the platform generates a public-private key pair for the user, where the public key is fully public and the private key is kept secret. Suppose seller A has a data set about a patient's health records, uploads it to the data trading platform, generates a symmetric key associated with the data plaintext and a random number, and prices the data set at x bitcoins. Figure 1 The trading platform encrypts the data by ciphertext grouping according to the number of grouping bits set by the seller and uploads it to the third-party cloud storage platform. The key is calculated according to the following formula:
[0043]
[0044] Among them, H(m) is the hash value of the data plaintext m, k is a random number, and P is the generator when the system is initialized.
[0045] Buyer B selects the data set of interest and sends a transaction request to the seller, and seller A calculates a secret factor s related to the public keys of both parties.
[0046] s=e(y A ,y B ) α
[0047] Among them, y A is the public key of the data owner, y B is the public key of the data buyer, and e is the bilinear pair generated when the system is initialized. The data owner publishes the parameter group [αP, sy A The characteristic of the above secret factor is that the buyer can recover the secret factor based on his own private key and the seller's public key to verify the sy A =s′y A It can then be used as the input of the blockchain transaction to continue the next transaction.
[0048]
[0049] According to the operational properties of bilinear pairings: for any e(aP, bQ) = e(P, Q) ab Therefore, we can verify that s=s′ by the following calculation process:
[0050]
[0051] Seller A generates the conversion key δ based on the secret factor key The characteristic of this conversion key is that it is publicly shared on the blockchain, but only buyer B can convert it into the real data decryption key through his own private key.
[0052]
[0053] For buyer B, the conversion key δ shared by seller A is obtained at this time. key , and a secret factor s′, and the secret factor s′ is verified to be correct. Based on this, the decryption key key of the data can be recovered.
[0054]
[0055] After the above key sharing process, buyer B obtains the decryption key, but has not yet obtained all the data and the validity of the key is unknown. Figure 2 and Figure 3 Introducing the key validity verification process, buyer B requests the cloud storage platform to obtain the ciphertext group corresponding to the data set. The cloud storage platform randomly selects a ciphertext group numbered t and sends it to the data buyer. According to the characteristics of the ciphertext group link decryption algorithm, the decryption of the ciphertext group numbered t will obtain the value of the XOR operation between the ciphertext group numbered t-1 and the plaintext group numbered t. At this time, if buyer B does not obtain the ciphertext group numbered t-1, it is impossible to obtain the plaintext group numbered t through the XOR operation. At this time, buyer B only obtains the XOR value corresponding to one of the ciphertext groups, and does not obtain valid data, but fairness can still be guaranteed.
[0056]
[0057] In order to further obtain all the data, buyer B will publish a data transaction on the blockchain. The output condition of the transaction is the XOR value obtained in the previous step. This transaction contains the value of all the data x bitcoins. When seller A provides the same XOR value, the transaction is completed, seller A obtains the profit and buyer B obtains the confirmed valid decryption key. Then buyer B sends the transaction completion certificate to the cloud storage platform to obtain all ciphertext groups and the initialization vector when performing ciphertext group link encryption, and finally decrypts to obtain all the plaintext.
[0058] It should be noted that the above content only illustrates the technical idea of the present invention and cannot be used to limit the protection scope of the present invention. For ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications all fall within the protection scope of the claims of the present invention.
Claims
1. A fair data transaction method based on blockchain, characterized by: The transaction parties use a fair key sharing method in the blockchain system to conduct fair transactions of data decryption keys and money. The method is based on conversion keys and ciphertext block chaining encryption technology. The secret factor and conversion key are shared with the data buyer twice in the form of blockchain transactions. The data buyer generates a decryption key based on this. Then the cloud storage platform randomly selects a ciphertext block and sends it to the data buyer. The key validity is verified using the characteristics of ciphertext block chaining encryption. After the transaction is completed, the data buyer can request all the data from the cloud storage platform. Key validity verification includes the following steps: S1. Initialize the system and generate an additive cyclic group G1, with P as the generator and a large prime number q as the order of G1; generate a cyclic multiplicative group G2, with G2 and G1 having the same order; e: G1×G1→G2 as a bilinear pairing and select a cryptographic hash function Generate a pair of public and private keys for each user who joins the blockchain. For example, A’s public key is y A , the private key is x A , where y A =x A P; S2. The data owner pre-processes the data, generates a specific key, and then uses the ciphertext link block encryption algorithm to encrypt the data. The generated n ciphertext groups are uploaded to the cloud storage platform and marked as ID x ; S3. The data buyer browses the data information and selects the corresponding data set to initiate a transaction request. A tradable data set in the trading platform corresponds to a set of ciphertext groups in the cloud storage platform. S4. The underlying blockchain system runs smart contracts to process transaction requests, executes fair data transaction methods, uses the transaction atomicity of the blockchain to ensure the fairness of information exchange between the two parties, and provides key validity verification for data buyers, ultimately achieving fair data transactions.
2. The fair data transaction method based on blockchain as claimed in claim 1, characterized in that: Step S2 specifically includes the following steps: S21. The data owner calculates a symmetric encryption key, which is generated by the data owner based on the hash value of the data plaintext and a random number, and is used to encrypt the traded data; Among them, H(m) is the hash value of the data plaintext m, k is a random number, and P is the generator when the system is initialized; S22. The data owner groups the plaintext data according to a fixed number of bits and calculates an initialization vector. The input of the ciphertext group chain encryption algorithm is the XOR of the current plaintext group and the previous ciphertext group. Finally, all ciphertext groups are stored in a third-party storage platform.
3. The fair data transaction method based on blockchain as claimed in claim 1, characterized in that: In step S4, the data owner and the data buyer enter into an information exchange process, which mainly includes the following steps: S41. After receiving the transaction request, the data owner randomly selects a number α and calculates the secret factor s; if(and A ,and B ) α Among them, y A is the public key of the data owner, y B is the public key of the data buyer, e is the bilinear pairing generated in step S1; the data owner publishes the parameter group [αP, sy A ]; S42. After receiving the above parameter group, the data buyer recovers the secret factor according to his private key and verifies sy A Is it equal to s′y A , if they are equal, it means the recovered secret factor is correct; S43. The data owner generates a conversion key δ based on the secret factor key ; Through the form of transactions, release [δ key ,sH(m),sθ k ]; where θ k = kP, k is the random number used by the data owner to calculate the key; S44. The data buyer uses the private key to recover the decryption key; S45. The data buyer sends the corresponding data set ID to the cloud storage platform x , the cloud storage platform randomly selects a ciphertext group numbered t and sends it to the data buyer; according to the characteristics of the ciphertext group link encryption algorithm, the ciphertext group numbered t-1 and the plaintext group numbered t are XORed to obtain the ciphertext group numbered t; therefore, after decrypting the ciphertext group numbered t, the XOR value of the ciphertext group numbered t-1 and the plaintext group numbered t is obtained: S46. The data buyer publishes a blockchain transaction, and the output condition is the XOR value obtained in step S45. When the data owner provides the corresponding XOR value, the transaction is completed. At this time, the data buyer obtains a valid data decryption key and the data owner obtains the profit simultaneously; finally, the data buyer sends a transaction completion certificate to the cloud storage platform to obtain all ciphertext groups and the initialization vector for link encryption of the ciphertext groups, and finally decrypts to obtain all plaintext.
Citation Information
Patent Citations
Decentralized data access right transaction method and system
CN109889504A
Fair data transaction method and system based on block chain
CN111681002A