WO2020233235A1 - 一种区块链的数据验证方法和装置 - Google Patents
一种区块链的数据验证方法和装置 Download PDFInfo
- Publication number
- WO2020233235A1 WO2020233235A1 PCT/CN2020/082203 CN2020082203W WO2020233235A1 WO 2020233235 A1 WO2020233235 A1 WO 2020233235A1 CN 2020082203 W CN2020082203 W CN 2020082203W WO 2020233235 A1 WO2020233235 A1 WO 2020233235A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- encrypted
- organization
- institution
- requesting
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/602—Providing cryptographic facilities or services
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q40/00—Finance; Insurance; Tax strategies; Processing of corporate or income taxes
- G06Q40/04—Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
Definitions
- the embodiments of the present invention relate to the field of Fintech, and in particular, to a method and device for data verification of a blockchain (Blockchain).
- Blockchain is a way for all people to participate in bookkeeping, which has the characteristics of decentralization and trustlessness. The most important thing about blockchain is to solve the problem of intermediary credit. In the past, it was difficult for two people who did not know and trust each other to achieve collaboration, and it was necessary to rely on a third party. For example, payment behavior, any kind of transfer in the past, must have an institution such as a bank or Alipay. However, through blockchain technology, Bitcoin is the first time that human beings can complete mutual trust transfer behavior without any intermediary institutions. This is a major breakthrough in the blockchain, and the blockchain is becoming more and more important. Get people's attention.
- the present invention provides a blockchain data verification method and device to solve the problem of untrustworthy and low security of data requests in the prior art.
- the embodiment of the present invention provides a blockchain data verification method, including:
- the data requesting institution sends a data request to the data storage institution; the data request is used to obtain the first data;
- the data requesting institution obtains the request response returned by the data storage institution, so that the data requesting institution obtains the second encrypted data;
- the data requesting agency decrypts the second encrypted data to obtain the second data
- the data requesting institution obtains the first hash value of the first data from the blockchain;
- the first hash value is the interference of the data storage institution based on the first data and the first data Value generated and uploaded to the blockchain;
- the data requesting organization When the data requesting organization confirms that the first hash value and the second hash value are consistent, obtain the first data from the second data; the second hash value is that the data requesting organization passes the The second data is generated.
- the request response includes the second encrypted data
- the data request agency decrypts the second encrypted data to obtain the second data, including:
- the data requesting organization decrypts the second encrypted data according to the private key of the data requesting organization to obtain the second data; the second encrypted data is the data storage organization according to the public key of the data requesting organization Obtained after encryption.
- the request response further includes a signature of the second encrypted data;
- the signature of the second encrypted data is that the data storage organization uses the private key of the data storage organization to Encrypted data to be signed;
- the method further includes:
- the data requesting organization verifies the signature of the second encrypted data according to the public key of the data storage organization.
- the request response includes the second encrypted data and a signature of the second encrypted data
- the method further includes:
- the data requesting institution obtains the third hash value of the first data from the blockchain; the third hash value is the signature of the data storage institution based on the first encrypted data and the first encrypted data The first encrypted data is obtained after the data storage organization encrypts the first data and the interference value of the first data according to the public key of the data requesting organization;
- the data requesting agency determines a fourth hash value according to the second encrypted data and the signature of the second encrypted data
- the data requesting agency confirms that the third hash value is consistent with the fourth hash value.
- the request response includes the address of the first encrypted data on the blockchain;
- the first encrypted data is the data storage institution pairing the data according to the public key of the data requesting institution
- the first data and the interference value of the first data are obtained after encryption;
- the address is obtained after the data storage institution uploads the first encrypted data to the blockchain;
- the acquiring, by the data requesting organization, the request response returned by the data storage organization so that the data requesting organization can acquire the second encrypted data includes:
- the data requesting agency obtains the second encrypted data according to the address.
- the request response includes a two-dimensional code; the two-dimensional code is generated by the data storage institution according to the first encrypted data; the first encrypted data is the data storage institution according to the Obtained after the public key of the data requesting agency encrypts the first data and the interference value of the first data;
- the acquiring, by the data requesting organization, the request response returned by the data storage organization so that the data requesting organization can acquire the second encrypted data includes:
- the data requesting institution obtains the second encrypted data through the two-dimensional code sent by the data storage institution.
- the embodiment of the present invention provides a blockchain data verification method, including:
- the data storage mechanism determines the interference value of the first data
- the data storage mechanism generates a first hash value of the first data according to the interference value of the first data and the first data;
- the data storage mechanism uploads the first hash value to the chain through the blockchain; the first hash value is used by the data requesting organization to determine whether the encrypted data obtained through the data storage mechanism is consistent with the information on the chain.
- the method further includes:
- the data storage mechanism receives a data request sent by a data requesting mechanism; the data request is used to obtain the first data;
- the data storage institution sends a request response to the data request institution, and the data response is used by the data request institution to obtain the second encrypted data provided by the data storage institution so that the data request institution can pass the second
- the data is encrypted to obtain the first data.
- the data response used by the data requesting organization to obtain the second encrypted data provided by the data storage organization includes:
- the data response includes the second encrypted data; the second encrypted data is after the data storage organization encrypts the first data and the interference value of the first data according to the public key of the data requesting organization Obtained; or
- the data response includes the address of the first encrypted data on the blockchain; the first encrypted data is that the data storage organization compares the first data and the first data with the public key of the data requesting organization.
- the interference value of a data is obtained after encryption; the address is obtained after the data storage institution uploads the first encrypted data to the blockchain; or
- the data response includes a two-dimensional code, the two-dimensional code is generated by the data storage institution according to the first encrypted data; the first encrypted data is the data storage institution according to the public key pair of the data requesting institution Obtained after encryption of the first data and the interference value of the first data;
- the method further includes:
- the data storage organization encrypts the first data and the interference value of the first data by using the public key of the data request organization to obtain the first encrypted data;
- the data storage mechanism generates a third hash value from the first encrypted data and the signature of the first encrypted data, and stores the third hash value in the blockchain, so that the data request mechanism Verify the request response.
- the embodiment of the present invention provides a block chain data verification device, including:
- a transceiver unit configured to send a data request to a data storage institution; the data request is used to obtain first data; and a request response returned by the data storage institution is obtained, so that the data request institution obtains the second encrypted data;
- the processing unit is used to decrypt the second encrypted data to obtain the second data; obtain the first hash value of the first data from the blockchain; the first hash value is the data storage mechanism according to The interference value of the first data and the first data is generated and uploaded to the blockchain; when it is confirmed that the first hash value and the second hash value are consistent, all the values are obtained from the second data
- the first data; the second hash value is generated by the data requesting agency through the second data.
- the request response includes the second encrypted data
- the processing unit is specifically configured to: decrypt the second encrypted data according to the private key of the data requesting organization to obtain the second Data; the second encrypted data is obtained by the data storage organization after encryption according to the public key of the data requesting organization.
- the request response further includes a signature of the second encrypted data;
- the signature of the second encrypted data is that the data storage organization uses the private key of the data storage organization to The encrypted data is obtained by signing;
- the processing unit is specifically configured to verify the signature of the second encrypted data according to the public key of the data storage institution.
- the request response includes the second encrypted data and a signature of the second encrypted data
- the transceiver unit is specifically configured to obtain the third hash value of the first data from the blockchain;
- the third hash value is the data storage mechanism according to the first encrypted data and the first encrypted Generated by the signature of the data;
- the first encrypted data is obtained after the data storage organization encrypts the first data and the interference value of the first data according to the public key of the data requesting organization;
- the processing unit is further configured to determine a fourth hash value according to the second encrypted data and the signature of the second encrypted data; confirm that the third hash value is consistent with the fourth hash value.
- the request response includes the address of the first encrypted data on the blockchain;
- the first encrypted data is the data storage institution pairing the data according to the public key of the data requesting institution
- the first data and the interference value of the first data are obtained after encryption;
- the address is obtained after the data storage institution uploads the first encrypted data to the blockchain;
- the processing unit is further configured to obtain the second encrypted data according to the address.
- the request response includes a two-dimensional code; the two-dimensional code is generated by the data storage institution according to the first encrypted data; the first encrypted data is the data storage institution according to the Obtained after the public key of the data requesting agency encrypts the first data and the interference value of the first data;
- the transceiver unit is further configured to obtain the second encrypted data through the two-dimensional code sent by the data storage mechanism.
- the embodiment of the present invention provides a block chain data verification device, including:
- the transceiver unit is used for the data storage mechanism to determine the interference value of the first data
- the processing unit is configured to generate a first hash value of the first data according to the interference value of the first data and the first data; upload the first hash value through the blockchain; The first hash value is used by the data requesting organization to determine whether the encrypted data obtained by the data storage organization is consistent with the information on the chain.
- the transceiver unit is further configured to receive a data request sent by a data requesting organization; the data request is used to obtain the first data; and a request response is sent to the data requesting organization. The response is used for the data requesting agency to obtain the second encrypted data provided by the data storage agency so that the data requesting agency obtains the first data through the second encrypted data.
- the data response includes the second encrypted data; the second encrypted data is that the data storage institution compares the first data and the first data with the public key of the data requesting institution.
- the interference value of a data is obtained after encryption; or
- the data response includes the address of the first encrypted data on the blockchain; the first encrypted data is that the data storage organization compares the first data and the first data with the public key of the data requesting organization.
- the interference value of a data is obtained after encryption; the address is obtained after the data storage institution uploads the first encrypted data to the blockchain; or
- the data response includes a two-dimensional code, the two-dimensional code is generated by the data storage institution according to the first encrypted data; the first encrypted data is the data storage institution according to the public key pair of the data requesting institution Obtained after encryption of the first data and the interference value of the first data;
- the processing unit is further configured to encrypt the first data and the interference value of the first data using the public key of the data requesting organization to obtain the first encrypted data;
- the private key of the data storage mechanism generates a signature of the first encrypted data; generates a third hash value from the first encrypted data and the signature of the first encrypted data, and stores the third hash value in all The blockchain, so that the data requesting agency verifies the request response.
- An embodiment of the present invention provides a computer storage medium, where the computer-readable storage medium includes a computer program, and when the computer program runs on a computer, the computer executes the method described in any one of the foregoing embodiments.
- An embodiment of the present invention provides a computer program product containing instructions, which when the instructions run on a computer, cause the computer to execute the method described in any one of the foregoing embodiments.
- the embodiment of the present invention provides a computer device, including:
- At least one memory for storing program instructions
- At least one processor is configured to invoke program instructions stored in the memory, and execute the method according to any one of the foregoing embodiments according to the obtained program.
- the original data is stored in the private database of each organization in the blockchain network, and the plaintext will not be uploaded to the chain, only the hash of the data will be uploaded; each hash value is confused by the interference value, and the interference value can be Self-renewal eliminates the possibility of reverse attack.
- Data disclosure is encrypted by asymmetrically encrypted public key and signed by private key; the public key is placed on the chain, and the participating parties cannot be tampered with or denied; each disclosed data ciphertext can only be decrypted by the disclosed party, so there is no need to worry about data leakage .
- the ciphertext of the data disclosure supports further credit enhancement on the chain deposit certificate. Effectively ensure the security and reliability of transaction data.
- Figure 1a is a schematic diagram of a system architecture provided by an embodiment of the present invention.
- Figure 1b is a schematic diagram of another system architecture provided by an embodiment of the present invention.
- FIG. 2 is a schematic flowchart of a data verification method provided by an embodiment of the present invention.
- FIG. 3 is a schematic structural diagram of a data verification device provided by an embodiment of the present invention.
- FIG. 4 is a schematic structural diagram of a data verification device provided by an embodiment of the present invention.
- Fig. 5 is a schematic structural diagram of a computer device provided by an embodiment of the present invention.
- Data storage organization This role is used to describe the organization that stores the data and prepares to disclose it. Other institutions may apply to data storage institutions for data disclosure.
- Data requesting agency This role has the need to apply for data disclosure to the data requesting agency.
- Blockchain All participants have the read and write access capabilities of the blockchain.
- Block used to record data collections and status results divided according to certain conditions, which are formed after each node reaches a consensus.
- the data to be recorded is mainly data or user data
- blocks can be divided by time. For example, a block is generated every 10 seconds (s), then this block is to record all the data in these 10s, or a block is generated every day, then this The block is to record all the data during the day; or, the block can also be divided according to the number of received data or history update information, for example, after receiving a specified amount of data or history update information, a block is generated Block, then this block is used to record the specified amount of data update information that has been received.
- a block includes a block header and a block body.
- the block header includes the previous block address (Prev-block)
- the previous block address can be stored in the block header in the form of the previous block hash code (pre-hash)
- pre-hash previous block hash code
- the direction of the address connects all the blocks in series to form a blockchain.
- the block body is used to store specific data, such as data in the embodiment of the present invention.
- Blockchain or distributed data recording ledger, is a chained data structure in which data storage blocks are sequentially connected in a certain order. As shown in Figure 1a, the blocks are connected in sequence to form a blockchain.
- Node refers to the computing equipment that participates in the process of data recording or verification in the blockchain network.
- computers, mobile phones, mining machines, desktops, or servers that have computing capabilities can all be used as nodes in the blockchain network.
- any device in the network can be used as a node of the blockchain and can participate in the recording and storage of the blockchain. Based on the consensus mechanism between nodes, the entire block is jointly maintained through competitive computing. chain. Since any node can have a complete copy of the data of the blockchain, any node fails, and the remaining nodes can still work normally, so the reliability of the blockchain-based storage method is high.
- each node can have the same authority, so there is no centralized equipment or management organization. All data information in the blockchain is open and transparent, and the modification of its own data by a single node or even multiple nodes cannot affect the data of other nodes unless it can control more than half of the nodes in the entire blockchain network to modify. However, this method is too difficult, and each block in the blockchain is associated with two blocks before and after. If you want to tamper with the data of a block, you need to tamper with multiple blocks related to it. Data is more difficult, so the data stored based on the blockchain is immutable.
- Hash value an algorithm that generates a hash map value for a certain string, such as sha3.
- the data storage organization has moral hazard, and it may not guarantee that the data published by the data storage organization on the chain is consistent with the data used for transmission; in this regard, the data storage organization can generate a Hash certificate for the data Publicize on the blockchain. For example, it is based on storing each participant's own public key on the blockchain, then using the other party's public key to encrypt, or even signing with their own private key, and transmitting data.
- Fig. 1b exemplarily shows another schematic diagram of the system architecture to which the embodiment of the present invention is applicable. As shown in Fig.
- the system architecture to which the embodiment of the present invention is applicable includes a data request mechanism 101; a data storage mechanism 102; and a blockchain network 103 .
- the data request agency 101 sends a data request to the data storage agency; the data storage agency is connected to the blockchain network and sends the data that needs to be chained to the blockchain network; the data request agency is connected to the blockchain network to verify the data returned by the data storage agency Response data.
- the nodes in the blockchain network can be accounting nodes or ordinary nodes. However, when the frequency of the data itself does not change much, Hash may be violently reversed.
- an embodiment of the present invention provides a blockchain data verification method, as shown in FIG. 2, including:
- Step 201 The data storage mechanism determines the interference value of the first data; the data storage mechanism generates the first hash value of the first data according to the interference value of the first data and the first data.
- the interference value may be a string of variable length.
- the interference value can be a salt value or a pseudo-random sequence. The following description takes the salt value as an example.
- the salt value refers to a string of unspecified length.
- the data structures of the first data 1 and the first data 2 are as follows:
- the first data and the interference value are used as input parameters of the Hash algorithm to generate a hash map value. Since the terminal that is reversely attacked does not know the existence of the interference value, it cannot reverse the first data and interference value, and can only be interpreted as meaningless characters in the same field of the first data. Therefore, the Hash value resistance is provided. The ability to reverse attack.
- Step 202 The data storage institution uploads the first hash value to the chain through the blockchain; the first hash value is used by the data requesting institution to determine whether the encrypted data obtained through the data storage institution is consistent with the information on the chain.
- the data storage organization publishes the data table on the blockchain.
- the data storage organization publishes a data table, including each disclosed data identification, calculated hash, and other remarks attributes.
- the data identification should not contain any real data, it is only used to confirm "what is stored in this data" to other data requesting agencies.
- the data storage institution may store other remarks information in the remarks column for easy understanding by other institutions.
- the embodiment of the present invention provides an example of a public data table:
- the salt value can also include an update process, which is called by the data storage mechanism.
- the data storage organization can define the cycle by itself and change the salt value of the data at any time.
- the data storage organization can determine the updated hash value based on the data and the updated salt value, and update it in the public data table published on the chain to further improve the security of the data.
- a possible implementation is that before the data requesting organization sends the data request, the data requesting organization can pre-store the hash value of the data. Therefore, the data requesting organization will attach the hash value when applying for disclosure; if the hash value is in this gap If an update occurs in the database, the data storage organization will return the result of "not found". The data requesting agency can check whether the hash has been updated, and re-acquire the hash value of the data according to actual needs.
- Step 203 The data requesting organization sends a data request to the data storage organization; the data request is used to obtain the first data; the data storage organization receives the data request sent by the data requesting organization.
- Step 204 The data storage institution sends a request response to the data request institution, and the data response is used by the data request institution to obtain the second encrypted data provided by the data storage institution so that the data request institution can pass the first Encrypt the data to obtain the first data.
- the data requesting institution obtains the request response returned by the data storage institution, so that the data requesting institution obtains the second encrypted data.
- Step 205 The data requesting agency decrypts the second encrypted data to obtain the second data
- the data requesting institution obtains the first hash value of the first data from the blockchain; the first hash value is generated by the data storage institution according to the first data and the interference value of the first data And uploaded to the blockchain;
- the data requesting organization When the data requesting organization confirms that the first hash value is consistent with the second hash value, it obtains the first data from the second data; the second hash value is that the data requesting organization passes the second hash value. Data generated.
- the first hash value is generated by the data storage mechanism according to the first data and the interference value of the first data and uploaded to the blockchain, so that the original data exists in each data
- the plaintext will not be uploaded to the chain, only the hash of the data will be uploaded; each hash value is confused by the interference value, and the interference value can be updated independently, eliminating the possibility of reverse attack.
- Data disclosure is encrypted by asymmetrically encrypted public key and signed by private key; the public key is placed on the chain, and the participating parties cannot be tampered with or denied; each disclosed data ciphertext can only be decrypted by the disclosed party, so there is no need to worry about data leakage , Which effectively guarantees the security and reliability of transaction data.
- a possible implementation method further includes:
- the data storage organization uses the public key of the data request organization to encrypt the first data and the interference value of the first data to obtain first encrypted data.
- the request response includes the second encrypted data; the data requesting agency decrypts the second encrypted data to obtain the second data, including:
- the data requesting organization decrypts the second encrypted data according to the private key of the data requesting organization to obtain the second data; the second encrypted data is encrypted by the data storage organization according to the public key of the data requesting organization acquired.
- the method further includes: a data storage organization generates a signature of the first encrypted data through a private key of the data storage organization.
- the request response further includes a signature of the second encrypted data;
- the signature of the second encrypted data is that the data storage institution signs the second encrypted data with the private key of the data storage institution owned;
- step 206 the data requesting organization verifies the signature of the second encrypted data according to the public key of the data storage organization.
- a possible implementation is that the data storage mechanism generates a third hash value from the first encrypted data and the signature of the first encrypted data, and stores the third hash value To the blockchain so that the data requesting agency verifies the request response.
- the request response includes the second encrypted data and a signature of the second encrypted data; the method further includes:
- Step 1 The data requesting institution obtains the third hash value of the first data from the blockchain; the third hash value is the data storage institution based on the first encrypted data and the first encrypted data Signature generated; the first encrypted data is obtained after the data storage organization encrypts the first data and the interference value of the first data according to the public key of the data requesting organization;
- Step 2 The data requesting agency determines a fourth hash value according to the second encrypted data and the signature of the second encrypted data;
- Step 3 The data requesting agency confirms that the third hash value is consistent with the fourth hash value.
- the data response for the data requesting organization to obtain the second encrypted data provided by the data storage organization includes:
- the data response includes the address of the first encrypted data on the blockchain; the address is after the data storage institution uploads the first encrypted data to the blockchain Obtained;
- the data requesting agency obtains the second encrypted data according to the address.
- the request response includes a two-dimensional code; the two-dimensional code is generated by the data storage mechanism according to the first encrypted data; the first encrypted data Is obtained by the data storage organization after encrypting the first data and the interference value of the first data according to the public key of the data requesting organization;
- step 207 in a possible implementation manner, the data requesting institution obtains the second encrypted data through the two-dimensional code sent by the data storage institution.
- the embodiment of the present invention provides a blockchain data verification method, which includes a data requesting organization applying for data and a data storage organization sending data. Specifically, it includes:
- Step 1 The data requesting organization accesses the public data table of the data storage organization, selects a number of data to be applied for, and stores the hash value of these data items.
- Step 2 The data requesting organization sends a data application request to the data storage organization, and specifies the data item and hash value to be accessed.
- Step 3 The data storage organization accesses the blockchain and obtains the public key of the data requesting organization.
- Step 4 The data storage organization serializes all requested data content and salt values.
- Step 5 The data storage organization uses the obtained public key of the data request organization to encrypt the serialized content and generate the corresponding ciphertext.
- Step 6 The data storage institution uses its own private key to sign the obtained ciphertext.
- a possible implementation is that, in order to increase credit, the data storage institution can further upload the results to the chain to form an on-chain deposit certificate.
- Step 7 The data storage institution sends the ciphertext + signature (if there is a need for credit enhancement, including the address of the deposit on the chain) to the data requesting institution. For example, through offline paper (two-dimensional code), Internet, or blockchain carrier transmission.
- the content of the certificate on the chain should at least include the signature value and ciphertext.
- the signature value + ciphertext hash value can also be uploaded on the chain.
- the on-chain certification step can also be completely removed, and it has no effect on the result of the authenticity of the data without tampering.
- the data storage institution can choose to directly send the address of the on-chain certificate to the data requesting institution instead of the ciphertext + signature-because the ciphertext + signature is already in Stored on the chain.
- the specific ciphertext + signature sending method is not limited, and there is no need to worry about whether it is leaked, because neither the ciphertext nor the signature can be reversed.
- QR code transmission It can be used in situations where data export supervision is required. Specifically, the transmitted content is converted into a two-dimensional code, and then printed on a paper slip and sent in the form of a letter.
- One possible way to achieve this is to transmit via the Internet, such as standard RPC interface, Restful API.
- One possible way to achieve this is to transmit via a blockchain network, such as the AMOP protocol.
- the embodiment of the present invention provides a blockchain data verification method, including a process for a data requesting agency to verify the authenticity of the received data, which may specifically include the following steps:
- Step 1 The data requesting organization accesses the blockchain to obtain the public key of the data storage organization.
- Step 2 The data requesting organization uses the obtained public key of the data storage organization and the received ciphertext to verify the signature.
- Step 3 The data requesting agency uses its own private key to decrypt the ciphertext to obtain the serialized data content and salt value;
- Step 4 The data requesting agency adds a salt value to each piece of data, calculates the Hash, and compares it with the Hash value it saved at the beginning of the data application process to check whether it is consistent.
- Step 5 If the data requesting organization also receives the on-chain deposit address, it needs to go to the chain to confirm that the signature value on the chain is consistent with the received signature value.
- Step 6 When all the above verification steps are passed, it indicates that the data is true and without tampering.
- the data requesting organization sends a successful verification message to the data storage organization.
- an embodiment of the present invention provides a blockchain data verification device, as shown in FIG. 3, including:
- the transceiver unit 301 is configured to send a data request to a data storage institution; the data request is used to obtain first data; to obtain a request response returned by the data storage institution, so that the data request institution obtains the second encrypted data;
- the processing unit 302 is configured to decrypt the second encrypted data to obtain second data; obtain the first hash value of the first data from the blockchain; the first hash value is the data storage mechanism Generated according to the interference value of the first data and the first data and uploaded to the blockchain; when it is confirmed that the first hash value and the second hash value are consistent, obtain from the second data
- the first data; the second hash value is generated by the data requesting agency through the second data.
- the request response includes the second encrypted data;
- the processing unit 302 is specifically configured to: decrypt the second encrypted data according to the private key of the data requesting organization to obtain the second data
- the second encrypted data is obtained by the data storage organization after encryption according to the public key of the data requesting organization.
- the request response further includes a signature of the second encrypted data;
- the signature of the second encrypted data is that the data storage organization uses the private key of the data storage organization to The encrypted data is obtained by signing;
- the processing unit 302 is specifically configured to: verify the signature of the second encrypted data according to the public key of the data storage institution.
- the request response includes the second encrypted data and a signature of the second encrypted data
- the transceiver unit 301 is specifically configured to obtain the third hash value of the first data from the blockchain; the third hash value is the data storage mechanism according to the first encrypted data and the first encrypted data The first encrypted data is obtained after the data storage organization encrypts the first data and the interference value of the first data according to the public key of the data requesting organization;
- the processing unit 302 is further configured to determine a fourth hash value according to the second encrypted data and the signature of the second encrypted data; confirm that the third hash value is consistent with the fourth hash value.
- the request response includes the address of the first encrypted data on the blockchain;
- the first encrypted data is the data storage institution pairing the data according to the public key of the data requesting institution
- the first data and the interference value of the first data are obtained after encryption;
- the address is obtained after the data storage institution uploads the first encrypted data to the blockchain;
- the processing unit 302 is further configured to obtain the second encrypted data according to the address.
- the request response includes a two-dimensional code; the two-dimensional code is generated by the data storage institution according to the first encrypted data; the first encrypted data is the data storage institution according to the Obtained after the public key of the data requesting agency encrypts the first data and the interference value of the first data;
- the transceiver unit is further configured to obtain the second encrypted data through the two-dimensional code sent by the data storage mechanism.
- an embodiment of the present invention provides a blockchain data verification device, including:
- the transceiver unit 401 is used for the data storage mechanism to determine the interference value of the first data
- the processing unit 402 is configured to generate a first hash value of the first data according to the interference value of the first data and the first data; and upload the first hash value to the chain through a blockchain;
- the first hash value is used by the data requesting organization to determine whether the encrypted data obtained through the data storage organization is consistent with the information on the chain.
- the transceiver unit 401 is further configured to receive a data request sent by a data requesting organization; the data request is used to obtain the first data; and a request response is sent to the data requesting organization. For the data requesting organization to obtain the second encrypted data provided by the data storage organization so that the data requesting organization can obtain the first data through the second encrypted data.
- the data response includes the second encrypted data; the second encrypted data is that the data storage institution compares the first data and the first data with the public key of the data requesting institution.
- the interference value of a data is obtained after encryption; or
- the data response includes the address of the first encrypted data on the blockchain; the first encrypted data is that the data storage organization compares the first data and the first data with the public key of the data requesting organization.
- the interference value of a data is obtained after encryption; the address is obtained after the data storage institution uploads the first encrypted data to the blockchain; or
- the data response includes a two-dimensional code, the two-dimensional code is generated by the data storage institution according to the first encrypted data; the first encrypted data is the data storage institution according to the public key pair of the data requesting institution Obtained after encryption of the first data and the interference value of the first data;
- the processing unit 402 is further configured to encrypt the first data and the interference value of the first data using the public key of the data requesting agency to obtain first encrypted data;
- the private key of the data storage institution generates a signature of the first encrypted data; generates a third hash value from the first encrypted data and the signature of the first encrypted data, and stores the third hash value in the Blockchain to enable the data requesting agency to verify the request response.
- an embodiment of the present invention also provides a computer device for executing the method of a data request mechanism or a data storage mechanism in any embodiment of the present invention, which may include a memory 1001 and a processor 1002.
- the memory 1001 is used to store a computer program executed by the processor 1002.
- the memory 1001 may mainly include a program storage area and a data storage area.
- the program storage area may store an operating system, an application program required for at least one function, and the like; the data storage area may store data created according to the use of a computer device.
- the processor 1002 may be a central processing unit (central processing unit, CPU), or a digital processing unit or the like.
- the embodiment of the present invention does not limit the specific connection medium between the foregoing memory 1001 and the processor 1002.
- the memory 1001 and the processor 1002 are connected through a bus 1003, and the bus 1003 is represented by a thick line in FIG. Limited.
- the bus 1003 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used to indicate in FIG. 5, but it does not mean that there is only one bus or one type of bus.
- the memory 1001 may be a volatile memory (volatile memory), such as a random-access memory (random-access memory, RAM); the memory 1001 may also be a non-volatile memory (non-volatile memory), such as a read-only memory, flash memory Flash memory, hard disk drive (HDD) or solid-state drive (SSD), or memory 1001 can be used to carry or store desired program codes in the form of instructions or data structures and can be used by Any other medium accessed by the computer, but not limited to this.
- the memory 1001 may be a combination of the above-mentioned memories.
- the processor 1002 is configured to execute the blockchain data verification method provided by the embodiment of the present invention when calling the computer program stored in the memory 1001.
- An embodiment of the present invention also provides a computer storage medium that stores computer executable instructions required to execute the foregoing processor, and contains a program used to execute the foregoing processor.
- various aspects of the blockchain-based data verification method provided by the present invention can also be implemented in the form of a program product, which includes program code, when the program product runs on a computer device
- the program code is used to make the computer device execute the steps in the blockchain-based data verification method provided according to various exemplary implementations of the present invention described above in this specification.
- the computer device can execute the present invention
- the embodiment provides a blockchain-based data verification method.
- the program product can use any combination of one or more readable media.
- the readable medium may be a readable signal medium or a readable storage medium.
- the readable storage medium may be, for example, but not limited to, an electric, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Type programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
- the program product based on the blockchain-based data verification method provided in the embodiment of the present invention may adopt a portable compact disk read-only memory (CD-ROM) and include program code, and may run on a computing device.
- CD-ROM portable compact disk read-only memory
- the program product of the present invention is not limited thereto.
- the readable storage medium can be any tangible medium that contains or stores a program, and the program can be used by or in combination with an instruction execution system, device, or device.
- the readable signal medium may include a data signal propagated in baseband or as a part of a carrier wave, and readable program code is carried therein. This propagated data signal can take many forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing.
- the readable signal medium may also be any readable medium other than a readable storage medium, and the readable medium may send, propagate, or transmit a program for use by or in combination with the instruction execution system, apparatus, or device.
- the program code contained on the readable medium can be transmitted by any suitable medium, including, but not limited to, wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
- the program code used to perform the operations of the present invention can be written in any combination of one or more programming languages.
- the programming languages include object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural styles. Programming language-such as "C" language or similar programming language.
- the program code can be executed entirely on the user's computing device, partly on the user's device, executed as an independent software package, partly on the user's computing device and partly executed on the remote computing device, or entirely on the remote computing device or server Executed on.
- the remote computing device can be connected to the user's computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (for example, using Internet services) Provider to connect via the Internet).
- LAN local area network
- WAN wide area network
- an external computing device for example, using Internet services
- the embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Finance (AREA)
- Accounting & Taxation (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Development Economics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Bioethics (AREA)
- General Engineering & Computer Science (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Technology Law (AREA)
- General Business, Economics & Management (AREA)
- Storage Device Security (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种区块链的数据验证方法和装置,涉及科技金融(Fintech)领域,数据请求机构向数据存储机构发送数据请求;所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据;所述数据请求机构解密所述第二加密数据,得到第二数据;所述数据请求机构从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;所述数据请求机构在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据。
Description
相关申请的交叉引用
本申请要求在2019年05月17日提交中国专利局、申请号为201910413920.9、申请名称为“一种区块链的数据验证方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明实施例涉及科技金融(Fintech)领域,尤其是涉及一种区块链(Block Chain)的数据验证方法和装置。
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Finteh)转变,区块链(Block chain)技术也不例外,但由于金融行业的安全性、实时性要求,也对技术提出的更高的要求。
区块链(Block chain)是一种全民参与记账的方式,具有去中心化和去信任的特点。区块链最重要的是解决了中介信用问题。在过去,两个互不认识和信任的人要达成协作是难的,必须要依靠第三方。比如支付行为,在过去任何一种转账,必须要有银行或者支付宝这样的机构存在。但是通过区块链技术,比特币是人类第一次实现在没有任何中介机构参与的情况下,完成双方可以互信的转账行为,这是区块链的重大突破,也因此区块链越来越受到人们的关注。
在区块链使用的过程中,可以实现分布式身份认证,但是目前的验证过程仍存在传输的数据与上链的数据不一致无法验证的问题。
发明内容
本发明提供一种区块链的数据验证方法和装置,用以解决现有技术中数 据请求不可信安全性低的问题。
本发明实施例提供一种区块链的数据验证方法,包括:
数据请求机构向数据存储机构发送数据请求;所述数据请求用于获取第一数据;
所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据;
所述数据请求机构解密所述第二加密数据,得到第二数据;
所述数据请求机构从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;
所述数据请求机构在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据;所述第二hash值是所述数据请求机构通过所述第二数据生成的。
一种可能的实现方式,所述请求响应包括所述第二加密数据;
所述数据请求机构解密所述第二加密数据,得到第二数据,包括:
所述数据请求机构根据所述数据请求机构的私钥解密所述第二加密数据,获得所述第二数据;所述第二加密数据为所述数据存储机构根据所述数据请求机构的公钥加密后获得的。
一种可能的实现方式,所述请求响应还包括所述第二加密数据的签名;所述第二加密数据的签名为所述数据存储机构通过所述数据存储机构的私钥对所述第二加密数据进行签名得到的;
所述数据请求机构解密所述第二加密数据,得到第二数据之前,还包括:
所述数据请求机构根据所述数据存储机构的公钥验证所述第二加密数据的签名。
一种可能的实现方式,所述请求响应包括所述第二加密数据及所述第二加密数据的签名;
所述数据请求机构解密所述第二加密数据,得到第二数据之前,还包括:
所述数据请求机构从所述区块链上获取所述第一数据的第三hash值;所述第三hash值是所述数据存储机构根据第一加密数据及所述第一加密数据的签名生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
所述数据请求机构根据所述第二加密数据及所述第二加密数据的签名,确定第四hash值;
所述数据请求机构确认所述第三hash值和所述第四hash值一致。
一种可能的实现方式,所述请求响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;
所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据,包括:
所述数据请求机构根据所述地址,获取所述第二加密数据。
一种可能的实现方式,所述请求响应包括二维码;所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据,包括:
所述数据请求机构通过所述数据存储机构发送的二维码,获取所述第二加密数据。
本发明实施例提供一种区块链的数据验证方法,包括:
数据存储机构确定第一数据的干扰值;
所述数据存储机构根据所述第一数据和所述第一数据的干扰值,生成所述第一数据的第一哈希hash值;
所述数据存储机构通过区块链将所述第一hash值上链;所述第一hash值 用于数据请求机构确定通过所述数据存储机构获得的加密数据是否与上链信息一致。
一种可能的实现方式,所述方法还包括:
所述数据存储机构接收数据请求机构发送的数据请求;所述数据请求用于获取所述第一数据;
所述数据存储机构向所述数据请求机构发送请求响应,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据以使所述数据请求机构通过所述第二加密数据获得所述第一数据。
一种可能的实现方式,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据,包括:
所述数据响应包括所述第二加密数据;所述第二加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;或
所述数据响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;或
所述数据响应包括二维码,所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
一种可能的实现方式,所述方法还包括:
所述数据存储机构使用所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值进行加密,得到第一加密数据;
所述数据存储机构通过所述数据存储机构的私钥生成所述第一加密数据的签名;
所述数据存储机构将所述第一加密数据及所述第一加密数据的签名生成第三hash值,并将所述第三hash值存储至所述区块链,以使所述数据请求机 构验证所述请求响应。
本发明实施例提供一种区块链的数据验证装置,包括:
收发单元,用于向数据存储机构发送数据请求;所述数据请求用于获取第一数据;获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据;
处理单元,用于解密所述第二加密数据,得到第二数据;从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据;所述第二hash值是所述数据请求机构通过所述第二数据生成的。
一种可能的实现方式,所述请求响应包括所述第二加密数据;所述处理单元,具体用于:根据所述数据请求机构的私钥解密所述第二加密数据,获得所述第二数据;所述第二加密数据为所述数据存储机构根据所述数据请求机构的公钥加密后获得的。
一种可能的实现方式,所述请求响应还包括所述第二加密数据的签名;所述第二加密数据的签名为所述数据存储机构通过所述数据存储机构的私钥对所述第二加密数据进行签名得到的;所述处理单元,具体用于:根据所述数据存储机构的公钥验证所述第二加密数据的签名。
一种可能的实现方式,所述请求响应包括所述第二加密数据及所述第二加密数据的签名;
所述收发单元,具体用于从所述区块链上获取所述第一数据的第三hash值;所述第三hash值是所述数据存储机构根据第一加密数据及所述第一加密数据的签名生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
所述处理单元,还用于根据所述第二加密数据及所述第二加密数据的签名,确定第四hash值;确认所述第三hash值和所述第四hash值一致。
一种可能的实现方式,所述请求响应包括第一加密数据在所述区块链上 的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;
所述处理单元,还用于根据所述地址,获取所述第二加密数据。
一种可能的实现方式,所述请求响应包括二维码;所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
所述收发单元,还用于通过所述数据存储机构发送的二维码,获取所述第二加密数据。
本发明实施例提供一种区块链的数据验证装置,包括:
收发单元,用于数据存储机构确定第一数据的干扰值;
处理单元,用于根据所述第一数据和所述第一数据的干扰值,生成所述第一数据的第一哈希hash值;通过区块链将所述第一hash值上链;所述第一hash值用于数据请求机构确定通过所述数据存储机构获得的加密数据是否与上链信息一致。
一种可能的实现方式,所述收发单元,还用于接收数据请求机构发送的数据请求;所述数据请求用于获取所述第一数据;向所述数据请求机构发送请求响应,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据以使所述数据请求机构通过所述第二加密数据获得所述第一数据。
一种可能的实现方式,所述数据响应包括所述第二加密数据;所述第二加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;或
所述数据响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第 一加密数据上传至所述区块链后得到的;或
所述数据响应包括二维码,所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
一种可能的实现方式,所述处理单元,还用于使用所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值进行加密,得到第一加密数据;通过所述数据存储机构的私钥生成所述第一加密数据的签名;将所述第一加密数据及所述第一加密数据的签名生成第三hash值,并将所述第三hash值存储至所述区块链,以使所述数据请求机构验证所述请求响应。
本发明实施例提供一种计算机存储介质,所述计算机可读存储介质包括计算机程序,当计算机程序在计算机上运行时,使得所述计算机执行上述实施例中任一项所述的方法。
本发明实施例提供一种包含指令的计算机程序产品,当所述指令在计算机上运行时,使得所述计算机执行如上述实施例任一项所述的方法。
本发明实施例提供一种计算机设备,包括:
至少一个存储器,用于存储程序指令;
至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如上述实施例任一项所述的方法。
本发明实施例通过向区块链网络中,原始数据存在各机构的私有数据库里,明文不会被上传到链上,只会上传数据的Hash;每个Hash值经过干扰值混淆,干扰值可自主更新,杜绝了被反向攻破的可能。数据的披露经过非对称加密的公钥加密和私钥加签;公钥放在链上,参与的多方不可篡改或抵赖;每个披露的数据密文仅支持被披露方解密,不用担心数据泄露。数据的披露密文支持上链存证进一步增信。有效保证了交易数据的安全性和可靠性。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中 所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1a为本发明实施例提供的一种系统架构示意图;
图1b为本发明实施例提供的另一种系统架构示意图;
图2为本发明实施例提供的一种数据验证方法的流程示意图;
图3为本发明实施例提供的一种数据验证装置的结构示意图;
图4为本发明实施例提供的一种数据验证装置的结构示意图;
图5为本发明实施例提供的一种计算机设备的结构示意图。
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部份实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
数据存储机构:这一角色用来描述存储了数据并准备将其披露的机构。其他机构可能会向数据存储机构申请数据披露。
数据请求机构:这一角色有着向数据请求机构申请披露数据的需求。
区块链:所有参与方都具有区块链的读写访问能力。
区块(block):用于记录按照一定条件划分出的数据集合和状态结果,是在各个节点达成共识之后形成的,在本发明实施例中,需要记录的数据主要是数据,或者用户的数据变化后的履历更新信息。具体的,区块可以是以时间进行划分,例如每间隔10秒(s)产生一个区块,那么这个区块即是记录这10s内的所有数据,或者每间隔一天产生一个区块,那么这个区块即是记录这一天内的所有数据;或者,区块还可以是根据接收到的数据或者履历更新信息的数量进行划分,例如,在接收到指定数量的数据或者履历更新信息之后, 生成一个区块,那么这个区块即是用于记录已接收到的指定数量的数据更新信息,当然,本发明实施例对区块具体的划分方式并不进行限制。一个区块包括区块头和区块体。其中,区块头中包括前一区块地址(Prev-block),前一区块地址在区块头中可以通过前一区块哈希码(pre-hash)的形式进行存储,通过前一区块地址的指向将所有的区块串联起来,进而形成一条区块链。区块体中则用于存储具体的数据,例如本发明实施例中的数据。
区块链(block chain):或称分布式数据记录账本,是一种按照一定顺序将存储数据的区块以顺序相连的方式组合成的一种链式数据结构。如图1a中所示,将区块按照顺序串联起来在而形成了一条区块链。
节点:指区块链网络中参与数据的记录或者验证等处理过程的计算设备,例如计算机、手机、矿机、台式机或者服务器等拥有计算能力的设备均可作为区块链网络中的节点。
另外,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,在不做特别说明的情况下,一般表示前后关联对象是一种“或”的关系。
为了利于对本发明实施例的技术方案的理解,下面介绍区块链的原理。
在区块链技术中,网络中的任意一个设备都可以作为区块链的一个节点,并且可以参与到区块链的记录和存储中,节点间基于共识机制,通过竞争计算共同维护整个区块链。由于任一节点都可以拥有一份完整的区块链的数据拷贝,因而任一节点失效,其余节点仍能够正常进行工作,从而基于区块链存储的方式可靠性高。
此外,由于在区块链技术中心通过众多的节点来共同维护整个区块链,每个节点所拥有的权限可以是相同的,因而并不存在中心化的设备或者管理机构。区块链中所有的数据信息都是公开透明的,单个节点甚至多个节点对自身数据的修改无法影响到其他节点的数据,除非能够控制整个区块链网络中超过一半的节点都进行修改,但是这种方式难度太大,并且区块链中的每 一个区块都与前后的两个区块进行关联,要想篡改一个区块的数据,就需要篡改与之相关的多个区块的数据,难度较大,从而基于区块链存储的数据具有不可篡改性。
Hash值:对某种字符串生成哈希映射值的算法,例如sha3。
在大数据时代,不同机构间存在着披露数据的需求。然而,由于各个机构之间通常难以组建有效的信任合作机制,各机构间难以将各自保管的数据安全可信地披露给其他机构。分布式身份认证的核心要素就是公钥上链。每个参与方机构使用约定的非对称加密算法,如ECDSA生成自己的公私钥对;将私钥存储到自己的私有数据库里,再将公钥上链。如图1a所示,机构A将自己的公钥A发布至区块链上,机构B将自己的公钥B发布至区块链上。然而,这类做法至少存在以下问题:数据存储机构存在道德风险,不一定保证数据存储机构上链公示的数据和自己用来传输的数据一致;对此,数据存储机构可以将数据生成Hash存证放在区块链上公示。例如,基于将各参与方把自己的公钥存到区块链上,然后使用对方的公钥加密、乃至再用自己的私钥做签名,并传输数据。图1b示例性示出了本发明实施例适用的另一种系统架构示意图,如图1b所示,本发明实施例适用的系统架构包括数据请求机构101;数据存储机构102;区块链网络103。数据请求机构101向数据存储机构发送数据请求;数据存储机构与区块链网络相连,给区块链网络发送需上链的数据;数据请求机构与区块链网络相连,验证数据存储机构返回的响应数据。区块链网络中的节点可以为记账节点或者普通节点。但是数据本身变化频率不大的情况下,Hash存在被暴力反向攻破的可能。
基于上述问题,本发明实施例提供一种区块链的数据验证方法,如图2所示,包括:
步骤201:数据存储机构确定第一数据的干扰值;数据存储机构根据所述第一数据和所述第一数据的干扰值,生成所述第一数据的第一哈希hash值。
在一种具体的实施例中,干扰值可以为一长度不定的字符串。例如,干扰值可以为盐值,也可以为伪随机序列。以下以盐值为例进行说明。
数据存储机构确认有需要披露的数据,例如,第一数据,则随机为第一数据生成一个字符串,作为盐值。其中,盐值指一个不指定长度的字符串。举例来说,第一数据1和第一数据2的数据结构如下所示:
第一数据和干扰值用于作为Hash算法的输入参数,以生成哈希映射值。由于反向攻破的终端并不知晓干扰值的存在,因此,无法反向攻破出第一数据和干扰值,只能解出于第一数据相同字段的无意义字符,因此,提供了Hash值抗反向攻破的能力。
步骤202:数据存储机构通过区块链将所述第一hash值上链;所述第一hash值用于数据请求机构确定通过所述数据存储机构获得的加密数据是否与上链信息一致。
数据存储机构将数据表公开到区块链上。数据存储机构公开一个数据表,包括每项披露的数据标识、计算出的Hash,及其他备注属性。数据标识里面不应该包含任何真实数据,它仅仅用于给其他数据请求机构确认“这项数据里面存储的是什么内容”。数据存储机构可以将其他备注信息存入备注栏内以便于其他机构了解。本发明实施例给出一个公开数据表的范例:
表1公开数据表(范例)
为进一步提高安全性,一种可能的实现方式,盐值还可以包括更新流程,由数据存储机构调用。数据存储机构可以自己定义周期,在任何时刻,更换数据的盐值。数据存储机构可以根据数据及更新后的盐值,确定出更新的Hash值,更新于公布在链上的公开数据表中,以进一步提高数据的安全性。
一种可能的实现方式,在数据请求机构发出数据请求之前,数据请求机构可以预先存储数据的Hash值,因此,数据请求机构申请披露的时候会同时附带上此Hash值;如果Hash值在这个间隙中发生了更新,那么数据存储机构就会返回“未查询到”的结果。数据请求机构可以检查Hash是否被更新了,并且根据实际需要,重新进行数据的hash值的获取。
步骤203:数据请求机构向数据存储机构发送数据请求;所述数据请求用于获取第一数据;数据存储机构接收数据请求机构发送的数据请求。
步骤204:数据存储机构向所述数据请求机构发送请求响应,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据以使所 述数据请求机构通过所述第二加密数据获得所述第一数据。
数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据。
步骤205:数据请求机构解密所述第二加密数据,得到第二数据;
数据请求机构从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;
数据请求机构在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据;所述第二hash值是所述数据请求机构通过所述第二数据生成的。
本发明实施例中,通过将第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的,使得原始数据存在各数据存储机构的私有数据库里,明文不会被上传到链上,只会上传数据的Hash;每个Hash值经过干扰值混淆,干扰值可自主更新,杜绝了被反向攻破的可能。数据的披露经过非对称加密的公钥加密和私钥加签;公钥放在链上,参与的多方不可篡改或抵赖;每个披露的数据密文仅支持被披露方解密,不用担心数据泄露,有效保证了交易数据的安全性和可靠性。
在步骤205中,为提高数据的可信度,一种可能的实现方式,还包括:
数据存储机构使用所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值进行加密,得到第一加密数据。
在步骤206中,一种可能的实现方式,所述请求响应包括所述第二加密数据;所述数据请求机构解密所述第二加密数据,得到第二数据,包括:
数据请求机构根据所述数据请求机构的私钥解密所述第二加密数据,获得所述第二数据;所述第二加密数据为所述数据存储机构根据所述数据请求机构的公钥加密后获得的。
通过验证第一加密数据和第二加密数据是否为同一数据,进而确定数据请求机构获得的第二数据为第一数据。
为进一步提高数据的可信度,一种可能的实现方式,所述方法还包括:数据存储机构通过所述数据存储机构的私钥生成所述第一加密数据的签名。
对应的,所述请求响应还包括所述第二加密数据的签名;所述第二加密数据的签名为所述数据存储机构通过所述数据存储机构的私钥对所述第二加密数据进行签名得到的;
对应的,在步骤206中,所述数据请求机构根据所述数据存储机构的公钥验证所述第二加密数据的签名。
为进一步提高数据的可信度,一种可能的实现方式,数据存储机构将所述第一加密数据及所述第一加密数据的签名生成第三hash值,并将所述第三hash值存储至所述区块链,以使所述数据请求机构验证所述请求响应。
对应的,一种可能的实现方式,所述请求响应包括所述第二加密数据及所述第二加密数据的签名;所述方法还包括:
步骤一、数据请求机构从所述区块链上获取所述第一数据的第三hash值;所述第三hash值是所述数据存储机构根据第一加密数据及所述第一加密数据的签名生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
步骤二、数据请求机构根据所述第二加密数据及所述第二加密数据的签名,确定第四hash值;
步骤三、数据请求机构确认所述第三hash值和所述第四hash值一致。
结合上述实施例,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据,包括:
一种可能的实现方式,所述数据响应包括第一加密数据在所述区块链上的地址;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;在步骤207中,一种可能的实现方式,所述数据请求机构根据所述地址,获取所述第二加密数据。
为满足传输数据需求的多样性,一种可能的实现方式,所述请求响应包括二维码;所述二维码为所述数据存储机构根据第一加密数据生成的;所述 第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
在步骤207中,一种可能的实现方式,所述数据请求机构通过所述数据存储机构发送的二维码,获取所述第二加密数据。
本发明实施例提供一种区块链的数据验证方法,包括数据请求机构申请数据、及数据存储机构发送数据的过程,具体的,包括:
步骤一、数据请求机构访问数据存储机构的公开数据表,从中选择若干项需要申请的数据,并存储这些数据项的Hash值。
步骤二、数据请求机构向数据存储机构发送数据申请请求,并指名要访问的数据项及Hash值。
步骤三、数据存储机构访问区块链,获取数据请求机构的公钥。
步骤四、数据存储机构将被请求的所有数据内容及盐值,进行序列化。
步骤五、数据存储机构,用获取到的数据请求机构的公钥,对序列化的内容进行加密,生成对应密文。
步骤六、数据存储机构使用自己的私钥,对得到的密文进行签名。
一种可能的实现方式,为提高增信,数据存储机构可以进一步将结果上传到链上,形成链上存证。
步骤七、数据存储机构将密文+签名(如果有增信的需求,还包括链上存证地址)发送给数据请求机构。例如,通过线下纸质(二维码)、互联网、或区块链载体传输。
一种可能的实现方式,为提高增信,则需要生成链上存证。链上存证的内容最少应当包含签名值、密文。链上也可以上传签名值+密文的Hash值。链上存证这一步也可以被完全拿掉,对数据真实无篡改的结果没有影响。
一种可能的实现方式,如果使用链上存证的方式,那么数据存储机构可以选择直接发送链上存证的地址给数据请求机构,而不是密文+签名——因为密文+签名已经在链上存储了。具体的密文+签名发送方式不限,也不必担心是否被泄露,因为密文和签名都无法被反向推出。
一种可能的实现方式,通过二维码传输。可以用于需要数据出境监管的场合里。具体地,将被传输的内容转换成二维码,然后打印在纸质单上以信件形式发出。一种可能的实现方式,通过Internet传输,如标准RPC接口、Restful API。一种可能的实现方式,通过区块链网络传输,如AMOP协议。
本发明实施例提供一种区块链的数据验证方法,包括数据请求机构验证所接收的数据真实性的过程,具体可以包括以下步骤:
步骤一、数据请求机构访问区块链,获取数据存储机构的公钥。
步骤二、数据请求机构用获取到的数据存储机构的公钥,及接收的密文,验证签名。
步骤三、数据请求机构用自己的私钥,对密文进行解密,得到序列化的数据内容及盐值;
步骤四、数据请求机构为每条数据加上盐值,计算Hash,并和自己在数据申请流程开始阶段所存下的Hash值进行对比,检查是否一致。
步骤五、如果数据请求机构还接收到了链上存证地址,则还需要去链上确认链上的签名值和收到的签名值一致。
步骤六、以上的验证步骤全部通过时,说明数据真实无篡改。数据请求机构向数据存储机构发送验证成功的信息。
基于相同的发明构思,本发明实施例提供一种区块链的数据验证装置,如图3所示,包括:
收发单元301,用于向数据存储机构发送数据请求;所述数据请求用于获取第一数据;获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据;
处理单元302,用于解密所述第二加密数据,得到第二数据;从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据;所述第二hash值是所述数据请求机构通过所述第二数据生成的。
一种可能的实现方式,所述请求响应包括所述第二加密数据;处理单元302,具体用于:根据所述数据请求机构的私钥解密所述第二加密数据,获得所述第二数据;所述第二加密数据为所述数据存储机构根据所述数据请求机构的公钥加密后获得的。
一种可能的实现方式,所述请求响应还包括所述第二加密数据的签名;所述第二加密数据的签名为所述数据存储机构通过所述数据存储机构的私钥对所述第二加密数据进行签名得到的;处理单元302,具体用于:根据所述数据存储机构的公钥验证所述第二加密数据的签名。
一种可能的实现方式,所述请求响应包括所述第二加密数据及所述第二加密数据的签名;
收发单元301,具体用于从所述区块链上获取所述第一数据的第三hash值;所述第三hash值是所述数据存储机构根据第一加密数据及所述第一加密数据的签名生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
处理单元302,还用于根据所述第二加密数据及所述第二加密数据的签名,确定第四hash值;确认所述第三hash值和所述第四hash值一致。
一种可能的实现方式,所述请求响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;
处理单元302,还用于根据所述地址,获取所述第二加密数据。
一种可能的实现方式,所述请求响应包括二维码;所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
所述收发单元,还用于通过所述数据存储机构发送的二维码,获取所述第二加密数据。
基于相同的发明构思,如图4所示,本发明实施例提供一种区块链的数据验证装置,包括:
收发单元401,用于数据存储机构确定第一数据的干扰值;
处理单元402,用于根据所述第一数据和所述第一数据的干扰值,生成所述第一数据的第一哈希hash值;通过区块链将所述第一hash值上链;所述第一hash值用于数据请求机构确定通过所述数据存储机构获得的加密数据是否与上链信息一致。
一种可能的实现方式,收发单元401,还用于接收数据请求机构发送的数据请求;所述数据请求用于获取所述第一数据;向所述数据请求机构发送请求响应,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据以使所述数据请求机构通过所述第二加密数据获得所述第一数据。
一种可能的实现方式,所述数据响应包括所述第二加密数据;所述第二加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;或
所述数据响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;或
所述数据响应包括二维码,所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;
一种可能的实现方式,处理单元402,还用于使用所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值进行加密,得到第一加密数据;通过所述数据存储机构的私钥生成所述第一加密数据的签名;将所述第一加密数据及所述第一加密数据的签名生成第三hash值,并将所述第三hash值存储至所述区块链,以使所述数据请求机构验证所述请求响应。
请参见图5,基于同一技术构思,本发明实施例还提供了一种计算机设备,用于执行数据请求机构或数据存储机构在本发明任一实施例中的方法,可以包括存储器1001和处理器1002。
所述存储器1001,用于存储处理器1002执行的计算机程序。存储器1001可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据计算机设备的使用所创建的数据等。处理器1002,可以是一个中央处理单元(central processing unit,CPU),或者为数字处理单元等等。本发明实施例中不限定上述存储器1001和处理器1002之间的具体连接介质。本发明实施例在图5中以存储器1001和处理器1002之间通过总线1003连接,总线1003在图5中以粗线表示,其它部件之间的连接方式,仅是进行示意性说明,并不引以为限。所述总线1003可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。
存储器1001可以是易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储器1001也可以是非易失性存储器(non-volatile memory),例如只读存储器,快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD)、或者存储器1001是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器1001可以是上述存储器的组合。
处理器1002,用于调用所述存储器1001中存储的计算机程序时执行本发明实施例提供的区块链的数据验证方法。
本发明实施例还提供了一种计算机存储介质,存储为执行上述处理器所需执行的计算机可执行指令,其包含用于执行上述处理器所需执行的程序。
在一些可能的实施方式中,本发提供的基于区块链的数据验证方法的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当所述程序产品在计算机设备上运行时,所述程序代码用于使所述计算机设备执行本说明 书上述描述的根据本发明各种示例性实施提供的基于区块链的数据验证方法中的步骤,例如,所述计算机设备可以执行本发明实施例提供的基于区块链的数据验证方法。
所述程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。
本发明的实施方式中提供的基于区块链的数据验证方法的程序产品可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在计算设备上运行。然而,本发明的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。
可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括——但不限于——电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于——无线、有线、光缆、RF等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言的任意组合来编写用于执行本发明操作的程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执 行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。
应当注意,尽管在上文详细描述中提及了装置的若干单元或子单元,但是这种划分仅仅是示例性的并非强制性的。实际上,根据本发明的实施方式,上文描述的两个或更多单元的特征和功能可以在一个单元中具体化。反之,上文描述的一个单元的特征和功能可以进一步划分为由多个单元来具体化。
此外,尽管在附图中以特定顺序描述了本发明方法的操作,但是,这并非要求或者暗示必须按照该特定顺序来执行这些操作,或是必须执行全部所示的操作才能实现期望的结果。附加地或备选地,可以省略某些步骤,将多个步骤合并为一个步骤执行,和/或将一个步骤分解为多个步骤执行。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设 备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
Claims (15)
- 一种区块链的数据验证方法,其特征在于,包括:数据请求机构向数据存储机构发送数据请求;所述数据请求用于获取第一数据;所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据;所述数据请求机构解密所述第二加密数据,得到第二数据;所述数据请求机构从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;所述数据请求机构在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据;所述第二hash值是所述数据请求机构通过所述第二数据生成的。
- 如权利要求1所述的方法,其特征在于,所述请求响应包括所述第二加密数据;所述数据请求机构解密所述第二加密数据,得到第二数据,包括:所述数据请求机构根据所述数据请求机构的私钥解密所述第二加密数据,获得所述第二数据;所述第二加密数据为所述数据存储机构根据所述数据请求机构的公钥加密后获得的。
- 如权利要求2所述的方法,其特征在于,所述请求响应还包括所述第二加密数据的签名;所述第二加密数据的签名为所述数据存储机构通过所述数据存储机构的私钥对所述第二加密数据进行签名得到的;所述数据请求机构解密所述第二加密数据,得到第二数据之前,还包括:所述数据请求机构根据所述数据存储机构的公钥验证所述第二加密数据的签名。
- 如权利要求1所述的方法,其特征在于,所述请求响应包括所述第二 加密数据及所述第二加密数据的签名;所述数据请求机构解密所述第二加密数据,得到第二数据之前,还包括:所述数据请求机构从所述区块链上获取所述第一数据的第三hash值;所述第三hash值是所述数据存储机构根据第一加密数据及所述第一加密数据的签名生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述数据请求机构根据所述第二加密数据及所述第二加密数据的签名,确定第四hash值;所述数据请求机构确认所述第三hash值和所述第四hash值一致。
- 如权利要求1所述的方法,其特征在于,所述请求响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据,包括:所述数据请求机构根据所述地址,获取所述第二加密数据。
- 如权利要求1所述的方法,其特征在于,所述请求响应包括二维码;所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述数据请求机构获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据,包括:所述数据请求机构通过所述数据存储机构发送的二维码,获取所述第二加密数据。
- 一种区块链的数据验证方法,其特征在于,包括:数据存储机构确定第一数据的干扰值;所述数据存储机构根据所述第一数据和所述第一数据的干扰值,生成所述第一数据的第一哈希hash值;所述数据存储机构通过区块链将所述第一hash值上链;所述第一hash值用于数据请求机构确定通过所述数据存储机构获得的加密数据是否与上链信息一致。
- 如权利要求7所述的方法,其特征在于,所述方法还包括:所述数据存储机构接收数据请求机构发送的数据请求;所述数据请求用于获取所述第一数据;所述数据存储机构向所述数据请求机构发送请求响应,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据以使所述数据请求机构通过所述第二加密数据获得所述第一数据。
- 如权利要求8所述的方法,其特征在于,所述数据响应用于所述数据请求机构获取所述数据存储机构提供的第二加密数据,包括:所述数据响应包括所述第二加密数据;所述第二加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;或所述数据响应包括第一加密数据在所述区块链上的地址;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的;所述地址是所述数据存储机构将所述第一加密数据上传至所述区块链后得到的;或所述数据响应包括二维码,所述二维码为所述数据存储机构根据第一加密数据生成的;所述第一加密数据是所述数据存储机构根据所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值加密后得到的。
- 如权利要求7所述的方法,其特征在于,所述方法还包括:所述数据存储机构使用所述数据请求机构的公钥对所述第一数据及所述第一数据的干扰值进行加密,得到第一加密数据;所述数据存储机构通过所述数据存储机构的私钥生成所述第一加密数据 的签名;所述数据存储机构将所述第一加密数据及所述第一加密数据的签名生成第三hash值,并将所述第三hash值存储至所述区块链,以使所述数据请求机构验证所述请求响应。
- 一种区块链的数据验证装置,其特征在于,包括:收发单元,用于向数据存储机构发送数据请求;所述数据请求用于获取第一数据;获取所述数据存储机构返回的请求响应,以使所述数据请求机构获取第二加密数据;处理单元,用于解密所述第二加密数据,得到第二数据;从区块链上获取所述第一数据的第一哈希hash值;所述第一hash值是所述数据存储机构根据所述第一数据及所述第一数据的干扰值生成并上传至所述区块链的;在确认所述第一hash值和第二hash值一致时,从所述第二数据中得到所述第一数据;所述第二hash值是所述数据请求机构通过所述第二数据生成的。
- 一种区块链的数据验证装置,其特征在于,包括:收发单元,用于数据存储机构确定第一数据的干扰值;处理单元,用于根据所述第一数据和所述第一数据的干扰值,生成所述第一数据的第一哈希hash值;通过区块链将所述第一hash值上链;所述第一hash值用于数据请求机构确定通过所述数据存储机构获得的加密数据是否与上链信息一致。
- 一种计算机存储介质,其特征在于,所述计算机可读存储介质包括计算机程序,当计算机程序在计算机上运行时,使得所述计算机执行如权利要求1至6任一所述的方法或执行使得所述计算机执行如权利要求7至10任一所述的方法。
- 一种包含指令的计算机程序产品,其特征在于,当所述指令在计算机上运行时,使得所述计算机执行如权利要求1至6任一所述的方法或执行使得所述计算机执行如权利要求7至10任一所述的方法。
- 一种计算机设备,其特征在于,包括:至少一个存储器,用于存储程序指令;至少一个处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如权利要求1至6任一所述的方法或执行使得所述计算机执行如权利要求7至10任一所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910413920.9A CN110188550B (zh) | 2019-05-17 | 2019-05-17 | 一种区块链的数据验证方法和装置 |
| CN201910413920.9 | 2019-05-17 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020233235A1 true WO2020233235A1 (zh) | 2020-11-26 |
Family
ID=67716709
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/082203 Ceased WO2020233235A1 (zh) | 2019-05-17 | 2020-03-30 | 一种区块链的数据验证方法和装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110188550B (zh) |
| WO (1) | WO2020233235A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114760111A (zh) * | 2022-03-24 | 2022-07-15 | 标信智链(杭州)科技发展有限公司 | 基于区块链的文件保密方法及文件保密装置 |
Families Citing this family (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110188550B (zh) * | 2019-05-17 | 2024-05-24 | 深圳前海微众银行股份有限公司 | 一种区块链的数据验证方法和装置 |
| CN112486944B (zh) * | 2019-09-12 | 2024-04-26 | 戴科冕 | 一种基于区块链的数据验证方法 |
| CN113329031B (zh) * | 2019-10-10 | 2023-06-13 | 深圳前海微众银行股份有限公司 | 一种区块的状态树的生成方法及装置 |
| CN111080296B (zh) * | 2019-12-05 | 2023-12-01 | 深圳前海微众银行股份有限公司 | 一种基于区块链系统的验证方法及装置 |
| CN111681016B (zh) * | 2020-06-17 | 2022-03-22 | 广州粤建三和软件股份有限公司 | 用于建筑工程特种设备追溯的区块链系统 |
| CN112035475B (zh) * | 2020-08-28 | 2023-06-02 | 平安科技(深圳)有限公司 | 区块链的区块存储方法、装置、节点设备及存储介质 |
| CN112887375B (zh) * | 2021-01-13 | 2022-08-05 | 中南林业科技大学 | 一种基于区块链的消息验证方法及设备 |
| CN112887295B (zh) * | 2021-01-22 | 2022-08-05 | 湖北宸威玺链信息技术有限公司 | 基于区块链的数据传输安全检测方法及系统及装置及介质 |
| CN112988412B (zh) * | 2021-02-07 | 2023-06-27 | 中国联合网络通信集团有限公司 | 基于区块链网络的边缘缓存方法、基站和系统 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007060336A (ja) * | 2005-08-25 | 2007-03-08 | Tohoku Information Systems Co Inc | 電子割印システム |
| CN105610578A (zh) * | 2016-01-25 | 2016-05-25 | 杭州复杂美科技有限公司 | 区块链信息存证及隐私保护方法 |
| CN108833111A (zh) * | 2018-05-29 | 2018-11-16 | 浪潮软件集团有限公司 | 一种基于区块链的文件存证及鉴定的实现方法 |
| CN110188550A (zh) * | 2019-05-17 | 2019-08-30 | 深圳前海微众银行股份有限公司 | 一种区块链的数据验证方法和装置 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR101989450B1 (ko) * | 2017-06-23 | 2019-09-30 | 홍석현 | 블록체인 기반의 공개 분산 데이터베이스에서 데이터에 대한 보안을 유지하는 방법 및 이를 이용한 블록체인 관리 서버 |
| WO2020037654A1 (zh) * | 2018-08-24 | 2020-02-27 | 区链通网络有限公司 | 区块链数据保护方法、装置、系统及计算机可读存储介质 |
| CN109257342B (zh) * | 2018-09-04 | 2020-05-26 | 阿里巴巴集团控股有限公司 | 区块链跨链的认证方法、系统、服务器及可读存储介质 |
-
2019
- 2019-05-17 CN CN201910413920.9A patent/CN110188550B/zh active Active
-
2020
- 2020-03-30 WO PCT/CN2020/082203 patent/WO2020233235A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2007060336A (ja) * | 2005-08-25 | 2007-03-08 | Tohoku Information Systems Co Inc | 電子割印システム |
| CN105610578A (zh) * | 2016-01-25 | 2016-05-25 | 杭州复杂美科技有限公司 | 区块链信息存证及隐私保护方法 |
| CN108833111A (zh) * | 2018-05-29 | 2018-11-16 | 浪潮软件集团有限公司 | 一种基于区块链的文件存证及鉴定的实现方法 |
| CN110188550A (zh) * | 2019-05-17 | 2019-08-30 | 深圳前海微众银行股份有限公司 | 一种区块链的数据验证方法和装置 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114760111A (zh) * | 2022-03-24 | 2022-07-15 | 标信智链(杭州)科技发展有限公司 | 基于区块链的文件保密方法及文件保密装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110188550A (zh) | 2019-08-30 |
| CN110188550B (zh) | 2024-05-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12229753B2 (en) | Method and system for mobile cryptocurrency wallet connectivity | |
| WO2020233235A1 (zh) | 一种区块链的数据验证方法和装置 | |
| US12294661B2 (en) | Personal device security using cryptocurrency wallets | |
| CN111095256B (zh) | 在可信执行环境中安全地执行智能合约操作 | |
| CN108292402B (zh) | 用于信息的安全交换的公共秘密的确定和层级确定性密钥 | |
| CN110520884B (zh) | 基于可信执行环境的链外智能合约服务 | |
| AU2019204725B2 (en) | Retrieving access data for blockchain networks using highly available trusted execution environments | |
| CN111680324B (zh) | 用于区块链的凭证验证方法、管理方法以及签发方法 | |
| CN111431713B (zh) | 一种私钥存储方法、装置和相关设备 | |
| CN110189184B (zh) | 一种电子发票存储方法和装置 | |
| CN114244502B (zh) | 基于sm9算法的签名密钥生成方法、装置和计算机设备 | |
| CN108769010A (zh) | 节点受邀注册的方法和装置 | |
| CN119276505A (zh) | 身份认证方法、终端设备、身份认证系统及存储介质 | |
| CN120380719B (zh) | 账户管理的密钥推导 | |
| WO2021082222A1 (zh) | 通信方法、存储方法、运算方法及装置 | |
| CN114944949B (zh) | 一种基于区块链的数据授权方法、系统、装置及存储介质 | |
| CN113783689B (zh) | 招标信息处理方法和装置 | |
| CN113206746B (zh) | 一种数字证书管理方法和装置 | |
| WO2019223231A1 (zh) | 实现交易信息验证的方法和装置 | |
| TWI766171B (zh) | 帳戶資料處理方法及帳戶資料處理系統 | |
| CN115720137A (zh) | 一种信息管理的系统、方法以及装置 | |
| CN112348674A (zh) | 一种区块链的交易数据存储与获取方法及装置 | |
| CN104901974A (zh) | 安全超文本传输方法 | |
| CN112380574A (zh) | 一种基于区块链及se芯片的数据上链方法 | |
| CN116405319B (zh) | 基于区块链的碳金融凭证共享方法和装置、设备和介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20809190 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 01.03.2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20809190 Country of ref document: EP Kind code of ref document: A1 |

