Privacy protection method based on block chainTechnical Field
The invention relates to a privacy protection method based on a block chain, and belongs to the technical field of artificial intelligence.
Background
Blockchains are a term of art in information technology. In essence, the system is a shared database, and the data or information stored in the shared database has the characteristics of 'unforgeability', 'whole-course trace', 'traceability', 'public transparency', 'collective maintenance', and the like. Based on the characteristics, the block chain technology lays a solid 'trust' foundation, creates a reliable 'cooperation' mechanism and has wide application prospect. Many public chain transactions exist that are publicly transparent, such as: bitcoin, etherhouse, EOS, etc. Although the public chain transaction account is anonymous, the amount of the transaction is public and transparent due to the initiator and the receiver of each transaction, the specific person of the anonymous account corresponding to the real world can be inquired in an indirect mode by searching the transaction record, and particularly, the traditional privacy authentication information is submitted to a third-party service platform in a clear text, so that privacy leakage is easily caused. Therefore, a privacy protection method based on a block chain is urgently needed to solve the problem existing in the prior art.
In order to solve the technical problems, a new technical scheme is especially provided.
Disclosure of Invention
The present invention is directed to a privacy protection method based on a block chain, so as to solve the problems in the background art.
In order to achieve the purpose, the invention provides the following technical scheme: a privacy protection method based on a blockchain, the method comprising the steps of:
receiving a query transaction aiming at target privacy data initiated by a query party;
encrypting the private data through a private key, calculating a HASH value of the private data, packaging and incorporating the private data into a block after information packaging, information confirmation and block chain consensus are completed, and storing the private data at the link points of the block in a distributed mode;
step three, comparing the HASH value of the applied privacy authentication information with the corresponding HASH value on the block chain, and returning a comparison result;
reading target privacy data into a trusted execution environment of the block chain node for decryption under the condition that a query condition of a returned comparison result is met, so that the inquirer acquires corresponding decrypted data, and performing decrement updating on the query quota;
step five, registering a messagebase account on the application of each connection block chain node; the messagebase is a message address;
and step six, carrying out application message communication between the same block chain nodes or message communication between different block chain nodes by adopting the registered new messagebase, wherein the content of the message communication is provided with a selective uplink chain, so that the evidence is convenient to retain.
Preferably, the first step of auditing the query transaction of the private data after the query transaction, wherein the auditing mode includes:
step 1, the auditing node decrypts and verifies the private transaction Tx-AB, signs the transaction hash value HAB after the verification is passed, and then sends the signature to A;
step 2, the node A encrypts the transaction by using the same AES key in the S1, encrypts the AES key by using the public key of the node B, and sends the encrypted private transaction, the hash value of the transaction and the encrypted AES key to the node B;
step 3, after receiving the privacy transaction Tx-AB, the node B sends confirmation information to the node A;
step 4, the node A broadcasts the hash value of Tx-AB and the signature of the auditing node;
step 5, other nodes directly pack the hash value of the privacy transaction and the signature of the auditing node into a block after receiving the hash value and the signature;
and 6, after receiving the block containing the Tx-AB, the node A and the node B decrypt the transaction, execute the transaction and update the private state.
Preferably, the step four data query condition includes that the query quota has not been exhausted.
Preferably, the information package is a complete data block combined by a data block encrypted by an asymmetric encryption algorithm and the personal signature information.
Compared with the prior art, the invention has the beneficial effects that: the existing privacy authentication mode needs to pay higher cost, but the privacy authentication authorization cost by adopting the block chain technology is almost ignored, and the penetration supervision of the block chain system is realized. The supervision node can monitor the health state of the blockchain system in real time, and audit on private transactions, private data and behaviors of other nodes is achieved.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all 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.
The invention provides a technical scheme that: a privacy protection method based on a blockchain, the method comprising the steps of:
receiving a query transaction aiming at target privacy data initiated by a query party;
encrypting the private data through a private key, calculating a HASH value of the private data, packaging and incorporating the private data into a block after information packaging, information confirmation and block chain consensus are completed, and storing the private data at the link points of the block in a distributed mode;
step three, comparing the HASH value of the applied privacy authentication information with the corresponding HASH value on the block chain, and returning a comparison result;
reading target privacy data into a trusted execution environment of the block chain node for decryption under the condition that a query condition of a returned comparison result is met, so that the inquirer acquires corresponding decrypted data, and performing decrement updating on the query quota;
step five, registering a messagebase account on the application of each connection block chain node; the messagebase is a message address;
and step six, carrying out application message communication between the same block chain nodes or message communication between different block chain nodes by adopting the registered new messagebase, wherein the content of the message communication is provided with a selective uplink chain, so that the evidence is convenient to retain.
Preferably, the first step of auditing the query transaction of the private data after the query transaction, wherein the auditing mode includes:
step 1, the auditing node decrypts and verifies the private transaction Tx-AB, signs the transaction hash value HAB after the verification is passed, and then sends the signature to A;
step 2, the node A encrypts the transaction by using the same AES key in the S1, encrypts the AES key by using the public key of the node B, and sends the encrypted private transaction, the hash value of the transaction and the encrypted AES key to the node B;
step 3, after receiving the privacy transaction Tx-AB, the node B sends confirmation information to the node A;
step 4, the node A broadcasts the hash value of Tx-AB and the signature of the auditing node;
step 5, other nodes directly pack the hash value of the privacy transaction and the signature of the auditing node into a block after receiving the hash value and the signature;
and 6, after receiving the block containing the Tx-AB, the node A and the node B decrypt the transaction, execute the transaction and update the private state.
Preferably, the step four data query condition includes that the query quota has not been exhausted.
Preferably, the information package is a complete data block combined by a data block encrypted by an asymmetric encryption algorithm and the personal signature information.
When the system is used, the existing privacy authentication mode needs to pay higher cost, but the privacy authentication authorization cost by adopting the block chain technology is almost ignored, and the penetration supervision of the block chain system is realized. The supervision node can monitor the health state of the blockchain system in real time, and audit on private transactions, private data and behaviors of other nodes is achieved.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.