CN109509099B - Data transaction method and device, computing equipment and storage medium - Google Patents

Data transaction method and device, computing equipment and storage medium Download PDF

Info

Publication number
CN109509099B
CN109509099B CN201811611360.XA CN201811611360A CN109509099B CN 109509099 B CN109509099 B CN 109509099B CN 201811611360 A CN201811611360 A CN 201811611360A CN 109509099 B CN109509099 B CN 109509099B
Authority
CN
China
Prior art keywords
data
transaction
intelligent contract
sender
encryption key
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
CN201811611360.XA
Other languages
Chinese (zh)
Other versions
CN109509099A (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.)
Shigengjian Data Technology Shanghai Co ltd
Original Assignee
Shigengjian Data Technology Shanghai 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 Shigengjian Data Technology Shanghai Co ltd filed Critical Shigengjian Data Technology Shanghai Co ltd
Priority to CN201811611360.XA priority Critical patent/CN109509099B/en
Publication of CN109509099A publication Critical patent/CN109509099A/en
Application granted granted Critical
Publication of CN109509099B publication Critical patent/CN109509099B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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)
  • Finance (AREA)
  • General Physics & Mathematics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

A data transaction method and device, computing equipment and storage media are provided, wherein the data transaction method comprises the following steps: locking a transaction fund in the intelligent contract when a payment operation invoking the intelligent contract is detected; when the confirmation operation of calling the intelligent contract is detected, acquiring a re-encryption key and verifying the re-encryption key; and after the verification is passed, transferring the transaction money to the wallet address of the data sender and informing the data receiver to obtain the re-encrypted data. By adopting the data transaction method, the safety of data transaction can be improved.

Description

Data transaction method and device, computing equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a data transaction method and device, computing equipment and a storage medium.
Background
With the development of the internet, online transactions are prevalent, and the internet transactions become a preferred mode for more and more people. The internet transaction provides great convenience for people's life, especially data transaction.
At present, in the whole transaction process, because the two transaction parties can not establish a trust relationship, a centralized service platform is needed to transfer transaction data, and usually after the transaction is completed, the transfer is carried out by the centralized service platform.
However, it is difficult to ensure the security of data transaction by adopting a centralized service platform to perform data transaction.
Disclosure of Invention
The problem solved by the embodiment of the invention is how to improve the safety of data transaction.
To solve the above technical problem, an embodiment of the present invention provides a data transaction method, including: locking a transaction fund in the intelligent contract when a payment operation invoking the intelligent contract is detected; when the confirmation operation of calling the intelligent contract is detected, acquiring a re-encryption key and verifying the re-encryption key; after the verification is passed, transferring the transaction money to a wallet address of a data sender and informing a data receiver to obtain re-encrypted data; wherein the intelligent contract is generated by populating an intelligent contract template, the intelligent contract template comprising: transaction information parameters and re-encryption parameters; and the re-encrypted data is obtained by re-encrypting ciphertext data of the data sender by using the re-encrypted key, the ciphertext data is obtained by encrypting transaction data by the data sender, and the re-encrypted key is generated by the data sender by using a private key of the data sender and a public key of the data receiver.
Optionally, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction money required by the transaction.
Optionally, the notifying the data receiver of obtaining the re-encrypted data includes: and informing the data receiver to acquire a cipher text data storage address of the data sender and the re-encryption key in the intelligent contract, so that the data receiver downloads the cipher text data by using the cipher text data storage address, and re-encrypts the cipher text data by using the acquired re-encryption key to obtain the re-encrypted data.
Optionally, the ciphertext data of the data issuer is stored in the data transaction platform.
Optionally, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the ciphertext data of the data sender, the wallet address of the data sender and the amount of the transaction money required by the transaction.
Optionally, the notifying the data receiver of obtaining the re-encrypted data includes: the intelligent contract utilizes the re-encryption key to re-encrypt the ciphertext data of the data sender to obtain the re-encrypted data, and stores the re-encrypted data into the intelligent contract; notifying the data receiver to obtain the re-encrypted data in the smart contract.
Optionally, the intelligent contract is generated by filling the value of the transaction information parameter included in the purchase data request of the data receiver into the intelligent contract template.
Optionally, when the payment operation invoking the smart contract is detected, the method further includes: and verifying that the caller calling the intelligent contract is the data receiver.
Optionally, when the payment operation invoking the smart contract is detected, the method further includes: and checking the credit of the transaction fund as the credit of the transaction fund required by the transaction.
Optionally, when the confirmation operation for invoking the intelligent contract is detected, the method further includes: and checking that the caller calling the intelligent contract is the data sender.
Optionally, the verifying the re-encryption key includes: acquiring a public key of the data sender, a public key of the data receiver and a fixed-length random number of the re-encryption key; splicing the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key to obtain a spliced value; performing hash calculation on the splicing value to obtain a hash value of the splicing value; and verifying that the hash value of the splicing value is the hash value of the re-encryption key.
Optionally, before obtaining the public key of the data sender, the public key of the data receiver, and the fixed-length random number of the re-encryption key, the method further includes: and verifying that the total length of the re-encryption key is a preset length value.
Optionally, the intelligent contract is generated by the data transaction platform based on the intelligent contract template and is deployed to the block chain.
An embodiment of the present invention further provides a data transaction apparatus, including: a first storage unit configured to store transaction information parameters; a second storage unit configured to store the re-encryption parameter; a payment operation unit comprising: a payment operation subunit configured to lock a transaction amount in the smart contract when a payment operation invoking the smart contract is detected; a confirmation operation unit including: a confirmation operation processing subunit configured to, when a confirmation operation of invoking the smart contract is detected, acquire a re-encryption key and verify the re-encryption key; a transaction fund transfer subunit configured to transfer the transaction fund to a wallet address of the data issuer when the confirmation operation processing subunit verifies that the transaction fund is passed; a notification subunit configured to notify a data receiver of acquisition of the re-encrypted data when the confirmation operation processing subunit verifies; wherein the intelligent contract is generated by populating an intelligent contract template that includes the transaction information parameters and the re-encryption parameters; and the re-encrypted data is obtained by re-encrypting ciphertext data of the data sender by using the re-encrypted key, the ciphertext data is obtained by encrypting transaction data by the data sender, and the re-encrypted key is generated by the data sender by using a private key of the data sender and a public key of the data receiver.
Optionally, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction money required by the transaction.
Optionally, the notification subunit includes: the first notification module is configured to notify the data receiver to acquire a ciphertext data storage address of the data sender and the re-encryption key in the intelligent contract, so that the data receiver downloads the ciphertext data by using the ciphertext data storage address, and re-encrypts the ciphertext data by using the acquired re-encryption key to obtain the re-encrypted data.
Optionally, the ciphertext data of the data issuer is stored in the data transaction platform.
Optionally, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the ciphertext data of the data sender, the wallet address of the data sender and the amount of the transaction money required by the transaction.
Optionally, the notification subunit includes: the re-encryption module is configured to re-encrypt ciphertext data of the data sender by using the re-encryption key to obtain the re-encrypted data, and store the re-encrypted data in the intelligent contract; a second notification module configured to notify the data recipient to obtain the re-encrypted data in the smart contract.
Optionally, the intelligent contract is generated by filling the value of the transaction information parameter included in the purchase data request of the data receiver into an intelligent contract template.
Optionally, the payment operation unit further includes: a first checking subunit configured to check that a caller invoking the intelligent contract is the data receiver.
Optionally, the payment operation unit further includes: and the second check subunit is configured to check the amount of the transaction fund to be the amount of the transaction fund required by the transaction.
Optionally, the confirmation operation unit further includes: a third checking subunit configured to check that a caller invoking the intelligent contract is the data issuer.
Optionally, the confirmation operation processing subunit includes: an obtaining module configured to obtain a public key of the data sender, a public key of the data receiver, and a fixed-length random number of the re-encryption key; the splicing module is configured to splice the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key to obtain a splicing value; the hash calculation module is configured to perform hash calculation on the splicing value to obtain a hash value of the splicing value; a verification module configured to verify that the hash value of the concatenation value is the hash value of the re-encryption key.
Optionally, the confirmation operation processing subunit further includes: and the total length verification module is configured to verify that the total length of the re-encryption key is a preset length value before the obtaining module obtains the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key.
The embodiment of the present invention further provides a computing device, which includes a memory and a processor, where the memory stores thereon computer instructions capable of being executed on the processor, and the processor executes the computer instructions to perform any of the steps of the data transaction method.
The embodiment of the invention also provides a computer readable storage medium, wherein computer instructions are stored on the computer readable storage medium, and the computer instructions execute the steps of any data transaction method when running.
Compared with the prior art, the technical scheme of the embodiment of the invention has the following beneficial effects:
by adopting the data transaction method in the embodiment of the invention, when the payment operation for calling the intelligent contract is detected, the transaction fund is locked in the intelligent contract, when the confirmation operation for calling the intelligent contract is detected, the re-encryption key is obtained and verified, and when the verification is passed, the transaction fund is transferred to the wallet address of the data sender and the data receiver is informed to obtain the re-encryption data.
Further, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction fund required by the transaction are informed to the data receiver to obtain the ciphertext data storage address of the data sender and the re-encryption key in the intelligent contract, so that the data receiver downloads the ciphertext data by using the ciphertext data storage address and re-encrypts the ciphertext data by using the obtained re-encryption key to obtain the re-encryption data, the re-encryption data is obtained in the transaction process, the data receiver can obtain the ciphertext data storage address of the data sender through the data transaction process, the security of the data transaction can be improved, in addition, transmission resources of the data transaction system can also be saved.
Further, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the ciphertext data of the data sender, the wallet address of the data sender and the amount of the transaction fund required by the transaction are obtained, so that when a re-encryption key corresponding to an input re-encryption parameter is obtained and confirmation operation of the intelligent contract is called, the re-encryption key is obtained and verified, when the verification is passed, the ciphertext data of the data sender is re-encrypted by using the re-encryption key to obtain re-encryption data, the re-encryption data is stored in the intelligent contract, the transaction fund is transferred to the wallet address of the data sender, and the data receiver is informed of obtaining the re-encryption data. The payment operation and the confirmation operation in the transaction process are automatically carried out based on the intelligent contract, so that the whole transaction process does not have any intervention of a third party, and the safety of data transaction can be improved. In addition, the intelligent contract stores the ciphertext data, re-encrypts the ciphertext data and stores the obtained re-encrypted data, so that the re-encryption and transaction processes of the data can be realized only by automatically executing the intelligent contract for the data with small data volume, and the efficiency of data transaction can be improved.
Furthermore, the intelligent contract is automatically generated after the value of the transaction information parameter contained in the purchase data requirement of the data receiving party is filled into the intelligent contract template, convenience and rapidness are realized, and the generation process does not need to be interacted with the outside, so that the safety of data transaction can be improved.
Further, when the payment operation of invoking the intelligent contract is detected, by checking that the caller invoking the intelligent contract is the data receiver, it can be avoided that a fake data receiver invokes the intelligent contract, so that it can be ensured that both parties of the data transaction are the data receiver and the data sender in the intelligent contract, and therefore, the security of the data transaction can be improved, and the misoperation of a user can also be avoided.
Further, when the payment operation of calling the intelligent contract is detected, the condition that the transaction fund limit paid by the data receiver is inconsistent with the transaction fund limit required by the transaction can be avoided by checking the transaction fund limit as the transaction fund limit required by the transaction, so that the data receiver can be ensured to obtain the transaction fund with the correct limit, and the property security of the data transaction can be ensured.
Further, when the confirmation operation of calling the intelligent contract is detected, the caller calling the intelligent check is confirmed to be the data sender through verification, so that a fake data sender can be prevented from calling the intelligent contract, and then both data transaction parties can be guaranteed to be the data receiver and the data sender in the intelligent contract, so that the safety of data transaction can be improved, and misoperation of a user can be avoided.
Further, whether the re-encryption key passes the verification can be determined by checking the consistency of the hash value of the splicing value and the hash value of the re-encryption key, so that the use of a fake re-encryption key for re-encryption can be avoided, further, the transaction can be avoided under the condition that the re-encryption key is maliciously tampered, the transaction fraud can be avoided, the transaction dispute is reduced, and the safety of data transaction is further improved.
Further, since the data transaction platform has a higher security level, by storing the ciphertext data of the data sender in the data transaction platform, the occurrence of ciphertext data leakage can be reduced, and the security of data transaction can be further improved.
Drawings
FIG. 1 is a flow chart of a data transaction method in an embodiment of the invention;
FIG. 2 is a flow chart of a data transaction method in an embodiment of the invention;
FIG. 3 is a flow chart of one embodiment of the present invention for re-encryption key verification;
FIG. 4 is a flow chart of a data transaction method in an application scenario according to an embodiment of the present invention;
FIG. 5 is a flow chart of another data transaction method in an embodiment of the present invention;
FIG. 6 is a flow chart of a data transaction method in another application scenario of an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a data transaction apparatus according to an embodiment of the present invention.
Detailed Description
As described in the background, it is difficult to avoid transaction fraud in the existing data transaction methods, and the data transaction methods are yet to be optimized.
In the embodiment of the invention, the payment operation and the confirmation operation are automatically carried out through the intelligent contract, so that no third party intervenes in the transaction process, transaction fraud is avoided through the verification operation of the re-encryption key in the intelligent contract, and the security of data transaction is improved.
In order to make the aforementioned objects, features and advantages of the embodiments of the present invention more comprehensible, specific embodiments accompanied with figures are described in detail below.
Fig. 1 is a flowchart of a data transaction method according to an embodiment of the present invention, which is described in detail below with specific steps.
And S11, locking the transaction fund in the intelligent contract when the payment operation invoking the intelligent contract is detected.
In particular implementations, the intelligent contracts may be generated by populating intelligent contract templates. The intelligent contract template comprises: the transaction information parameter and the re-encryption parameter.
And S12, when the confirmation operation of calling the intelligent contract is detected, acquiring a re-encryption key and verifying the re-encryption key.
And S13, after the verification is passed, transferring the transaction fund to the wallet address of the data sender and informing the data receiver to obtain the re-encrypted data.
In a specific implementation, the re-encrypted data may be obtained by re-encrypting ciphertext data of the data issuer by using the re-encryption key, the ciphertext data may be obtained by encrypting transaction data by the data issuer, and the re-encryption key may be generated by the data issuer by using a private key of the data issuer and a public key of the data receiver.
With the data transaction method of the above embodiment, when a payment operation invoking an intelligent contract is detected, the transaction amount is locked in the intelligent contract, and when a confirmation operation invoking the intelligent contract is detected, a re-encryption key is acquired and verified, and when the verification passes, the transaction amount is transferred to the wallet address of the data sender and the data receiver is notified to acquire re-encryption data. The payment operation and the confirmation operation in the whole transaction process are automatically carried out based on the intelligent contract, so that the whole transaction process does not have any intervention of a third party, and the safety of data transaction can be improved.
It is understood that the above-described execution flow may have different implementations based on network environment, user requirements or data characteristics, etc. The following embodiments may be employed to perform data transaction and circulation on the general data. It is to be understood that the general data may be data with a large data volume or data with a small data volume, and in a specific implementation, the size of the data volume is not particularly limited.
In order that those skilled in the art may better understand and realize the embodiments of the present invention, the detailed description is given below with reference to the accompanying drawings by way of specific embodiments.
Fig. 2 is a flowchart of a data transaction method according to an embodiment of the present invention, which is described in detail below with specific steps:
and S21, locking the transaction fund in the intelligent contract when the payment operation invoking the intelligent contract is detected.
In particular implementations, the intelligent contract may be generated by populating an intelligent contract template that may include: the transaction information parameter and the re-encryption parameter. In an embodiment of the present invention, the transaction information parameters may include: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction money required by the transaction.
In a specific implementation, the re-encryption parameters may include: the key is re-encrypted.
In a specific implementation, the intelligent contract can also comprise a method (function) for payment operation and a method (function) for confirmation, and the whole transaction process can be automatically executed based on the intelligent contract by calling the corresponding method (function).
In the specific implementation, the intelligent contract template may be a data sender, a data receiver, or a third-party platform such as a data transaction platform, and in the specific implementation, no specific limitation is imposed on the main body for filling the intelligent contract template.
In an embodiment of the present invention, the intelligent contract template may be created by a data transaction platform, and the intelligent contract obtained after the filling is deployed on the blockchain. The block chain has the characteristics of decentralization, non-tampering and the like, so that once the intelligent contract is issued in the block chain, the intelligent contract cannot be tampered, the automatic execution of the intelligent contract cannot be interfered, and the two parties of the data transaction can check the execution condition of the intelligent contract in real time, so that the safety of the data transaction can be ensured. In implementations, the blockchain may be an Ethernet (ETH), commercial distributed design blockchain operating system (EOS), or other public, alliance, or private chain.
In specific implementation, when the payment operation for invoking the intelligent contract is detected, whether the caller invoking the intelligent contract is the data receiver can be checked, so that a counterfeit data receiver can be prevented from invoking the intelligent contract, and therefore, two data transaction parties can be guaranteed to be the data receiver and the data sender in the intelligent contract, and the security of data transaction can be improved.
In specific implementation, when the payment operation of calling the intelligent contract is detected, whether the credit of the trading fund is the credit of the trading fund required by the trading can be checked, so that the situation that the credit of the trading fund paid by the data receiver is inconsistent with the credit of the required trading can be avoided, the data receiver can be ensured to obtain the trading fund with the consistent credit, and the property security of the data trading can be ensured.
And S22, when the confirmation operation of calling the intelligent contract is detected, acquiring a re-encryption key and verifying the re-encryption key.
And S23, after the verification is passed, transferring the transaction fund to the wallet address of the data sender and informing the data receiver to obtain the re-encryption key.
Through the steps, the data receiver can download the ciphertext data of the data sender, and re-encrypt the ciphertext data by using the re-encryption key to obtain the re-encrypted data. And then, decrypting the obtained re-encrypted data to obtain the transaction data.
The ciphertext data of the data issuer may be obtained by encrypting the transaction data by the public key of the data issuer. In specific implementation, the data sender may encrypt the transaction data by using one or more preset encryption algorithms to obtain ciphertext data, where the encryption algorithm may be any preset asymmetric encryption algorithm such as an elliptic curve encryption algorithm, a digital signature algorithm, and the like.
In specific implementation, a data sender can upload obtained ciphertext data to a data transaction platform, the data transaction platform can store the ciphertext data in cloud storage, and the data transaction platform has higher security level, so that the ciphertext data leakage can be reduced, and the security of data transaction can be improved.
In specific implementation, a data receiver can download ciphertext data from a data transaction platform, can obtain a re-encryption key from an intelligent contract, encrypts the ciphertext data by using the re-encryption key to obtain re-encrypted data, and then can decrypt the re-encrypted data by using a private key of the data receiver, so that transaction data can be obtained.
In particular implementations, the re-encryption key may be generated by the data issuer using the data issuer's private key and the data receiver's public key. In a specific application process, a hardware key generation tool with an encryption chip may be used to generate a key in an offline state, a software key generation tool with an encryption engine may be used to generate a key in an offline state, or a key generation tool with a combination of software and hardware may be used to generate a key in an offline state.
In specific implementation, when the confirmation operation of calling the intelligent contract is detected, whether the caller calling the intelligent contract is the data sender can be checked, so that a fake data sender can be prevented from calling the intelligent contract, and the data transaction parties can be ensured to be the data receiver and the data sender in the intelligent contract, so that the security of data transaction can be improved.
By adopting the embodiment, the payment operation and the confirmation operation in the transaction process are automatically carried out based on the intelligent contract, and the intelligent contract verifies the re-encryption key, so that the intervention of any third party in the transaction process can be avoided, the transaction can be carried out by using a fake re-encryption key, and the safety of data transaction can be improved.
In particular implementations, the re-encryption key may be authenticated in a number of ways. For example, the re-encryption key may be verified in a zero knowledge proof. Referring to a flowchart of re-encryption key verification in the embodiment of the present invention shown in fig. 3, the following detailed description is made through specific steps:
and S31, acquiring the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key.
In a specific implementation, a preset random number generator can be used to generate a fixed-length random number for the re-encryption key.
In particular implementations, the fixed-length random number may be a string of characters, a number, or a combination of both.
And S32, splicing the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key to obtain a spliced value.
In a specific implementation, the public key of the data sender, the public key of the data receiver, and the fixed-length random number of the re-encryption key may be spliced in a preset order.
And S33, carrying out hash calculation on the splicing value to obtain the hash value of the splicing value.
In specific implementation, a preset hash algorithm may be adopted to perform hash calculation on the concatenation value to obtain a hash value of the concatenation value.
And S34, verifying the hash value of the splicing value as the hash value of the re-encryption key.
In an embodiment of the present invention, the obtained public key of the data sender, the public key of the data receiver, and the fixed-length random number of the re-encryption key are spliced, and then a hash value of the spliced value is obtained through hash calculation, and it is checked whether the hash value of the re-encryption key is the hash value of the spliced value, so that a verification result of the re-encryption key can be obtained. For example, when the hash value of the re-encryption key is determined to be consistent with the hash value of the splicing value, determining that the re-encryption key is verified; and when the Hash value of the re-encryption key is determined to be inconsistent with the Hash value of the splicing value, determining that the re-encryption key is not verified.
By adopting the embodiment, by verifying the re-encryption key, a fake data sender can be prevented from calling the intelligent contract, so that both data transaction parties can be ensured to be the data receiver and the data sender in the intelligent contract, and the security of data transaction can be improved.
In a specific implementation, to further improve the verification efficiency, before step S31, the method may further include: and verifying whether the total length of the re-encryption key is a preset length value. For example, when it is determined that the total length of the re-encryption key is consistent with the preset length value, step S31 may be performed; when it is determined that the total length of the re-encryption key is not consistent with the preset length value, the step S31 may not be required to be performed; in a specific implementation, the preset length value of the re-encryption key is fixed.
In particular implementations, other ways of verifying the re-encryption key may also be used. For example, the time stamp of the re-encryption key may be verified to verify whether a specific time point when the re-encryption key is generated is a preset time point. For another example, the re-encryption key may be verified by means of a digital signature to verify whether the digest is the preset digest.
In order to enable those skilled in the art to better understand and implement the embodiments of the present invention, the following detailed description is provided by way of specific application scenarios.
As a large amount of data is generated with the use of various sensors, mining analysis of the generated large amount of data can create unexpected value, and thus there is a need to trade on various data. For example, various vehicle-related information such as road condition information, tire pressure, and maintenance records recorded by a vehicle event data recorder of a vehicle can be analyzed, and a vehicle which meets the requirements of users better can be developed. However, direct transaction between a vehicle user and a vehicle data buyer may have the problem of invading the privacy of the user, and for this reason, the data transaction method in the embodiment of the present invention may be adopted to perform data transaction.
The method for performing data transaction through smart contracts according to the embodiment of the present invention is described in detail with reference to fig. 4. The intelligent contract can be generated by a data platform by using an intelligent contract template and is deployed in a block chain.
S401, the data sender D sends the ciphertext data encrypt D to the data trading platform B.
In a specific implementation, the data issuer D may encrypt the transaction data PlainD by using its own public key PkD, to obtain ciphertext data encrypt D.
In a specific implementation, the data transaction platform B may store the ciphertext data EncryptD in the cloud storage.
S402, the data receiver A makes a purchase data request to the data transaction platform B.
And S403, the data trading platform B fills the trading information parameters related to the trading into the intelligent contract template to generate the intelligent contract.
In particular implementations, the transaction information parameters may include: the data processing method comprises the steps of obtaining a public key of a data receiver A, a public key of a data sender D, a wallet address of the data sender A, a ciphertext data storage address of the data sender D and the amount of a transaction fund required by the transaction.
S404, the data transaction platform B deploys the intelligent contracts to the block chain C.
In particular implementations, blockchain C may be an ethernet house (ETH), a commercial distributed design blockchain operating system (EOS), or other public, alliance, or private chain.
Through the above steps S401 to S404, that is, upon receiving a purchase data request of the data receiver a, the data transaction platform B may generate an intelligent contract based on a pre-created intelligent contract template and deploy the intelligent contract in the blockchain C.
S405, the data receiver a invokes a payment operation.
In particular implementations, the data receiver a may invoke a payment operation in a smart contract to pay the transaction amount to the data issuer D via the smart contract.
In specific implementation, the intelligent contract can verify whether a caller calling the intelligent contract is the data receiver a in the intelligent contract template, if the caller calling the intelligent contract is not the data receiver a in the intelligent contract template, the payment operation can be stopped, and corresponding prompt information can be sent to the caller calling the intelligent contract, so that two parties of data transaction can be ensured to be the data receiver and the data sender in the intelligent contract, the security of data transaction can be improved, and misoperation of a user can be avoided.
In specific implementation, in order to improve the security of data transaction and avoid misoperation, the intelligent contract can also check whether the credit of the transaction fund is the credit of the transaction fund required by the transaction in the intelligent contract template, if the credit is not the same as the credit of the transaction fund required by the transaction in the intelligent contract template, the payment operation can be stopped, and then a caller of the intelligent contract can be called to send corresponding prompt information to prompt the caller to input the transaction fund again.
S406, the intelligent contract running on the blockchain C locks the trading fund of the data receiver a in the intelligent contract.
To secure the transaction, the smart contract may lock the transaction amount of the data receiver a in the smart contract.
Through the steps S405 to S406, the data receiver A only needs to input the corresponding trading fund, and the intelligent contract can be automatically executed to complete the trading payment operation.
S407, the data issuer D performs a call confirmation operation to the smart contract running on the blockchain C and sends the re-encryption key RekeyAD.
In particular implementations, the data issuer D may generate the re-encryption key RekeyAD using its own private key SkD and the data receiver a's public key PkA.
In particular implementations, data sender D may obtain public key PkA of data receiver A from the smart contract.
In specific implementation, the intelligent contract can verify whether a caller calling the intelligent contract is the data sender D in the intelligent contract template, if the caller calling the intelligent contract is not the data sender D in the intelligent contract template, the payment operation can be stopped, in addition, corresponding prompt information can be sent to the caller calling the intelligent contract, so that both parties of data transaction can be ensured to be the data receiver and the data sender in the intelligent contract, the security of data transaction can be improved, and misoperation of a user can be avoided.
S408, the smart contract running on blockchain C verifies the re-encryption key RekeyAD.
In specific implementation, the intelligent contract can verify the re-encryption key RekeyAD by using a zero-knowledge proof mode, so that the transaction can be avoided under the condition that the re-encryption key is maliciously tampered, transaction fraud can be avoided, transaction disputes are reduced, and the security of data transaction is further improved.
In a specific implementation, to improve the verification efficiency, it may be verified whether the total length of the re-encryption key RekeyAD is a preset length value. If so, a subsequent verification process may be performed; if not, returning the verification result to the data sender D, and enabling the data sender D to resend the re-encryption key.
In a specific implementation, the re-encryption key RekeyAD may include: the key encryption method comprises a re-encryption key RekeyAD core part, a fixed-length random number nonce and a hash value HashAD. In an embodiment of the present invention, the Hash (nonce + PkA + PkD), wherein the fixed-length random number nonce may be obtained by parsing through a predetermined random number generator. The intelligent contract can obtain a public key PkD of the data sender D, a public key PkA of the data receiver A and a fixed-length random number nonce of the re-encryption key RekeyAD, splices the public key PkD, the public key PkA of the data receiver A and the fixed-length random number nonce of the re-encryption key RekeyAD to obtain a spliced value, then performs hash calculation on the spliced value to obtain a hash value HashAD 'of the spliced value, and verifies whether the hash value HashAD' of the spliced value is consistent with the hash value HashAD or not. If the two are not consistent, the re-encryption key RekeyAD is incorrect, the verification result is that the verification fails, and step S409 can be executed; if the two are consistent, it indicates that the re-encryption key RekeyAD is correct, and the verification result is that the verification passes, and step S410 may be executed.
S409, the intelligent contract running on the blockchain C sends the verification result to the data issuer D, so that the data issuer D resends the re-encryption key.
S410, the smart contract running on blockchain C transfers the transaction amount to the wallet address of data receiver a.
Through the steps S407 to S410, the data sender D only needs to send the re-encryption key, and the intelligent contract can be automatically executed to complete the transaction confirmation operation.
S411, the data receiver a obtains the ciphertext data storage address from the intelligent contract running on the block chain C.
And S412, the data receiver A downloads the ciphertext data EncryptD from the data transaction platform B by using the ciphertext data storage address.
S413, the data receiver a obtains the re-encryption key RekeyAD from the smart contract.
S414, the data receiver a performs re-encryption.
In a specific implementation, the data receiver a may re-encrypt the ciphertext data EncryptD by using the re-encryption key RekeyAD to obtain re-encrypted data EncryptAD.
S415, the data receiver a decrypts.
In a specific implementation, the data receiver a may decrypt the encrypted data EncryptAD by using its own private key SkA, so as to obtain the transaction data PlainD.
By adopting the embodiment, the payment operation and the confirmation operation are automatically carried out based on the intelligent contract in the whole transaction process, and the intelligent contract verifies the re-encryption key, so that the intervention of any third party in the transaction process can be avoided, the transaction can be carried out by using the wrong re-encryption key, and the safety of data transaction can be improved.
In the data transaction method described in the above embodiment, ciphertext data formed by encrypting transaction data may be stored in any network node, for example, in a data transaction platform or a cloud storage corresponding to the data transaction platform, or may be stored in multiple network nodes in a distributed manner.
In particular, in order to improve the data transaction efficiency, the following data transaction method may be adopted for the transaction data with small data volume.
As shown in fig. 5, the following steps may be specifically adopted to implement data transaction:
and S51, locking the transaction fund in the intelligent contract when the payment operation invoking the intelligent contract is detected.
In particular implementations, intelligent contracts can be generated by populating intelligent contract templates.
In particular implementations, the transaction information parameters may include: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the cryptograph data storage of the data sender and the amount of the transaction money required by the transaction.
In a specific implementation, the re-encryption parameters may include: the key is re-encrypted.
In a specific implementation, the intelligent contract can also comprise a method (function) for payment operation and a method (function) for confirmation, and the whole transaction process can be automatically executed based on the intelligent contract by calling the corresponding method (function).
In a specific implementation, the main body for filling the intelligent contract template may be a data sender, a data receiver, or a third party platform such as a data transaction platform, and in a specific implementation, the main body for filling the intelligent contract template is not particularly limited.
In a specific implementation, the ciphertext data of the data issuer is obtained by encrypting the transaction data by the public key of the data issuer. In specific implementation, the data sender may encrypt the transaction data by using one or more preset encryption algorithms to obtain ciphertext data, where the encryption algorithm may be any preset asymmetric encryption algorithm such as an elliptic curve encryption algorithm, a digital signature algorithm, and the like.
In an embodiment of the present invention, the intelligent contract template may be created by a data trading platform, and the intelligent contract obtained after the filling is deployed in a blockchain. The block chain has the characteristics of decentralization, non-tampering and the like, so that once the intelligent contract is issued in the block chain, the intelligent contract cannot be tampered, the automatic execution of the intelligent contract cannot be interfered, and the two parties of the data transaction can check the execution condition of the intelligent contract in real time, so that the safety of the data transaction can be ensured. In implementations, the blockchain may be an Ethernet (ETH), commercial distributed design blockchain operating system (EOS), or other public, alliance, or private chain.
In specific implementation, when the payment operation for invoking the intelligent contract is detected, whether the caller invoking the intelligent contract is the data receiver can be checked and confirmed, and then the intelligent contract can be prevented from being invoked by a wrong data receiver, so that both data transaction parties can be ensured to be the data receiver and the data sender in the intelligent contract, and the security of data transaction can be improved.
In specific implementation, when the payment operation of calling the intelligent contract is detected, whether the line of the transaction fund is the line of the transaction fund required, and further the inconsistency between the line of the transaction fund paid by the data receiver and the required transaction amount can be avoided, so that the data receiver can be ensured to obtain the transaction fund with the correct line, and the property security of the data transaction can be ensured.
And S52, when the confirmation operation of calling the intelligent contract is detected, acquiring a re-encryption key and verifying the re-encryption key.
And S53, after the verification is passed, the intelligent contract uses the re-encryption key to re-encrypt the ciphertext data of the data sender to obtain re-encrypted data, stores the re-encrypted data in the intelligent contract, transfers the transaction fund to the wallet address of the data sender, and informs the data receiver of obtaining the re-encrypted data.
Then, the data receiver may obtain the re-encrypted data from the intelligent contract and decrypt the re-encrypted data to obtain the transaction data.
In particular implementations, the re-encryption key may be generated by the data issuer using its own private key and the data receiver's public key. In a specific application process, a hardware key generation tool with an encryption chip may be used to generate a key in an offline state, a software key generation tool with an encryption engine may be used to generate a key in an offline state, or a key generation tool with a combination of software and hardware may be used to generate a key in an offline state.
In specific implementation, when the confirmation operation of invoking the intelligent contract is detected, whether the caller invoking the intelligent check is the data sender can be checked, so that a counterfeit data sender can be prevented from invoking the intelligent contract, and then both data transaction parties can be ensured to be the data receiver and the data sender in the intelligent contract, and therefore, the security of data transaction can be improved.
In a specific implementation, the re-encryption key may be verified in a zero-knowledge proof manner, and the specific implementation and principle can refer to the detailed description of the above embodiments, which is not described herein again.
By adopting the embodiment, the payment operation and the confirmation operation are automatically carried out based on the intelligent contract, so that the whole transaction process does not have any intervention of a third party, and the safety of data transaction can be improved. In addition, the intelligent contract stores the ciphertext data, re-encrypts the ciphertext data and stores the obtained re-encrypted data, so that the re-encryption and transaction processes of the data can be realized only by automatically executing the intelligent contract for the data with small data volume, and the efficiency of data transaction can be improved.
In order to enable those skilled in the art to better understand and implement the embodiments of the present invention, the following detailed description is provided by way of specific application scenarios.
The method for performing data transaction through smart contracts according to the embodiment of the present invention is described in detail with reference to fig. 6. The intelligent contract can be generated by a data platform by using an intelligent contract template and is deployed in a block chain.
S601, the data receiver A makes a purchase request to the data transaction platform B.
And S602, the data sender D sends the ciphertext data EncryptD to the intelligent contract template of the data transaction platform B.
And S603, the data transaction platform B fills the intelligent contract template to generate the intelligent contract. In a specific implementation, the intelligent contract template may include: a transaction information parameter and a re-encryption parameter.
In particular implementations, the transaction information parameters may include: the data processing method comprises the steps of obtaining a public key of a data receiver A, a public key of a data sender D, a wallet address of the data sender A, ciphertext data of the data sender D and a credit of a transaction fund required by the transaction.
In particular implementations, the re-encryption parameters may include a re-encryption key and re-encryption data.
In a specific implementation, the intelligent contract template can also comprise a method (function) for payment operation and a method (function) for confirmation, and the whole transaction process can be automatically executed based on the intelligent contract by calling the corresponding method (function).
And S604, deploying the intelligent contract to the block chain C by the data transaction platform B.
In a particular implementation, blockchain C may be an ETH, EOS, or other public, alliance, or private chain.
Through the above steps S601 to S604, that is, upon receiving the purchase data request of the data receiver a, the data transaction platform B may generate an intelligent contract based on the pre-created intelligent contract template and deploy the intelligent contract in the blockchain C.
S605, the data receiver a invokes a payment operation.
In particular implementations, the data receiver a may invoke a payment operation in the smart contract to pay the smart contract for the transaction amount.
In specific implementation, the intelligent contract can verify whether a caller calling the intelligent contract is the data receiver a in the intelligent contract template, if not, the payment operation can be stopped, and in addition, corresponding prompt information can be sent to the caller calling the intelligent contract, so that two parties of data transaction can be ensured to be the data receiver and the data sender in the intelligent contract, the security of data transaction can be improved, and misoperation of a user can be avoided.
In specific implementation, the intelligent contract can also check whether the credit of the transaction fund is the credit of the transaction fund required by the transaction in the intelligent contract template, if the credit of the transaction fund is not consistent with the credit of the transaction fund required by the transaction in the intelligent contract template, the payment operation can be stopped, and in addition, a caller of the intelligent contract can be called to send corresponding prompt information to prompt the caller to re-input the transaction fund, so that the data transaction safety can be improved and misoperation can be avoided.
S606, the intelligent contract locks the trading fund of the data receiver a in the intelligent contract running on the blockchain C.
To secure the transaction, the smart contract may lock the transaction amount of the data receiver a in the smart contract.
Through the steps S605 to S606, the data receiver A only needs to input the corresponding trading fund, and the intelligent contract can be automatically executed to complete the trading payment operation.
S607, the data issuer D transmits the re-encryption key RekeyAD, and invokes a confirmation operation.
In particular implementations, the data issuer D may generate the re-encryption key RekeyAD using its own private key SkD and the data receiver a's public key PkA.
In particular implementations, data sender D may obtain public key PkA of data receiver A from the smart contract.
S608, the smart contract running on the blockchain C verifies the re-encryption key RekeyAD.
In a specific implementation, the re-encryption key may be verified in a zero-knowledge proof manner, and the specific implementation and principle can refer to the detailed description of the above embodiments, which is not described herein again.
In the embodiment of the present invention, if the smart contract verification heavy encryption key RekeyAD passes, step S610 is executed.
And S610, carrying out re-encryption on the intelligent contract running on the block chain C.
In specific implementation, the smart contract may re-encrypt the ciphertext data EncryptD by using the re-encryption key RekeyAD to obtain re-encrypted data EncryptAD, and store the re-encrypted data EncryptAD in the smart contract.
S611, the smart contract running on blockchain C transfers the transaction amount to the wallet address of data receiver a.
Through the above steps S607 to S611, the data issuer D only needs to send the re-encryption key, and the smart contract can be automatically executed to complete the confirmation operation.
S612, the data receiver a obtains the re-encrypted data EncryptAD from the intelligent contract running on the blockchain C.
S613, the data receiver a decrypts.
In a specific implementation, the data receiver a may decrypt the encrypted data EncryptAD by using its own private key SkA, so as to obtain the transaction data PlainD.
By adopting the embodiment, the payment operation and the confirmation operation are automatically carried out based on the intelligent contract in the transaction process, so that the whole transaction process is free from any intervention of a third party, and the safety of data transaction can be improved. In addition, the intelligent contract stores the ciphertext data, re-encrypts the ciphertext data and stores the obtained re-encrypted data, so that the re-encryption and transaction processes of the data can be realized only by automatically executing the intelligent contract for the data with small data volume, and the efficiency of data transaction can be improved.
In order to make the embodiment of the present invention better understood and realized by those skilled in the art, a data transaction apparatus used in the embodiment of the present invention will be described with reference to fig. 7.
Referring to fig. 7, an embodiment of the present invention provides an apparatus 70 for data transaction, which may include: a first storage unit 71, a second storage unit 72, a payment operation unit 73, a confirmation operation unit 74, wherein:
a first storage unit 71, which may be configured to store transaction information parameters;
a second storage unit 72, which may be configured to store the re-encryption parameters;
the payment operation unit 73 may include: a payment operation subunit 731, which may be configured to lock a transaction amount in a smart contract when a payment operation invoking the smart contract is detected;
the confirmation operation unit 74 may include: a confirmation operation processing sub-unit 741, which may be configured to acquire the re-encryption key and verify the re-encryption key when a confirmation operation that invokes the smart contract is detected; a transaction fund transfer sub-unit 742, which may be configured to transfer the transaction fund to a wallet address of a data sender when the confirmation operation processing sub-unit 741 determines that the re-encryption key verification passes; a notifying subunit 743, which may be configured to notify the data receiver of the acquisition of the re-encrypted data when the confirmation operation processing subunit verifies.
Wherein the intelligent contract may be generated by populating an intelligent contract template that includes the transaction information parameter and the re-encryption parameter; the re-encrypted data can be obtained by re-encrypting ciphertext data of the data sender by using the re-encryption key, the ciphertext data can be obtained by encrypting transaction data by the data sender, and the re-encryption key can be generated by the data sender by using a private key of the data sender and a public key of a data receiver.
After the data transaction device is adopted to perform transaction operation, the data receiver can obtain the re-encrypted data and decrypt the re-encrypted data, so that the transaction data can be obtained.
The payment operation and the confirmation operation of the data transaction device are automatically carried out based on the intelligent contract, and the intelligent contract verifies the re-encryption key, so that the intervention of any third party in the transaction process can be avoided, the transaction can be carried out by using the wrong re-encryption key, and the safety of the data transaction can be improved.
In a specific implementation, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction money required by the transaction.
In an embodiment of the present invention, the notifying subunit 743 may include a first notifying module (not shown), which may be configured to notify the data receiver to obtain a ciphertext data storage address of the data sender and the re-encryption key in the smart contract, so that the data receiver downloads the ciphertext data by using the ciphertext data storage address, and re-encrypts the ciphertext data by using the obtained re-encryption key to obtain the re-encrypted data.
In a specific implementation, the ciphertext data of the data sender can be stored in a data transaction platform.
In a specific implementation, the transaction information parameters include: the public key of the data receiver, the public key of the data sender, the ciphertext data of the data sender, the wallet address of the data sender and the amount of the transaction money required by the transaction.
In an embodiment of the present invention, the notifying subunit 743 may include: a re-encryption module (not shown) and a second notification module (not shown), wherein:
the re-encryption module may be configured to re-encrypt ciphertext data of the data sender by using the re-encryption key in the smart contract to obtain the re-encrypted data, and store the re-encrypted data in the smart contract;
the notification module may be configured to notify the data receiver to obtain the re-encrypted data in the smart contract.
In a specific implementation, the intelligent contract may be generated after the value of the transaction information parameter included in the purchase data request of the data receiver is filled into the intelligent contract template.
In a specific implementation, the payment operation unit 73 may further include: a first syndrome subunit 732 and a second syndrome subunit 733, wherein: a first checking subunit 732, which may be configured to check to confirm that the caller invoking the intelligent contract is the data receiver; the second checking sub-unit 733 may be configured to check the amount of the transaction money as the amount of the transaction money required for the transaction.
It is understood that in other embodiments of the present invention, the payment operation unit 73 may only include the first verification sub-unit 732 or only include the second verification sub-unit 733.
In particular implementations, validation operation element 74 may also include a third checking sub-element 744 that may be configured to check that the caller invoking the smart contract is the data issuer.
In a specific implementation, the confirmation operation processing subunit 741 may include: an obtaining module (not shown) configured to obtain a public key of the data issuer, a public key of the data receiver, and a fixed-length random number of the re-encryption key; a concatenation module (not shown) configured to concatenate the public key of the data sender, the public key of the data receiver, and the fixed-length random number of the re-encryption key to obtain a concatenated value; a hash calculation module (not shown) configured to perform a hash calculation on the concatenation value to obtain a hash value of the concatenation value; a verification module (not shown) may be configured to verify that the hash value of the concatenation value is the hash value of the re-encryption key.
In a specific implementation, the confirmation operation processing subunit 741 may further include: a total length verification module (not shown) configured to verify that the total length of the re-encryption key is a preset length value before the obtaining module obtains the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key.
An embodiment of the present invention further provides a computing device, including a memory and a processor, where the memory may store a computer instruction capable of being executed on the processor, and when the processor executes the computer instruction, the processor executes the steps of the data transaction method according to any one of the embodiments described above, which may specifically refer to the foregoing embodiments and is not described again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer instruction is stored, and when the computer instruction runs, the steps of the data transaction method according to any of the above embodiments are executed. The computer storage medium may include: ROM, RAM, magnetic or optical disks, and the like.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (25)

1. A method of data transaction, comprising:
locking a transaction fund in the intelligent contract when a payment operation invoking the intelligent contract is detected;
when the confirmation operation of calling the intelligent contract is detected, acquiring a re-encryption key and verifying the re-encryption key;
after the verification is passed, transferring the transaction money to a wallet address of a data sender and informing a data receiver to obtain re-encrypted data;
wherein the intelligent contract is generated by populating an intelligent contract template, the intelligent contract template comprising: transaction information parameters and re-encryption parameters; and
the re-encrypted data is obtained by re-encrypting ciphertext data of the data sender by using the re-encrypted key, the ciphertext data is obtained by encrypting transaction data by the data sender, and the re-encrypted key is generated by the data sender by using a private key of the data sender and a public key of the data receiver;
the verifying the re-encryption key comprises:
acquiring a public key of the data sender, a public key of the data receiver and a fixed-length random number of the re-encryption key;
splicing the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key to obtain a spliced value;
performing hash calculation on the splicing value to obtain a hash value of the splicing value;
and verifying that the hash value of the splicing value is the hash value of the re-encryption key.
2. The data transaction method of claim 1, wherein the transaction information parameters comprise: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction money required by the transaction.
3. The data transaction method of claim 2, wherein notifying a recipient of the data to obtain the re-encrypted data comprises:
and informing the data receiver to acquire a cipher text data storage address of the data sender and the re-encryption key in the intelligent contract, so that the data receiver downloads the cipher text data by using the cipher text data storage address, and re-encrypts the cipher text data by using the acquired re-encryption key to obtain the re-encrypted data.
4. The data transaction method of claim 3, wherein the ciphertext data of the data issuer is stored in a data transaction platform.
5. The data transaction method of claim 1, wherein the transaction information parameters comprise: the public key of the data receiver, the public key of the data sender, the ciphertext data of the data sender, the wallet address of the data sender and the amount of the transaction money required by the transaction.
6. The data transaction method of claim 5, wherein notifying a recipient of the data to obtain the re-encrypted data comprises:
the intelligent contract utilizes the re-encryption key to re-encrypt the ciphertext data of the data sender to obtain the re-encrypted data, and stores the re-encrypted data into the intelligent contract;
notifying the data receiver to obtain the re-encrypted data in the smart contract.
7. The data transaction method of claim 1, wherein the intelligent contract is generated by populating the intelligent contract template with values of the transaction information parameters included in a purchase data request from the data recipient.
8. The data transaction method of claim 1, upon the detection of a payment operation invoking a smart contract, further comprising: and verifying that the caller calling the intelligent contract is the data receiver.
9. The data transaction method of claim 1, upon the detection of a payment operation invoking a smart contract, further comprising: and checking the credit of the transaction fund as the credit of the transaction fund required by the transaction.
10. The data transaction method of claim 1, upon the detecting a confirmation operation invoking the smart contract, further comprising: and checking that the caller calling the intelligent contract is the data sender.
11. The data transaction method according to claim 1, further comprising, before obtaining the public key of the data issuer, the public key of the data receiver, and the fixed-length random number of the re-encryption key: and verifying that the total length of the re-encryption key is a preset length value.
12. The data trading method of claim 1, wherein the intelligent contracts are generated by a data trading platform based on the intelligent contract template and deployed onto a blockchain.
13. A data transaction apparatus, comprising:
a first storage unit configured to store transaction information parameters;
a second storage unit configured to store the re-encryption parameter;
a payment operation unit comprising:
a payment operation subunit configured to lock a transaction amount in the smart contract when a payment operation invoking the smart contract is detected;
a confirmation operation unit including:
a confirmation operation processing subunit configured to, when a confirmation operation of invoking the smart contract is detected, acquire a re-encryption key and verify the re-encryption key;
a transaction fund transfer subunit configured to transfer the transaction fund to a wallet address of the data issuer when the confirmation operation processing subunit verifies that the transaction fund is passed;
a notification subunit configured to notify a data receiver of acquisition of the re-encrypted data when the confirmation operation processing subunit verifies;
wherein the intelligent contract is generated by populating an intelligent contract template that includes the transaction information parameters and the re-encryption parameters; the re-encrypted data is obtained by re-encrypting ciphertext data of the data sender by using the re-encrypted key, the ciphertext data is obtained by encrypting transaction data by the data sender, and the re-encrypted key is generated by the data sender by using a private key of the data sender and a public key of the data receiver;
the confirmation operation processing subunit includes:
an obtaining module configured to obtain a public key of the data sender, a public key of the data receiver, and a fixed-length random number of the re-encryption key;
the splicing module is configured to splice the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key to obtain a splicing value;
the hash calculation module is configured to perform hash calculation on the splicing value to obtain a hash value of the splicing value;
a verification module configured to verify that the hash value of the concatenation value is the hash value of the re-encryption key.
14. The data trafficking device of claim 13, wherein the traffic information parameter includes: the public key of the data receiver, the public key of the data sender, the wallet address of the data sender, the ciphertext data storage address of the data sender and the amount of the transaction money required by the transaction.
15. The data trafficking device of claim 14, wherein the notification subunit includes:
the first notification module is configured to notify the data receiver to acquire a ciphertext data storage address of the data sender and the re-encryption key in the intelligent contract, so that the data receiver downloads the ciphertext data by using the ciphertext data storage address, and re-encrypts the ciphertext data by using the acquired re-encryption key to obtain the re-encrypted data.
16. The data transaction apparatus of claim 15, wherein the ciphertext data of the data sender is stored in the data transaction platform.
17. The data trafficking device of claim 13, wherein the traffic information parameter includes: the public key of the data receiver, the public key of the data sender, the ciphertext data of the data sender, the wallet address of the data sender and the amount of the transaction money required by the transaction.
18. The data trafficking device of claim 17, wherein the notification subunit includes:
the re-encryption module is configured to re-encrypt ciphertext data of the data sender by using the re-encryption key to obtain the re-encrypted data, and store the re-encrypted data in the intelligent contract;
a second notification module configured to notify the data recipient to obtain the re-encrypted data in the smart contract.
19. The data trafficking device of claim 13, wherein the intelligent contract is generated by populating an intelligent contract template with values of the traffic information parameters included in a purchase data request from the data recipient.
20. The data transaction apparatus of claim 13, wherein the payment operation unit further comprises:
a first checking subunit configured to check that a caller invoking the intelligent contract is the data receiver.
21. The data transaction apparatus of claim 13, wherein the payment operation unit further comprises:
and the second check subunit is configured to check the amount of the transaction fund to be the amount of the transaction fund required by the transaction.
22. The data transaction apparatus of claim 13, wherein the confirmation operation unit further comprises:
a third checking subunit configured to check that a caller invoking the intelligent contract is the data issuer.
23. The data transaction arrangement of claim 13, wherein the confirmation operation processing subunit further comprises:
and the total length verification module is configured to verify that the total length of the re-encryption key is a preset length value before the obtaining module obtains the public key of the data sender, the public key of the data receiver and the fixed-length random number of the re-encryption key.
24. A computing device comprising a memory and a processor, the memory having stored thereon computer instructions executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the data transaction method of any one of claims 1 to 12.
25. A computer readable storage medium having stored thereon computer instructions, wherein said computer instructions when executed perform the steps of the data transaction method of any of claims 1 to 12.
CN201811611360.XA 2018-12-27 2018-12-27 Data transaction method and device, computing equipment and storage medium Active CN109509099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811611360.XA CN109509099B (en) 2018-12-27 2018-12-27 Data transaction method and device, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811611360.XA CN109509099B (en) 2018-12-27 2018-12-27 Data transaction method and device, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109509099A CN109509099A (en) 2019-03-22
CN109509099B true CN109509099B (en) 2021-02-02

Family

ID=65755311

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811611360.XA Active CN109509099B (en) 2018-12-27 2018-12-27 Data transaction method and device, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109509099B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245948A (en) * 2019-05-27 2019-09-17 清华大学 Data trade method and system based on block chain and asymmetric encryption
CN110430186B (en) * 2019-07-31 2020-07-21 国网电子商务有限公司 Block chain data transaction system and method based on agent re-encryption and intelligent contract
CN110990855A (en) * 2019-12-02 2020-04-10 中国银行股份有限公司 Block chain information recording and inquiring method, device and system
CN112669147B (en) * 2019-12-31 2023-09-26 蚂蚁区块链科技(上海)有限公司 Service request method and device based on block chain
CN112581127B (en) * 2020-12-10 2024-07-02 深圳技术大学 Commodity transaction method and device, computer equipment, storage medium and system
CN116561739B (en) * 2023-04-06 2024-04-16 北京熠智科技有限公司 Data transaction method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169764A (en) * 2017-05-10 2017-09-15 山东大学 Fair data trade method based on block chain
CN108063752A (en) * 2017-11-02 2018-05-22 暨南大学 A kind of credible genetic test and data sharing method based on block chain and proxy re-encryption technology
CN108764911A (en) * 2018-06-05 2018-11-06 北京阿尔山金融科技有限公司 Interconnect network accumulated method of commerce and system
CN109087080A (en) * 2018-07-13 2018-12-25 杭州复杂美科技有限公司 Across chain method of commerce, equipment and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10637645B2 (en) * 2017-05-11 2020-04-28 Microsoft Technology Licensing, Llc Cryptlet identity

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107169764A (en) * 2017-05-10 2017-09-15 山东大学 Fair data trade method based on block chain
CN108063752A (en) * 2017-11-02 2018-05-22 暨南大学 A kind of credible genetic test and data sharing method based on block chain and proxy re-encryption technology
CN108764911A (en) * 2018-06-05 2018-11-06 北京阿尔山金融科技有限公司 Interconnect network accumulated method of commerce and system
CN109087080A (en) * 2018-07-13 2018-12-25 杭州复杂美科技有限公司 Across chain method of commerce, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于区块链+IPFS的数据共享平台实现;王纪樟;《浙江工商大学硕士论文库》;20181201;说明书第18-26页、图3-1至图3-8 *

Also Published As

Publication number Publication date
CN109509099A (en) 2019-03-22

Similar Documents

Publication Publication Date Title
CN109509099B (en) Data transaction method and device, computing equipment and storage medium
CN106452775B (en) Method and device for realizing electronic signature and signature server
CN111654367B (en) Method for cryptographic operation and creation of working key, cryptographic service platform and device
CN109347625B (en) Password operation method, work key creation method, password service platform and equipment
KR20180114182A (en) Secure personal devices using elliptic curve cryptography for secret sharing
CN111444273B (en) Data authorization method and device based on block chain
CN108734018B (en) Authentication method, device, system and computer readable storage medium
CA3116067A1 (en) Techniques for improving security of encrypted vehicle software updates
CN106936588B (en) Hosting method, device and system of hardware control lock
CN114499875B (en) Service data processing method, device, computer equipment and storage medium
CN108319857B (en) Trusted application locking and unlocking method and system
CN103942896A (en) System for money withdrawing without card on ATM
CN104753674A (en) Application identity authentication method and device
CN113674456B (en) Unlocking method, unlocking device, electronic equipment and storage medium
CN114282193A (en) Application authorization method, device, equipment and storage medium
CN114338091B (en) Data transmission method, device, electronic equipment and storage medium
TW201828642A (en) Method and device for realizing electronic signature, and signature server to solve the problem that the implementation cost of the U-shield signature scheme in the prior art is high
KR20200041490A (en) Method and apparatus for providing contract service based on blockchain
CN112583826A (en) Remote measurement method, monitoring method, device and system based on block chain
CN113127930B (en) Charging data processing method, device and computer readable storage medium
US20230124498A1 (en) Systems And Methods For Whitebox Device Binding
CN111191273B (en) Method and device for processing document, electronic equipment and readable storage medium
WO2014187363A1 (en) Wireless terminal network locking method and system
CN112818384B (en) Asset processing method, device, equipment and storage medium based on blockchain
CN115996126B (en) Information interaction method, application device, auxiliary platform and electronic device

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