CN111523891A - Block chain based information encryption method, device, equipment and storage medium - Google Patents
Block chain based information encryption method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111523891A CN111523891A CN202010327136.9A CN202010327136A CN111523891A CN 111523891 A CN111523891 A CN 111523891A CN 202010327136 A CN202010327136 A CN 202010327136A CN 111523891 A CN111523891 A CN 111523891A
- Authority
- CN
- China
- Prior art keywords
- transaction
- ciphertext
- transaction account
- account
- consensus
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 32
- 238000012546 transfer Methods 0.000 claims abstract description 96
- 238000012790 confirmation Methods 0.000 claims abstract description 27
- 230000008685 targeting Effects 0.000 claims description 11
- 238000012545 processing Methods 0.000 claims description 8
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 238000005516 engineering process Methods 0.000 abstract description 6
- 230000007246 mechanism Effects 0.000 abstract description 5
- 238000012795 verification Methods 0.000 description 9
- 238000004422 calculation algorithm Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 7
- 239000002453 shampoo Substances 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 238000006467 substitution reaction Methods 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/38—Payment protocols; Details thereof
- G06Q20/382—Payment protocols; Details thereof insuring higher security of transaction
- G06Q20/3829—Payment protocols; Details thereof insuring higher security of transaction involving key management
Landscapes
- Business, Economics & Management (AREA)
- Engineering & Computer Science (AREA)
- Accounting & Taxation (AREA)
- Computer Security & Cryptography (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
Abstract
The application provides an information encryption method based on a block chain, which comprises the following steps: receiving a transaction request submitted by a first transaction account; generating transaction event information according to the transaction request; the method comprises the steps that transaction event information is sent to a consensus node, the consensus node searches for the residual data volume of a first transaction account according to the identification of the first transaction account, the homomorphic public key is used for encrypting the residual data volume of the first transaction account to obtain a ciphertext of the residual data volume, the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, if the result after homomorphic operation meets a preset rule, the consensus node returns a consensus confirmation message, transaction event information is generated into a transaction block, and the transaction block is uploaded to a block chain network. By implementing the method and the device, the data privacy is protected while a consensus mechanism of a block chain technology is used, and additional information designated objects in transaction events can be visible.
Description
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method, an apparatus, a device, and a storage medium for information encryption based on a blockchain.
Background
The account book of the block chain has the distributed characteristic, each participating node independently and completely stores and writes account book data information, so that each participating node backups the account book data information, and as a plurality of nodes are required to participate in the storage and verification of the account book, the account book data is in a completely open state in the block chain network, for example, a game player A gives an A device to a team friend B and tells the team friend B in a remark when the A device is used for matching with the A device; for another example, some information with a targeted push object, such as advertisement or video, is pushed in a blockchain network, and the prior art links the targeted information to allow the targeted information to be spread in the blockchain network, which may cause a problem that the non-targeted push object also receives the targeted information, causing information flooding.
Disclosure of Invention
The application provides an information encryption method based on a blockchain, which can ensure the legality of transaction event information and protect the privacy of consensus data by using a consensus mechanism of a blockchain technology, and can also be visible for additional information designated objects in transaction events.
In one aspect, an embodiment of the present application provides an information encryption method based on a block chain, where the method includes:
the transaction service node receives a transaction request submitted by a first transaction account, wherein the transaction request comprises a data transfer amount, additional information, an identifier of the first transaction account and an identifier of a second transaction account;
the transaction service node generates transaction event information according to the transaction request, wherein the transaction event information comprises a ciphertext of the data transfer amount, a ciphertext of the additional information, a ciphertext of a symmetric key, an identifier of the first transaction account and an identifier of the second transaction account; the ciphertext of the data transfer amount is obtained by encrypting the data transfer amount by using a homomorphic public key by the transaction service node; the ciphertext of the additional information is obtained by encrypting the transaction service node by using the symmetric key, the symmetric key is randomly generated by the transaction service node, the ciphertext of the symmetric key is obtained by searching the public key of the second transaction account in the blockchain network by the transaction service node according to the identifier of the second transaction account and encrypting the symmetric key by using the public key of the second transaction account;
the transaction service node sends the transaction event information to a consensus node so that the consensus node searches the residual data volume of the first transaction account according to the identification of the first transaction account, and encrypts the residual data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the residual data volume; the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, and returns a consensus confirmation message to the transaction service node if the homomorphic operation result conforms to a preset rule;
and under the condition that the transaction service node receives a consensus confirmation message returned by the consensus node and meets a preset consensus strategy, generating a transaction block from the transaction event information, and uploading the transaction block to the block chain network.
In one aspect, an embodiment of the present application provides an information encryption apparatus based on a block chain, where the apparatus includes:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a transaction request submitted by a first transaction account, and the transaction request comprises a data transfer amount, additional information, an identifier of the first transaction account and an identifier of a second transaction account;
a generating module, configured to generate transaction event information according to the transaction request, where the transaction event information includes a ciphertext of the data transfer amount, a ciphertext of the additional information, a ciphertext of a symmetric key, an identifier of the first transaction account, and an identifier of the second transaction account;
the calculation module is used for encrypting the data transfer amount by using a homomorphic public key to obtain a ciphertext of the data transfer amount;
the computing module is further configured to randomly generate the symmetric key, and encrypt the additional information using the symmetric key to obtain a ciphertext of the additional information;
the computing module is further configured to search the public key of the second transaction account in a blockchain network according to the identifier of the second transaction account, and encrypt the symmetric key using the public key of the second transaction account to obtain a ciphertext of the symmetric public key;
the sending module is used for sending the transaction event information to a consensus node so that the consensus node searches the residual data volume of the first transaction account according to the identifier of the first transaction account, and encrypts the residual data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the residual data volume; the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, and returns a consensus confirmation message to the transaction service node if the homomorphic operation result conforms to a preset rule;
the generating module is further configured to generate a transaction block from the transaction event information when the receiving module receives a consensus confirmation message returned by the consensus node and meets a preset consensus strategy;
the sending module is further configured to upload the transaction block to the blockchain network.
In a possible implementation manner, under the condition that the sending module sends the transaction event information to a consensus node, the consensus node performs homomorphic subtraction operation on the ciphertext of the data transfer amount and the ciphertext of the remaining data amount to obtain a ciphertext of a difference data amount; the consensus node encrypts a preset data volume by using the homomorphic public key to obtain a ciphertext of the preset data volume, and compares the ciphertext of the difference data volume with the ciphertext of the preset data volume; and if the ciphertext of the preset data volume is not less than the ciphertext of the difference data volume, determining that the homomorphic operation result conforms to the preset rule.
In a possible embodiment, the receiving module further receives a first digital signature and a second digital signature upon receiving a transaction request submitted by the first transaction account;
the information encryption device based on the block chain further comprises a search module, wherein the search module is used for searching a public key of the first transaction account and a public key of the second transaction account in the block chain network according to the identification of the first transaction account and the identification of the second transaction account, checking the first digital signature and the second digital signature, and respectively obtaining a first check code and a second check code;
the calculation module is further used for performing hash operation on the transaction request to obtain a third check code;
the generating module is further configured to generate transaction event information according to the transaction request under the condition that the first check code, the second check code, and the third check code are the same.
Further, the transaction block carries the transaction event information, and the sending module is further configured to transfer the data transfer amount from the first transaction account to the second transaction account, and send the address of the transaction block to the second transaction account, so that the second transaction account obtains the transaction event information in the block chain network according to the address of the transaction block.
In a possible embodiment, the data transfer amount is virtual item data, and the additional information is a use remark condition of the first transaction account on the virtual item data.
Optionally, the information encryption device based on the block chain further includes a determining module, where the determining module is configured to, when detecting that the second transaction account performs the operation on the virtual item data, determine whether the current operation on the virtual item data by the second transaction account satisfies a use remark condition of the first transaction account on the virtual item data, and if so, respond to the operation on the virtual item data by the second transaction account.
In another possible embodiment, the data transfer amount is a digital asset with a preset numerical value, the additional information is targeting information, the second transaction account is found in the blockchain network by the first transaction account according to an object feature of the targeting information, and the object feature of the targeting information is matched with a user feature of the second transaction account.
In one aspect, an embodiment of the present application provides an information encryption device based on a blockchain, where the device includes a transceiver, a processor, and a memory, where the processor is configured to execute a computer program stored in the memory, and implement any one of the above possible embodiments.
In one aspect, the present application also provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform the method of the above aspects.
In the embodiment of the application, the homomorphic public key is used for encrypting the data transfer amount in the transaction request, the symmetric key is used for encrypting the additional information, the data transfer amount uploaded to the block chain network by the transaction service node and the additional information are both ciphertext, the data transfer amount is information used by the consensus node for consensus verification, the additional information is information for selectively visible by a specified object, the consensus node can perform consensus verification based on homomorphic operation under the condition that plaintext data of the data transfer amount is not taken, the legality of transaction event information is ensured, and the privacy of the data transfer amount is protected, and encrypting the symmetric key by a public key of a second transaction account, determining that a visible object of the additional information is the second transaction account, and other random transaction accounts can obtain the plaintext data of the additional information. If the data transfer amount and the additional information are encrypted by adopting a homomorphic public key, the second transaction account acquires plaintext data of the additional information through homomorphic decryption, on one hand, the computation amount of the homomorphic decryption is far greater than that of symmetric key decryption in the embodiment, on the other hand, a visible object of the additional information has no specificity, and other accounts except the second transaction account can acquire plaintext data of the additional information through homomorphic decryption; if the data transfer amount and the additional information are encrypted by adopting a symmetric key, the consensus node in the blockchain network cannot perform consensus verification on the data transfer amount in the transaction event information. Therefore, by implementing the embodiment, the data privacy can be protected while the legality of the transaction event information is ensured by using a consensus mechanism of the blockchain technology, and an additional information designated object in the transaction event can be visible.
Drawings
Fig. 1 is a schematic flowchart of an information encryption method based on a block chain according to an embodiment of the present application;
fig. 2 is an application scenario diagram of information encryption based on a block chain according to an embodiment of the present application;
fig. 3 is a block diagram of an information encryption system based on a blockchain according to an embodiment of the present disclosure;
fig. 4 is a block diagram of an information encryption apparatus based on a block chain according to an embodiment of the present application;
fig. 5 is a block diagram of an information encryption device based on a block chain according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following describes embodiments of the present application in further detail with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic flowchart of an information encryption method based on a blockchain according to an embodiment of the present application. As shown in fig. 1, the present embodiment specifically executes the following steps:
s100, the transaction service node receives a transaction request submitted by a first transaction account, wherein the transaction request comprises a data transfer amount, additional information, an identifier of the first transaction account and an identifier of a second transaction account. Specifically, the transaction service node may be any node in the blockchain network. The transaction request is that the first transaction account requests to transfer part or all of the remaining data volume of the first transaction account to the second transaction account, and exemplarily, the transaction request is that: the method comprises the steps that 10Q coins are transferred from a first transaction account A to a second transaction account B, the additional information is 222, namely the data transfer amount is 10Q coins, the identification of the first transaction account is A, and the identification of the second transaction account is B.
S101, the transaction service node generates transaction event information according to a transaction request, wherein the transaction event information comprises a ciphertext of the data transfer amount, a ciphertext of the additional information, a ciphertext of the symmetric key, an identifier of the first transaction account and an identifier of the second transaction account; the ciphertext of the data transfer amount is obtained by encrypting the data transfer amount by using a homomorphic public key by the transaction service node; the cipher text of the additional information is obtained after the transaction service node is encrypted by using the symmetric key, the symmetric key is randomly generated by the transaction service node, the cipher text of the symmetric key is obtained by searching the public key of the second transaction account in the blockchain network by the transaction service node according to the identifier of the second transaction account and encrypting the symmetric key by using the public key of the second transaction account.
Specifically, the homomorphic public key is generated by one function of the transaction service node when the homomorphic algorithm is operated, and is generated in the homomorphic operation process. For example, the mathematical four arithmetic operations of the homomorphic operation are subtraction operations, and the formula is expressed as: wherein Enc is an encryption function, a is a remaining data transfer amount of the first transaction account, b is the data transfer amount,representing operations in the ciphertext domain and-representing operations in the plaintext domain. For example, the first transaction account transfers 10Q coins to the second transaction account, where b is 10Q coins, 20Q coins are in the first transaction account, where a is 20Q coins, homomorphic encryption is performed on 10Q coins and 20Q coins by using the homomorphic public key respectively to obtain ciphertext data of 10Q coins and ciphertext data of 20Q coins, the transaction service node subtracts 10 ciphertext data of Q coins from 20 ciphertext data of Q coins in a ciphertext domain to obtain a first output result, which is a result obtained by encrypting plaintext data of 20Q coins minus 10Q coins by using the same homomorphic public key, that is, performing plaintext subtraction on data and then homomorphic encryption, and performing ciphertext encryption after homomorphic encryptionThe corresponding subtraction is performed and the result is equivalent. Illustratively, the mathematical four fundamental operations of the homomorphic operation are addition operations, and the formula is as follows:for example, the first transaction account transfers 10Q coins to the second transaction account, the data transfer amount is increased on the basis of the remaining data amount for the second transaction account, where b is 10Q coins, the remaining data amount in the second transaction account is 30Q coins, where a is 30Q coins, 10Q coins and 30Q coins are homomorphic encrypted by using the homomorphic public key respectively to obtain 10 ciphertext data of Q coins and 30 ciphertext data of Q coins, the transaction service node adds 30 ciphertext data of Q coins to 10 ciphertext data of Q coins in a ciphertext domain to obtain an output result, which is a result obtained by encrypting 10 plaintext data of Q coins and 30 plaintext data of Q coins by using the same homomorphic public key, that is, performing addition operation on data plaintext and then homomorphic encryption, and performing corresponding addition operation after homomorphic encryption, the results are equivalent. Optionally, the mathematical four arithmetic operations of the homomorphic operation are multiplication operations, and the formula is expressed as:for example, in a game scenario, if the first transaction account is transferred to the second transaction account by an acceleration device, for example, the moving speed is increased by 1.5 times, then the second transaction account is multiplied by 1.5, where b is 1.5, and the original moving speed of the second transaction account is 2m/s, where a is 2m/s, homomorphic encryption is performed on 1.5 and 2m/s respectively by using the homomorphic public key to obtain 1.5 ciphertext data and 2m/s ciphertext data, the transaction service node multiplies 1.5 ciphertext data by 2m/s ciphertext data in a ciphertext domain, and the obtained output result is the result obtained by encrypting 1.5 times 2m/s plaintext data by using the same homomorphic public key, that is, performing homomorphic encryption after performing multiplication operation on the data plaintext, after homomorphic encryption, the corresponding multiplication operation is carried out on the ciphertext, and the result is equalAnd (4) the price is high. Similarly, if the first transaction account is transferred to the second transaction account by a deceleration device in a game scene, for example, the moving speed is reduced by 2 times, the second transaction account is divided by 2 on the basis of the original moving speed, and a homomorphic division operation is applied, where the formula is: taking the original moving speed of the second transaction account as 1m/s as an example, where a is 1m/s, homomorphic encryption is performed on 2 and 1m/s respectively by using the homomorphic public key to obtain ciphertext data of 2 and ciphertext data of 1m/s, the transaction service node divides the ciphertext data of 1m/s by the ciphertext data of 2 in a ciphertext domain to obtain an output result, namely, the plaintext data of 1m/s divided by 2 is encrypted by using the same homomorphic public key, namely, homomorphic encryption is performed by performing division operation on the plaintext data, and the result is equivalent to that of performing corresponding division operation on the ciphertext after homomorphic encryption.
Illustratively, the transaction service node executes a symmetric Encryption Algorithm to randomly generate the symmetric key, such as a Data Encryption Algorithm (DEA), an Advanced Encryption Standard (AES), or a Triple Data Encryption Algorithm (TDEA), etc. It will be appreciated that the transaction service node may randomly generate a plurality of different symmetric keys that associate the generated symmetric keys with the identity of the transaction account, e.g., a first symmetric key for the first transaction account, a second symmetric key for the second transaction account, and so on. And the transaction service node encrypts additional information in the transaction request of the first transaction account by using a symmetric key which has an association relation with the second transaction account to obtain a ciphertext of the additional information, and the transaction account with the symmetric key can obtain plaintext data of the additional information. In order to avoid the leakage of the symmetric key, the transaction service node encrypts the symmetric key by using the public key of the second transaction account, so that the second transaction account can decrypt the ciphertext of the symmetric key by using the private key of the second transaction account to obtain the symmetric key, and then decrypt the ciphertext of the additional information by using the symmetric key to obtain the additional information.
In a possible embodiment, the transaction service node further receives a first digital signature and a second digital signature when receiving the transaction request submitted by the first transaction account; the transaction service node searches a public key of the first transaction account and a public key of the second transaction account in the block chain network according to the identifier of the first transaction account and the identifier of the second transaction account, and verifies the first digital signature and the second digital signature to obtain a first check code and a second check code respectively; the transaction service node performs hash operation on the transaction request to obtain a third check code; and if the first check code, the second check code and the third check code are the same, the transaction service node generates transaction event information according to the transaction request. Specifically, the first transaction account performs a hash operation on the transaction request to obtain a first digest hash, and the first account encrypts the first digest hash by using a private key of the first account to obtain the first digital signature; similarly, the second transaction account performs hash operation on the transaction request to obtain a second digest hash, and the second transaction account encrypts the second digest hash by using its own private key to obtain the second digital signature. The first digital signature represents a confirmation of the validity of the transaction request by the first transaction account, and the second digital signature represents a confirmation of the validity of the transaction request by the second transaction account. When receiving a transaction request submitted by the first transaction account, the transaction service node also receives the first digital signature and the second digital signature, and can verify the first digital signature and the second digital signature, namely, a public key of the first transaction account is used for decrypting the first digital signature to obtain a first check code, namely the first digest hash is obtained; similarly, the public key of the second transaction account is used for decrypting the second digital signature to obtain a second check code, and the second digest hash is obtained. And the transaction service node performs hash operation on the transaction request to obtain the third check code, and if the first check code, the second check code and the third check code are the same, the first transaction account, the second transaction account and the transaction service node perform hash operation on the transaction request to obtain the same value, which represents that the transaction request is real. In this embodiment, the transaction service node verifies the identity of the transaction account in the transaction request and determines the authenticity of the transaction request.
S102, the transaction service node sends the transaction event information to a consensus node, so that the consensus node searches the residual data volume of the first transaction account according to the identification of the first transaction account, and encrypts the residual data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the residual data volume; and the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, and returns a consensus confirmation message to the transaction service node if the homomorphic operation result conforms to a preset rule.
Specifically, the transaction service node sends the transaction event information generated in step S101 to a consensus node, which checks whether the transaction request is satisfied, searching the residual data volume of the first transaction account according to the identifier of the first transaction account, encrypting the residual data volume of the first transaction account by using the homomorphic public key in step S101, wherein the ciphertext of the data transfer volume in step S101 is obtained by encrypting the transaction service node by using the homomorphic public key, the ciphertext of the data transfer amount and the ciphertext of the remaining data amount of the first account may be in the same key interval, and homomorphic operations may be performed between the two, which may be, for example, the consensus node performs homomorphic subtraction operation on the ciphertext of the data transfer amount and the ciphertext of the residual data amount to obtain a ciphertext of a difference data amount; the consensus node encrypts a preset data volume by using the homomorphic public key to obtain a ciphertext of the preset data volume, and compares the ciphertext of the difference data volume with the ciphertext of the preset data volume; and if the ciphertext of the preset data volume is not less than the ciphertext of the difference data volume, determining that the homomorphic operation result conforms to the preset rule. For example, the preset data volume is zero, the transaction service node encrypts zero using the homomorphic public key to obtain a first ciphertext, and the first ciphertext, the ciphertext of the data transfer volume and the ciphertext of the remaining data volume are in the same key interval.
And S103, generating a transaction block from the transaction event information and uploading the transaction block to the block chain network under the condition that the transaction service node receives the consensus confirmation message returned by the consensus node and meets a preset consensus strategy.
Specifically, the blockchain network includes a plurality of consensus nodes, and the preset consensus strategy may be that the number of the consensus nodes returning the consensus confirmation message is not less than a first preset number. The first preset number may be 60, 70, or 90, for example, the blockchain network includes 100 consensus nodes, the first preset number is 90, and when the number of the consensus nodes returning the consensus confirmation message is not less than 90, the transaction service node determines that the consensus confirmation message returned by the consensus nodes meets a preset consensus policy. For another example, the preset consensus strategy is that the proportion of the consensus node returning the consensus confirmation message to all nodes in the block chain network is greater than a first preset proportion threshold. The first preset proportion threshold may be 50%, 60%, 70%, or the like, for example, the blockchain network includes 1000 consensus nodes, the first preset proportion threshold is 50%, when the number of the consensus nodes returning the consensus confirmation message exceeds 500, the transaction service node determines that the consensus confirmation message returned by the consensus nodes meets a preset consensus policy, and may upload the transaction block to the blockchain network.
In the embodiment, the homomorphic public key is used for encrypting the data transfer amount in the transaction request, the symmetric key is used for encrypting the additional information, the data transfer amount uploaded to the block chain network by the transaction service node and the additional information are both ciphertext, the data transfer amount is information used by the consensus node for consensus verification, the additional information is information which is selectively visible for a specified object, the consensus node can perform consensus verification based on homomorphic operation under the condition that plaintext data of the data transfer amount is not taken, the legality of transaction event information is ensured, and the privacy of the data transfer amount is protected, and encrypting the symmetric key by a public key of a second transaction account, determining that a visible object of the additional information is the second transaction account, and other random transaction accounts can obtain the plaintext data of the additional information. If the data transfer amount and the additional information are encrypted by adopting a homomorphic public key, the second transaction account acquires plaintext data of the additional information through homomorphic decryption, on one hand, the operation amount of the homomorphic decryption is far larger than that of symmetric key decryption in the embodiment, on the other hand, a visible object of the additional information has no specificity, and other accounts except the second transaction account can acquire plaintext data of the additional information through homomorphic decryption; if the data transfer amount and the additional information are encrypted by adopting a symmetric key, the consensus node in the blockchain network cannot perform consensus verification on the data transfer amount in the transaction event information. Therefore, by implementing the embodiment, the data privacy can be protected while the legality of the transaction event information is ensured by using a consensus mechanism of the blockchain technology, and an additional information designated object in the transaction event can be visible.
Further, the transaction block carries the transaction event information, and after step S103 is executed by the transaction service node, the transaction service node triggers an intelligent contract to transfer the data transfer amount from the first transaction account to the second transaction account, and sends the address of the transaction block to the second transaction account, so that the second transaction account obtains the transaction event information in the block chain network according to the address of the transaction block. Furthermore, after the second transaction account obtains the transaction event information, the symmetric key may be obtained by decrypting the ciphertext of the symmetric key using its own private key, and the plaintext data of the additional information may be obtained by decrypting the ciphertext of the additional information using the symmetric key. The ciphertext of the symmetric key is encrypted by the public key of the second transaction account, the second transaction account can decrypt the ciphertext of the symmetric key, in one possible implementation, the symmetric key may be encrypted using public keys of the third transaction account, the fourth transaction account, and/or the fifth transaction account, to obtain corresponding ciphertexts, it is understood that the third transaction account, the fourth transaction account and/or the fifth transaction account may be understood as an account for which the transaction service node authorizes the plaintext data of the additional information to be obtained, the third transaction account, the fourth transaction account and/or the fifth transaction account may not be an account having a transaction process with the first transaction account, but may be understood as an object to which the transaction service node informs of the additional information. In this embodiment, after the transaction service node links the transaction block, the data transfer amount is transferred from the first transaction account to the second transaction account to complete the transaction, and the second transaction account notifies the address of the transaction block to the second transaction account, and obtains the transaction event information according to the address of the transaction block, so that the ciphertext of the additional information in the transaction event information can be decrypted by using its own private key to obtain the plaintext data of the additional information.
In a possible embodiment, the data transfer amount is a digital asset with a preset value, the additional information is oriented information, the second transaction account is found in the blockchain network by the first transaction account according to an object feature of the oriented information, and the object feature of the oriented information is matched with a user feature of the second transaction account. In one possible implementation, the targeting information is an advertisement to be delivered; the second transaction account is any one of the target groups to be advertised. Optionally, the first transaction account performs character string recognition on a field included in the advertisement to be delivered to obtain an object feature of the advertisement to be delivered, for example, the advertisement to be delivered is "male shampoo", and the object feature of the advertisement to be delivered, which is obtained by performing character string recognition on "male shampoo" by the first transaction account, is male; for another example, the advertisement to be delivered is preset by the user of the first transaction account, the object feature of the advertisement to be delivered is input by the user of the first transaction account, and the application does not limit how to obtain the object feature of the targeting information. The first transaction account searches a second transaction account with a user characteristic of male in the blockchain network according to the object characteristic 'male' of the advertisement to be placed, and optionally, the user characteristic of the second transaction account is user information of the second transaction account, which may be information input by a user when registering the second transaction account. Illustratively, a male shampoo advertisement is delivered to a first transaction account a, the object to be advertised is characterized by a male, the first transaction account may search a male target group in a blockchain network, and add advertisement words of shampoo into additional information by respectively transferring data transfer amounts, such as Q coins, to the male target group, and further may attach a purchase link, optionally, an encoding converter is used to convert the advertisement words and the purchase link of shampoo into a hexadecimal machine language. The transaction service node performs consensus verification on the process of transferring the digital assets with the preset numerical value from the first transaction account to the second transaction account through the step S102, but the advertisement words added to the additional information by the first transaction account are not acquired by the consensus node or other transaction accounts except the second transaction account, that is, the transaction account of the target group not to be advertised does not acquire the additional information. In another possible implementation, the orientation information is video content; the second transaction account is any one of a target group of the video content. Optionally, a video tag is associated with the video content, the video tag being preset for the first transaction account, the object feature of the video content may be the video tag, for example, the video content of the video content is "childhood education", the first transaction account searches a second transaction account with user characteristics of childhood education in the blockchain network according to the object characteristics of the video content, namely child education, optionally, the user characteristic of the second transaction account may be obtained by the first transaction account according to the user subscription video content of the second transaction account, such as the user of the second transaction account clicking on the video content of the tag subscribed to children and/or education, it may be determined that the user characteristics of the second transaction account match the object characteristics of the first transaction account. Illustratively, a first transaction account A promotes a public welfare video for children education, the object characteristics of the video are children education, the first transaction account can search a block chain network for a target group, the target group is a user subscribing to video content of tags of children and/or education, and a playing address of the video content is added into additional information by respectively transferring data transfer amount, such as Q coins and the like, to the second transaction account. The playing address added by the first transaction account in the additional information is not acquired by the consensus node or other transaction accounts except the second transaction account, that is, the transaction account which is not the target group of the video content does not acquire the additional information. By implementing the embodiment, the targeted object push of the targeted information can be realized, for example, a merchant can realize accurate and in-place advertisement delivery, and for example, video accurate push is realized, so that the information flooding in the block chain network is avoided.
In another possible embodiment, the data transfer amount is virtual item data, and the additional information is a condition for remarking use of the virtual item data by the first transaction account. For example, in a game scenario, each transaction account corresponds to one game role, the data transfer amount may be a piece of equipment a data, the game role corresponding to the first transaction account a donates equipment a to the game role corresponding to the second transaction account b, the additional information is a use remark condition of the game role corresponding to the first transaction account a to the piece of equipment a data, for example, when an attack attribute of the game role corresponding to the first transaction account a is lower than a preset value, for example, the attack attribute is less than 5, the game role corresponding to the second transaction account b uses the piece of equipment a data, the transaction service node performs consensus verification on the process of transferring the equipment a from the first transaction account to the second transaction account through step S102, but the additional information of the use remark condition of the virtual item data by the first transaction account is not verified by the consensus node or other game roles except for the second transaction account b The player acquires the encrypted ciphertext data which is obtained by adding that the equipment A is homomorphic encrypted, so that the consensus node and/or other game players except the second transaction account B do not know what equipment data are transferred from the first transaction account A to the second transaction account, and do not know the use remark conditions of the equipment data by the first transaction account A. Further, when detecting the use operation of the virtual prop data by the second transaction account, the transaction service node determines whether the current use operation of the virtual prop data by the second transaction account meets the use remark condition of the virtual prop data by the first transaction account, and if so, responds to the use operation of the virtual prop data by the second transaction account. For example, when the transaction service node detects that a game character corresponding to the second transaction account b uses the a equipment data, the transaction service node determines whether to respond to the use operation of the game character corresponding to the second transaction account b on the a equipment data according to a use remark condition of the game character corresponding to the first transaction account b on the a equipment data, for example, the use remark condition is that an attack power attribute of the game character corresponding to the first transaction account b is smaller than 5, when the transaction service node detects that the attack power attribute of the game character corresponding to the first transaction account b is smaller than 5, the transaction service node responds to the use operation of the game character corresponding to the second transaction account b on the a equipment data, that is, the a equipment data is synthesized into the game character corresponding to the second transaction account b, otherwise, the transaction service node refuses the use operation of the game role corresponding to the second transaction account B on the virtual item data. By implementing the embodiment, the data information security in the game application scene can be better maintained, and the use operation of the data transfer amount can be further monitored.
An application scenario of the information encryption method based on the block chain is exemplarily described below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a view of an application scenario of information encryption based on a block chain according to an embodiment of the present application. As shown in fig. 2, the first transaction account 20 executes step S200 to send a transaction request to the transaction service node 21, where the transaction request includes the data transfer amount 10, the additional information 222, the first transaction account a and the second transaction account b; the data transfer amount may represent 10 money, 10Q coins, 10 points, etc., the additional information 222 may represent information such as a redemption ticket number of a point, or an invoice code, etc., and the additional information may also be text information, which is only exemplified here and is not limited to the representation form of the additional information. The transaction service node 21 executes step S201 to generate transaction event information 1 according to the transaction request, where the transaction event information 1 includes the ciphertext of the data transfer amount, the ciphertext of the additional information, the ciphertext of the symmetric key, the first transaction account a, and the second transaction account b; the transaction service node searches the public key of the second transaction account in the block chain network according to the second transaction account B, and encrypts the symmetric key by using the public key of the second transaction account to obtain a ciphertext of the symmetric key; illustratively, the transaction service node executes a symmetric Encryption Algorithm such as a Data Encryption Algorithm (DEA), Advanced Encryption Standard (AES), Triple Data Encryption Algorithm (TDEA), or the like to randomly generate the symmetric key; the transaction service node encrypts the data transfer amount by using a homomorphic public key to obtain a ciphertext of the data transfer amount, the ciphertext shows that the common identification node cannot check the plaintext data of the data transfer amount, and the transaction service node encrypts by using the symmetric key to obtain the ciphertext of the additional information. The transaction service node 21 sends the transaction event information 1 to a consensus node, where the consensus node may include multiple consensus nodes, such as a first consensus node 22 and/or a second consensus node 23, and the first consensus node 22 and/or the second consensus node 23 perform step S202 to search for the remaining data volume of the first transaction account a according to the first transaction account a, and encrypt the remaining data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the remaining data volume; the first consensus node 22 and/or the second consensus node 23 perform homomorphic operation on the ciphertext of the remaining data amount and the ciphertext of the data transfer amount, and the specific operation principle may refer to the embodiment described above with reference to fig. 1, which is not described herein again. If the result after the homomorphic operation meets a preset rule, the first consensus node 22 and/or the second consensus node 23 returns a consensus confirmation message to the transaction service node 21; when the transaction service node 21 receives the consensus confirmation message returned by the consensus node and meets the preset consensus strategy, the transaction service node 21 executes step S203 to generate a transaction block from the transaction event information, and uploads the transaction block to the block chain network. The second transaction account 20 executes step S204, and decrypts the ciphertext of the symmetric key by using its own private key to obtain the symmetric key, so as to decrypt the ciphertext of the additional information by using the symmetric key, where the transaction event information 2 shown in fig. 3 is located at the second transaction account 21, and the additional information 222 can be obtained by the second transaction account 21. Further, after executing step S203, the transaction service node 21 triggers the intelligent contract executing step S205 to transfer the data transfer amount 10 from the first transaction account 20 to the second transaction account 22, that is, the second transaction account 22 is not required to obtain the plaintext data of the data transfer amount through homomorphic decryption, and can also obtain the data of the additional information, so that the second transaction account 22 can know that the first transaction account a transfers the data transfer amount 10 thereto, and the additional information is 222. By implementing the embodiment, the homomorphic public key is used for encrypting the data transfer amount in the transaction request, the symmetric key is used for encrypting the additional information, a consensus mechanism of a block chain technology can be used for ensuring the legality of the transaction event information and protecting the data privacy, and an object specified by the additional information in the transaction event can be visible.
Referring to fig. 3, fig. 3 is a block chain-based information encryption system according to an embodiment of the present application, where fig. 3 is a block diagram of a block chain-based information encryption system according to an embodiment of the present application. As shown in fig. 3, the information encryption system 30 based on a blockchain includes: a first transaction account 300, a transaction service node 301, a consensus node, and a second transaction service node 301, which may include a plurality of consensus nodes, such as a first consensus node 301 and/or a second consensus node 302, wherein:
the transaction service node 301 may be a server, or may be other terminal devices having receiving and sending functions, where the transaction service node 301 is configured to receive a request and send information, for example, the transaction service node 301 is configured to receive a transaction request submitted by a first transaction account; the service node 301 is further configured to send transaction event information, for example, the transaction service node 301 sends the transaction event information to a consensus node, where the consensus node may include multiple nodes, for example, a first consensus node 302 and a second consensus node 303, and is configured to perform consensus confirmation on the transaction event information submitted by the transaction service node 301, and return a message of consensus confirmation to the transaction service node 301 after the consensus confirmation. The first transaction account 300 may be an account number of a terminal device having an association relationship with a first transaction party, the second transaction account 304 may be an account number of a terminal device having an association relationship with a second transaction party, the first transaction account 300 is configured to send a transaction request to the transaction service node 301, and the second transaction account 304 is configured to obtain additional information. The first transaction account 300 and the second transaction account 304 may access the same terminal device, and the transaction service node 301, the first consensus node 302, and the second consensus node 303 are all nodes in a blockchain network.
The present application further provides an information encryption apparatus based on a block chain, referring to fig. 4, and fig. 4 is a block diagram of a structure of an information encryption apparatus based on a block chain according to an embodiment of the present application. As shown in fig. 4, the block chain-based information encryption apparatus 40 includes:
a receiving module 400, configured to receive a transaction request submitted by a first transaction account, where the transaction request includes a data transfer amount, additional information, an identifier of the first transaction account, and an identifier of a second transaction account;
a generating module 401, configured to generate transaction event information according to the transaction request, where the transaction event information includes a ciphertext of the data transfer amount, a ciphertext of the additional information, a ciphertext of a symmetric key, an identifier of the first transaction account, and an identifier of the second transaction account;
a calculating module 402, configured to encrypt the data transfer amount by using a homomorphic public key to obtain a ciphertext of the data transfer amount;
the calculating module 402 is further configured to randomly generate the symmetric key, and encrypt the additional information using the symmetric key to obtain a ciphertext of the additional information;
the calculation module 402 is further configured to search the public key of the second transaction account in a blockchain network according to the identifier of the second transaction account, and encrypt the symmetric key using the public key of the second transaction account to obtain a ciphertext of the symmetric public key;
a sending module 403, configured to send the transaction event information to a consensus node, so that the consensus node searches for the remaining data volume of the first transaction account according to the identifier of the first transaction account, and encrypts the remaining data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the remaining data volume; the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, and returns a consensus confirmation message to the transaction service node if the homomorphic operation result conforms to a preset rule;
the generating module 401 is further configured to generate a transaction block from the transaction event information when the receiving module receives a consensus confirmation message returned by the consensus node and meets a preset consensus strategy;
the sending module 403 is further configured to upload the transaction block to the blockchain network.
In a possible implementation manner, when the sending module 403 sends the transaction event information to a consensus node, the consensus node performs homomorphic subtraction operation on the ciphertext of the data transfer amount and the ciphertext of the remaining data amount to obtain a ciphertext of a difference data amount;
the consensus node encrypts a preset data volume by using the homomorphic public key to obtain a ciphertext of the preset data volume, and compares the ciphertext of the difference data volume with the ciphertext of the preset data volume; and if the ciphertext of the preset data volume is not less than the ciphertext of the difference data volume, determining that the homomorphic operation result conforms to the preset rule.
In a possible embodiment, the receiving module 400 further receives a first digital signature and a second digital signature when receiving the transaction request submitted by the first transaction account;
the information encryption device 40 based on the blockchain further includes a lookup module 404, where the lookup module 404 is configured to lookup the public key of the first transaction account and the public key of the second transaction account in the blockchain network according to the identifier of the first transaction account and the identifier of the second transaction account, check the first digital signature and the second digital signature, and obtain a first check code and a second check code respectively;
the calculating module 402 is further configured to perform a hash operation on the transaction request to obtain a third check code;
the generating module 401 is further configured to generate transaction event information according to the transaction request under the condition that the first check code, the second check code, and the third check code are the same.
Further, the transaction block carries the transaction event information, and the sending module 403 is further configured to transfer the data transfer amount from the first transaction account to the second transaction account, and send the address of the transaction block to the second transaction account, so that the second transaction account obtains the transaction event information in the block chain network according to the address of the transaction block.
In a possible implementation manner, the data transfer amount is virtual item data, and the additional information is a use remark condition of the first transaction account on the virtual item data.
Optionally, the block chain-based information encryption device 40 further includes a determining module 405, where the determining module 405 is configured to, when detecting that the second transaction account performs the use operation on the virtual item data, determine whether the current use operation on the virtual item data by the second transaction account satisfies a use remark condition of the first transaction account on the virtual item data, and if yes, respond to the use operation on the virtual item data by the second transaction account.
In another possible embodiment, the data transfer amount is a digital asset with a preset numerical value, the additional information is targeting information, the second transaction account is found in the blockchain network by the first transaction account according to an object feature of the targeting information, and the object feature of the targeting information is matched with a user feature of the second transaction account.
Optionally, the homomorphic operation is: the transaction service node performs mathematical four-rule operation on the ciphertext data encrypted by the homomorphic public key to obtain a first output result; and performing the same four mathematical operations on the unencrypted original data to obtain a second output result, wherein the result of homomorphic decryption on the first output result is the same as the second output result.
Referring to fig. 5, fig. 5 is a block diagram of an information acquiring apparatus based on a block chain according to an embodiment of the present disclosure. As shown in fig. 5, the service processing device 50 includes a transceiver 500, a processor 501 and a memory 502, wherein:
the transceiver 500 is configured to receive a transaction request and a consensus confirmation message returned by a consensus node, and further configured to upload a transaction block to a block chain network, where the processor 500 may be a Central Processing Unit (CPU), and the processor may also be another general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or another programmable logic device, a discrete gate or a transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 502 stores instructions, and it is understood that the memory 502 stores the corresponding relationship between the home zone information and the home location. Illustratively, the memory 502 may include both read-only memory and random-access memory, and provides instructions and data to the processor 501 and the transceiver 500. A portion of the memory 502 may also include non-volatile random access memory. For example, memory 502 may also store device type information
The processor 501 is configured to execute the computer program stored in the memory to implement any one of the possible embodiments described above.
In a specific implementation, the service processing device may execute, through each built-in functional module, the implementation manners provided in the steps in fig. 1 to fig. 3, which may be specifically referred to the implementation manners provided in the steps in fig. 1 to fig. 3, and are not described herein again.
The present application provides a computer-readable storage medium having stored therein instructions, which when executed on a computer, cause the computer to perform any one of the possible embodiments described above.
It should be noted that the terms "first" and "second" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the embodiments provided in the present application, it should be understood that the disclosed method, apparatus, and system may be implemented in other ways. The above-described embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on a plurality of network units; some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Alternatively, the integrated unit of the present invention may be stored in a computer-readable storage medium if it is implemented in the form of a software functional module and sold or used as a separate product. Based on such understanding, the technical solutions of the embodiments of the present invention may be essentially implemented or a part contributing to the prior art may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, a ROM, a RAM, a magnetic or optical disk, or various other media that can store program code.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the appended claims.
Claims (10)
1. An information encryption method based on a block chain, the method comprising:
the transaction service node receives a transaction request submitted by a first transaction account, wherein the transaction request comprises a data transfer amount, additional information, an identifier of the first transaction account and an identifier of a second transaction account;
the transaction service node generates transaction event information according to the transaction request, wherein the transaction event information comprises a ciphertext of the data transfer amount, a ciphertext of the additional information, a ciphertext of a symmetric key, an identifier of the first transaction account and an identifier of the second transaction account; the ciphertext of the data transfer amount is obtained by encrypting the data transfer amount by using a homomorphic public key by the transaction service node; the ciphertext of the additional information is obtained by encrypting the transaction service node by using the symmetric key, the symmetric key is randomly generated by the transaction service node, the ciphertext of the symmetric key is obtained by searching the public key of the second transaction account in the blockchain network by the transaction service node according to the identifier of the second transaction account and encrypting the symmetric key by using the public key of the second transaction account;
the transaction service node sends the transaction event information to a consensus node so that the consensus node searches the residual data volume of the first transaction account according to the identification of the first transaction account, and encrypts the residual data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the residual data volume; the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, and returns a consensus confirmation message to the transaction service node if the homomorphic operation result conforms to a preset rule;
and under the condition that the transaction service node receives a consensus confirmation message returned by the consensus node and meets a preset consensus strategy, generating a transaction block from the transaction event information, and uploading the transaction block to the block chain network.
2. The method of claim 1, wherein homomorphically operating the ciphertext of the remaining amount of data and the ciphertext of the amount of data transfer by the consensus node comprises:
the consensus node performs homomorphic subtraction operation on the ciphertext of the data transfer amount and the ciphertext of the residual data amount to obtain a ciphertext of a difference data amount;
the consensus node encrypts a preset data volume by using the homomorphic public key to obtain a ciphertext of the preset data volume, and compares the ciphertext of the difference data volume with the ciphertext of the preset data volume; and if the ciphertext of the preset data volume is not less than the ciphertext of the difference data volume, determining that the homomorphic operation result conforms to the preset rule.
3. The method of claim 1, wherein the transaction service node, upon receiving a transaction request submitted by the first transaction account, also receives a first digital signature and a second digital signature;
the transaction service node generating transaction event information according to the transaction request comprises:
the transaction service node searches a public key of the first transaction account and a public key of the second transaction account in the block chain network according to the identifier of the first transaction account and the identifier of the second transaction account, and verifies the first digital signature and the second digital signature to obtain a first check code and a second check code respectively;
the transaction service node performs hash operation on the transaction request to obtain a third check code;
and if the first check code, the second check code and the third check code are the same, the transaction service node generates transaction event information according to the transaction request.
4. The method of claim 1, further comprising:
the transaction service node triggers an intelligent contract to transfer the data transfer amount from the first transaction account to the second transaction account, and sends the address of the transaction block to the second transaction account, so that the second transaction account obtains the transaction event information in the block chain network according to the address of the transaction block.
5. The method according to claim 4, wherein the data transfer amount is virtual item data, and the additional information is a condition for remarking the use of the virtual item data by the first transaction account.
6. The method of claim 5, further comprising:
when detecting the use operation of the second transaction account on the virtual prop data, the transaction service node judges whether the current use operation of the second transaction account on the virtual prop data meets the use remark condition of the first transaction account on the virtual prop data, and if so, responds to the use operation of the second transaction account on the virtual prop data.
7. The method of claim 1, wherein the data transfer amount is a digital asset of a preset value, the additional information is targeting information, the second transaction account is found in the blockchain network by the first transaction account according to an object feature of the targeting information, and the object feature of the targeting information is matched with a user feature of the second transaction account.
8. An apparatus for encrypting information based on a blockchain, the apparatus comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a transaction request submitted by a first transaction account, and the transaction request comprises a data transfer amount, additional information, an identifier of the first transaction account and an identifier of a second transaction account;
a generating module, configured to generate transaction event information according to the transaction request, where the transaction event information includes a ciphertext of the data transfer amount, a ciphertext of the additional information, a ciphertext of a symmetric key, an identifier of the first transaction account, and an identifier of the second transaction account;
the calculation module is used for encrypting the data transfer amount by using a homomorphic public key to obtain a ciphertext of the data transfer amount;
the computing module is further configured to randomly generate the symmetric key, and encrypt the additional information using the symmetric key to obtain a ciphertext of the additional information;
the computing module is further configured to search the public key of the second transaction account in a blockchain network according to the identifier of the second transaction account, and encrypt the symmetric key using the public key of the second transaction account to obtain a ciphertext of the symmetric public key;
the sending module is used for sending the transaction event information to a consensus node so that the consensus node searches the residual data volume of the first transaction account according to the identifier of the first transaction account, and encrypts the residual data volume of the first transaction account by using the homomorphic public key to obtain a ciphertext of the residual data volume; the consensus node performs homomorphic operation on the ciphertext of the residual data volume and the ciphertext of the data transfer volume, and returns a consensus confirmation message to the transaction service node if the homomorphic operation result conforms to a preset rule;
the generating module is further configured to generate a transaction block from the transaction event information when the receiving module receives a consensus confirmation message returned by the consensus node and meets a preset consensus strategy;
the sending module is further configured to upload the transaction block to the blockchain network.
9. An information encryption device based on a blockchain, the device comprising a transceiver, a processor and a memory, wherein the processor is configured to execute a computer program stored in the memory to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored therein instructions which, when run on a computer, cause the computer to perform the steps of the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010327136.9A CN111523891B (en) | 2020-04-23 | 2020-04-23 | Information encryption method, device, equipment and storage medium based on block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010327136.9A CN111523891B (en) | 2020-04-23 | 2020-04-23 | Information encryption method, device, equipment and storage medium based on block chain |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111523891A true CN111523891A (en) | 2020-08-11 |
CN111523891B CN111523891B (en) | 2023-11-24 |
Family
ID=71904128
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010327136.9A Active CN111523891B (en) | 2020-04-23 | 2020-04-23 | Information encryption method, device, equipment and storage medium based on block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111523891B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112150146A (en) * | 2020-09-22 | 2020-12-29 | 京东数字科技控股股份有限公司 | Block processing method, device and equipment of block chain and storage medium |
CN112269915A (en) * | 2020-10-30 | 2021-01-26 | 成都质数斯达克科技有限公司 | Service processing method, device, equipment and storage medium |
CN112860805A (en) * | 2021-04-01 | 2021-05-28 | 中国工商银行股份有限公司 | Block chain data interaction method and system |
CN113111370A (en) * | 2021-04-30 | 2021-07-13 | 永旗(北京)科技有限公司 | Block chain cross-chain communication method |
CN113298653A (en) * | 2021-05-27 | 2021-08-24 | 李政德 | Block chain-based data tampering monitoring method and device |
CN113538139A (en) * | 2021-06-29 | 2021-10-22 | 深圳市高德信通信股份有限公司 | Block chain-based secure transaction method |
CN113674077A (en) * | 2021-07-23 | 2021-11-19 | 华南理工大学 | Consumption credit risk prevention method, system, equipment and storage medium |
CN114117503A (en) * | 2022-01-24 | 2022-03-01 | 连连宝(杭州)信息技术有限公司 | Encrypted data processing method, device, system and storage medium |
CN114331397A (en) * | 2021-12-28 | 2022-04-12 | 北京百度网讯科技有限公司 | Information processing method, device, electronic equipment and storage medium |
CN115375464A (en) * | 2022-10-26 | 2022-11-22 | 江西信惠链科技有限公司 | Financing authorization method, system, computer device and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106549749A (en) * | 2016-12-06 | 2017-03-29 | 杭州趣链科技有限公司 | A kind of block chain method for secret protection encrypted based on additive homomorphism |
CN110033267A (en) * | 2019-02-19 | 2019-07-19 | 阿里巴巴集团控股有限公司 | Method, node, system and the storage medium of secret protection are realized in block chain |
US20190253235A1 (en) * | 2018-11-07 | 2019-08-15 | Alibaba Group Holding Limited | Blockchain data protection using homomorphic encryption |
CN110147994A (en) * | 2019-04-13 | 2019-08-20 | 山东公链信息科技有限公司 | A kind of instant execution method of the block chain based on homomorphic cryptography |
-
2020
- 2020-04-23 CN CN202010327136.9A patent/CN111523891B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106549749A (en) * | 2016-12-06 | 2017-03-29 | 杭州趣链科技有限公司 | A kind of block chain method for secret protection encrypted based on additive homomorphism |
US20190253235A1 (en) * | 2018-11-07 | 2019-08-15 | Alibaba Group Holding Limited | Blockchain data protection using homomorphic encryption |
CN110033267A (en) * | 2019-02-19 | 2019-07-19 | 阿里巴巴集团控股有限公司 | Method, node, system and the storage medium of secret protection are realized in block chain |
CN110147994A (en) * | 2019-04-13 | 2019-08-20 | 山东公链信息科技有限公司 | A kind of instant execution method of the block chain based on homomorphic cryptography |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112150146A (en) * | 2020-09-22 | 2020-12-29 | 京东数字科技控股股份有限公司 | Block processing method, device and equipment of block chain and storage medium |
CN112150146B (en) * | 2020-09-22 | 2023-11-03 | 京东科技控股股份有限公司 | Block processing method, device, equipment and storage medium of block chain |
CN112269915B (en) * | 2020-10-30 | 2023-08-25 | 成都质数斯达克科技有限公司 | Service processing method, device, equipment and storage medium |
CN112269915A (en) * | 2020-10-30 | 2021-01-26 | 成都质数斯达克科技有限公司 | Service processing method, device, equipment and storage medium |
CN112860805A (en) * | 2021-04-01 | 2021-05-28 | 中国工商银行股份有限公司 | Block chain data interaction method and system |
CN113111370A (en) * | 2021-04-30 | 2021-07-13 | 永旗(北京)科技有限公司 | Block chain cross-chain communication method |
CN113298653A (en) * | 2021-05-27 | 2021-08-24 | 李政德 | Block chain-based data tampering monitoring method and device |
CN113538139A (en) * | 2021-06-29 | 2021-10-22 | 深圳市高德信通信股份有限公司 | Block chain-based secure transaction method |
CN113674077A (en) * | 2021-07-23 | 2021-11-19 | 华南理工大学 | Consumption credit risk prevention method, system, equipment and storage medium |
CN114331397A (en) * | 2021-12-28 | 2022-04-12 | 北京百度网讯科技有限公司 | Information processing method, device, electronic equipment and storage medium |
CN114331397B (en) * | 2021-12-28 | 2024-02-13 | 北京百度网讯科技有限公司 | Information processing method, apparatus, electronic device and storage medium |
CN114117503B (en) * | 2022-01-24 | 2022-06-24 | 连连宝(杭州)信息技术有限公司 | Encrypted data processing method, device, system and storage medium |
CN114117503A (en) * | 2022-01-24 | 2022-03-01 | 连连宝(杭州)信息技术有限公司 | Encrypted data processing method, device, system and storage medium |
CN115375464A (en) * | 2022-10-26 | 2022-11-22 | 江西信惠链科技有限公司 | Financing authorization method, system, computer device and readable storage medium |
CN115375464B (en) * | 2022-10-26 | 2023-02-03 | 江西信惠链科技有限公司 | Financing authorization method, system, computer device and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN111523891B (en) | 2023-11-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111523891B (en) | Information encryption method, device, equipment and storage medium based on block chain | |
Zhao et al. | Machine learning based privacy-preserving fair data trading in big data market | |
Delgado-Segura et al. | A fair protocol for data trading based on bitcoin transactions | |
CN111095332B (en) | Method and system for protecting private social media advertisements | |
Wu et al. | A novel and provably secure authentication and key agreement scheme with user anonymity for global mobility networks | |
US20190354969A1 (en) | System and method for securing digital assets | |
CN108173805B (en) | Block chain-based distributed anonymous area collaborative construction method with privacy preservation function | |
EP2494486B1 (en) | System for protecting an encrypted information unit | |
KR100833828B1 (en) | Method of authenticating anonymous users while reducing potential for ?middleman? fraud | |
US20030105954A1 (en) | Method, system and computer program product for secure ticketing in a communications device | |
Delgado-Mohatar et al. | Blockchain-based semi-autonomous ransomware | |
CN103095453A (en) | Public-key Encrypted Bloom Filters With Applications To Private Set Intersection | |
CN110400162B (en) | Data processing method, device, server and system | |
JP2010220212A (en) | Securing communications sent by first user to second user | |
CN110719176A (en) | Logistics privacy protection method and system based on block chain and readable storage medium | |
CN111476573B (en) | Account data processing method, device, equipment and storage medium | |
Megias et al. | Privacy-aware peer-to-peer content distribution using automatically recombined fingerprints | |
Amiet | Blockchain vulnerabilities in practice | |
Lee et al. | An innovative electronic group-buying system for mobile commerce | |
Gao et al. | Secure, fair and instant data trading scheme based on bitcoin | |
Yang et al. | Enhanced digital rights management authentication scheme based on smart card | |
JP2023524107A (en) | Decentralized privacy-preserving rewards with encrypted black-box accumulators | |
CN114144783A (en) | Cryptographic pseudonym mapping method, computer system, computer program and computer-readable medium | |
CN102833239B (en) | Method for implementing nesting protection of client account information based on network identity | |
JP3784055B2 (en) | List matching method, network system, server and information terminal |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |