A data storage method, device and system based on blockchain
The blockchain-based data storage method encrypts and verifies user identity and files, using smart contracts to ensure secure and transparent data storage, addressing user data leakage and trust issues in cloud servers.
Patent Information
- Application Number
- CN202311611501.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-29
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2043-11-29
AI Technical Summary
The challenge of user data leakage and the lack of trustworthiness in cloud storage servers, as well as the inability of traditional and cloud storage technologies to securely manage the increasing volume of data in the civil aviation industry.
A blockchain-based data storage method that encrypts user identity information and files, verifies the identity, and uploads encrypted packages to cloud storage servers, using smart contracts to ensure data integrity and security, with optional homomorphic signatures and challenge mechanisms to verify storage status.
Enhances data security by decoupling users from stored data, ensuring data integrity and privacy, and providing a transparent, traceable, and reliable storage solution through blockchain technology.
Smart Images

Figure CN117874777B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data storage technology, and also to a data storage method, device and system based on blockchain. Background Art
[0002] In recent years, with the rapid development of information technology and network technology, global data has shown explosive growth. In the civil aviation system, the rapid growth of data volume has also had a great impact on the entire industry. With the increase in the number of flights and the complexity of flight data, the amount of data in the civil aviation industry continues to rise. Flight information, passenger information, aircraft operation data, ticket sales data, air cargo data and other data have increased dramatically, making the data integrity within the industry face great challenges. However, in the face of rapidly growing data, it is impossible to store huge amounts of data locally, and traditional local storage technology can no longer meet storage requirements.
[0003] As an emerging storage technology, cloud storage technology is gradually replacing local storage technology and is favored by more and more customers. Since cloud storage servers (CSPs) are servers rented by users from cloud storage providers, they are not trustworthy to users. Therefore, most users will introduce third-party auditors (TPAs) to assist users and cloud storage servers in data interaction and jointly implement data integrity protocols. However, third-party auditors are not completely trustworthy, and user data may be leaked. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a blockchain-based data storage method, device and system to solve the problem of user data leakage.
[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:
[0006] The first aspect of the present invention provides a data storage method based on blockchain, comprising:
[0007] Receive the user's identity information and the file to be uploaded;
[0008] Encrypting the identity information to obtain encrypted identity information;
[0009] Sending the encrypted identity information to a cloud storage server to obtain a verification result;
[0010] According to the verification result, the file to be uploaded is encrypted to obtain an encrypted file package;
[0011] The encrypted file package is uploaded to the cloud storage server for storage, and feedback information is obtained; the feedback information includes the transaction smart contract and the file storage status.
[0012] Optionally, encrypting the identity information to obtain encrypted identity information includes:
[0013] Calculate and obtain a digital summary of the identity according to the identity information;
[0014] The identity information is encrypted using the user's private key and the identity identification digital summary to obtain encrypted identity information.
[0015] Optionally, according to the verification result, the file to be uploaded is encrypted to obtain an encrypted file package, including:
[0016] When the verification result includes information that the identity authentication is passed, the file to be uploaded is encrypted to obtain an encrypted file package;
[0017] When the verification result includes information that the identity authentication fails, the updated encrypted identity information is sent to the cloud storage server.
[0018] Optionally, the file to be uploaded is encrypted to obtain an encrypted file package, including:
[0019] Using the user's private key to encrypt and sign the file to be uploaded to obtain a file identifier;
[0020] Performing a splitting and encryption process on the file to be uploaded to obtain an encrypted file containing a plurality of encrypted data blocks;
[0021] Calculate the signature of the root node according to the hash tree of the encrypted file;
[0022] Calculating a homomorphic signature of the encrypted file based on the homomorphic signatures of the plurality of encrypted data blocks;
[0023] An encrypted file package is obtained according to the file identifier, the encrypted file, the signature of the root node and the homomorphic signature of the encrypted file.
[0024] Optionally, the method further includes:
[0025] Receiving a verification request from a user regarding the storage status of the file;
[0026] Sending a challenge request according to the verification request and the transaction smart contract in the feedback information;
[0027] Verifying the file storage status according to the response information to the challenge request sent by the cloud storage server to obtain a verification result;
[0028] The verification result is uploaded to the chain.
[0029] Optionally, the formula for verifying the file storage status is:
[0030]
[0031] Among them, e is a bilinear mapping, L is the response information parameter, g is the generator of the multiplicative cyclic group G, and W i is the homomorphic signature of each encrypted data block in the encrypted file package, H is the hash function, z i is a set of random numbers, q μ is the user's random number, and y is the user's public key.
[0032] Optionally, the method further includes:
[0033] According to the verification result, paying the cloud storage server or receiving compensation sent by the cloud storage server to obtain a transaction record;
[0034] Encrypting the transaction record using the user's private key to obtain an encrypted transaction record;
[0035] The encrypted transaction record is submitted to the blockchain for storage.
[0036] A second aspect of the present invention provides a data storage device based on blockchain, comprising:
[0037] A first receiving module, used to receive the user's identity information and the file to be uploaded;
[0038] A first encryption module, used to encrypt the identity information to obtain encrypted identity information;
[0039] A first sending module, used to send the encrypted identity information to a cloud storage server to obtain a verification result;
[0040] A second encryption module is used to encrypt the file to be uploaded according to the verification result to obtain an encrypted file package;
[0041] The upload module is used to upload the encrypted file package to the cloud storage server for storage and obtain feedback information; the feedback information includes the transaction smart contract and the file storage status.
[0042] The third aspect of the present invention provides a blockchain-based data storage system, comprising the blockchain-based data storage device as described in the second aspect, and also comprising a user terminal, a key management device and a cloud storage server, wherein:
[0043] The client is used to send identity information including a key pair and the file to be uploaded;
[0044] A key management device, used to generate a key pair and send it to the user end;
[0045] The cloud storage server is used to receive encrypted identity information and send verification results after verification; receive encrypted file packages and send feedback information; the feedback information includes transaction smart contracts and file storage status.
[0046] A fourth aspect of the present invention provides a computing device, comprising: a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the blockchain-based data storage method as described in the first aspect is executed.
[0047] The above solution of the present invention includes at least the following beneficial effects:
[0048] The above scheme of the present invention encrypts the user's identity information and sends it to the cloud storage server, and uploads files for storage based on the verification result of the identity information by the cloud storage server, which replaces the data interaction and file uploading for storage between the user and the cloud storage server, and uses blockchain to store the storage and transaction information, which is beneficial to improving the user's data security and realizing the decoupling between the user and the stored data, and has the advantages of simple method and high user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 It is a flowchart of a data storage method based on blockchain in an embodiment of the present invention;
[0050] Figure 2 It is a flowchart of a specific embodiment of the data storage method based on blockchain in an embodiment of the present invention;
[0051] Figure 3 is a schematic diagram of the structure of a data storage device based on blockchain in an embodiment of the present invention;
[0052] Figure 4 It is a structural diagram of a blockchain-based data storage system in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] The exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present invention and to enable the scope of the present invention to be fully communicated to those skilled in the art.
[0054] like Figure 1 As shown, an embodiment of the present invention proposes a data storage method based on blockchain, comprising:
[0055] Step 101, receiving the user's identity information and the file to be uploaded; specifically, the user's identity information may include the user's identity identifier, the user's key pair and other information, which are used to encrypt the identity information and the file to be uploaded to improve the security and privacy of the data storage process;
[0056] Step 102, encrypting the identity information to obtain encrypted identity information;
[0057] Step 103, sending the encrypted identity information to the cloud storage server to obtain a verification result;
[0058] Step 104, according to the verification result, encrypt the file to be uploaded to obtain an encrypted file package;
[0059] Step 105, upload the encrypted file package to the cloud storage server for storage, and obtain feedback information; the feedback information includes the transaction smart contract and the file storage status. After the cloud storage server stores the encrypted file package, it will upload the data uploaded by the user to the chain through the smart contract. At the same time, the cloud storage server will send the feedback information including the transaction smart contract and the file storage status to the user, so that the user can understand the storage status of the file, such as storage success or failure.
[0060] The blockchain-based data storage method proposed in the embodiment of the present invention encrypts the user's identity information and sends it to the cloud storage server, and uploads files for storage based on the verification result of the identity information by the cloud storage server, which replaces the data interaction and file uploading for storage between the user and the cloud storage server, and uses the blockchain to store the storage and transaction information, which is beneficial to improving the user's data security and realizing the decoupling between the user and the stored data, and has the advantages of simple method and high user experience.
[0061] In an optional embodiment, step 102 includes:
[0062] Step 1021, calculating and obtaining a digital summary of the identity identifier based on the identity information; the user's identity information includes information such as the user's identity identifier and the user's key pair, so the digital summary of the user's identity identifier can be obtained through hash calculation;
[0063] Step 1022: encrypt the identity information using the user private key and the identity identification digital summary to obtain encrypted identity information.
[0064] Specifically, the signature of the digital summary is generated using the user's private key, and the digital summary of the user's identity identifier and the signature of the digital summary are packaged and sent to the cloud storage server for identity authentication.
[0065] In an optional embodiment, step 104 includes:
[0066] Step 1041, when the verification result includes information that the identity authentication is passed, the file to be uploaded is encrypted to obtain an encrypted file package;
[0067] Step 1042: When the verification result includes information indicating that the identity authentication has not passed, the updated encrypted identity information is sent to the cloud storage server.
[0068] The cloud storage server decrypts the signature of the received digital summary with the user's public key to obtain the decrypted digital summary, and compares the received digital summary of the user's identity with the decrypted digital summary. If the two are the same, it proves that the user's identity information is accurate and the identity authentication is passed. After receiving the verification result of the identity authentication, the file to be uploaded is encrypted and sent to the cloud storage server for data storage; if the two are different, it means that the user's identity information has been tampered with or damaged. At this time, the verification result is that the identity authentication has failed. After receiving the verification result of the identity authentication has failed, the identity information needs to be resent to the cloud storage server to verify the user's identity. This is conducive to improving the security of data storage and the privacy of user data.
[0069] In an optional embodiment, step 1041 includes:
[0070] Step 10411, using the user's private key to encrypt and sign the file to be uploaded to obtain a file identifier; specifically, using the user's private key to encrypt and sign the file to be uploaded to ensure the accuracy of the file;
[0071] Step 10412, cutting and encrypting the file to be uploaded to obtain an encrypted file containing multiple encrypted data blocks; cutting the file to be uploaded to obtain multiple data blocks, and then encrypting each data block using the user's private key and encryption algorithm to generate an encrypted file block, and the multiple encrypted file blocks constitute an encrypted file;
[0072] Step 10413, according to the hash tree of the encrypted file, calculate the signature of the root node; construct the hash tree of the entire file through the generated encrypted file, calculate the root node value of the hash tree, and then use the hash function to calculate the signature of the root node;
[0073] Step 10414, calculating the homomorphic signature of the encrypted file according to the homomorphic signatures of the plurality of encrypted data blocks; calculating the homomorphic signature of each encrypted data block, and calculating the homomorphic signature of the entire encrypted file through the homomorphic signature of each encrypted data block;
[0074] Step 10415, obtaining an encrypted file package according to the file identifier, the encrypted file, the signature of the root node and the homomorphic signature of the encrypted file.
[0075] The file identifier, encrypted file, root node signature and the homomorphic signature of the encrypted file form an encrypted file package and are sent to the cloud storage server. After confirmation by the cloud storage server, the user deletes the local data and the user successfully uploads the file.
[0076] In an optional embodiment, the data storage method based on blockchain further includes:
[0077] Step 106, receiving a user's verification request for the file storage status; after the user successfully uploads the file, it is still necessary to verify whether the data on the cloud server is complete. At this time, the user's verification request is received;
[0078] Step 107, sending a challenge request according to the verification request and the transaction smart contract in the feedback information;
[0079] Step 108, verifying the file storage status according to the response information to the challenge request sent by the cloud storage server to obtain a verification result;
[0080] Step 109, upload the verification result to the chain.
[0081] According to the user's verification request, a challenge request is sent to the cloud storage server. According to the response information sent by the cloud storage server, the file storage status is verified. The verification formula can be:
[0082] If the equation holds true, it proves that the data is complete. Otherwise, it means that the data has been damaged. The result needs to be notified to the user and the record must be uploaded to the chain.
[0083] Among them, e is a bilinear mapping, L is the response information parameter, g is the generator of the multiplicative cyclic group G, and W i is the homomorphic signature of each encrypted data block in the encrypted file package, H is the hash function, z i is a set of random numbers, q μ is the user's random number, and y is the user's public key.
[0084] In an optional embodiment, the data storage method based on blockchain further includes:
[0085] Step 110, paying the cloud storage server or receiving compensation sent by the cloud storage server according to the verification result, and obtaining a transaction record;
[0086] Step 111, encrypting the transaction record using the user's private key to obtain an encrypted transaction record;
[0087] Step 112: submit the encrypted transaction record to the blockchain for storage.
[0088] The verification result is that the data file stored on the cloud storage server is complete. At this time, the user needs to pay the cloud storage server, otherwise the cloud storage server needs to compensate the user. The resulting transaction records are submitted to the blockchain for storage.
[0089] like Figure 2 As shown, a specific embodiment of the data storage method based on blockchain in an embodiment of the present invention is:
[0090] The following theory is used in this embodiment:
[0091] Bilinear Maps: G and G T are two multiplicative cyclic groups with the same prime order p, and g is a generator of the multiplicative cyclic group G. G is selected to form the bilinear map e = G × G → G T ; The bilinear map e will satisfy the following properties:
[0092] (1) Bilinear: For g 1 ,g 2 ∈G and Existence equation
[0093] (2) Non-degeneracy: If g 1 ,g 2 ∈G and g 1 ≠g 2 , there exists an equation e(g 1 ,g 2 )≠1.
[0094] (3) Efficiency: For any g 1 ,g 2 ∈G,e(g 1 ,g 2 ) is valid.
[0095] Hash function: H,H 1 ,h are all secure hash functions, where {0,1} * →G represents {0,1} * Mapping to G,H,H 1 ,h These three hash functions map the string in the graph to each element of G. f(·) is a pseudo-random function that satisfies f:{0,1} * →[1,n].
[0096] Assume that the identity of user User is represented by ID User, the corresponding Ethereum account is Eth User ; The identity of the file F to be uploaded by the user is ID F ; The cloud storage server's identity is ID CSP , the corresponding Ethereum account is Eth CSP The user submits his or her identity to the method of this instance for operation, and the user interacts with the cloud storage server on behalf of the user to upload files and verify data integrity.
[0097] The key is used to sign the data. The trusted authority PKG (key management device) generates a pair of trusted RSA key pairs (sk, pk) for the user, where the private key is The public key is pk=y=g x , the user randomly selects a number q∈G for subsequent data integrity verification. After completing the key generation operation, the user fully entrusts his own key to the method of this example for processing, and makes the user's public key pk public and sends it to the cloud storage server.
[0098] After receiving the user's personal identity information, it initiates an identity authentication request to the cloud storage server. After receiving the identity authentication request, the cloud storage server replies with a successful response and detects the user's identity ID. User The specific execution operations are as follows:
[0099] The first step is to receive the user's personal identification ID User After that, through the ID User Perform hash calculation to calculate the digital summary H(ID User ), then the signature sig of the digital summary is generated by the user's private key sk sk (H(ID User )), then, {H(ID User ),sig sk (H(ID User ))}Package and send to CSP.
[0100] Step 2: When the cloud storage server receives {H(ID User ),sig sk (H(ID User ))}, the received signature sig is received through the user's public key pk sk (H(ID User )) to decrypt, and finally obtain the decrypted digital summary H′(ID User ).
[0101] The third step is to use the cloud storage server to receive the digital summary H (ID User) and the newly generated digital summary H′(ID User ) for comparison. If the two are the same, it proves that the user's information is accurate. The cloud storage server feeds back the verification result and informs it to receive the data uploaded by the user. Otherwise, it means that the user's identity information has been tampered with or damaged. The cloud storage server returns the information of identity authentication failure to the user and informs the user to upload again.
[0102] After receiving the user's uploaded file F, the private key sk is used to encrypt and sign the file F to ensure the accuracy of the file F, that is:
[0103] sig F =ID F ||sig sk (ID F )
[0104] sig F Can be considered as an identifier of file F.
[0105] Then, the data block splitting operation is performed to split the file F into n data blocks, namely:
[0106] F={f i}={f 1 ,f 2 ,...,f n}(1≤i≤n)
[0107] For the i-th file data block f i ,Use the Encrypt algorithm to encrypt each data block through the private key to generate an encrypted file block, namely:
[0108]
[0109] After that, the tag of the generated encrypted file block is calculated, namely:
[0110] T F =TagGen(F * )
[0111] The encrypted data file F generated above * Build the Merkle hash tree of the entire file and calculate the root node value of the Merkle hash tree, that is:
[0112] R C =root(F * )
[0113] Use the hash function to calculate the signature of the root node, namely:
[0114] δ=sig(R C )
[0115] Calculate the homomorphic signature of each encrypted data block, that is:
[0116] W i =i||ID F
[0117] Through the homomorphic signature of each data block mentioned above, the homomorphic signature of the entire encrypted file is calculated, that is:
[0118] σ i =(H(W i ·q F* )) x
[0119] After executing the above content, {sig F ,F * ,σ i ,δ} is packaged and sent to the cloud storage server. After receiving the confirmation request from the cloud storage server, the user is notified to delete the local data and the user uploads the file successfully.
[0120] If the user wants to check whether the data stored on the cloud storage server is complete, he needs to send a verification request. After receiving the user's request, the cloud storage server sends a data integrity verification request challenge to verify the encrypted data block F * Whether to store the data completely on the cloud storage server and return the final result to the user. The specific implementation content is as follows:
[0121] First, receive the user's verification request for the file storage status, and randomly select a set containing c elements I = {S 1 ,S 2 ,...,S c}(1≤c≤n), and input set I into smart contract 1, which can be:
[0122]
[0123]
[0124] Among them, Block id is the identifier of the current block in the blockchain, T s Indicates the current timestamp. Smart contract 1 will record this transaction after executing this program.
[0125] After the calculation of smart contract 1, a random number set {z i}, based on the random number set, generate a challenge chal = {z i}Sent to the cloud storage server.
[0126] The cloud storage server receives the challenge chal and calculates the following information:
[0127]
[0128]
[0129] Among them, μ and L are response information parameters calculated by the cloud storage server. After the calculation is completed, the cloud storage server sends the response information (μ, L) for data integrity verification.
[0130] After receiving the response from the cloud storage server, check the correctness of the following equation to prove that the user's stored data is complete, that is, equation 1:
[0131]
[0132] Among them, e is a bilinear mapping, L is the response information parameter, g is the generator of the multiplicative cyclic group G, and W i is the homomorphic signature of each encrypted data block in the encrypted file package, H is the hash function, z i is a set of random numbers, q μ is the user's random number, and y is the user's public key. If the above equation is true, it proves that the data is complete. Otherwise, it means that the data has been damaged, and the result needs to be notified to the user and the record must be uploaded to the chain.
[0133] Integrate all the required metadata of file F into a transaction record block on the blockchain to effectively prevent tampering. The following calculations are required:
[0134] Data=H(ID User )||H(ID F )||H(ID CSP )||pay||Extra F ||θ||δ
[0135] Among them, θ represents a flag. When the user pays the cloud storage server, θ=1, and when the cloud storage server pays the user, θ=-1. Therefore, the fees paid by both parties are represented by pay·θ. If pay·θ>0, it means that the data has been successfully stored on the cloud storage server, and the user needs to pay the storage fee to the cloud storage server. store If pay·θ<0, it means that the data is incomplete, and the cloud storage server should compensate the user for the corresponding fee pay compensate , Extra F Represents the metadata information of file F.
[0136] The transaction record TX of this interaction is generated through the following smart contract 2, which means that the user transfers the transaction data to the cloud storage service provider:
[0137]
[0138] Among them, the specific process of transaction record TX is:
[0139] The user's Ethereum account Eth User Go to the Ethereum account of the cloud storage service provider CSP Execute this communication process, the data transmitted during the interaction is: Data = H (ID User )||H(ID F )||H(ID CSP )||pay||Extra F ||θ||δ; After obtaining the transaction record TX, the signature information sig of the transaction is generated through the user's private key sk sk (TX), and set transaction Transaction = From||To||Value||Data||sig sk (TX) is submitted to the blockchain.
[0140] After the user uploads the data to the cloud storage server, the user needs to pay the storage fee to the cloud storage server provider. When the data is checked to be incomplete, the user and the cloud storage server provider need to be notified. The user and the cloud storage server provider will execute the following smart contract 3. The provider should compensate the user for a certain fee. This payment method can be achieved through the following smart contract 3:
[0141]
[0142] When smart contract 3 is automatically activated and executed, if equation 1 is true, it means that the data block is completely stored on the cloud storage server. At this time, the corresponding fee is paid to the cloud storage server on behalf of the user. If equation 1 is not true, it means that the data is incomplete and has been damaged or lost. The cloud storage server must bear the responsibility and make certain compensation for the lost data.
[0143] The blockchain-based data storage method of the embodiment of the present invention introduces blockchain, ensures data integrity through decentralization, non-tamperability and other characteristics, ensures the correct data interaction through smart contracts, and improves the openness and transparency of data storage; and replaces users to interact with cloud storage servers, reduces users' local operations, and realizes the decoupling between users and stored data.
[0144] In the embodiment of the present invention, the correctness of the data integrity protocol is proved as follows:
[0145]
[0146] If the above equation is true, it means that the data stored by the user on the cloud storage server is complete. Otherwise, it means that the data stored on the cloud storage server has been damaged and the cloud storage server needs to compensate the user.
[0147] Due to the decentralized and tamper-proof nature of blockchain, the data uploaded by users is uploaded to the blockchain through smart contracts, and the challenges initiated to the cloud storage server are also stored on the blockchain. When verifying the integrity of the data, it is verified through smart contracts, and the results are finally uploaded to the chain. All of the above operations are recorded on the blockchain and can be publicly viewed and shared. Due to the traceability of blockchain, users or cloud storage servers can ensure the security and reliability of data by tracing the data.
[0148] like Figure 3 As shown, an embodiment of the present invention provides a data storage device 200 based on blockchain, including:
[0149] The first receiving module 201 is used to receive the user's identity information and the file to be uploaded;
[0150] The first encryption module 202 is used to encrypt the identity information to obtain encrypted identity information;
[0151] A first sending module 203, used to send the encrypted identity information to a cloud storage server to obtain a verification result;
[0152] The second encryption module 204 is used to encrypt the file to be uploaded according to the verification result to obtain an encrypted file package;
[0153] The upload module 205 is used to upload the encrypted file package to the cloud storage server for storage and obtain feedback information; the feedback information includes the transaction smart contract and the file storage status.
[0154] Optionally, encrypting the identity information to obtain encrypted identity information includes:
[0155] Calculate and obtain a digital summary of the identity according to the identity information;
[0156] The identity information is encrypted using the user's private key and the identity identification digital summary to obtain encrypted identity information.
[0157] Optionally, according to the verification result, the file to be uploaded is encrypted to obtain an encrypted file package, including:
[0158] When the verification result includes information that the identity authentication is passed, the file to be uploaded is encrypted to obtain an encrypted file package;
[0159] When the verification result includes information that the identity authentication fails, the updated encrypted identity information is sent to the cloud storage server.
[0160] Optionally, the file to be uploaded is encrypted to obtain an encrypted file package, including:
[0161] Using the user's private key to encrypt and sign the file to be uploaded to obtain a file identifier;
[0162] Performing a splitting and encryption process on the file to be uploaded to obtain an encrypted file containing a plurality of encrypted data blocks;
[0163] Calculate the signature of the root node according to the hash tree of the encrypted file;
[0164] Calculating a homomorphic signature of the encrypted file based on the homomorphic signatures of the plurality of encrypted data blocks;
[0165] An encrypted file package is obtained according to the file identifier, the encrypted file, the signature of the root node and the homomorphic signature of the encrypted file.
[0166] Optionally, the blockchain-based data storage device 200 further includes:
[0167] The second receiving module 206 is used to receive a user's verification request for the file storage status;
[0168] A challenge request module 207, configured to send a challenge request according to the verification request and the transaction smart contract in the feedback information;
[0169] A verification module 208, configured to verify the file storage status according to the response information to the challenge request sent by the cloud storage server, and obtain a verification result;
[0170] The uplink module 209 is used to upload the verification result to the chain.
[0171] Optionally, the formula for verifying the file storage status is:
[0172]
[0173] Among them, e is a bilinear mapping, L is the response information parameter, g is the generator of the multiplicative cyclic group G, and W i is the homomorphic signature of each encrypted data block in the encrypted file package, H is the hash function, z i is a set of random numbers, q μ is the user's random number, and y is the user's public key.
[0174] Optionally, the blockchain-based data storage device 200 further includes:
[0175] The transaction module 210 is used to pay the cloud storage server or receive compensation sent by the cloud storage server according to the verification result, and obtain a transaction record;
[0176] The third encryption module 211 is used to encrypt the transaction record using the user's private key to obtain an encrypted transaction record;
[0177] The submission module 212 is used to submit the encrypted transaction record to the blockchain for storage.
[0178] It should be noted that the device is a device corresponding to the above method, and all implementations in the above method embodiment are applicable to the embodiment of the device and can achieve the same technical effect. This embodiment will not be repeated.
[0179] like Figure 4 As shown, an embodiment of the present invention provides a blockchain-based data storage system 300, including the blockchain-based data storage device 200 described in the above embodiment, and also includes a user terminal 301, a key management device 302 and a cloud storage server 303, wherein:
[0180] The client 301 is used to send identity information including a key pair and a file to be uploaded;
[0181] The key management device 302 is used to generate a key pair and send it to the user end;
[0182] The cloud storage server 303 is used to receive the encrypted identity information and send the verification result after verification; receive the encrypted file package and send feedback information; the feedback information includes the transaction smart contract and the file storage status.
[0183] Among them, the key management device is a trusted authority responsible for setting public parameters for the entire system and generating keys for other entities in the system. Users refer to entities that have a large amount of data that can be outsourced, but have limited communication, storage, and computing resources. They need to store data on cloud storage servers and send audit requests to cloud storage servers on demand. Blockchain-based data storage devices are trusted entities designated by users, performing various computing operations on their behalf. Cloud storage providers CSP provide users with a large amount of storage resources and more efficient computing power, respond to received integrity requests, and can also check updates and maintain blocks at any time like users. Due to its advantages of decentralization, traceability, and immutability, blockchain enables the entire system to implement secure integrity audits, public verification, and other mechanisms.
[0184] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the data storage method based on blockchain as described in any one of the above embodiments is executed. All implementation methods in the above method embodiments are applicable to the embodiments of the device, and can achieve the same technical effect. This embodiment will not be repeated.
[0185] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A data storage method based on blockchain, characterized in that: include: Receive the user's identity information and the file to be uploaded; The user's identity information includes the user's identity identifier and the user's key pair; Encrypting the identity information to obtain encrypted identity information; Sending the encrypted identity information to a cloud storage server to obtain a verification result; According to the verification result, the file to be uploaded is encrypted to obtain an encrypted file package; Uploading the encrypted file package to the cloud storage server for storage, and obtaining feedback information; The feedback information includes transaction smart contracts and file storage status; The step of encrypting the identity information to obtain the encrypted identity information includes: Calculate and obtain a digital summary of the identity according to the identity information; The identity information is encrypted using the user's private key and the identity digital summary to obtain encrypted identity information; wherein the signature of the identity digital summary is generated using the user's private key, and the identity digital summary and the signature of the identity digital summary are packaged into encrypted identity information; According to the verification result, the file to be uploaded is encrypted to obtain an encrypted file package, including: When the verification result includes information that the identity authentication is passed, the file to be uploaded is encrypted to obtain an encrypted file package; When the verification result includes information that the identity authentication fails, the updated encrypted identity information is sent to the cloud storage server; The file to be uploaded is encrypted to obtain an encrypted file package, including: Using user private key and sig F =ID F ||sig sk (ID F ) encrypts and signs the file to be uploaded to obtain a file identifier; wherein, sig F is the file identifier, ID F is the identity of the file F to be uploaded, sig sk (ID F ) is to generate the signature of the file to be uploaded using the user's private key sk; Performing a splitting and encryption process on the file to be uploaded to obtain an encrypted file containing a plurality of encrypted data blocks; Calculate the signature of the root node according to the hash tree of the encrypted file; Calculating a homomorphic signature of the encrypted file based on the homomorphic signatures of the plurality of encrypted data blocks; Obtain an encrypted file package according to the file identifier, the encrypted file, the signature of the root node and the homomorphic signature of the encrypted file; The method further comprises: Receiving a verification request from a user regarding the storage status of the file; Sending a challenge request according to the verification request and the transaction smart contract in the feedback information; Verifying the file storage status according to the response information to the challenge request sent by the cloud storage server to obtain a verification result; Uploading the verification results to the blockchain; The formula for verifying the file storage status is: Among them, e is a bilinear mapping, L is the response information parameter, g is the generator of the multiplicative cyclic group G, and W i is the homomorphic signature of each encrypted data block in the encrypted file package, H is the hash function, z i is a set of random numbers, q μ is the user's random number, y is the user's public key; The method further comprises: According to the verification result, paying the cloud storage server or receiving compensation sent by the cloud storage server to obtain a transaction record; Encrypting the transaction record using the user's private key to obtain an encrypted transaction record; The encrypted transaction record is submitted to the blockchain for storage.
2. A data storage device based on blockchain, characterized in that: include: A first receiving module, used to receive the user's identity information and the file to be uploaded; The user's identity information includes the user's identity identifier and the user's key pair; A first encryption module, used to encrypt the identity information to obtain encrypted identity information; A first sending module, used to send the encrypted identity information to a cloud storage server to obtain a verification result; A second encryption module is used to encrypt the file to be uploaded according to the verification result to obtain an encrypted file package; An uploading module, used for uploading the encrypted file package to the cloud storage server for storage and obtaining feedback information; The feedback information includes transaction smart contracts and file storage status; The step of encrypting the identity information to obtain the encrypted identity information includes: Calculate and obtain a digital summary of the identity according to the identity information; The identity information is encrypted using the user's private key and the identity digital summary to obtain encrypted identity information; wherein the signature of the identity digital summary is generated using the user's private key, and the identity digital summary and the signature of the identity digital summary are packaged into encrypted identity information; According to the verification result, the file to be uploaded is encrypted to obtain an encrypted file package, including: When the verification result includes information that the identity authentication is passed, the file to be uploaded is encrypted to obtain an encrypted file package; When the verification result includes information that the identity authentication fails, the updated encrypted identity information is sent to the cloud storage server; The file to be uploaded is encrypted to obtain an encrypted file package, including: Using user private key and sig F =ID F ||sig sk (ID F ) encrypts and signs the file to be uploaded to obtain a file identifier; wherein, sig F is the file identifier, ID F is the identity of the file F to be uploaded, sig sk (ID F ) is to generate the signature of the file to be uploaded using the user's private key sk; Performing a splitting and encryption process on the file to be uploaded to obtain an encrypted file containing a plurality of encrypted data blocks; Calculate the signature of the root node according to the hash tree of the encrypted file; Calculating a homomorphic signature of the encrypted file based on the homomorphic signatures of the plurality of encrypted data blocks; Obtain an encrypted file package according to the file identifier, the encrypted file, the signature of the root node and the homomorphic signature of the encrypted file; The device also includes: A second receiving module is used to receive a user's verification request for the file storage status; A challenge request module, used to send a challenge request according to the verification request and the transaction smart contract in the feedback information; A verification module, used to verify the file storage status according to the response information to the challenge request sent by the cloud storage server, and obtain a verification result; An uplink module, used for uplinking the verification result; The formula for verifying the file storage status is: Among them, e is a bilinear mapping, L is the response information parameter, g is the generator of the multiplicative cyclic group G, and W i is the homomorphic signature of each encrypted data block in the encrypted file package, H is the hash function, z i is a set of random numbers, q μ is the user's random number, y is the user's public key; The device also includes: A transaction module, used to pay the cloud storage server or receive compensation sent by the cloud storage server according to the verification result, and obtain a transaction record; A third encryption module, used to encrypt the transaction record using a user private key to obtain an encrypted transaction record; The submission module is used to submit the encrypted transaction record to the blockchain for storage.
3. A data storage system based on blockchain, characterized in that: The device comprises a blockchain-based data storage device as claimed in claim 2, and further comprises a user terminal, a key management device and a cloud storage server, wherein: The user end is used to send identity information including a key pair and a file to be uploaded; the identity information also includes the user's identity identifier; A key management device, used to generate a key pair and send it to the user end; The cloud storage server is used to receive encrypted identity information and send verification results after verification; receive encrypted file packages and send feedback information; the feedback information includes transaction smart contracts and file storage status.
4. A computing device, characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to claim 1 is performed.
Citation Information
Patent Citations
Searchable encrypted data security sharing method based on homomorphic encryption and blockchain
CN111835500A
Cloud storage data security deduplication method based on block chain
CN112732695A
