Next Article in Journal
Model to Optimize the Management of Strategic Projects Using Genetic Algorithms in a Public Organization
Previous Article in Journal
Deep-Learning Image Stabilization for Adaptive Optics Ophthalmoscopy
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research on Data Transaction Security Based on Blockchain

School of Computer and Communication, Lanzhou University of Technology, Lanzhou 730050, China
*
Author to whom correspondence should be addressed.
Information 2022, 13(11), 532; https://doi.org/10.3390/info13110532
Submission received: 16 September 2022 / Revised: 7 November 2022 / Accepted: 7 November 2022 / Published: 8 November 2022

Abstract

:
With the increasing value of various kinds of data in the era of big data, the demand of different subjects for data transactions has become more and more urgent. In this paper, a blockchain-based data transaction protection scheme is proposed to realize the secure transaction sharing among data. This paper carries out the following work: by analyzing the existing data transaction models, we find the data security and transaction protection problems, establish a third-party-free data transaction platform using blockchain, protect users’ data security by combining AES and improved homomorphic encryption technology, and upload the encrypted data to the Interplanetary File System (IPFS) for distributed storage. Finally, we use the powerful functions of the IPFS, combined with inadvertent transmission protocol, two-way authentication, zero-knowledge proof, and other security verification for data transactions. The security analysis proves that this scheme has higher security despite the time overhead, and we will continue to optimize the scheme to improve efficiency in the future.

1. Introduction

In recent years, with the deepening popularity of the Internet and the continuous development of informatization, the importance of data to individuals, enterprises, and countries has become increasingly prominent. For individuals and enterprises, data are a valuable asset; for countries, data are a fundamental strategic resource, and the combination of data and blockchain is the focus of current research [1]. Whether data have an increasingly important impact in personal life, enterprise production, or national and social governance, the flow of data transactions is about the overall situation of the data element market cultivation, but its overall system is lacking. The transfer and sharing of data control between two or more parties and the circulation of data transactions are mainly reflected in “data sharing” and “data reuse”. The empirical studies of various countries show that data transaction circulation faces three major dilemmas: technology, standards, and law [2]. As an important means of data circulation [3], data trading satisfies the needs of data consumers and allows data owners to gain economic benefits from it. At the same time, data trading promotes the open sharing and resource integration of data, which makes data play an important role in social governance, scientific research, commodity research and development marketing, and public life and entertainment [4]. However, data have their own special characteristics, and data contain information related to individuals such as life and work, which may bring distress to individuals once the traded data are illegally stolen, leaked, and linked to the real identity of individuals. In recent years, blockchain transaction security problems have emerged [5], and there are two main reasons for this phenomenon: (1) the existing trading platform does not pay attention to the protection of user data and relies on the central trading platform; the reliability and security of the central platform itself is very important, and once the platform is maliciously attacked, it may interrupt the service and leak user data, thus causing losses to users; (2) there is a possibility that data are retained and deposited on the trading center platform during the data trading process, and the trading center does not ensure that users have control over the access to their personal data.
Aiming at the existing security and fairness problems such as data transaction and data protection, many scholars have developed various schemes to better protect the interests of users.
Soubhagya et al. [6] studied how to use blockchain for secure healthcare data transactions. Their scheme exploited the decentralized and immutable record-keeping properties of blockchain technology to potentially improve the scalability, security, and privacy of healthcare data. Using the power of blockchain technology, a novel smart contract-based framework called electronic medical record infrastructure (EMRI) was proposed for the privacy protection of proprietary information and to enable scalable and secure communication. Guo et al. [7] proposed a transactional model based on an IoT data blockchain using zero-knowledge proofs and proxy re-encryption, addressing the issues of privacy challenges and the inability to achieve key leakage and the risk of flexible data sharing using asymmetric encryption for data sharing on blockchain. Ren et al. [8] proposed an efficient, provable, fair document exchange protocol with transactional privacy that allowed untrusted buyers and sellers to exchange files fairly. None of the above research solutions had an effective data validation method to ensure the rights of data consumers, and this proposal uses inadvertent transmission to validate data and protect the legal rights of data consumers.
Segura et al. [9] proposed a fair data transaction protocol based on the Bitcoin scripting language, where they used inadvertent transmission to verify data and use an elliptic curve digital signature vulnerability to exchange private keys. The scheme could further reduce the encryption and decryption overhead if it first encrypted the digital content using a symmetric encryption algorithm. Kiyomoto et al. [10] presented the design of a fair-trade protocol for anonymous data sets between data agents and data analysts. The scheme used a combination of public key encryption and hash functions to ensure data confidentiality and tamper evidence. Wang et al. [11] proposed a new peer-to-peer (P2P)-based digital rights management scheme to protect valuable digital content. The scheme used P2P technology to reduce the storage overhead of servers, combined symmetric encryption and public key encryption to ensure the confidentiality of digital content, and used bitcoin transaction scripts to ensure the fair transmission of encryption keys. Zhao et al. [12] proposed a new blockchain-based fair data transaction protocol. They used inadvertent transmission and similarity learning to verify data, ring signatures and two-factor authentication to guarantee user privacy, and Ethereum smart contracts to exchange cryptographic keys. When a transaction went wrong, they used arbitration to ensure fairness for both parties. In addition to the above studies, Missier et al. [13] studied the value of real data through data transactions. Alrawahi et al. [14], Lin et al. [15], and Cattelan et al. [16] studied data transactions through a platform, designing e-commerce type protocols, etc. Perear et al. [17] and Lin et al. [18] studied how to encourage digital content transactions. Huang et al. [19] and Fan et al. [20] studied the fair exchange of digital content. Qian et al. [21] studied the use of offline semitrusted third parties and interactive verification signatures to secure data transactions. The above studies do not verify the legitimacy of the data quantity of the transaction, which makes it difficult to guarantee the rights of the data owner; our scheme uses zero-knowledge proof for the verification of the transaction amount to guarantee the legitimate rights of both parties of the transaction.
In this paper, the transaction process of personal data should meet the following security requirements: to ensure data security, to ensure that individuals control the access rights of their data, data plaintext cannot be viewed and obtained by irrelevant parties; participants cannot expose their transaction amount in the system, and the transaction validity can be verified through intelligent matching. Based on the above analysis, it can be seen that trading personal data through the existing trading platforms cannot meet the requirements of data security and privacy protection for personal data trading.
It can be seen that there are still many security risks in the current data trading platforms. In order to solve the above security problems, we established a secure trading platform through the blockchain.
The main research work of this paper is as follows:
(1) Based on the research and analysis of existing data encryption storage security mechanisms and data access rights control management schemes, a new data protection scheme is proposed by combining AES symmetric encryption, improved homomorphic encryption, and blockchain technology. This scheme first uses symmetric encryption to encrypt long data, and then uses improved homomorphic encryption to encrypt the symmetric key, and the encrypted data ciphertext is uploaded to the IPFS’s distributed system for storage, so as to solve the problem of data storage on untrusted third-party platforms and security storage issues.
(2) We propose a data transaction scheme that does not require third-party participation. In order to prevent malicious users from stealing data and to prevent user identity information from being stolen by illegal users, a two-way identity between data consumers and data owners is used in data transactions. The authentication scheme can effectively prevent illegal users from stealing users’ personal identity information; data consumers and data owners use inadvertent transmission to verify whether the data meet their needs during transaction verification and verify the legitimacy of the transaction amount through a zero-knowledge proof.
(3) The feasibility of the scheme is verified through a security analysis, performance analysis, and efficiency analysis. The analysis shows that the scheme in this paper can realize data transactions between users safely under the premise of ensuring data privacy, which is more secure and reliable than similar schemes. The scheme in this paper has the characteristics of feasibility, safety, and effectiveness.

2. Materials and Methods

2.1. Methods

2.1.1. Oblivious Transfer

Oblivious transmission is a communication protocol that can protect the privacy of both parties. It causes the receiver to receive messages from the sender in a random manner. The sender knows that the receiver accepts some messages but does not know which messages the receiver accepts.
At present, the most widely used oblivious transfer protocol is the 2 takes 1 transfer, whose specific process is as follows:
  • User A generates two messages m 0 and m 1 ;
  • User B selects one digit and enters c 0 , 1 ;
  • User A interacts with user B. User A enters messages m 0 and m 1 , user B enters c , and the program returns m c to user B.
In this process, user A only knows that user B received one of the two messages but does not know what message user B received, and user B only knows what message they received but does not know what the other message is.
We applied this technique to the data validation process in our data trading scheme, where the data consumer randomly validates a part of the data to see if the data owner has mixed invalid data into the data they provide. At the same time, the data owner only needs to disclose a small part of the data, without worrying about revealing more information related to the plaintext of the data.

2.1.2. Homomorphic Encryption Algorithm

Homomorphic encryption allows the server to encrypt the data without knowing the original plaintext; it allows the server to perform specific mathematical operations on the encrypted data and the decryption result is consistent with the corresponding plaintext operation result, thus protecting the data [22]. The basic process of data encryption and decryption is shown in Figure 1.
In an encryption system, if the encryption algorithm is C K , the decryption algorithm is D K , and the plaintext is n and m, then the homomorphic encryption satisfies the following properties
D K C K n C K m = n m  
D K C K n + C K m = n + m  
The first attribute of the above encryption method is multiplicative homomorphic encryption, and the second attribute is additive homomorphic encryption. If both attributes are satisfied, the encryption algorithm becomes fully homomorphic encryption [23].

2.1.3. Elliptic Curve Encryption

An elliptic curve is not an ellipse; it is called elliptic curve encryption because its curve equation is similar to the equation used to calculate the circumference of an ellipse. A general elliptic curve refers to the elliptic curve determined by Weierstrass’s equation, as follows:
y 2 + a x y + b y = x 3 + c x 2 + d x + e
It is the set of all the solutions x , y plus an infinite point O . The security of an elliptic curve encryption algorithm is based on the difficulty of solving the discrete logarithm of its elliptic curve (ECDLP) [24]. Let E be a curve and G and Q two points on the curve, where x is the discrete logarithm problem of the elliptic curve [25].
The point-plus geometric representation is shown in Figure 2.
Let the base fields F , x , y belong to F and satisfy the following:
y 2 + a x y + b y = x 3 + c x 2 + d x + e
which is transformed into the following form by coordinate transformation
E : y 2 = x 3 + a x + b
where a , b , x , y belong to the finite field F p , where p is a large prime number greater than 3. Suppose P x 1 , y 1 ,     Q x 2 , y 2 are two points on the curve and Δ = y 1 y 2 / x 1 x 2 is the slope of line L that connects them. L intersects the elliptic curve exactly at another point R x 3 , y 3 , so R is the negative element of the sum of Q and P , which is P + Q = R . Among them,
x 3 = Δ 2 x 1 x 2
y 3 = x 1 + Δ x 1 x 3  

2.1.4. Zero-Knowledge Proof Techniques

Zero-knowledge proof is mainly used to prove the range of encrypted data. The proposed scheme only uses interval proof [26] to ensure that the transaction amount is greater than 0.
Proof: 
Let t , l , s be three safe parameters, n be a large composite number unknown to factorization, g be a large order element in Z n , and h be an element in the cyclic group generated by g .
Let E = E x , r = g x h r be an FO promise that guarantees x a , b , where r is a random number selected from 2 s n + 1 , · · · , 2 s n 1 . The prover P makes the verifier V confident of x a , b without knowing the value of x by the following step of FO commitment.
The protocol P K { x , r : E = g x h r m o d n x a , b } is defined as follows:
Step. 1
Make
y = x a
Step. 2
Set P to
u = α 2 y + ω > 2 t + l + s + T α 0 , ω 0 , 2 s + T
and randomly select r 1 , r 2 , r 3 2 s n + 1 , · · · , 2 s n 1 so that r 3 r α 2 + r 1 α + r 2 2 s n + 1 , 2 s n 1 .
Calculate
E 1 = g x a h r = g y h r m o d n ,  
  E 2 = E 1 α h r 1 m o d n ,
  E 3 = E 2 α h r 2 m o d n ,  
F = g ω h r 3 m o d n ,  
U = g u / E 3 = g ω h r α 2 r 1 α r 2   m o d n
and P   sends u , E 2 , E 3 , F to V .
Step. 3
V calculation:
E 1 = E x , r / g a = g y h r m o d n ,  
U = g u / E 3 = g ω h r α 2 r 1 α r 2 m o d n .  
Step. 4
Calculate P and V separately
  P K 1 α , r 1 , r 2 : E 2 = E 1 α h r 1 m o d n E 3 = E 2 α h r 2 m o d n ,  
  P K 2 ω , r r α 2 r 1 α r 2 : F = g ω h r 3 m o d n U = g ω h r r α 2 r 1 α r 2 m o d n ,  
  P K 3 { ω , r 3 : F = g ω h r 3 m o d n ω 2 t + l + s + T , 2 t + l + s + T .
Step. 5
V checks the correctness of P K i i = 1 , 2 , 3 and u > 2 t + l + s + T to trust x > a .
Similarly, set
y = b x
and repeat steps 2 through 5 to prove x < b . □

2.2. Solution Model

Based on the decentralized characteristics of the blockchain system, this paper designs a decentralized and verifiable data trading scheme based on a blockchain. This scheme uses a distributed system, and users do not need any third party to participate in the process of data transaction, so as to ensure the authenticity of the data and the fairness of the transaction. Users obtain their own public and private key pairs through the decentralized key management scheme proposed by Yao et al. [27], verify the data according to the idea of inadvertent transmission to ensure the authenticity of the data, and use smart contracts to trade keys that decrypt the data to ensure fair trading. The data transaction model is shown in Figure 3.
This solution model includes five entities: data owner, data consumer, blockchain, cloud storage platform (IPFS), and smart contract.
Data owner: The data owner is the person who owns the data and hopes to make a profit by selling data; they need to sell the data encryption, signature and hash operation, and the data, store the path information such as the registration on the blockchain for the convenience of consumers to find data, and store the data ciphertext on the IPFS’s distributed file system.
Data consumer: The data consumer selects the data to be purchased by searching the data summary on the blockchain, then verifies the data through the oblivious transmission protocol, and finally verifies the transaction funds on the smart contract. After the verification is completed, the user’s private key is obtained through the smart contract and the data are decrypted.
IPFS: the IPFS is responsible for storing the ciphertext of the encrypted data.
Blockchain: the blockchain is responsible for storing the hash digest, data storage path and data transaction records, while it is convenient for data traceability.
Smart contract: it verifies the legitimacy of the transaction amount and the key of the transaction data through zero-knowledge proof.
Our solution consists of four phases: user registration, processing, validation, and transaction data. The timing diagram of the trading scheme is shown in Figure 4.
User registration stage: users register their identity on the blockchain according to their own requirements, and then obtain their public and private key pairs according to the decentralized key management scheme, as shown in Figure 4, step (1) to step (3).
Data processing phase: The data owner encrypts the data, computes the hash of the plaintext and symmetric key, generates a summary of the data, and signs the summary. Then, the data ciphertext, plaintext, and the hash value of the symmetric key are signed and stored on the IPFS’s distributed file system. The data summary and the signature of the summary are recorded on the blockchain. This is shown in Figure 4, step (4) to step (6).
Data verification stage: data consumers check the data summary on the blockchain, search for the data they need, find the data they need, verify the signature of the data owner of the data, verify the signature by inadvertently transferring the data, and then call the smart contract for the data transaction, as shown in Figure 4, step (7) to step (9).
Trading data phase: The smart contract validates the data in the consumer’s account for the legitimate amount, after verification is passed, the account amount is frozen and sending the private key of the encrypted data to the consumer, unlocks the data for consumers to get the unencrypted data, after the verification data passed, changes the balance in the accounts of the owners and consumers, and finally saves the transaction records in the chain of blocks. This is shown in Figure 4, step (10) to step (14).

2.3. Program Overview

The four stages of this scheme are described as follows:

2.3.1. Initialization Phase

  • Users register as data owners or data consumers on the blockchain according to their own needs;
  • The data owner obtains their own public and private key pair according to the decentralized key management scheme;
  • If the user needs to purchase data, they find the data they need through the data digest on the blockchain;
  • If the user needs to sell the data, the data are encrypted, hashed, and signed, the data ciphertext and signature are uploaded to the IPFS distributed file system, and the data summary is recorded on the blockchain.

2.3.2. Data Encryption Phase

After the data owner registers their identity on the blockchain, they encrypt the data they sell. They first use the symmetric encryption algorithm to encrypt the data, and then use the asymmetric encryption algorithm to encrypt the symmetric key to ensure the confidentiality of the data. They calculate the hash of the plaintext fragment and the symmetric key and record it on the blockchain to ensure that the data have not been tampered with. They sign the summary and register it as the source of the guaranteed data on the blockchain.
The detailed steps for the data encryption are as follows:
Step. 1
The data owner divides the data D that needs to be sold into n equal parts: d i i 1 , , n ;
Step. 2
The data owner uses the AES encryption algorithm to generate n symmetric keys m i and uses these symmetric keys to encrypt the split file:
C i = E n c m i , d i
Step. 3
The data owner uses a collision-resistant hash function to hash the plaintext and symmetric key:
h d i = H d i
  h m i = H m i ;  
Step. 4
The data owner encrypts symmetric key m i using an improved homomorphic encryption algorithm as follows:
(1)
The data owner locally generates an elliptic curve E and a random base point G on the curve, and at the same time chooses different private keys k 1 , k 2 , , k n to generate a public-key-encrypted plaintext to enhance the security of the whole plaintext;
(2)
The data owner multiplies the base point G with the private key k 1 , k 2 , , k n to generate the public key Q 1 , Q 2 , , Q n , where Q i = G k i ; the client saves the private key k 1 , k 2 , , k n to local storage;
(3)
In order to encrypt the symmetric key m 1 , m 2 , , m n , the data owner should embed the symmetric key into the selected elliptic curve E to obtain the symmetric key text point P m 1 , P m 2 , , P m n ;
(4)
The data owner randomly generates an integer r 1 , r 2 , , r n , where the random number r < n and n are the order of the base point G . Then, the public key Q 1 , Q 2 , , Q n , the random number Q 1 , Q 2 , , Q n , and the base point G are used to encrypt the plaintext point P m 1 , P m 2 , , P m n
S 1 i = r i G  
  S 1 i = S 3 i P m i
  S 3 i = r i Q i
The encrypted symmetric key ciphertext is: S 1 ( S 1 1 , S 2 1 )… S n ( S 1 n , S 2 n );
(5)
The local client of the data owner sends ciphertext C 1 , C 2 , · · · , C n and symmetric key ciphertext S 1 , S 2 , · · · , S n to the IPFS’s distributed file system for storage.

2.3.3. Transaction Verification Phase

This stage is the core part of the transaction, which realizes the verification of the identity’s legitimacy, data authenticity, and amount of legitimacy of both parties through a three-step verification. If all three steps are passed, the data transaction is carried out. The specific steps are as follows:
Step. 1
Identity account verification
The data consumer initiates a transaction request to the data owner, and the two transactions first carry out identity authentication. The data consumer generates its own public and private key pair P K a , S K a = F p s y I D , P K b by using the public and private key pair P K b , S K b of the data owner and the private password of its own account p s y I D . The specific verification steps are as follows:
(1)
The data consumer submits an authentication request for an identity account to the data owner.
(2)
The data owner asks the data consumer to prove the account they own: the data owner looks for the corresponding P K a , uses it to encrypt a random number r 1 :   S 1 = E n c o d e ( r 1 | P K a ) , and then returns S 1 and their P K b to the data consumer.
(3)
The data consumer proves they have an account:
  • The data consumer uses F p s y I D , P K b to generate P K a , S K a and then decrypts r ˜ 1 = D e c o d e ( S 1 | S K a ) ;
  • The data consumer gets r ˜ 1 , picks another random number r 2 , encrypts r ˜ 1 and r 2 :   S 2 = E n c o d e ( r ˜ 1 | P K b ) using the data owner’s public key P K b , and returns S 2 and S 3 to the data owner.
(4)
The data owner authenticates the account identity of the data consumer and proves that they own the data:
  • The data owner decrypts r ˜ 1 = D e c o d e ( S 2 | S K b ) , and if r ˜ 1 is equal to r 1 , the identity authentication of the data consumer is passed;
  • The data owner decrypts r 2 = D e c o d e ( S 3 | S K b ) and then uses r 2 as a factor of symmetric encryption C to transmit the following normal communication content to the data consumer encryption n: N = C r 2 n .
(5)
The data consumer authenticates the identity of the data owner:
The data consumer uses r 2 as the factor of symmetric encryption C to decrypt N: n = C r 2 1 N , if n is the content with normal semantics, then the other party has P K b corresponding to S K b .
The data consumer continues communication with the data owner using r 2 as a factor of symmetric encryption C.
After the authentication is completed, the data consumer encrypted the signature of the transaction information and sent it to the data owner, who decrypts and verifies the transaction information and sends his account address and signature to the data consumer with the data consumer’s public key, who decrypts and verifies the received information. After confirming the correctness, they proceed to the next Step.
Step. 2
Transaction data verification
After finding the data they need from the blockchain, the data consumer sends a verification request to the data owner, and then transfers the verification data to the data owner inadvertently. The specific steps are as follows:
(1)
The data owner and the data consumer generate t random numbers x o 1 , x o 2 , · · · x o t and x p 1 , x p 2 , · · · x p t , respectively, and compute the hash h o i = H x o i , h p i = H x p i , of these random numbers;
(2)
The data owner and the data consumer exchange the hashes h o i and h p i of the random numbers, and then exchange the generated random numbers x o 1 , x o 2 , · · · x o t and x p 1 , x p 2 , · · · x p t to determine that the sequence number of the data to be verified is x x i = x o i + x p i m o d n , where n is the fraction of the data segmentation;
(3)
The data owner combines the symmetric key k x x i corresponding to the sequence number of the verification data with the random number r x x i used to encrypt the symmetric key using the homomorphic encryption algorithm, and sends it to the data consumer after encryption with the public key of the data consumer (dc):
d c = E n c e c c ( p k e c c , k x x 1 k x x 2 k x x t r x x 1 | r x x 2 | r x x t )  
(4)
After using its private key dc, the data consumer uses its symmetric key to decrypt the downloaded ciphertext to obtain the plaintext m x x j :
m x x j = D e c k x x j , c x x j j 1 , 2 , , t
(5)
The data consumer checks whether the plaintext after decryption is consistent with the data summary, uses the obtained random number r x x i to encrypt the symmetric key again with the homomorphic encryption algorithm, checks whether the ciphertext is consistent, and calculates the hash of the plaintext and symmetric key to check whether they are consistent.
Step. 3
Transaction amount verification
The smart contract verifies the validity of the transaction amount, and the transaction amount is protected by Paillier’s homomorphic encryption. To verify whether the transaction amount is greater than 0 and whether the balance of the data consumer’s account is greater than the transaction amount, the specific steps are as follows:
The data consumer uses the interval proof in the zero-knowledge proof to prove to the smart contract that the transaction amount is e > 0 , that is, set
y = x a
to
y = e 0
(1)
The data consumer sets
u = α 2 y + ω > 2 t + l + s + T α 0 , ω 0 , 2 s + T ,
randomly selects r 1 , r 2 , r 3 2 s n + 1 , · · · , 2 s n 1 , makes r 3 r α 2 + r 1 α + r 2 2 s n + 1 , 2 s n 1 , calculates
  E 1 = g e a h r = g y h r m o d n ,
E 2 = E 1 α h r 1 m o d n ,
  E 3 = E 2 α h r 2 m o d n , F = g ω h r 3 m o d n ,
U = g u / E 3 = g ω h r α 2 r 1 α r 2 m o d n
and then the data consumer sends u , E 2 , E 3 , F to the smart contract;
(2)
The smart contract computes:
E 1 = E e , r / g a = g y h r m o d n ,
U = g u / E 3 = g ω h r α 2 r 1 α r 2 m o d n ;
(3)
The data consumer and smart contract’s keys are calculated separately
P K 1 α , r 1 , r 2 : E 2 = E 1 α h r 1 m o d n E 3 = E 2 α h r 2 m o d n ,  
P K 2 ω , r r α 2 r 1 α r 2 : F = g ω h r 3 m o d n U = g ω h r r α 2 r 1 α r 2 m o d n ,
P K 3 { ω , r 3 : F = g ω h r 3 m o d n ω 2 t + l + s + T , 2 t + l + s + T ;  
(4)
The smart contract checks the correctness of P K i i = 1 , 2 , 3 and u > 2 t + l + s + T to believe x > a , which is e > 0 . If the verification is successful, it proves that the transaction amount is greater than 0.
Verifying whether the account balance of the data consumer is greater than the transaction amount can be translated into whether the account balance of the data consumer is greater than 0 after the transaction. Therefore, it can be proved that the account balance of the data consumer is greater than 0 after the transaction according to the above four steps.
If both of the two interval proofs pass, the next step is to verify the legitimacy of the transaction amount.
The correctness of the transaction amount is verified by the addition homomorphic property of Paillier. It consists in verifying whether the transaction amount of the data consumer plus the account balance after the transaction is equal to the current account balance and whether the current account balance of the data owner in the transaction plus the transaction amount is equal to the account balance after the transaction is completed, that is, whether the following formula is valid:
E n c p S U M p r e s e n t A = E n c p S U M A + E n c p m ,
E n c p S U M B = E n c p S U M p r e s e n t B + E n c p m .
If the above verification is successful, the transaction verification is successful, the smart contract verifies the legitimacy of the transaction, and the next step of data trading is carried out. On the other hand, if the verification fails, the smart contract returns the verification failure to the data consumer and terminates the transaction.
Step. 4
Data decryption phase
The data consumer decrypts the symmetric key using the private key k 1 , k 2 , , k n of the smart contract transaction
i = 1 n k i i = 1 n S 1 i = k 1 k 2 · · · k n S 1 1 S 1 2 = k 1 k 2 · · · k n r 1 r 2 · · · r n G = i = 1 n r i i = 1 n Q i = i = 1 n S 3 i
i = 1 n S 2 i i = 1 n S 3 i 1 = S 3 1 P m 1 S 3 i P m 2 · · · S 3 i P m n S 3 1 1 S 3 2 1 · · · S 3 n 1 = P m 1 P m 2 · · · P m n = i = 1 n P m i
Since the ciphertext decrypted by the data consumer is the product of point i = 1 n P m i embedded in the elliptic curve, the point is finally decoded into symmetric key m 1 , m 2 , , m n . After obtaining the symmetric key, the data ciphertext obtained from the IPFS is decrypted to obtain the required data plaintext.
The data consumer checks whether the decrypted plaintext matches the data summary. If it does, the transaction is written to the blockchain through a smart contract and the account balance of the data consumer and the data owner is updated to E n c p S U M A and E n c p S U M A , respectively. Otherwise, a smart contract is used to terminate the transaction. Figure 5 shows the smart contract:

3. Results and Discussion

In this scheme, a secondary encryption was used to protect the data. Since the transaction data were long data, and the key length generated by symmetric encryption was short, we first used symmetric encryption for the encryption, and then carried out a secondary encryption on the symmetric key and used homomorphic encryption improved with ECC to encrypt the key. Three steps were used to verify the legitimacy of the data transaction. If any step failed to pass the verification, the transaction was considered illegal and the transaction was immediately stopped. The first step was to verify the identity and confirm that both parties were legitimate users through a two-way verification. The second step was to verify the data by using the idea of inadvertent transmission. The third step verification was the verification of the transaction amount, where the noninteractive zero-knowledge proof was used to verify whether the account balance provided by the user after the transaction was legitimate. In this section, the security, privacy, and efficiency of the proposed scheme are analyzed, and the security and privacy of the proposed scheme are demonstrated.

3.1. Security Analysis

In this scheme, data encryption was designed based on AES symmetric encryption and improved homomorphic encryption. The homomorphic encryption was combined with an elliptic curve. The security of the elliptic curve encryption algorithm was based on the difficulty of solving the ECDLP.
1.
Public-key substitution attack
When the attacker is the data owner and falsifies the data to conduct transactions with other data consumers, in the first step of the transaction verification, if the data owner does not provide the identity information of the data consumers to conduct transactions, the verification in the first step will not pass. Because it can provide identity information, the initial verification can pass, but because the data are forged, it cannot pass the transaction data verification in step 2, so the security of the user account cannot be threatened. Therefore, the scheme can resist a public-key substitution attack.
2.
Tampering attack
The transaction amount in this scheme is the homomorphic encrypted amount, and the transaction is completed through the smart contract, so it is not feasible if one of the two parties tries to tamper with the transaction amount. Secondly, if the transaction amount is successfully tampered with, the transaction amount verification of the smart contract also verifies the legitimacy of the transaction amount, and if the transaction amount is illegally tampered with, it cannot pass the third step of the transaction amount’s legitimacy verification, so this scheme can resist tampering attacks.
3.
Safety strength
The security of ECC depends on the solution of discrete logarithms on the group of elliptic curves, and the difficulty of solving discrete logarithms of elliptic curves is much greater than the difficulty of decomposing large prime numbers, so the homomorphic encryption based on elliptic curve encryption technology has a higher security compared with RSA homomorphic encryption. For example, for curve y 2 = x 3 + x + 1 , when the finite field is given a prime number p = 11, its scattering point distribution is shown in Figure 6; there are as many as 14 scattering points including infinity points. When the finite field is given a prime number p = 23, its scattering point distribution is shown in Figure 7; there are as many as 28 scattering points including infinity points, presenting a strong disorder and dispersion. The number of scattered points in the actual project is in the hundreds, so our proposed encryption algorithm is sufficient to ensure the effectiveness of the encryption algorithm for a practical application and can better ensure the security of data transactions.

3.2. Performance Analysis

Compared with general encryption methods, using homomorphic encryption can operate directly on the ciphertext, which means that data security and data privacy are ensured and the ciphertext transmission rate is increased. Since the key size and system parameters of elliptic curve encryption technology are much smaller compared to RSA and DSA, the storage space occupied by ECC is much smaller. As can be seen from Table 1, the security strength of the elliptic curve cryptography algorithm with a 160-bit key is equivalent to the security strength of the RSA and DSA algorithms with a 1024-bit key, which effectively solves the problem of difficult engineering implementation caused by increasing the key length to improve the security strength. The use of different private keys k for plaintext encryption makes the security of the method greatly improved on the basis of the security of elliptic curve cryptography. Therefore, the homomorphic encryption method based on ECC has a better transmission rate with a higher security compared to RSA and DSA methods.

3.3. Efficiency Analysis

We compared the schemes in the literature [6,7,8,9,10] with our scheme, and the results are shown in Table 2. Let us first assume that all the schemes’ data are divided into 100 pieces, and we only need to select 3 of them for verification. Let us assume the symmetric encryption and decryption time is t 1 , the hash function time is t 2 , the public key encryption time is t 3 , the private key decryption time is t 4 , the smart contract time is t 5 , the transaction time is t 6 , and the communication time is t 7 .
As can be seen from Table 2, compared to the other schemes, our scheme is more expensive in terms of data processing only, because in scheme [5], we encrypt the data only once, which is not conducive to the transaction of encryption keys. Schemes [7,8] do not split the data, and scheme [9] uses a public key to encrypt the split data directly. Scheme [10] is similar to our scheme but does not use enough hash functions to ensure that the data will not be tampered with and does not use signatures to ensure the source of the data. Our scheme uses secondary encryption to protect data security and has little impact on data transaction efficiency. All in all, our scheme only sacrifices trivial efficiency but increases the security of data transactions.

3.4. Scheme Comparison

In this paper, we achieved secure data transactions while protecting data privacy. The decentralization and traceability of the blockchain were utilized to achieve data transactions without relying on third parties. The comparison of this paper with other schemes is shown in Table 3.
Scheme [8] validates data through a trusted third party, schemes [9,10] and our scheme use a one-to-one approach to validate data, and none of the other schemes provide a data validation method. In data trading centers, the authenticity of the data must be guaranteed, so a data validation method must be designed to suit both sides of the transaction, and if the data are validated through a trusted third party, the data will inevitably be leaked to the trusted third party, which may harm the interests of the data owner.
Compared with other schemes, only scheme [9] and our scheme are truly distributed and adopt secondary encryption to protect data security, which ensures that a single point of failure will not occur in the scheme and greatly strengthens data security.
In scheme [6], the transaction adopts a method similar to bank charging, but the method is slightly complex. In scheme [7], an agent re-encryption is combined with zero-knowledge proof, and the transaction process is complex. Schemes [8] and [10] do not provide a charging method, but scheme [9] and our scheme provide a simple charging method. As an integral part of fee-based data trading centers, it can be complicated for data owners and data consumers to trade encryption keys if transactions are conducted through banks. The transaction scheme in [9] cannot guarantee the legitimacy of the transaction amount, while we used smart contracts to verify the legitimacy of the transaction amount.

4. Conclusions

In order to solve the problem of security and fairness in data transactions, some measures have been proposed to guarantee the fairness and security of data transactions through trusted third parties or arbitration. However, these recommendations are vulnerable to single points of failure and may reveal useful data information. We designed a fair and verifiable data trading scheme, which did not require third-party participation, and the whole process of data trading is only between data owners and data consumers, with all transaction data on the chains and private data business operations and sharing completed in on-chain smart contracts, making full use of the decentralized and non-tamperable features of blockchain technology. Data were encrypted with secondary encryption, and transaction data were long data, so the efficiency of asymmetric encryption was low. We adopted AES symmetric encryption, and the symmetric key generated by the data encryption adopted an improved homomorphic encryption for encryption protection. The data consumer could obtain part of the data for verification, but it was difficult for the data consumer to obtain all the plaintext data, even if the verification was performed multiple times. When the data consumer verified that the data were fine, the smart contract payment currency was used to obtain the key to encrypt the data. Once the data owner received the currency, the data consumer obtained the encryption key immediately, and the smart contract wrote the transaction record to the blockchain for easy traceability. We proved the high transmission efficiency, short key, and high security strength of both elliptic curve encryption technology algorithms of our scheme through a security analysis.
The proposed solution used a blockchain, which has excellent features, such as being tamper-evident, but is not good enough in terms of data processing efficiency. In future research, we hope to improve the theory and methods of blockchain operation efficiency, such as using more efficient algorithms, as well as studying the possibility of exchanging security and efficiency on the blockchain to further improve the efficiency of the scheme. In addition, in the fair and verifiable data trading scheme, the scheme of data verification can greatly guarantee the authenticity of the data, but it does not completely guarantee that the data are not adulterated with invalid data. In the future, we hope to complete the work of data verification through machine learning, AI, and other technologies to ensure the authenticity of data in specific application scenarios, without leaking data content to data consumers.

Author Contributions

Y.J. participated in the feasibility discussion, analysis of the paper scheme, and the proofreading of the paper; G.S. was responsible for the overall design, performance analysis, and paper writing; T.F. supervised the formulation of the scheme and reviewed and revised the paper. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the National Natural Science Foundation of China (grant nos. 62162039, 61762060), Foundation for the Key Research and Development Program of Gansu Province, China (grant no. 20YF3GA016).

Data Availability Statement

The data used to support the findings of this study are included within the article.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Deepa, N.; Pham, Q.V.; Nguyen, D.C.; Bhattacharya, S.; Prabadevi, B.; Gadekallu, T.R.; Maddikunta, P.K.; Fang, F.; Pathirana, P.N. A survey on blockchain for big data: Approaches, opportunities, and future directions. Future Gener. Comput. Syst. 2022, 131, 209–226. [Google Scholar] [CrossRef]
  2. Ke, X. Ternary Governance of Data Transaction Circulation: Technology, Standards and Law. J. Jishou Univ. (Soc. Sci. Ed.) 2022, 43, 96. [Google Scholar]
  3. Xu, L. Analysis of the application of blockchain in data transactions. Think Tank Times 2018, 38–39. [Google Scholar]
  4. Jian, Y.; Zhong, W. Research on Personal Data Traceability Management System in Big Data Environment. Inf. Sci. 2016, 34, 139–143. [Google Scholar]
  5. Sun, G.; Li, Z.; Xiao, R.; Yang, J.; Wang, X. Research on Blockchain Transaction Security. J. Nanjing Univ. Posts Telecommun. Nat. Sci. Ed. 2021, 41, 36–48. [Google Scholar]
  6. Mallick, S.R.; Sharma, S. EMRI: A scalable and secure Blockchain-based IoMT framework for healthcare data transaction. In Proceedings of the 2021 19th OITS International Conference on Information Technology (OCIT), Bhubaneswar, India, 16–18 December 2021; pp. 261–266. [Google Scholar] [CrossRef]
  7. Guo, H.; Cheng, J.; Wang, J.; Chen, T.; Yuan, Y.; Li, H.; Sheng, V.S. IoT Data Blockchain-Based Transaction Model Using Zero-Knowledge Proofs and Proxy Re-encryption. In Proceedings of the International Conference on Artificial Intelligence and Security, Qinghai China, 22–26 July 2022; Springer: Cham, Switzerland, 2022; pp. 573–586. [Google Scholar]
  8. Hwang, R.J.; Lai, C.H. Provable fair document exchange protocol with transaction privacy for ecommerce. Symmetry 2015, 7, 464–487. [Google Scholar] [CrossRef] [Green Version]
  9. Delgado-Segura, S.; Pérez-Solà, C.; Navarro-Arribas, G.; Herrera-Joancomartí, J. A fair protocol for data trading based on Bitcoin transactions. Future Gener. Comput. Syst. 2019, 107, 832–840. [Google Scholar] [CrossRef] [Green Version]
  10. Kiyomoto, S.; Fukushima, K. Fair-trading protocol for anonymised datasets requirements and solution. In Proceedings of the 2018 4th International Conference on Information Management (ICIM), Oxford, UK, 25–27 May 2018; pp. 13–16. [Google Scholar]
  11. Wang, D.; Gao, J.; Yu, H.; Li, X. A Novel Digital Rights Management in P2P Networks Based on Bitcoin System. In Proceedings of the International Conference on Frontiers in Cyber Security. IEEE, Chengdu, China, 5–7 November 2018; Springer: Singapore, 2018; pp. 227–240. [Google Scholar]
  12. Zhao, Y.; Yu, Y.; Li, Y.; Han, G.; Du, X. Machine learning based privacy-preserving fair data trading in big data market. Inf. Sci. 2019, 478, 449–460. [Google Scholar] [CrossRef]
  13. Missier, P.; Bajoudah, S.; Capossele, A.; Gaglione, A.; Nati, M. Mind My Value: A decentralized infrastructure for fair and trusted loT data trading. In Proceedings of the Seventh International Conference on the Internet of Things. ACM, Linz, Austria, 22–25 October 2017; p. 15. [Google Scholar]
  14. Alrawahi, A.S.; Lee, K.; Lotfi, A. Trading of cloud of things resources. In Proceedings of the Second International Conference on Internet of things and Cloud Computing. ACM, Cambridge, UK, 22–23 March 2017; p. 163. [Google Scholar]
  15. Lin, S.J.; Liu, D.C. A fair-exchange and customer-anonymity electronic commerce protocol for digital content transactions. In Proceedings of the International Conference on Distributed Computing and Internet Technology, Bangalore, India, 17–20 December 2007; Springer: Berlin/Heidelberg, Germany, 2007; pp. 321–326. [Google Scholar]
  16. Cattelan, R.G.; He, S.; Kirovski, D. Prototyping a novel platform for free-trade of digital content. In Proceedings of the 12th Brazilian Symposium on Multimedia and the Web. ACM, Natal Rio Grande do Norte, Brazil, 19–22 November 2006; pp. 79–88. [Google Scholar]
  17. Perera, C. Sensing as a service (S2aaS): Buying and selling IoT data. arXiv 2017, arXiv:1702.02380. [Google Scholar]
  18. Lin, S.J.; Liu, D.C. An incentive-based electronic payment scheme for digital content transactions over the Internet. J. Netw. Comput. Appl. 2009, 32, 589–598. [Google Scholar] [CrossRef]
  19. Huang, Z.; Su, X.; Zhang, Y.; Shi, C.; Zhang, H.; Xie, L. A decentralized solution for loT data trusted exchange based-on blockchain. In Proceedings of the 2017 3rd IEEE International Conference on Computer and Communications (ICCC), IEEE, Chengdu, China, 13–16 December 2017; pp. 1180–1184. [Google Scholar]
  20. Fan, C.I.; Juang, W.S.; Chen, M.T. Efficient fair content exchange in cloud computing. In Proceedings of the 2010 International Computer Symposium (1CS2010), IEEE, Tainan, Taiwan, 16–18 December 2010; pp. 294–299. [Google Scholar]
  21. Qian, W.; Qi, S. A Fair Transaction Protocol with an Offline Semi-Trusted Third Party. In Advances in Intelligent Decision Technologies; Springer: Berlin/Heidelberg, Germany, 2010; pp. 249–257. [Google Scholar]
  22. Bensitel, Y.; Romadi, R. Secure data storage in the cloud with homomorphic encryption. In Proceedings of the International Conference on Cloud Computing Technologies and Applications IEEE, Marrakech, Morocco, 24–26 May 2017; pp. 1–6. [Google Scholar]
  23. Li, Z.; Zhang, F.; Wang, P. Highly efficient fully homomorphic encryption scheme with shorter publickeys. Comput. Appl. Res. 2017, 34, 487–489. (In Chinese) [Google Scholar]
  24. Zou, Y. Research on cloud storage encryption based on ellip-tic curve. Cyberspace Secur. 2017, 8, 21–23. (In Chinese) [Google Scholar]
  25. Huang, R. Information security system based on ellip-tic curve encryption algorithm. J. Neijiang Teac-Hers Coll. 2017, 32, 72–76. (In Chinese) [Google Scholar]
  26. Wu, Q.; Zhang, J.; Wang, Y. Simple proofthat a committed number is in a specific interval. ActaElectronica Sin. 2004, 32, 1071–1073. (In Chinese) [Google Scholar]
  27. Yao, Y.; Chang, X.; Zhen, P. Decentralized Identity Authentication and Key Management Scheme Based on Blockchain. Cyberspace Secur. 2019, 10, 33–39. [Google Scholar]
Figure 1. Basic flow chart of data encryption and decryption.
Figure 1. Basic flow chart of data encryption and decryption.
Information 13 00532 g001
Figure 2. Point-plus geometric representation.
Figure 2. Point-plus geometric representation.
Information 13 00532 g002
Figure 3. Data transaction model.
Figure 3. Data transaction model.
Information 13 00532 g003
Figure 4. Time sequence diagram of decentralized data transactions.
Figure 4. Time sequence diagram of decentralized data transactions.
Information 13 00532 g004
Figure 5. Smart contract pseudocode.
Figure 5. Smart contract pseudocode.
Information 13 00532 g005
Figure 6. Scatter plot at p = 11.
Figure 6. Scatter plot at p = 11.
Information 13 00532 g006
Figure 7. Scatter plot at p = 23.
Figure 7. Scatter plot at p = 23.
Information 13 00532 g007
Table 1. Required key length for the same decryption time ECC/RSA/DSA.
Table 1. Required key length for the same decryption time ECC/RSA/DSA.
Deciphering Time/YearsKey Length of RSA, DSA/BitKey Length of ECC/BitKey Length Ratio of RSA, ECC
10 4 5121065:1
10 8 7681326:1
10 11 10241607:1
10 20 204821010:1
10 78 21,00060035:1
Table 2. Scheme efficiency.
Table 2. Scheme efficiency.
SchemeProcess the DataValidation DataTrading Data
Soubhagya [5] 100 t 1 + 100 t 2 N/A 5 t 1 + 3 t 3 + 4 t 4 + 4 t 7
Guo [7] 10 t 2 + 7 t 3 + t 4 N/A 10 t 2 + 12 t 3 + 2 t 4 + 4 t 7
Ren [8] t 1 + 6 t 2 + 2 t 3 + 2 t 4 + 3 t 7 N/A 9 t 2 + 14 t 3 + 5 t 4
Segura [9] 100 t 3 3 t 7 t 6
Kiyomoto [10] 10 t 2 + 100 t 3 + 100 t 4 3 t 1 + 3 t 7 100 t 4 + t 7
This scheme 100 t 1 + 200 t 2 + 100 t 3 + 2 t 4 3 t 4 + 3 t 7 t 5
Table 3. Option comparison.
Table 3. Option comparison.
SchemeData ValidationDistributedBlockchainTransaction ComplexitySecondary Encryption
Soubhagya [5]NoYesYescomplexNo
Guo [7]YesYesYescomplexNo
Ren [8]YesHalfNo\No
Segura [9]YesYesYessimpleYes
Kiyomoto [10]YesHalfYes\No
This schemeYesYesYessimpleYes
“Half”: semidistributed; “\”: no trading part.
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Jiang, Y.; Sun, G.; Feng, T. Research on Data Transaction Security Based on Blockchain. Information 2022, 13, 532. https://doi.org/10.3390/info13110532

AMA Style

Jiang Y, Sun G, Feng T. Research on Data Transaction Security Based on Blockchain. Information. 2022; 13(11):532. https://doi.org/10.3390/info13110532

Chicago/Turabian Style

Jiang, Yongbo, Gongxue Sun, and Tao Feng. 2022. "Research on Data Transaction Security Based on Blockchain" Information 13, no. 11: 532. https://doi.org/10.3390/info13110532

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop