CN115150417A - Data storage method based on block chain and related device - Google Patents

Data storage method based on block chain and related device Download PDF

Info

Publication number
CN115150417A
CN115150417A CN202210769440.8A CN202210769440A CN115150417A CN 115150417 A CN115150417 A CN 115150417A CN 202210769440 A CN202210769440 A CN 202210769440A CN 115150417 A CN115150417 A CN 115150417A
Authority
CN
China
Prior art keywords
verification
node
encrypted
data storage
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210769440.8A
Other languages
Chinese (zh)
Inventor
邓威
卢启付
冉旺
肖磊石
钟飞
石泉
付东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Southern Power Grid Power Technology Co Ltd
Original Assignee
China Southern Power Grid Power Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Southern Power Grid Power Technology Co Ltd filed Critical China Southern Power Grid Power Technology Co Ltd
Priority to CN202210769440.8A priority Critical patent/CN115150417A/en
Publication of CN115150417A publication Critical patent/CN115150417A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • H04L63/0435Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload wherein the sending and receiving network entities apply symmetric encryption, i.e. same key used for encryption and decryption
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Storage Device Security (AREA)

Abstract

The application discloses a data storage method based on a block chain and a related device, wherein the method comprises the following steps: sending the encrypted file to a verification node in a alliance chain for verification through an access node, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key; if the verification of the verification node is passed, triggering the access node to send target storage data to the target block link node; and storing the target storage data in a Merkel tree form through the target block chain node according to the global state root hash. The method and the device can solve the technical problems that the existing test data storage mode is easily attacked and tampered by people and lacks safety and reliability.

Description

Data storage method based on block chain and related device
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a data storage method and related apparatus based on a block chain.
Background
At present, most of the management of personnel, equipment, samples, test methods, test environments and the like in detection laboratories in China adopts a traditional manual management mode, lacks of systematic and scientific management means and is low in efficiency. Technological and industrial innovations have deeply changed the world, society and life, and the interconnection of everything has become the direction of upgrading the industries. An intelligent safety tool detection laboratory based on a block chain is used for digitally acquiring and processing people, machines, materials, methods and rings related to the laboratory through the technology of Internet of things, the detection automation, the detection intellectualization and the detection big data are realized.
The existing test data storage mode is too single, and is easy to attack and tamper by a man-in-the-middle, so that the stored test data is lack of reliability.
Disclosure of Invention
The application provides a data storage method based on a block chain and a related device, which are used for solving the technical problems that the existing test data storage mode is easily tampered by people and lacks safety and reliability.
In view of the above, a first aspect of the present application provides a data storage method based on a block chain, including:
sending an encrypted file to a verification node in a alliance chain for verification through an access node, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key;
if the verification of the verification node is passed, triggering the access node to send target storage data to a target block chain node;
and storing the target storage data in a Merkel tree form according to the global state root hash by the target block chain node.
Preferably, the sending, by the access node, the encrypted file to a verification node in a federation chain for verification, where the encrypted file includes an encrypted ciphertext and an encrypted key, and before the sending, the method further includes:
and respectively encrypting the verification plaintext and the private key by using a preset symmetric encryption algorithm through the access node to obtain an encrypted ciphertext and an encrypted key.
Preferably, the sending, by the access node, the encrypted file to a verification node in the federation chain for verification, where the encrypted file includes an encrypted ciphertext and an encrypted key, further includes:
and managing the security level and the sharing range of the encryption key by adopting a preset key derivation function.
Preferably, the storing the target storage data in a merkel tree form according to a global state root hash by the target block chain node includes:
calculating sub-block hash values of target storage data through the target block chain nodes;
splicing the sub-block hash values into hash strings, and then calculating corresponding hash values to obtain global state root hashes;
and constructing a Meckel tree for storing different state data based on the global state root hash.
A second aspect of the present application provides a data storage device based on a block chain, including:
the verification module is used for sending the encrypted file to a verification node in the alliance chain through the access node for verification, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key;
the judging module is used for triggering the access node to send target storage data to a target block link node if the access node passes the verification of the verification node;
and the storage module is used for storing the target storage data in a Merkel tree form through the target block chain node according to the global state root hash.
Preferably, the method further comprises the following steps:
and the encryption module is used for respectively encrypting the verification plaintext and the private key by adopting a preset symmetric encryption algorithm through the access node to obtain an encrypted ciphertext and an encrypted key.
Preferably, the method further comprises the following steps:
and the management module is used for performing management operation of security level and sharing range on the encryption key by adopting a preset key derivation function.
Preferably, the storage module is specifically configured to:
calculating sub-block hash values of target storage data through the target block chain nodes;
splicing the sub-block hash values into hash strings, and then calculating corresponding hash values to obtain global state root hashes;
and constructing a Meckel tree for storing different state data based on the global state root hash.
A third aspect of the present application provides a blockchain-based data storage device, the device comprising a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the method for blockchain-based data storage according to the first aspect according to instructions in the program code.
A fourth aspect of the present application provides a computer-readable storage medium for storing a program code for executing the method for block chain based data storage according to the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
in this application, a data storage method based on a block chain is provided, including: sending the encrypted file to a verification node in a alliance chain for verification through an access node, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key; if the verification of the verification node is passed, triggering the access node to send target storage data to the target block chain node; and storing the target storage data in a Merkel tree form through the target block chain node according to the global state root hash.
According to the data storage method based on the block chain, identity verification is carried out through the encrypted ciphertext and the encrypted secret key, data cannot be tampered by a third party, the data is stored in a distributed mode in the form of the Merkel tree, and the reliability of the data stored in other nodes cannot be affected even if the data of a certain node is tampered. Therefore, the method and the device can solve the technical problems that an existing test data storage mode is easy to be tampered by people and lacks safety and reliability.
Drawings
Fig. 1 is a schematic flowchart of a data storage method based on a block chain according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a data storage device based on a block chain according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a programming system based on block chain data storage according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
For easy understanding, please refer to fig. 1, an embodiment of a block chain-based data storage method provided in the present application includes:
step 101, sending the encrypted file to a verification node in the alliance chain for verification through the access node, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key.
The access node may be a node such as a user or a client, and the access node is generally in a federation chain, and this embodiment does not limit authentication between the method application and a node outside the federation chain. The encrypted file in this embodiment includes, in addition to an encrypted ciphertext obtained by encrypting a plaintext, an encrypted key, where the key is a private key, and may be encrypted by using an encryption algorithm, or may be encrypted by using another private key, which is not limited herein.
Further, step 101, before, further includes:
and respectively encrypting the verification plaintext and the private key by using a preset symmetric encryption algorithm through the access node to obtain an encrypted ciphertext and an encrypted key.
In this embodiment, a symmetric encryption algorithm is used to encrypt the plaintext and the secret key respectively, and the specific symmetric encryption algorithm may be selected according to actual requirements, which is not limited herein.
And 102, if the verification of the verification node is passed, triggering the access node to send target storage data to the target block chain node.
Further, step 102, further includes:
and performing management operation of security level and sharing range on the encryption key by adopting a preset key derivation function.
The preset key derivation function is a random number generation algorithm based on a safe and high system entropy value as a seed in a cipher machine, so that the key is protected from being recovered by an attacker. The key is protected by a hardware security mechanism, and the key plaintext is only used for cryptographic operation in the cryptographic engine and cannot leave the security boundary of the cryptographic engine hardware.
And each key has a different security level and sharing scope, specific authority and priority control can be performed according to the preset key derivation function.
And 103, storing the target storage data in a Merkel tree form through the target block chain node according to the global state root hash.
Further, step 103 includes:
calculating sub-block hash values of the target storage data through the target block chain nodes;
splicing the sub-block hash values into hash strings, and calculating corresponding hash values to obtain global state root hashes;
and constructing a Meckel tree for storing different state data based on the global state root hash.
In the embodiment, the data storage is divided into KV database storage of a local file system and abstract world state data storage of an upper layer; the object storage uses a specific tree data structure to store data to achieve global state fast computation abstraction, that is, the root hash-based constructed merkel tree in this embodiment is used to store target storage data. Different blocks have different global state root hashes, different global state history trees can be constructed according to the different blocks and the different global state root hashes, and data in different history states can be inquired.
The storage method in this embodiment can achieve three-dimensional security, which is network security, data security and storage security, and network security: the client and the node acquire the TLS certificate through the CA center, TLS bidirectional authentication is carried out between the client and the node and between the nodes, and the communication flow is encrypted through TLS to resist man-in-the-middle attacks. Besides basic certificate verification, handshake logic is added between nodes, and communication reliability between the nodes is ensured by adding a mode of verifying private key signatures of nodes of opposite sides in the handshake process. And (3) data security: the transaction makes the private key of the user sign, and the transaction content can not be tampered. And (4) storage safety: the data is stored in multiple nodes, the whole network is not influenced by the loss of single-node data, a data synchronization mechanism among the nodes ensures the correct copying of the data, a data filing tool is provided, and the data can be filed and backed up by using a traditional mode.
The method in the embodiment of the present application is applied to a specific data verification system, and please refer to fig. 3, where the method includes a user side SDK, an access network, a consensus organization, a P2P network, a storage component, an account book management, and a contract engine, and there are specific interaction actions between different modules. The visual display of the structured data on the block chain enables the user node to conveniently check the information stored on the block chain under various different states by authorizing the user node.
According to the data storage method based on the block chain, identity verification is carried out through the encrypted ciphertext and the encrypted key, data cannot be tampered by third party attacks, the data is stored in a distributed mode in a Merkel tree mode, and reliability of stored data of other nodes is not affected even if data of a certain node is tampered. Therefore, the technical problems that an existing test data storage mode is prone to being tampered by people and lacks of safety and reliability can be solved.
To facilitate understanding, referring to fig. 2, the present application further provides an embodiment of a data storage device based on a block chain, including:
the verification module 201 is configured to send the encrypted file to a verification node in the alliance chain through the access node for verification, where the encrypted file includes an encrypted ciphertext and an encryption key;
the judging module 202 is configured to trigger the access node to send the target storage data to the target block link node if the verification by the verification node is passed;
and the storage module 203 is used for storing the target storage data in a Merkel tree form according to the global state root hash by the target block chain node.
Further, the method also comprises the following steps:
the encryption module 204 is configured to encrypt the verification plaintext and the private key by using a preset symmetric encryption algorithm through the access node, respectively, to obtain an encrypted ciphertext and an encrypted key.
Further, the method also comprises the following steps:
and the management module 205 is configured to perform a management operation on the security level and the sharing range of the encryption key by using a preset key derivation function.
Further, the storage module 203 is specifically configured to:
calculating target by target block chain node storing the sub-block hash value of the data;
splicing the sub-block hash values into hash strings, and then calculating corresponding hash values to obtain global state root hashes;
and constructing a Meckel tree for storing different state data based on the global state root hash.
The application also provides a data storage device based on the block chain, wherein the device comprises a processor and a memory;
the memory is used for storing the program codes and transmitting the program codes to the processor;
the processor is configured to execute the block chain based data storage method in the above method embodiment according to instructions in the program code.
The present application also provides a computer-readable storage medium for storing a program code for executing the block chain based data storage method in the above method embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for executing all or part of the steps of the method described in the embodiments of the present application through a computer device (which may be a personal computer, a server, or a network device). And the aforementioned storage medium includes: a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present application.

Claims (10)

1. A data storage method based on a block chain is characterized by comprising the following steps:
sending an encrypted file to a verification node in a alliance chain for verification through an access node, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key;
if the verification of the verification node is passed, triggering the access node to send target storage data to a target block chain node;
and storing the target storage data in a Merkel tree form according to the global state root hash by the target block chain node.
2. The blockchain-based data storage method according to claim 1, wherein the sending, by the access node, the encrypted file to a verification node in a federation chain for verification, the encrypted file including an encrypted ciphertext and an encryption key, further includes:
and respectively encrypting the verification plaintext and the private key by using a preset symmetric encryption algorithm through the access node to obtain an encrypted ciphertext and an encrypted key.
3. The blockchain-based data storage method according to claim 1, wherein the sending of the encrypted file to a verification node in a federation chain for verification by the access node, the encrypted file including an encrypted ciphertext and an encryption key, further comprises:
and managing the security level and the sharing range of the encryption key by adopting a preset key derivation function.
4. The blockchain-based data storage method according to claim 1, wherein the storing the target storage data in a merkel tree form according to a global state root hash by the target blockchain node comprises:
calculating sub-block hash values of target storage data through the target block chain nodes;
splicing the sub-block hash values into hash strings, and calculating corresponding hash values to obtain global state root hashes;
and constructing a Meckel tree for storing different state data based on the global state root hash.
5. A blockchain-based data storage device, comprising:
the verification module is used for sending the encrypted file to a verification node in the alliance chain through the access node for verification, wherein the encrypted file comprises an encrypted ciphertext and an encrypted key;
the judging module is used for triggering the access node to send target storage data to a target block link node if the access node passes the verification of the verification node;
and the storage module is used for storing the target storage data in a Merkel tree form through the target block chain node according to the global state root hash.
6. The blockchain-based data storage device of claim 5, further comprising:
and the encryption module is used for respectively encrypting the verification plaintext and the private key by adopting a preset symmetric encryption algorithm through the access node to obtain an encrypted ciphertext and an encrypted key.
7. The blockchain-based data storage device of claim 5, further comprising:
and the management module is used for managing the security level and the sharing range of the encryption key by adopting a preset key derivation function.
8. The blockchain-based data storage device of claim 5, wherein the storage module is specifically configured to:
calculating sub-block hash values of target storage data through the target block chain nodes;
splicing the sub-block hash values into hash strings, and calculating corresponding hash values to obtain global state root hashes;
and constructing a Meckel tree for storing different state data based on the global state root hash.
9. A blockchain-based data storage device, the device comprising a processor and a memory;
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the blockchain-based data storage method of any one of claims 1 to 4 according to instructions in the program code.
10. A computer-readable storage medium for storing program code, the program code is for performing the blockchain-based data storage method of any one of claims 1 to 4.
CN202210769440.8A 2022-07-01 2022-07-01 Data storage method based on block chain and related device Pending CN115150417A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210769440.8A CN115150417A (en) 2022-07-01 2022-07-01 Data storage method based on block chain and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210769440.8A CN115150417A (en) 2022-07-01 2022-07-01 Data storage method based on block chain and related device

Publications (1)

Publication Number Publication Date
CN115150417A true CN115150417A (en) 2022-10-04

Family

ID=83409797

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210769440.8A Pending CN115150417A (en) 2022-07-01 2022-07-01 Data storage method based on block chain and related device

Country Status (1)

Country Link
CN (1) CN115150417A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109903049A (en) * 2019-03-01 2019-06-18 长沙理工大学 A kind of block chain transaction data storage method, device, equipment and storage medium
CN110832519A (en) * 2019-03-27 2020-02-21 阿里巴巴集团控股有限公司 Improving integrity of communications between blockchain networks and external data sources
CN111865563A (en) * 2020-07-27 2020-10-30 北京航空航天大学 Civil aviation passenger data safety protection and anti-falsification scheme based on alliance chain
CN111916173A (en) * 2020-08-07 2020-11-10 安徽师范大学 Medical data safety sharing system and method based on IPFS and alliance chain
WO2021068728A1 (en) * 2019-10-10 2021-04-15 深圳前海微众银行股份有限公司 Methods and apparatus for generating state tree of block and validating on-chain data
CN114172735A (en) * 2021-12-11 2022-03-11 中国人民解放军战略支援部队信息工程大学 Double-chain mixed block chain data sharing method and system based on intelligent contract

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109903049A (en) * 2019-03-01 2019-06-18 长沙理工大学 A kind of block chain transaction data storage method, device, equipment and storage medium
CN110832519A (en) * 2019-03-27 2020-02-21 阿里巴巴集团控股有限公司 Improving integrity of communications between blockchain networks and external data sources
WO2021068728A1 (en) * 2019-10-10 2021-04-15 深圳前海微众银行股份有限公司 Methods and apparatus for generating state tree of block and validating on-chain data
CN111865563A (en) * 2020-07-27 2020-10-30 北京航空航天大学 Civil aviation passenger data safety protection and anti-falsification scheme based on alliance chain
CN111916173A (en) * 2020-08-07 2020-11-10 安徽师范大学 Medical data safety sharing system and method based on IPFS and alliance chain
CN114172735A (en) * 2021-12-11 2022-03-11 中国人民解放军战略支援部队信息工程大学 Double-chain mixed block chain data sharing method and system based on intelligent contract

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
吕冰等: "基于龙芯平台的服务器密码", 2021年国家网络安全宣传周"网络安全产业发展论坛"论文集, 5 October 2021 (2021-10-05) *

Similar Documents

Publication Publication Date Title
EP3345360B1 (en) Method for storing an object on a plurality of storage nodes
CN111492624B (en) Method and control system for controlling and/or monitoring a device
Ray et al. Secure logging as a service—delegating log management to the cloud
CN112740615B (en) Key management for multiparty computing
CN110268679B (en) Block chain-based authentication method and system
Luo et al. A novel covert communication method based on bitcoin transaction
CN112313908B (en) Method and control system for controlling and/or monitoring a device
CN111327419B (en) Method and system for resisting quantum computation block chain based on secret sharing
EP3552131A1 (en) Password security
WO2021034274A1 (en) Blockchain for operational data security in industrial control systems
CN117240625B (en) Tamper-resistant data processing method and device and electronic equipment
CN111585995B (en) Secure wind control information transmission and processing method and device, computer equipment and storage medium
WO2018035371A1 (en) Multi-factor-protected private key distribution
CN114078061A (en) Electric power core data traceability system based on block chain
CN113726515B (en) UKEY-based key processing method, storage medium and electronic device
CN114885325A (en) Credible auditing method and system for regulating and controlling service network security suitable for 5G network
CN111212026A (en) Data processing method and device based on block chain and computer equipment
CN112968774B (en) Method, device storage medium and equipment for encrypting and decrypting configuration file
CN117439799A (en) Anti-tampering method for http request data
CN116112216B (en) Cloud data verification method and device, electronic equipment and nonvolatile storage medium
Jabbar et al. Design and implementation of hybrid EC-RSA security algorithm based on TPA for cloud storage
CN115150417A (en) Data storage method based on block chain and related device
CN104780049B (en) A kind of method of safe read-write data
Keerthana et al. Slicing, Tokenization, and Encryption Based Combinational Approach to Protect Data-at-Rest in Cloud Using TF-Sec Model
Venkatesan et al. Multi-agent based dynamic data integrity protection in cloud computing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination