CN111523891B - Information encryption method, device, equipment and storage medium based on block chain - Google Patents

Information encryption method, device, equipment and storage medium based on block chain Download PDF

Info

Publication number
CN111523891B
CN111523891B CN202010327136.9A CN202010327136A CN111523891B CN 111523891 B CN111523891 B CN 111523891B CN 202010327136 A CN202010327136 A CN 202010327136A CN 111523891 B CN111523891 B CN 111523891B
Authority
CN
China
Prior art keywords
transaction
ciphertext
transaction account
account
data
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.)
Active
Application number
CN202010327136.9A
Other languages
Chinese (zh)
Other versions
CN111523891A (en
Inventor
李茂材
蓝虎
王宗友
朱耿良
周开班
时一防
黄焕坤
刘区城
杨常青
刘攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010327136.9A priority Critical patent/CN111523891B/en
Publication of CN111523891A publication Critical patent/CN111523891A/en
Application granted granted Critical
Publication of CN111523891B publication Critical patent/CN111523891B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION 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/00Payment architectures, schemes or protocols
    • G06Q20/38Payment protocols; Details thereof
    • G06Q20/382Payment protocols; Details thereof insuring higher security of transaction
    • G06Q20/3829Payment 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; and sending the transaction event information to a consensus node, searching the residual data quantity of the first transaction account by the consensus node according to the identification of the first transaction account, encrypting the residual data quantity of the first transaction account by using a homomorphic public key to obtain a ciphertext of the residual data quantity, carrying out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity by the consensus node, returning a consensus confirmation message by the consensus node if the result after homomorphic operation accords with a preset rule, generating a transaction block by the transaction event information, and uploading the transaction block to a block chain network. By implementing the application, the privacy of data is protected while the consensus mechanism of the blockchain technology is used, and the object can be visible to the additional information appointed in the transaction event.

Description

Information encryption method, device, equipment and storage medium based on block chain
Technical Field
The application relates to the technical field of blockchains, in particular to a blockchain-based information encryption method, a blockchain-based information encryption device, blockchain-based information encryption equipment and a blockchain-based information storage medium.
Background
The account book of the blockchain has the distributed characteristic, each participating node independently and completely stores the written account book data information, so that each participating node is backed up with the account book data information, and as a plurality of nodes are needed to participate in the storage and verification of the account book, the account book data is in a completely public state in the blockchain network, for example, a game player A gives a player B an A device, tells the player B when the A device is used to cooperate with the A device in a remark, and when the process is commonly identified and verified, the common node of the blockchain knows that the A device is the A device for the player B and the A device is also known when the A device is used by the B device, thus information leakage can be caused, and other game players can adjust a combat strategy according to the leaked information; for another example, some information with a directional pushing object, such as advertisement or video, is pushed in the blockchain network, and the prior art adopts to uplink the directional information, so that the directional information propagates in the blockchain network, which causes the problem that the non-directional pushing object also receives the directional information, and information flooding is caused.
Disclosure of Invention
The application provides an information encryption method based on a blockchain, which can ensure the validity of transaction event information by using a consensus mechanism of the blockchain technology, protect the privacy of consensus data and can also be visible to an additional information appointed object in a transaction event.
In one aspect, an embodiment of the present application provides a blockchain-based information encryption method, including:
the transaction service node receives a transaction request submitted by a first transaction account, wherein the transaction request comprises data transfer quantity, additional information, an identification of the first transaction account and an identification of a second transaction account;
the transaction service node generates transaction event information according to the transaction request, wherein the transaction event information comprises ciphertext of the data transfer quantity, ciphertext of the additional information, ciphertext of a symmetric key, identification of the first transaction account and identification of the second transaction account; the ciphertext of the data transfer quantity is obtained by encrypting the data transfer quantity by using a homomorphic public key through the transaction service node; the ciphertext of the additional information is obtained after the transaction service node encrypts the symmetric key, the symmetric key is randomly generated by the transaction service node, the ciphertext of the symmetric key is obtained by the transaction service node searching a public key of the second transaction account in a blockchain network according to the identification 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 carries out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity, and if the result after homomorphic operation accords with a preset rule, the consensus node returns a consensus confirmation message to the transaction service node;
and under the condition that the transaction service node receives that the consensus confirmation message returned by the consensus node meets a preset consensus strategy, generating a transaction block from the transaction event information, and uploading the transaction block to the blockchain network.
In one aspect, an embodiment of the present application provides a blockchain-based information encryption device, including:
the receiving module is used for receiving a transaction request submitted by a first transaction account, wherein the transaction request comprises data transfer quantity, additional information, an identification of the first transaction account and an identification of a second transaction account;
The generation module is used for generating transaction event information according to the transaction request, wherein the transaction event information comprises ciphertext of the data transfer quantity, ciphertext of the additional information, ciphertext of a symmetric key, identification of the first transaction account and identification of the second transaction account;
the computing module is used for encrypting the data transfer quantity by using the homomorphic public key to obtain a ciphertext of the data transfer quantity;
the computing module is further used for randomly generating the symmetric key, and encrypting the additional information by using the symmetric key to obtain a ciphertext of the additional information;
the computing module is further configured to search a 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 by 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 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 carries out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity, and if the result after homomorphic operation accords with a preset rule, the consensus node returns a consensus confirmation message to the transaction service node;
The generation module is further configured to generate the transaction event information into a transaction block when the receiving module receives that the consensus confirmation message returned by the consensus node meets a preset consensus strategy;
the sending module is further configured to upload the transaction block to the blockchain network.
In one possible implementation manner, under the condition that the sending module sends the transaction event information to a consensus node, the consensus node carries out homomorphic subtraction operation on the ciphertext of the data transfer quantity and the ciphertext of the residual data quantity to obtain ciphertext of a difference data quantity; the common 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 quantity is not smaller than the ciphertext of the difference data quantity, determining that the homomorphic operation result accords with the preset rule.
In one possible embodiment, the receiving module, upon receiving a transaction request submitted by the first transaction account, also receives a first digital signature and a second digital signature;
The blockchain-based information encryption device further comprises a searching module, wherein the searching module is used for searching a public key of the first transaction account and a public key of the second transaction account in the blockchain network according to the identification of the first transaction account and the identification of the second transaction account, and checking the first digital signature and the second digital signature to obtain a first check code and a second check code respectively;
the computing module is further used for carrying out hash operation on the transaction request to obtain a third check code;
the generation module is further configured to generate transaction event information according to the transaction request when the first check code, the second check code, and the third check code are all 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 blockchain network according to the address of the transaction block.
In one possible embodiment, the data transfer amount is virtual prop data, and the additional information is a usage remark condition of the virtual prop data by the first transaction account.
Optionally, the blockchain-based information encryption device further includes a determining module, where the determining module is configured to determine, when detecting a usage operation of the virtual prop data by the second transaction account, whether a current usage operation of the virtual prop data by the second transaction account meets a usage remark condition of the virtual prop data by the first transaction account, and if yes, respond to the usage operation of the virtual prop data by the second transaction account.
In another possible embodiment, the data transfer amount is a digital asset with a preset value, the additional information is orientation information, the second transaction account is found in the blockchain network by the first transaction account according to the object feature of the orientation information, and the object feature of the orientation information is matched with the user feature of the second transaction account.
In one aspect, an embodiment of the present application provides a blockchain-based information encryption device, including a transceiver, a processor, and a memory, where the processor is configured to execute a computer program stored in the memory, to implement any one of the possible embodiments described above.
In one aspect, the application also provides a computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of the above aspects.
In the embodiment of the application, the data transfer amount in the transaction request is encrypted by using the homomorphic public key, the additional information is encrypted by using the symmetric key, the data transfer amount uploaded to the blockchain network by the transaction service node and the additional information are both ciphertext, the data transfer amount is information used for carrying out the consensus verification by the consensus node, the additional information is information which is selectively visible by a designated object, the consensus node can carry out the consensus verification based on homomorphic operation under the condition that plaintext data of the data transfer amount is not taken, the validity of transaction event information is ensured, the privacy of the data transfer amount is protected, the symmetric key is encrypted by using the public key of a second transaction account, and the visible object of the additional information is determined to be the second transaction account, but not other random transaction accounts can acquire 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 homomorphic decryption is far greater than that of symmetric key decryption in the embodiment, and on the other hand, visible objects of the additional information are not specified, 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 common knowledge mechanism of the blockchain technology can be used for guaranteeing the validity of the transaction event information and protecting the data privacy, and the object can be visible to the additional information appointed in the transaction event.
Drawings
FIG. 1 is a schematic flow chart of a block chain based information encryption method according to an embodiment of the present application;
FIG. 2 is a block chain based application scenario diagram of information encryption according to an embodiment of the present application;
FIG. 3 is a block diagram of a block chain based information encryption system according to an embodiment of the present application;
FIG. 4 is a block diagram of an information encryption device based on blockchain according to an embodiment of the present application;
fig. 5 is a block diagram of a block chain-based information encryption device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The implementation of the technical scheme of the application is further described in detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flow chart of a block chain-based information encryption method according to an embodiment of the present application. As shown in fig. 1, the specific implementation steps of this embodiment are as follows:
S100, the transaction service node receives a transaction request submitted by a first transaction account, wherein the transaction request comprises data transfer quantity, additional information, identification of the first transaction account and identification 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 that part or all of the remaining data amount of the transaction request be transferred to the second transaction account, and is exemplary: the first transaction account A transfers 10Q coins to the 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 ciphertext of the data transfer quantity, ciphertext of the additional information, ciphertext of the symmetric key, identification of the first transaction account and identification of the second transaction account; the ciphertext of the data transfer quantity is obtained by encrypting the data transfer quantity by using a homomorphic public key through the transaction service node; the ciphertext of the additional information is obtained after the transaction service node uses the symmetric key to encrypt, the symmetric key is randomly generated by the transaction service node, the ciphertext of the symmetric key is obtained by the transaction service node searching a public key of the second transaction account in a blockchain network according to the identification of the second transaction account, and the public key of the second transaction account is used to encrypt the symmetric key.
Specifically, the homomorphic public key is generated for one of functions of the transaction service node when the homomorphic algorithm is operated, and the homomorphic public key is generated in the process of executing homomorphic operation. For example, the mathematical four-law operation of the homomorphic operation is a subtraction operation, and the formula is: wherein Enc is an encryption function, a is the remaining data transfer amount of the first transaction account, b is the data transfer amount, < >>Representing an operation on the ciphertext domain, -representing an operation on 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, the 10Q coins and the 20Q coins are respectively homomorphic-encrypted by using the homomorphic public key to obtain ciphertext data of the 10Q coins and ciphertext data of the 20Q coins, the transaction service node subtracts the ciphertext data of the 10Q coins from the ciphertext data of the 20Q coins in the ciphertext domain, and the obtained first output result is a result obtained by subtracting the plaintext data of the 10Q coins from the 20Q coins and encrypting the plaintext data by using the same homomorphic public key, that is, subtracting the homomorphic encryption is performed on the plaintext by subtracting the data, and the result is equivalent to the result obtained by subtracting the ciphertext after homomorphic encryption. Illustratively, the homomorphic arithmetic four-law operation is an addition operation, and the formula is: For example, the first transaction account transfers 10Q coins to the second transaction account, the second transaction account is added with the data transfer amount based on the remaining data amount, b is 10Q coins, the remaining data amount in the second transaction account is 30Q coins, a is 30Q coins, the 10Q coins and 30Q coins are respectively encrypted by using the homomorphic public key to obtain ciphertext data of 10Q coins and ciphertext data of 30Q coins, the transaction service node adds ciphertext data of 30Q coins to ciphertext data of 10Q coins in the ciphertext domain, and the obtained output result is obtained by encrypting plaintext data of 10Q coins plus plaintext data of 30Q coins by using the same homomorphic public key, namely, by performing plaintext on dataThe addition operation is then homomorphic encryption, and the corresponding addition operation is carried out on the ciphertext after homomorphic encryption, so that the result is equivalent. Optionally, the mathematical four-law operation of the homomorphic operation is a multiplication operation, and the formula is:for example, in the game scenario, the first transaction account is transferred to the second transaction account by acceleration equipment, for example, the moving speed is increased by 1.5 times, then for the second transaction account, the second transaction account is multiplied by 1.5 based on the original moving speed, b is 1.5, taking the second transaction account as an example, the original moving speed is 2m/s, a is 2m/s, homomorphic encryption is performed on 1.5 and 2m/s by using the homomorphic public key respectively to obtain ciphertext data of 1.5 and ciphertext data of 2m/s, the transaction service node multiplies ciphertext data of 1.5 by ciphertext data of 2m/s in the ciphertext domain, the obtained output result is a plaintext result obtained by encrypting plaintext data of 1.5 times 2m/s by using the same homomorphic public key, namely, the plaintext is obtained by carrying out homomorphic encryption on data and then carrying out corresponding multiplication on ciphertext after homomorphic encryption, and the result is equivalent. Similarly, if in the game scenario the first transaction account is transferred to the second transaction account by a deceleration device, for example, the moving speed is 2 times slower, then the second transaction account is divided by 2 based on the original moving speed, and homomorphic division operation is applied, where the formula is expressed as: / > Taking the original moving speed of the second transaction account as 1m/s as an example, wherein a is 1m/s, homomorphic encryption is carried out on 2 and 1m/s by using the homomorphic public key respectively to obtain 2 ciphertext data and 1m/s ciphertext data, the transaction service node divides the 1m/s ciphertext data by the 2 ciphertext data in the ciphertext domain to obtain an output result, namely the result obtained by encrypting the 1m/s divided 2 plaintext data by using the same homomorphic public key,the method comprises the steps of dividing data plaintext, then homomorphic encryption, and correspondingly dividing ciphertext after homomorphic encryption, wherein the result is equivalent.
Illustratively, the transaction service node executes a symmetric encryption algorithm to randomly generate the symmetric key, such as a data encryption algorithm (Data Encryption Algorithm, DEA), an advanced encryption standard (English: advanced Encryption Standard, AES), or a triple data encryption algorithm (TDEA, triple Data Encryption Algorithm), among others. It will be appreciated that the transaction service node may randomly generate a plurality of different symmetric keys that relate the generated symmetric keys to the identity of the transaction account, e.g., a first symmetric key corresponds to the first transaction account, a second symmetric key corresponds to the second transaction account, and so on. The transaction service node encrypts the additional information in the transaction request of the first transaction account by using a symmetric key with 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 acquire 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 one possible embodiment, the transaction service node further receives a first digital signature and a second digital signature upon receiving a 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 blockchain network according to the identification of the first transaction account and the identification of the second transaction account, and performs signature verification on 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 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, the second transaction account encrypts the second digest hash by using its own private key to obtain the second digital signature, and it can be understood that the hash values obtained by performing hash operation on the same transaction request by the first transaction account and the second transaction account are the same, i.e. the first digest hash is the same as the second digest hash. The first digital signature represents a validation of the transaction request legitimacy by the first transaction account, and the second digital signature represents a validation of the transaction request legitimacy 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 check the first digital signature and the second digital signature, namely, decrypt the first digital signature by using a public key of the first transaction account to obtain a first check code, namely, obtain the first digest hash; and similarly, decrypting the second digital signature by using the public key of the second transaction account to obtain a second check code, and obtaining the second digest hash. 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, that is, the value obtained after the first transaction account, the second transaction account and the transaction service node perform hash operation on the transaction request is the same, the value 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 carries out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity, and if the result after homomorphic operation accords with a preset rule, the consensus node returns a consensus confirmation message to the transaction service node.
Specifically, the transaction service node sends the transaction event information generated in step S101 to a consensus node, the consensus node searches for the remaining data amount of the first transaction account according to the identifier of the first transaction account in order to check whether the transaction request is satisfied, encrypts the remaining data amount of the first transaction account by using the homomorphic public key in step S101, and in step S101, the ciphertext of the data transfer amount is also obtained by encrypting the transaction service node by using the homomorphic public key, and then the ciphertext of the data transfer amount and the ciphertext of the remaining data amount of the first account are in the same key interval, homomorphic operation can be performed between the ciphertext of the data transfer amount and the ciphertext of the remaining data amount, and 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 the ciphertext of the differential data amount; the common 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 quantity is not smaller than the ciphertext of the difference data quantity, determining that the homomorphic operation result accords with the preset rule. For example, the preset data amount is zero, the transaction service node encrypts zero by using the homomorphic public key to obtain a first ciphertext, where the first ciphertext, the ciphertext of the data transfer amount and the ciphertext of the residual data amount are in the same key interval, and in one possible implementation manner, the homomorphic subtraction operation may be implemented by using a successive approximation method, and the ciphertext of the residual data amount is continuously decremented to obtain a second ciphertext until the second ciphertext is the same as the ciphertext of the data transfer amount.
And S103, under the condition that the transaction service node receives that the consensus confirmation message returned by the consensus node meets a preset consensus strategy, generating a transaction block from the transaction event information, and uploading the transaction block to the blockchain network.
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 acknowledgement 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 acknowledgement message is not less than 90, the transaction service node determines that the consensus acknowledgement message returned by the consensus node meets a preset consensus strategy. For another example, the preset consensus strategy is that a ratio of consensus nodes returning a consensus acknowledgement message to all nodes in the blockchain network is greater than a first preset ratio threshold. The first preset proportion threshold value may be 50%, 60% or 70%, etc., and in an exemplary embodiment, the blockchain network includes 1000 consensus nodes, the first preset proportion threshold value is 50%, when the number of consensus nodes that return the consensus acknowledgement message exceeds 500, the transaction service node determines that the consensus acknowledgement message returned by the consensus node meets a preset consensus policy, and may upload the transaction block to the blockchain network.
In the embodiment, the data transfer amount in the transaction request is encrypted by using the homomorphic public key, the additional information is encrypted by using the symmetric key, the data transfer amount uploaded to the blockchain network by the transaction service node and the additional information are both ciphertext, the data transfer amount is information used for carrying out the homomorphic verification by the homomorphic node, the additional information is information selectively visible for a specified object, the homomorphic node can carry out the homomorphic verification based on homomorphic operation under the condition that plaintext data of the data transfer amount is not taken, the validity of transaction event information is ensured, the privacy of the data transfer amount is protected, the symmetric key is encrypted by using the public key of a second transaction account, and the visible object of the additional information is determined to be the second transaction account, but not other random transaction accounts can acquire 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 homomorphic decryption is far greater than that of symmetric key decryption in the embodiment, and on the other hand, visible objects of the additional information are not specified, 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 common knowledge mechanism of the blockchain technology can be used for guaranteeing the validity of the transaction event information and protecting the data privacy, and the object can be visible to the additional information appointed in the transaction event.
Further, the transaction block carries the transaction event information, and after executing step S103, 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 blockchain network according to the address of the transaction block. Further, after the second transaction account obtains the transaction event information, the secret key of the second transaction account may be used to decrypt the secret text of the symmetric key to obtain the symmetric key, and the symmetric key decrypts the secret text of the additional information to obtain the plaintext data of the additional information. The ciphertext of the symmetric key is obtained by encrypting the public key of the second transaction account, the second transaction account can decrypt the ciphertext of the symmetric key, in one possible implementation manner, the public key of a third transaction account, a fourth transaction account and/or a fifth transaction account can be used for encrypting the symmetric key to obtain corresponding ciphertext respectively, and it is understood that the third transaction account, the fourth transaction account and/or the fifth transaction account can be understood as an account in which the transaction service node can obtain the plaintext data of the additional information, and the third transaction account, the fourth transaction account and/or the fifth transaction account can be understood as an object of informing the transaction service node of the additional information instead of an account having a transaction process with the first transaction account. After the transaction block is uplink by the transaction service node, the transaction service node transfers the data transfer amount from the first transaction account to the second transaction account to complete the transaction, and informs the second transaction account of the address of the transaction block, and the second transaction account acquires the transaction event information according to the address of the transaction block, so that the private key of the transaction service node can be used for decrypting the ciphertext of the additional information in the transaction event information to obtain the plaintext data of the additional information.
In one possible embodiment, the data transfer amount is a digital asset with a preset value, the additional information is orientation information, the second transaction account is found in the blockchain network by the first transaction account according to the object feature of the orientation information, and the object feature of the orientation information is matched with the user feature of the second transaction account. In one possible implementation, the targeting information is an advertisement to be put; 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 placed, so as to obtain an object feature of the advertisement to be placed, for example, the advertisement to be placed is "male shampoo", and the object feature of the advertisement to be placed, which is obtained by performing character string recognition on the "male shampoo" by the first transaction account, is male; for another example, the advertisement to be placed is preset by the user of the first transaction account, and the object feature of the advertisement to be placed is input by the user of the first transaction account. The first transaction account searches a second transaction account with the user characteristic of male in the blockchain network according to the object characteristic of the advertisement to be placed, and optionally, the user characteristic of the second transaction account is the user information of the second transaction account and can be the information input by the user when registering the second transaction account. The first transaction account can search a male target group in a blockchain network, transfer data transfer quantity such as Q coins and the like to the male target group respectively, add advertisement words of the shampoo into the additional information, and further can be additionally provided with purchase links, and optionally, a code converter is used for converting the advertisement words and the purchase links of the shampoo into hexadecimal machine language. And the transaction service node performs consensus verification on the process of transferring the digital assets with the preset value from the first transaction account to the second transaction account through step S102, but the advertisement words added in the additional information by the first transaction account cannot be acquired by the consensus node or other transaction accounts except the second transaction account, namely the transaction account which is not the target group to be advertised cannot acquire the additional information. In another possible implementation, the targeting information is video content; the second transaction account is any one of a target group of the video content. Optionally, the video content is associated with a video tag, where the video tag is preset for the first transaction account, then an object feature of the video content may be the video tag, for example, the video content of the video content is "child education", the first transaction account searches for a second transaction account whose user feature is child education in the blockchain network according to the object feature of the video content, optionally, the user feature of the second transaction account may be obtained by the first transaction account according to the video content subscribed by the user of the second transaction account, for example, if the user of the second transaction account clicks on the video content subscribed to children and/or education, it may be determined that the user feature of the second transaction account matches the object feature of the first transaction account. Illustratively, the first transaction account A promotes a public benefit video of child education, the object characteristic of the video is child education, the first transaction account can search a target group in a blockchain network, the target group is a user subscribing to video content of a label of the child and/or education, and a play address of the video content is added in the additional information by respectively transferring data transfer amounts, such as Q coins and the like, to the second transaction account. The play 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, i.e. the transaction account which is not the target group of the video content does not acquire the additional information. By implementing the embodiment, the directional object pushing of the directional information can be realized, for example, the accurate and in-place advertisement putting of merchants is realized, and for example, the accurate pushing of video is realized, so that the information flooding in the blockchain network is avoided.
In another possible embodiment, the data transfer amount is virtual prop data, and the additional information is a usage remark condition of the virtual prop data by the first transaction account. In an exemplary game scenario, each transaction account corresponds to a game character, the data transfer amount may be a piece of equipment data, the game character corresponding to the first transaction account a gives the equipment a to the game character corresponding to the second transaction account b, the additional information is a remark condition of the game character corresponding to the first transaction account a for using the equipment a data, for example, when an attack force attribute of the game character corresponding to the first transaction account a is lower than a preset value, for example, an attack force attribute is lower than 5, the game character corresponding to the second transaction account b uses the equipment a data, the transaction service node performs common verification on a process of transferring the equipment a to the second transaction account through step S102, but the additional information of the remark condition of the virtual equipment data by the first transaction account is not acquired by the common node or other game players except the second transaction account b, and the first transaction account b knows neither the first transaction account b has knowledge of the equipment a state encrypted data nor the other transaction condition of the second transaction account b. Further, when detecting the operation of the second transaction account on the virtual prop data, the transaction service node judges whether the current operation of the second transaction account on the virtual prop data meets the remark using condition of the first transaction account on the virtual prop data, if yes, the operation of the second transaction account on the virtual prop data is responded. When the transaction service node detects that the game role corresponding to the second transaction account b is operated to use the equipment data a, the transaction service node determines whether to respond to the operation of using the equipment data a by the game role corresponding to the first transaction account b according to the remark using condition of the game role corresponding to the first transaction account a, for example, the remark using condition is that the attack force attribute of the game role corresponding to the first transaction account a is less than 5, when the transaction service node detects that the attack force attribute of the game role corresponding to the first transaction account a is less than 5, the transaction service node responds to the operation of using the equipment data a by the game role corresponding to the second transaction account b, namely, synthesizes the equipment data a into the game role corresponding to the second transaction account b, otherwise, the transaction service node refuses the operation of using the virtual prop data by the game role corresponding to the second transaction account b. 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 quantity can be further monitored.
An application scenario of a blockchain-based information encryption method is described below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is an application scenario diagram of information encryption based on blockchain according to an embodiment of the present application. As shown in fig. 2, the first transaction account 20 performs step S200 to send a transaction request to the transaction service node 21, wherein 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 notes, 10 points, etc., and the additional information 222 may represent an integrated coupon number, or an invoice code, etc., and the additional information may be text information, which is only exemplified herein, and the representation form of the additional information is not limited. 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 ciphertext of the data transfer amount, ciphertext of the additional information, ciphertext of a symmetric key, the first transaction account a and the second transaction account b; the transaction service node searches a public key of the second transaction account in the blockchain network according to the second transaction account, 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 performs a symmetric encryption algorithm such as a data encryption algorithm (Data Encryption Algorithm, DEA), an advanced encryption standard (English: advanced Encryption Standard, AES), or a triple data encryption algorithm (TDEA, triple Data Encryption Algorithm), etc., to randomly generate the symmetric key; the transaction service node encrypts the data transfer quantity by using a homomorphic public key to obtain a ciphertext of the data transfer quantity, wherein the ciphertext is represented by the fact that the consensus node cannot check plaintext data of the data transfer quantity, and the transaction service node obtains the ciphertext of the additional information after encrypting by using the symmetric key. The transaction service node 21 sends the transaction event information 1 to a consensus node, where the consensus node may include a plurality of consensus nodes, for example, 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 performs step S202 to search for a remaining data amount of the first transaction account a according to the first transaction account a, and encrypts the remaining data amount of the first transaction account using the homomorphic public key to obtain a ciphertext of the remaining data amount; 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 in connection with fig. 1, which is not described herein. 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; in the case that the transaction service node 21 receives that the consensus acknowledgement message returned by the consensus node 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 blockchain network. The second transaction account 20 performs step S204, decrypts the ciphertext of the symmetric key by using its private key to obtain the symmetric key, so that the ciphertext of the additional information is decrypted by using the symmetric key, and the transaction event information 2 shown in fig. 3 is located in the second transaction account 21, and the second transaction account 21 can obtain the additional information 222. Further, after executing step S203, the transaction service node 21 triggers the smart contract to execute step S205 to transfer the data transfer amount 10 from the first transaction account 20 to the second transaction account 22, i.e. the second transaction account 22 may obtain the data of the additional information without knowing the plaintext data of the data transfer amount through homomorphic decryption, so that the second transaction account 22 may know that the first transaction account a transferred 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, and the symmetric key is used for encrypting the additional information, so that the common knowledge mechanism of the blockchain technology can be used for guaranteeing the validity of the transaction event information and protecting the data privacy, and the additional information in the transaction event can be appointed for being visible.
Referring to fig. 3, fig. 3 is a block chain-based information encryption system according to an embodiment of the present application. As shown in fig. 3, the blockchain-based information encryption system 30 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 with receiving and transmitting functions, where the transaction service node 301 is configured to receive a request and transmit 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 a plurality of, for example, a first consensus node 302 and a second consensus node 303, configured to perform consensus confirmation on the transaction event information submitted by the transaction service node 301, and return a message of the 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 with a first transaction party, the second transaction account 304 may be an account number of a terminal device having an association with a second transaction party, the first transaction account 300 is used for sending a transaction request to the transaction service node 301, and the second transaction account 304 is used for acquiring 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 nodes in a blockchain network.
The application further provides a block chain-based information encryption device, and referring to fig. 4, fig. 4 is a structural block diagram of the block chain-based information encryption device according to the embodiment of the application. As shown in fig. 4, the blockchain-based information encryption device 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 calculation module 402, configured to encrypt the data transfer amount using a homomorphic public key to obtain a ciphertext of the data transfer amount;
the computing module 402 is further configured to randomly generate the symmetric key, encrypt the additional information using the symmetric key, and obtain a ciphertext of the additional information;
the computing module 402 is further configured to search a 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 with 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 a remaining data amount of the first transaction account according to the identifier of the first transaction account, and encrypts the remaining data amount of the first transaction account using the homomorphic public key to obtain a ciphertext of the remaining data amount; the consensus node carries out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity, and if the result after homomorphic operation accords with a preset rule, the consensus node returns a consensus confirmation message to the transaction service node;
the generating module 401 is further configured to generate the transaction event information into a transaction block when the receiving module receives that the consensus confirmation message returned by the consensus node meets a preset consensus policy;
the sending module 403 is further configured to upload the transaction block into the blockchain network.
In a possible implementation manner, in a case that 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 residual data amount to obtain ciphertext of a difference data amount;
The common 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 quantity is not smaller than the ciphertext of the difference data quantity, determining that the homomorphic operation result accords with the preset rule.
In one possible embodiment, the receiving module 400, upon receiving a transaction request submitted by the first transaction account, also receives a first digital signature and a second digital signature;
the blockchain-based information encryption device 40 further includes a searching module 404, where the searching module 404 is configured to search, in the blockchain network, a public key of the first transaction account and a public key of the second transaction account according to the identifier of the first transaction account and the identifier of the second transaction account, and perform signature verification on the first digital signature and the second digital signature to obtain a first check code and a second check code respectively;
the computing 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 when the first check code, the second check code, and the third check code are all 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 blockchain network according to the address of the transaction block.
In one possible implementation, the data transfer amount is virtual prop data, and the additional information is a usage remark condition of the virtual prop data by the first transaction account.
Optionally, the blockchain-based information encryption device 40 further includes a determining module 405, where the determining module 405 is configured to determine, when detecting the operation of the second transaction account on the virtual prop data, whether the current operation of the second transaction account on the virtual prop data meets a remark condition of the first transaction account on the virtual prop data, and if yes, respond to the operation of the second transaction account on the virtual prop data.
In another possible embodiment, the data transfer amount is a digital asset with a preset value, the additional information is orientation information, the second transaction account is found in the blockchain network by the first transaction account according to the object feature of the orientation information, and the object feature of the orientation information is matched with the 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 carrying out the same mathematical four arithmetic operation 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 a block chain-based information acquisition apparatus according to an embodiment of the present application. 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 acknowledge message returned by a consensus node, and further configured to upload a transaction block into a blockchain network, and the processor 500 may be a central processing unit (central processing unit, CPU), which may also be other general purpose processors, digital signal processors (digital signal processor, DSP), application specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate arrays (field-programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. 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 a correspondence between the home domain information and the home domain. The memory 502 may include, for example, read-only memory and random access memory, and provides instructions and data to the processor 501 and transceiver 500. A portion of memory 502 may also include non-volatile random access memory. For example, memory 502 may also store information of device type
The processor 501 is configured to execute a computer program stored in the memory, and 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, an implementation manner provided by each step in fig. 1 to 3, and specifically, the implementation manner provided by each step in fig. 1 to 3 may be referred to, which is not described herein again.
The present application provides a computer readable storage medium having instructions stored therein which when run on a computer cause the computer to perform any of the possible embodiments described hereinbefore.
It should be noted that the above-described terms "first," "second," 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 manners. The above-described embodiments are merely illustrative, and for example, the division of the units is merely a logical function division, and there may be other division manners 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 performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the above-described integrated units of the present invention may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) 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, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A blockchain-based information encryption method, the method comprising:
the transaction service node receives a transaction request submitted by a first transaction account, wherein the transaction request comprises data transfer quantity, additional information, an identification of the first transaction account and an identification of a second transaction account;
the transaction service node generates transaction event information according to the transaction request, wherein the transaction event information comprises ciphertext of the data transfer quantity, ciphertext of the additional information, ciphertext of a symmetric key, identification of the first transaction account and identification of the second transaction account; the ciphertext of the data transfer quantity is obtained by encrypting the data transfer quantity by using a homomorphic public key through the transaction service node; the ciphertext of the additional information is obtained after the transaction service node encrypts the symmetric key, the symmetric key is randomly generated by the transaction service node, the ciphertext of the symmetric key is obtained by the transaction service node searching a public key of the second transaction account in a blockchain network according to the identification 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 carries out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity, and if the result after homomorphic operation accords with a preset rule, the consensus node returns a consensus confirmation message to the transaction service node;
and under the condition that the transaction service node receives that the consensus confirmation message returned by the consensus node meets a preset consensus strategy, generating a transaction block from the transaction event information, and uploading the transaction block to the blockchain network.
2. The method of claim 1, wherein the homomorphic operation of the ciphertext of the remaining data amount and the ciphertext of the data transfer amount by the consensus node comprises:
the consensus node carries out homomorphic subtraction operation on the ciphertext of the data transfer quantity and the ciphertext of the residual data quantity to obtain ciphertext of the difference data quantity;
The common 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 quantity is not smaller than the ciphertext of the difference data quantity, determining that the homomorphic operation result accords with 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, further 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 blockchain network according to the identification of the first transaction account and the identification of the second transaction account, and performs signature verification on 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 according to claim 1, wherein the method further comprises:
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 blockchain network according to the address of the transaction block.
5. The method of claim 4, wherein the data transfer amount is virtual prop data and the additional information is a usage remark condition of the virtual prop data by the first transaction account.
6. The method of claim 5, wherein the method further comprises:
when detecting the operation of the second transaction account on the virtual prop data, the transaction service node judges whether the current operation of the second transaction account on the virtual prop data meets the remark using condition of the first transaction account on the virtual prop data or not, if yes, the transaction service node responds to the 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 orientation information, the second transaction account is a target feature of the orientation information that is found in the blockchain network by the first transaction account according to the target feature of the orientation information, and the target feature of the orientation information matches a user feature of the second transaction account.
8. A blockchain-based information encryption device, the device comprising:
the receiving module is used for receiving a transaction request submitted by a first transaction account, wherein the transaction request comprises data transfer quantity, additional information, an identification of the first transaction account and an identification of a second transaction account;
the generation module is used for generating transaction event information according to the transaction request, wherein the transaction event information comprises ciphertext of the data transfer quantity, ciphertext of the additional information, ciphertext of a symmetric key, identification of the first transaction account and identification of the second transaction account;
the computing module is used for encrypting the data transfer quantity by using the homomorphic public key to obtain a ciphertext of the data transfer quantity;
the computing module is further used for randomly generating the symmetric key, and encrypting the additional information by using the symmetric key to obtain a ciphertext of the additional information;
The computing module is further configured to search a 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 by using the public key of the second transaction account to obtain a ciphertext of the symmetric 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 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 carries out homomorphic operation on the ciphertext of the residual data quantity and the ciphertext of the data transfer quantity, and if the result after homomorphic operation accords with a preset rule, the consensus node returns a consensus confirmation message to the transaction service node;
the generation module is further configured to generate the transaction event information into a transaction block when the receiving module receives that the consensus confirmation message returned by the consensus node meets a preset consensus strategy;
the sending module is further configured to upload the transaction block to the blockchain network.
9. A blockchain-based information encryption device, characterized in that the device comprises a transceiver, a processor and a memory, wherein the processor is adapted to execute a computer program stored in the memory, implementing the steps of the method according to any 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 of claims 1 to 7.
CN202010327136.9A 2020-04-23 2020-04-23 Information encryption method, device, equipment and storage medium based on block chain Active CN111523891B (en)

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 CN111523891A (en) 2020-08-11
CN111523891B true 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)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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
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
CN115375464B (en) * 2022-10-26 2023-02-03 江西信惠链科技有限公司 Financing authorization method, system, computer device and readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
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
CN110147994A (en) * 2019-04-13 2019-08-20 山东公链信息科技有限公司 A kind of instant execution method of the block chain based on homomorphic cryptography

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3545640B1 (en) * 2018-11-07 2021-04-07 Advanced New Technologies Co., Ltd. Blockchain data protection using homomorphic encryption

Patent Citations (3)

* Cited by examiner, † Cited by third party
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
CN110147994A (en) * 2019-04-13 2019-08-20 山东公链信息科技有限公司 A kind of instant execution method of the block chain based on homomorphic cryptography

Also Published As

Publication number Publication date
CN111523891A (en) 2020-08-11

Similar Documents

Publication Publication Date Title
CN111523891B (en) Information encryption method, device, equipment and storage medium based on block chain
Wu et al. A novel and provably secure authentication and key agreement scheme with user anonymity for global mobility networks
CN111095332B (en) Method and system for protecting private social media advertisements
US20190356481A1 (en) System and method for securing digital assets
CN109510818B (en) Data transmission system, method, device, equipment and storage medium of block chain
EP3761203A1 (en) Information processing method, blockchain node, and electronic apparatus
KR100833828B1 (en) Method of authenticating anonymous users while reducing potential for ?middleman? fraud
CN109728906B (en) Anti-quantum-computation asymmetric encryption method and system based on asymmetric key pool
CN112215608A (en) Data processing method and device
CN109729041B (en) Method and device for issuing and acquiring encrypted content
CN104967693B (en) Towards the Documents Similarity computational methods based on full homomorphism cryptographic technique of cloud storage
CN110400162B (en) Data processing method, device, server and system
CN110400164B (en) Data determining method and device, storage medium and electronic device
CN110336779B (en) Block chain construction method and device and electronic equipment
CN109921905B (en) Anti-quantum computation key negotiation method and system based on private key pool
Delgado-Mohatar et al. Blockchain-based semi-autonomous ransomware
CN109728905B (en) Anti-quantum computation MQV key negotiation method and system based on asymmetric key pool
Gao et al. Secure, fair and instant data trading scheme based on bitcoin
WO2014030706A1 (en) Encrypted database system, client device and server, method and program for adding encrypted data
CN110602190B (en) Block chain consensus method, block chain node and storage device
CN115865508A (en) Edge calculation bidirectional authentication method
US11729231B2 (en) Secure multi-party random bit generation
Delgado-Segura et al. Bitcoin private key locked transactions
KR100971038B1 (en) Cryptographic method for distributing load among several entities and devices therefor
CN112765570B (en) Identity-based provable data holding method supporting data transfer

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