CN111259413A - Data management method and device based on block chain - Google Patents

Data management method and device based on block chain Download PDF

Info

Publication number
CN111259413A
CN111259413A CN202010024400.1A CN202010024400A CN111259413A CN 111259413 A CN111259413 A CN 111259413A CN 202010024400 A CN202010024400 A CN 202010024400A CN 111259413 A CN111259413 A CN 111259413A
Authority
CN
China
Prior art keywords
encrypted data
check code
data
verification
block chain
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
CN202010024400.1A
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.)
Shanghai Wangchain Information Technology Co Ltd
Original Assignee
Shanghai Wangchain Information 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 Shanghai Wangchain Information Technology Co Ltd filed Critical Shanghai Wangchain Information Technology Co Ltd
Priority to CN202010024400.1A priority Critical patent/CN111259413A/en
Publication of CN111259413A publication Critical patent/CN111259413A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/64Protecting data integrity, e.g. using checksums, certificates or signatures

Abstract

The invention discloses a data management method and a device based on a block chain, wherein the method comprises the following steps: receiving encrypted data uploaded by a user, and verifying the encrypted data by using a verification algorithm to generate a verification code; inserting a check code into the encrypted data, and writing the encrypted data into a node on a block chain; receiving a data access request input by a user, verifying the check code of the encrypted data in the nodes on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted. The method improves the safety of data uploading and reading in the block chain.

Description

Data management method and device based on block chain
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a block chain-based data management method and apparatus.
Background
With the rapid development of blockchain technology, there is a threat to data in many aspects, and whether the process of uploading or reading data becomes unsafe, the data is likely to be lost or tampered. In order to avoid the risks, many blockchain products use hardware private key storage equipment, so that the process of accessing data uplink is not touched, and the data security is ensured.
At present, the cold wallet is a related invention which typically uses a hardware private key storage technology in recent years, the storage function of the cold wallet is similar to that of a hard disk, but in the transaction, a payment password is needed, a strong seed password is randomly generated to obtain a private key and an address, and each transaction is subjected to digital signature remarking and is ready to be checked. The cold wallet is mainly used for the secure storage and transaction of digital assets, and cannot be applied to wider scenes, and particularly in wider application fields such as data security and access right control, related technologies are yet to be researched. Meanwhile, when the cold wallet is used for creating the wallet, the private key backup is quite troublesome, two persons far away and credible from each other are firstly found, and the traffic modes cannot be consistent, so that the financial and material expenses are increased. The cold wallet avoids the risk of stealing the private key by a hacker, but may face physical security risks, such as computer loss and damage, which brings great inconvenience to the application landing of non-digital assets.
Therefore, how to improve the security of data uploading and reading in the blockchain is an urgent problem to be solved.
Disclosure of Invention
The invention aims to provide a data management method and device based on a block chain, so as to improve the security of data uploading and reading in the block chain.
In order to solve the above technical problem, the present invention provides a data management method based on a block chain, including:
receiving encrypted data uploaded by a user, and verifying the encrypted data by using a verification algorithm to generate a verification code;
inserting a check code into the encrypted data, and writing the encrypted data into a node on a block chain;
receiving a data access request input by a user, verifying the check code of the encrypted data in the nodes on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted.
Preferably, the check algorithm includes a hash algorithm or a parity algorithm.
Preferably, the verifying the check code of the encrypted data in the node on the block chain, and if the verification is successful, deleting the check code of the encrypted data, and reading the encrypted data from which the check code is deleted includes:
and verifying the check code of the encrypted data, verifying whether the encrypted data contains the verification code, if so, deleting the check code in the encrypted data, and reading the encrypted data with the deleted check code.
Preferably, the method further comprises:
and if the verification fails, modifying the encrypted data to ensure that the modified encrypted data is the same as the encrypted data in the writing process, and reading out the modified encrypted data.
The invention also provides a data management device based on the block chain, which is used for realizing the method and comprises the following steps:
the verification module is used for receiving encrypted data uploaded by a user, verifying the encrypted data by using a verification algorithm and generating a verification code;
a write-in module, configured to insert a check code into the encrypted data, and write the encrypted data into a node on a block chain;
and the reading module is used for receiving a data access request input by a user, verifying the check code of the encrypted data in the node on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted.
Preferably, the check algorithm includes a hash algorithm or a parity algorithm.
Preferably, the reading module is specifically configured to receive a data access request input by a user, verify a check code of the encrypted data, verify whether the encrypted data contains the check code, delete the check code in the encrypted data if yes, and read the encrypted data from which the check code is deleted.
Preferably, the reading module further includes:
and the modifying unit is used for modifying the encrypted data if the verification fails, so that the modified encrypted data is the same as the encrypted data in the writing process, and reading out the modified encrypted data.
The invention provides a data management method and device based on a block chain, which are characterized in that encrypted data uploaded by a user are received, the encrypted data are verified by using a verification algorithm, and a verification code is generated; inserting a check code into the encrypted data, and writing the encrypted data into a node on a block chain; receiving a data access request input by a user, verifying the check code of the encrypted data in the nodes on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted. Therefore, the encrypted data is verified by using a verification algorithm to generate a verification code, the verification code is inserted into the encrypted data to be stored together, when the data is read, the verification code is deleted after the verification is successful, the original encrypted data is obtained, the verification code is added and verified to ensure that the read encrypted data is completely consistent with the written encrypted data, the encrypted data in the block chain is protected, and the data uploading and reading safety in the block chain is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a block chain-based data management method according to the present invention;
fig. 2 is a schematic structural diagram of a data management apparatus based on a block chain according to the present invention.
Detailed Description
The core of the invention is to provide a data management method and device based on a block chain, so as to improve the security of data uploading and reading in the block chain.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, 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 invention.
Referring to fig. 1, fig. 1 is a flowchart of a block chain-based data management method according to the present invention, including the following steps:
s11: receiving encrypted data uploaded by a user, and verifying the encrypted data by using a verification algorithm to generate a verification code;
s12: inserting a check code into the encrypted data, and writing the encrypted data into a node on the block chain;
s13: and receiving a data access request input by a user, verifying the check code of the encrypted data in the nodes on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted.
Therefore, the method verifies the encrypted data by using a verification algorithm to generate a verification code, inserts the verification code into the encrypted data to be stored together, deletes the verification code after the verification is successful when the data is read to obtain the original encrypted data, adds and verifies the verification code to ensure that the read-out encrypted data is completely consistent with the written-in encrypted data, further protects the encrypted data in the block chain, and improves the data uploading and reading safety in the block chain.
The process of inserting the check code into the encrypted data specifically comprises the following steps: an 8-bit byte check code is added to a 512-byte data block of encrypted data. Specifically, if the written encrypted data is composed of three data blocks a1, a2, and A3, and the check code is CC, the check code CC is added after the data block a1, the check code CC is added after the data block a2, the check code CC is added after the data block A3, and then each piece of data after the code is added is integrated, then each piece of data after the verification code is added is followed by one verification code CC, that is, each piece of data is added with the corresponding check code CC.
Based on the method, further, the check algorithm comprises a hash algorithm or a parity check algorithm.
The encrypted data can be verified by utilizing a Hash algorithm to generate a check code, and the check code is inserted into the encrypted data, so that the data is protected by utilizing the check code, and the integrity of the data is ensured.
Further, in step S13, the verification of the check code is performed on the encrypted data in the node on the blockchain, and if the verification is successful, the check code in the encrypted data is deleted, and the process of reading the encrypted data from which the check code is deleted specifically includes: and verifying the check code of the encrypted data, verifying whether the encrypted data contains the verification code, if so, deleting the check code in the encrypted data, and reading the encrypted data of which the check code is deleted.
Further, the method comprises the following steps:
s21: and if the verification fails, modifying the encrypted data to ensure that the modified encrypted data is the same as the encrypted data in the writing process, and reading out the modified encrypted data.
When a user needs to read the encrypted data in the block chain, the check code is deleted after the check code is successfully verified, the correct encrypted data is read, if the verification fails, the data is damaged, the data is modified, the modified encrypted data is the same as the encrypted data during writing, and therefore the integrity and consistency of the read data and the written data are ensured,
the verification code is added into the uploaded encrypted data, so that the data can be ensured to be correct, when the data are written into a block chain node, the data are verified through a Hash algorithm, the 8-bit verification code is added into the row and the column of the data block of the encrypted data and then stored, when the data need to be read, the verification code is verified, and the verification code is deleted to be read out as normal data. The method can not only verify the read/write operation, but also ensure the data integrity in the data transmission path.
The method for protecting data by using check codes mainly comprises the following three processes: and adding a check code, verifying the check code and deleting the check code. The method comprises the following specific steps:
before user data enters a block chain node, verifying encrypted data to be written by utilizing a Hash algorithm, generating a check code, simultaneously inserting the check code into a data block, and following a rule that 8-bit byte check codes are inserted into data of every 512 bytes. After the check code is inserted, when the data is written into the block chain node, the check code verification is carried out on the data so as to ensure the integrity of the data written into the node. When a user needs to read data, the data is read out from the node after the check code verification is carried out on the data, if the data is correct, the check code is deleted, the original encrypted data is sent into the link, and the original encrypted data is read. If the data is incorrect, namely the verification fails, the data is damaged, the data is modified, the modified data is the same as the data during writing, and the integrity and consistency of the read data and the written data are ensured. The addition and verification of the check code are carried out to ensure that the read-out encrypted data is completely consistent with the written-in encrypted data, so that the data is protected, and the integrity of the data in a transmission path can be ensured.
Referring to fig. 2, fig. 2 is a schematic structural diagram of a block chain-based data management apparatus for implementing the method according to the present invention, the apparatus including:
the verification module 101 is configured to receive encrypted data uploaded by a user, verify the encrypted data by using a verification algorithm, and generate a verification code;
a writing module 102, configured to insert a check code into the encrypted data, and write the encrypted data into a node on the block chain;
the reading module 103 is configured to receive a data access request input by a user, perform check code verification on encrypted data in a node on the block chain, delete a check code in the encrypted data if verification is successful, and read the encrypted data from which the check code is deleted.
Therefore, the loading method verifies the encrypted data by using a verification algorithm to generate a verification code, meanwhile, the verification code is inserted into the encrypted data to be stored together, when the data is read, the verification code is deleted after the verification is successful to obtain the original encrypted data, the verification code is added and verified to ensure that the read-out encrypted data is completely consistent with the written-in encrypted data, the encrypted data in the block chain is protected, and the data uploading and reading safety in the block chain is improved.
Based on the above device, further, the check algorithm includes a hash algorithm or a parity check algorithm.
Further, the reading module is specifically configured to receive a data access request input by a user, verify a check code of the encrypted data, verify whether the encrypted data contains the check code, delete the check code in the encrypted data if yes, and read the encrypted data from which the check code is deleted.
Further, the reading module further comprises: and the modification unit is used for modifying the encrypted data if the verification fails, so that the modified encrypted data is the same as the encrypted data in the writing process, and reading the modified encrypted data.
The embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The block chain-based data management method and device provided by the invention are described in detail above. The principles and embodiments of the present invention are explained herein using specific examples, which are presented only to assist in understanding the method and its core concepts. It should be noted that, for those skilled in the art, it is possible to make various improvements and modifications to the present invention without departing from the principle of the present invention, and those improvements and modifications also fall within the scope of the claims of the present invention.

Claims (8)

1. A data management method based on a block chain is characterized by comprising the following steps:
receiving encrypted data uploaded by a user, and verifying the encrypted data by using a verification algorithm to generate a verification code;
inserting a check code into the encrypted data, and writing the encrypted data into a node on a block chain;
receiving a data access request input by a user, verifying the check code of the encrypted data in the nodes on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted.
2. The method of claim 1, wherein the check algorithm comprises a hash algorithm or a parity algorithm.
3. The method of claim 1, wherein the verifying the check code of the encrypted data in the node on the blockchain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data with the deleted check code comprises:
and verifying the check code of the encrypted data, verifying whether the encrypted data contains the verification code, if so, deleting the check code in the encrypted data, and reading the encrypted data with the deleted check code.
4. The method of claim 1, further comprising:
and if the verification fails, modifying the encrypted data to ensure that the modified encrypted data is the same as the encrypted data in the writing process, and reading out the modified encrypted data.
5. A blockchain-based data management apparatus for implementing the method according to any one of claims 1 to 4, comprising:
the verification module is used for receiving encrypted data uploaded by a user, verifying the encrypted data by using a verification algorithm and generating a verification code;
a write-in module, configured to insert a check code into the encrypted data, and write the encrypted data into a node on a block chain;
and the reading module is used for receiving a data access request input by a user, verifying the check code of the encrypted data in the node on the block chain, deleting the check code of the encrypted data if the verification is successful, and reading the encrypted data of which the check code is deleted.
6. The apparatus of claim 5, wherein the check algorithm comprises a hash algorithm or a parity algorithm.
7. The apparatus according to claim 5, wherein the reading module is specifically configured to receive a data access request input by a user, verify the check code of the encrypted data, verify whether the encrypted data includes the check code, delete the check code of the encrypted data if the encrypted data includes the check code, and read the encrypted data from which the check code is deleted.
8. The apparatus of claim 5, wherein the read module further comprises:
and the modifying unit is used for modifying the encrypted data if the verification fails, so that the modified encrypted data is the same as the encrypted data in the writing process, and reading out the modified encrypted data.
CN202010024400.1A 2020-01-10 2020-01-10 Data management method and device based on block chain Pending CN111259413A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010024400.1A CN111259413A (en) 2020-01-10 2020-01-10 Data management method and device based on block chain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010024400.1A CN111259413A (en) 2020-01-10 2020-01-10 Data management method and device based on block chain

Publications (1)

Publication Number Publication Date
CN111259413A true CN111259413A (en) 2020-06-09

Family

ID=70950339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010024400.1A Pending CN111259413A (en) 2020-01-10 2020-01-10 Data management method and device based on block chain

Country Status (1)

Country Link
CN (1) CN111259413A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183382A (en) * 2015-09-09 2015-12-23 浪潮(北京)电子信息产业有限公司 Data block protection method and device
CN108600227A (en) * 2018-04-26 2018-09-28 众安信息技术服务有限公司 A kind of medical data sharing method and device based on block chain
CN108646983A (en) * 2018-05-08 2018-10-12 北京融链科技有限公司 The treating method and apparatus of storage service data on block chain
CN109492426A (en) * 2018-10-09 2019-03-19 重庆易保全网络科技有限公司 Security method, device, storage medium and server based on block chain
CN109861992A (en) * 2019-01-10 2019-06-07 深圳英飞拓智能技术有限公司 A kind of information interacting method and across scene method for tracing of monitor terminal
CN109918925A (en) * 2019-02-19 2019-06-21 上海泉坤信息科技有限公司 Date storage method, back end and storage medium
CN110164534A (en) * 2019-05-30 2019-08-23 爱多特(广东)网络技术有限公司 Diabetes remote comprehensive based on block chain intervenes management service and is worth excitation system
CN110457911A (en) * 2019-06-24 2019-11-15 深圳壹账通智能科技有限公司 A kind of bill management method, system and computer readable storage medium
CN110601848A (en) * 2019-09-10 2019-12-20 北京清红微谷技术开发有限责任公司 Appointment information processing method, device and system based on block chain and electronic equipment
CN110602079A (en) * 2019-09-05 2019-12-20 广州怀恩科技有限公司 Scientific research data uploading and storing method based on block chain technology hierarchical control

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105183382A (en) * 2015-09-09 2015-12-23 浪潮(北京)电子信息产业有限公司 Data block protection method and device
CN108600227A (en) * 2018-04-26 2018-09-28 众安信息技术服务有限公司 A kind of medical data sharing method and device based on block chain
CN108646983A (en) * 2018-05-08 2018-10-12 北京融链科技有限公司 The treating method and apparatus of storage service data on block chain
CN109492426A (en) * 2018-10-09 2019-03-19 重庆易保全网络科技有限公司 Security method, device, storage medium and server based on block chain
CN109861992A (en) * 2019-01-10 2019-06-07 深圳英飞拓智能技术有限公司 A kind of information interacting method and across scene method for tracing of monitor terminal
CN109918925A (en) * 2019-02-19 2019-06-21 上海泉坤信息科技有限公司 Date storage method, back end and storage medium
CN110164534A (en) * 2019-05-30 2019-08-23 爱多特(广东)网络技术有限公司 Diabetes remote comprehensive based on block chain intervenes management service and is worth excitation system
CN110457911A (en) * 2019-06-24 2019-11-15 深圳壹账通智能科技有限公司 A kind of bill management method, system and computer readable storage medium
CN110602079A (en) * 2019-09-05 2019-12-20 广州怀恩科技有限公司 Scientific research data uploading and storing method based on block chain technology hierarchical control
CN110601848A (en) * 2019-09-10 2019-12-20 北京清红微谷技术开发有限责任公司 Appointment information processing method, device and system based on block chain and electronic equipment

Similar Documents

Publication Publication Date Title
CN111723383B (en) Data storage and verification method and device
CN108334753B (en) Pirate application verification method and distributed server node
EP3740920A1 (en) Multi-approval system using m of n keys to perform an action at a customer device
US20140289523A1 (en) Systems and methods for authenticating and protecting the integrity of data streams and other data
EP1542112A1 (en) Open type general-purpose attack-resistant cpu, and application system thereof
CN110795126A (en) Firmware safety upgrading system
CN108496323B (en) Certificate importing method and terminal
CN105183382B (en) A kind of data block guard method and device
CN112257086B (en) User privacy data protection method and electronic equipment
EP3316160A1 (en) Authentication method and apparatus for reinforced software
CN108229144B (en) Verification method of application program, terminal equipment and storage medium
KR101443405B1 (en) System and method for securing data
CN111292091A (en) Verification method, device and equipment
CN111539042B (en) Safe operation method based on trusted storage of core data files
JP4475386B2 (en) Chip card initialization
CN106533678A (en) Multi-signature-based login method and system thereof
CN111259413A (en) Data management method and device based on block chain
WO2022148149A1 (en) License file management method and apparatus, and device
CN110311773B (en) Method for preventing injection type attack of advanced encryption standard coprocessor
CN115688120A (en) Secure chip firmware importing method, secure chip and computer readable storage medium
KR101673369B1 (en) Security providing method of improving security of application in mobile device through integrity verification performed in mobile device
CN112165396A (en) Method for updating safety firmware
CN114297679B (en) Method for encrypted transmission and upgrading of mirror image
CN117768114A (en) Key derivation method and security architecture system
CN117827229A (en) Method for preventing device firmware version from rolling back

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200609