CN115664769A - Data transmission method, system, equipment and medium based on block chain commitment - Google Patents

Data transmission method, system, equipment and medium based on block chain commitment Download PDF

Info

Publication number
CN115664769A
CN115664769A CN202211286842.9A CN202211286842A CN115664769A CN 115664769 A CN115664769 A CN 115664769A CN 202211286842 A CN202211286842 A CN 202211286842A CN 115664769 A CN115664769 A CN 115664769A
Authority
CN
China
Prior art keywords
data
commitment
commitment value
symmetric key
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211286842.9A
Other languages
Chinese (zh)
Other versions
CN115664769B (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.)
Oxford Hainan Blockchain Research Institute Co ltd
Original Assignee
Oxford Hainan Blockchain Research Institute 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 Oxford Hainan Blockchain Research Institute Co ltd filed Critical Oxford Hainan Blockchain Research Institute Co ltd
Priority to CN202211286842.9A priority Critical patent/CN115664769B/en
Publication of CN115664769A publication Critical patent/CN115664769A/en
Application granted granted Critical
Publication of CN115664769B publication Critical patent/CN115664769B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

The application discloses a data transmission method, a system, equipment and a medium based on block chain commitment, which are applied to a data sender to obtain target data to be transmitted; encrypting the target data based on the symmetric key to obtain target encrypted data; generating a first commitment value corresponding to the target encrypted data, and chaining the first commitment value; transmitting the target encrypted data to a data receiving party so that the data receiving party generates first verification information to verify the validity of the first commitment value; if the first commitment value is legal, generating a second commitment value of the symmetric key, and chaining the second commitment value; generating encryption information of a symmetric key based on a public key of a data receiver; transmitting the encrypted information to a data receiving party so that the data receiving party generates second verification information to verify that the second commitment value is legal and then decrypts the target encrypted data based on the symmetric key to obtain target data; the authenticity verification of data transmission and the confirmation of data receiving of a data receiving party are realized.

Description

Data transmission method, system, equipment and medium based on block chain commitment
Technical Field
The present application relates to the field of data transmission technologies, and in particular, to a method, a system, a device, and a medium for data transmission based on block chain commitment.
Background
Currently, in the data transmission process, a data sender can safely transmit data to a data receiver by encrypting the data, however, in the process, after the data receiver receives the data, the data receiver may obtain the data by copying and delete the received information of the data, so as to defer the self-received data, and make it difficult to determine whether the data is actually transmitted.
In summary, how to determine whether data is actually transmitted is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The present application aims to provide a data transmission method based on block chain commitment, which can solve the technical problem of how to determine whether data is actually transmitted or not to a certain extent. The application also provides a data transmission system, equipment and a computer readable storage medium based on block chain commitment.
In order to achieve the above purpose, the present application provides the following technical solutions:
a data transmission method based on block chain commitment is applied to a data sending party and comprises the following steps:
acquiring target data to be transmitted;
encrypting the target data based on the symmetric key to obtain target encrypted data;
generating a first commitment value corresponding to the target encrypted data, and chaining the first commitment value;
transmitting the target encrypted data to a data receiving party so that the data receiving party generates first verification information of the target encrypted data and links the first verification information to verify the validity of the first commitment value;
if the first commitment value is legal, generating a second commitment value of the symmetric key, and chaining the second commitment value;
generating encryption information of the symmetric key based on a public key of the data receiver;
and transmitting the encrypted information to the data receiving party so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain the symmetric key, generates second verification information of the symmetric key, and links the second verification information to verify the validity of the second commitment value, and further, the data receiving party decrypts the target encrypted data based on the symmetric key to obtain the target data after the second commitment value is legal.
Preferably, the generating a first commitment value corresponding to the target encrypted data includes:
acquiring a globally unique request identifier;
calculating a first hash value of the request identification and the target encrypted data;
generating a first random number, and encrypting the first random number based on the public key of the data receiver to obtain a first encrypted random number;
generating, by a commitment function, the first commitment value based on an initial commitment value, the first hash value, and the first random number;
after said enwinding said first committed value, further comprising:
and chaining the request identifier and the first encrypted random number, so that the data receiver decrypts the first encrypted random number based on a private key of the data receiver to obtain the first random number, and generates the first verification information based on the request identifier and the first random number.
Preferably, the generating the second commitment value of the symmetric key includes:
calculating a second hash value of the symmetric key and the request identifier;
generating a second random number;
generating, by the commitment function, the second commitment value based on the initial commitment value, the second hash value and the second random number;
the generating encryption information of the symmetric key based on the public key of the data receiver comprises:
and carrying out Hash operation on the symmetric key and the second random number based on the public key of the data receiver to obtain the encrypted information.
Preferably, the transmitting the target encrypted data to a data receiving side includes:
transmitting the target encrypted data to the data receiver based on a P2P protocol under a link;
the transmitting the encryption information to the data receiver includes:
and uplinking the encryption information so that the data receiving party acquires the encryption information from the block chain.
A data transmission method based on block chain commitment is applied to a data receiver and comprises the following steps:
receiving target encrypted data transmitted by a data sender, wherein the target encrypted data comprises data obtained by encrypting the target data by the data sender based on a symmetric key;
generating and chaining first verification information of the target encrypted data to verify validity of a first commitment value in a blockchain based on the first verification information, wherein the first commitment value comprises the commitment value of the target encrypted data generated by the data sender;
receiving encryption information transmitted by the data sender, wherein the encryption information comprises encryption information of the symmetric key generated by the data sender based on a public key of the data receiver;
decrypting the encrypted information based on a private key of the user to obtain the symmetric key;
generating and chaining second verification information of the symmetric key to verify the validity of a second commitment value in the block chaining based on the second verification information, wherein the second commitment value comprises the commitment value of the symmetric key generated by the data sender after the first commitment value is valid;
and if the second commitment value is legal, decrypting the target encrypted data based on the symmetric key to obtain the target data.
Preferably, the generating of the first verification information of the target encrypted data includes:
acquiring a request identifier and a first encrypted random number of the uplink of the data sending party from the block chain;
decrypting the first encrypted random number based on a private key of the data receiver to obtain a first check random number;
calculating a third hash value of the target encrypted data and the request identifier;
taking the request identifier, the first check random number and the third hash value as the first verification information;
wherein the first commitment value comprises a commitment value generated by the data sender through a commitment function based on an initial commitment value, a first hash value and a first random number; the first hash value comprises the request identifier obtained by the data sender through calculation and the hash value of the target encrypted data; the first encrypted random number includes a random number obtained by the data sender encrypting the first random number based on the public key of the data receiver.
Preferably, the decrypting the encrypted information based on the private key of the user to obtain the symmetric key includes:
decrypting the encrypted information based on a self private key to obtain a verification symmetric key and a second verification random number;
the generating of the second verification information of the symmetric key includes:
calculating a fourth hash value of the symmetric key and the request identifier;
taking the symmetric key, the second verification random number and the fourth hash value as the second verification information;
wherein the second commitment value comprises a commitment value generated by the data sender through the commitment function based on the initial commitment value, a second hash value and a second random number; the second hash value comprises the symmetric key calculated by the data sender and the hash value of the request identifier; the encryption information includes information obtained by the data sending party performing hash operation on the symmetric key and the second random number based on a public key of the data receiving party.
A data transmission system based on block chain commitment is applied to a data sending party and comprises:
the first acquisition module is used for acquiring target data to be transmitted;
the first encryption module is used for encrypting the target data based on the symmetric key to obtain target encrypted data;
a first generating module, configured to generate a first commitment value corresponding to the target encrypted data, and uplink the first commitment value;
a first transmission module, configured to transmit the target encrypted data to a data receiver, so that the data receiver generates first verification information of the target encrypted data and uplinks the first verification information to verify validity of the first commitment value;
a second generating module, configured to generate a second commitment value of the symmetric key if the first commitment value is legal, and uplink the second commitment value;
a third generation module, configured to generate encryption information of the symmetric key based on a public key of the data receiver;
the second transmission module is configured to transmit the encrypted information to the data receiving party, so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain the symmetric key, generates second verification information of the symmetric key, and chains the second verification information to verify validity of the second commitment value, and then the data receiving party decrypts the target encrypted data based on the symmetric key after the second commitment value is legal to obtain the target data.
A data transmission device comprising:
a memory for storing a computer program;
a processor configured to implement the steps of the data transmission method based on blockchain commitment as described above when the computer program is executed.
A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for data transmission based on blockchain commitments as defined in any of the above.
The application provides a data transmission method based on block chain commitment, which is applied to a data sender and used for obtaining target data to be transmitted; encrypting the target data based on the symmetric key to obtain target encrypted data; generating a first commitment value corresponding to the target encrypted data, and chaining the first commitment value; transmitting the target encrypted data to a data receiving party so that the data receiving party generates first verification information of the target encrypted data and links the first verification information to verify the validity of the first commitment value; if the first commitment value is legal, generating a second commitment value of the symmetric key, and chaining the second commitment value; generating encryption information of a symmetric key based on a public key of a data receiver; and transmitting the encrypted information to a data receiving party so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain a symmetric key, generates second verification information of the symmetric key and links the second verification information to verify the legality of the second commitment value, and the data receiving party decrypts the target encrypted data based on the symmetric key to obtain target data after the second commitment value is legal. In the application, the data sending party can represent that the data sending party sends the target encrypted data based on the first commitment value, and the data receiving party can prove the authenticity of the target encrypted data received by the data receiving party based on the first verification information and the validity verification of the first commitment value; the data sending party can characterize the encrypted information sent by the data sending party on the basis of the second commitment value, and the data receiving party can prove the authenticity of the encrypted information received by the data receiving party on the basis of the second verification information and the validity verification of the second commitment value; in the whole process, the data receiver can receive the target data only after the first commitment value and the second commitment value are legal, and the first commitment value, the first verification information, the second commitment value and the second verification information are all stored in the block chain and are not easy to be tampered, so that whether the data sender really sends the target data to the data receiver or not and whether the data receiver really receives the target data or not can be determined subsequently based on the information stored in the block chain, and authenticity verification of data transmission and confirmation of data reception of the data receiver are achieved. The data transmission system, the device and the computer readable storage medium based on block chain commitment solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a first flowchart of a data transmission method based on block chain commitments according to an embodiment of the present application;
fig. 2 is a schematic view of a scenario of a data transmission method based on a block chain commitment according to an embodiment of the present application;
fig. 3 is a second flowchart of a data transmission method based on block chain commitment according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data transmission system based on block chain commitments according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data transmission apparatus based on block chain commitments according to an embodiment of the present application;
fig. 6 is another structural diagram of a data transmission apparatus based on a block chain commitment according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1 and fig. 2, fig. 1 is a first flowchart illustrating a data transmission method based on a block chain commitment according to an embodiment of the present application; fig. 2 is a schematic view of a scenario of a data transmission method based on block chain commitment according to an embodiment of the present application, and it should be noted that a data sending party and a data receiving party in the present application may be a client and a server used by a user, and may also be a platform mechanism, and the present application is not limited herein.
The data transmission method based on block chain commitment provided by the embodiment of the application is applied to a data sending party and comprises the following steps:
step S10: and acquiring target data to be transmitted.
In practical application, target data to be transmitted may be obtained first, and the type, content, and the like of the target data may be determined according to actual needs, for example, the target data may be image data, audio/video data, text data, and the like, which is not specifically limited herein.
Step S102: and encrypting the target data based on the symmetric key to obtain target encrypted data.
In practical application, after the target data to be transmitted is obtained, in order to ensure that the target data is not easily obtained by a lawbreaker, the target data can be encrypted based on the symmetric key to obtain target encrypted data.
It should be noted that the symmetric key may be generated by the data sending party, or may be generated by a third-party trusted authority, and the like, and the method applied when encrypting the target data may be determined according to actual needs, for example, the encryption method may be an SM2 algorithm, an SM9 algorithm, and the like, and the application is not limited specifically herein.
Step S103: and generating a first commitment value corresponding to the target encrypted data, and chaining the first commitment value.
In practical applications, after the target data is encrypted based on the symmetric key to obtain the target encrypted data, a first commitment value corresponding to the target encrypted data may be generated, and the first commitment value is uplinked, so as to represent that the data sender generates the target encrypted data by using the first commitment value stored in the block chain. It should be noted that the type of the commitment function generating the commitment value may be determined according to actual needs, for example, the commitment function may be a Pederson commitment or a hash commitment, and the present application is not limited in detail herein.
Step S104: and transmitting the target encrypted data to a data receiver so that the data receiver generates first verification information of the target encrypted data and links the first verification information to verify the validity of the first commitment value.
In practical applications, after a first commitment value corresponding to target encrypted data is generated and uplink is performed on the first commitment value, the target encrypted data can be transmitted to a data receiver, so that the target data is really transmitted to the data receiver by the data transmitter by means of the target encrypted data, and after the data receiver receives the target encrypted data, first verification information of the target encrypted data needs to be generated and uplink first verification information needs to be performed to verify validity of the first commitment value.
It should be noted that, the process of verifying the validity of the first commitment value based on the first verification information may be executed by a third-party trusted authority, or may be executed by a blockchain, and the like, and the present application is not specifically limited herein, and in order to urge the data sender to send the target encrypted data to the data receiver really, the deposit of the data sender and the data receiver may be stored in advance on the blockchain, and after the first commitment value is verified to be illegal based on the first verification information, the deposit of the data receiver is returned to the data receiver, and after the data receiver receives the target data really, the deposit of the data receiver may be sent to the data sender, and the like.
It should be noted that, in the process of transmitting the target encrypted data to the data receiver, the data transmitter may transmit the target encrypted data to the data receiver based on the P2P protocol in a linked manner, and the application is not limited herein.
In a specific application scenario, in the process of generating a first commitment value corresponding to target encrypted data, a globally unique request identifier may be obtained, for example, the request identifier generated by a data receiving party is obtained through a blockchain; calculating a first hash value of the request identifier and the target encrypted data, e.g. by the formula h cf Computing a first hash value of the request identification and the target encrypted data by = hash (Ci | | L), where h is cf Representing a first hash value, wherein the hash represents hash calculation, ci represents target encrypted data, and L represents a request identifier; generating a first random number, and encrypting the first random number based on a public key of a data receiver to obtain a first encrypted random number; generating a first commitment value based on an initial commitment value, a first hash value and a first random number through a commitment function, wherein the initial commitment value can be generated by the commitment function to calculate a request identifier; and after the first commitment value is uplink, the method may further comprise: the uplink request identifier and the first encrypted random number are used for enabling the data receiving party to decrypt the first encrypted random number based on the private key of the data receiving party to obtain the first random number and based on the request identifierThe first random number generates first verification information, and at the moment, the data receiving party can acquire the request identification and the first encrypted random number of the uplink of the data sending party from the block chain; decrypting the first encrypted random number based on a private key of a data receiving party to obtain a first check random number; calculating a third hash value of the target encrypted data and the request identifier; correspondingly, when whether the first commitment value is legal or not is verified based on the first verification information, a first verification commitment value can be generated based on the initial commitment value, the third hash value and the first verification random number through a commitment function, whether the first verification commitment value is consistent with the first commitment value or not is judged, if so, the first commitment value can be determined to be legal, and if not, the first commitment value can be determined to be illegal.
Step S105: if the first commitment value is legal, a second commitment value of the symmetric key is generated, and the second commitment value is linked.
In practical applications, in case that the first commitment value is legal, the data sender may generate a second commitment value of the symmetric key, and uplink the second commitment value to characterize that the data sender generates the symmetric key by the second commitment value stored in the block chain.
Step S106: encryption information of the symmetric key is generated based on a public key of the data receiver.
In practical application, if a data receiving party needs to obtain target data from target encrypted data, the symmetric key needs to be transmitted to the data receiving party for data transmission convenience, and in the process, in order to ensure the security of the symmetric key, a data transmitting party can generate encrypted information of the symmetric key based on a public key of the data receiving party, so that only the data receiving party can decrypt the encrypted information based on a private key of the data receiving party to obtain the symmetric key.
Step S107: and transmitting the encrypted information to a data receiving party so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain a symmetric key, generates second verification information of the symmetric key and links the second verification information to verify the legality of the second commitment value, and the data receiving party decrypts the target encrypted data based on the symmetric key to obtain target data after the second commitment value is legal.
In practical application, after the encrypted information of the symmetric key is generated based on the public key of the data receiver, the encrypted information can be transmitted to the data receiver, so that the symmetric key can be really transmitted to the data receiver by means of the encrypted information, correspondingly, after the data receiver receives the encrypted information, the encrypted information needs to be decrypted by the private key of the data receiver to obtain the symmetric key, second verification information of the symmetric key is generated, and the second verification information is linked up to verify the validity of the second commitment value; still further, the data receiver may decrypt the target encrypted data based on the symmetric key after the second commitment value is legal to obtain the target data, so as to really receive the target data.
It should be noted that, the process of verifying the validity of the second commitment value based on the second verification information may be executed by a third-party trusted authority, or may be executed by a blockchain, and the like. In addition, the data sender may uplink the encrypted information during the process of transmitting the encrypted information to the data receiver, so that the data receiver acquires the encrypted information from the blockchain, that is, the encrypted information can be safely transmitted to the data receiver by means of the blockchain.
In a specific application scenario, in the process of generating the second commitment value of the symmetric key, the data sender may calculate the second hash value of the symmetric key and the request identifier, for example, by using the formula h k = hash (k | | L) to generate the second hash value, where h k Represents a second hash value, k represents a symmetric key; generating a second random number; generating, by a commitment function, a second commitment value based on the initial commitment value, the second hash value, and the second random number; correspondingly, in the process of generating the encrypted information of the symmetric key based on the public key of the data receiver, the hash operation can be performed on the symmetric key and the second random number based on the public key of the data receiver to obtain the encrypted information. At this time, in the process of generating the second verification information, the data receiving party can decrypt the encrypted information based on the own private key to obtain a verification symmetric key and a second verification random number, and calculate a fourth hash value of the symmetric key and the request identifier; correspondingly, when the second commitment value is verified to be legal based on the second verification information, the second verification commitment value can be generated based on the initial commitment value, the fourth hash value and the second verification random value through the commitment function, whether the second verification commitment value is consistent with the second commitment value is judged, if so, the second commitment value can be determined to be legal, and if not, the second commitment value can be determined to be illegal.
The application provides a data transmission method based on block chain commitment, which is applied to a data sender and used for obtaining target data to be transmitted; encrypting the target data based on the symmetric key to obtain target encrypted data; generating a first commitment value corresponding to the target encrypted data, and chaining the first commitment value; transmitting the target encrypted data to a data receiving party so that the data receiving party generates first verification information of the target encrypted data and links the first verification information to verify the validity of the first commitment value; if the first commitment value is legal, generating a second commitment value of the symmetric key, and chaining the second commitment value; generating encryption information of a symmetric key based on a public key of a data receiver; and transmitting the encrypted information to a data receiving party so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain a symmetric key, generates second verification information of the symmetric key and links the second verification information to verify the legality of the second commitment value, and the data receiving party decrypts the target encrypted data based on the symmetric key to obtain target data after the second commitment value is legal. In the application, the data sending party can represent that the data sending party sends the target encrypted data based on the first commitment value, and the data receiving party can prove the authenticity of the target encrypted data received by the data receiving party based on the first verification information and the validity verification of the first commitment value; the data sending party can represent that the data sending party sends the encrypted information of the key based on the second commitment value, and the data receiving party can prove the authenticity of the encrypted information received by the data receiving party based on the second verification information and the validity verification of the second commitment value; in the whole process, the data receiver can receive the target data only after the first commitment value and the second commitment value are legal, and the first commitment value, the first verification information, the second commitment value and the second verification information are all stored in the block chain and are not easy to be tampered, so that whether the data sender really sends the target data to the data receiver or not and whether the data receiver really receives the target data or not can be determined subsequently based on the information stored in the block chain, and authenticity verification of data transmission and confirmation of data reception of the data receiver are achieved.
Referring to fig. 3, fig. 3 is a second flowchart illustrating a data transmission method based on a block chain commitment according to an embodiment of the present application.
The data transmission method based on block chain commitment provided by the embodiment of the application is applied to a data receiving party and comprises the following steps:
step S201: and receiving target encrypted data transmitted by the data sender, wherein the target encrypted data comprises data obtained by encrypting the target data by the data sender based on the symmetric key.
Step S202: and generating and chaining first verification information of the target encrypted data so as to verify the validity of a first commitment value in the blockchain based on the first verification information, wherein the first commitment value comprises the commitment value of the target encrypted data generated by the data sender.
In practical application, a data receiver can obtain a request identifier and a first encrypted random number of a chain on a data sender from a block chain in the process of generating first verification information of target encrypted data; decrypting the first encrypted random number based on a private key of a data receiving party to obtain a first check random number; calculating a third hash value of the target encrypted data and the request identifier; taking the request identifier, the first check random number and the third hash value as first verification information; the first commitment value comprises a commitment value generated by a data sender through a commitment function based on an initial commitment value, a first hash value and a first random number; the first hash value comprises a request identifier obtained by the data sending party through calculation and a hash value of the target encrypted data; the first encrypted random number comprises a random number obtained by encrypting the first random number by the data sender based on the public key of the data receiver
Step S203: and receiving encryption information transmitted by the data sending party, wherein the encryption information comprises encryption information of a symmetric key generated by the data sending party based on a public key of the data receiving party.
Step S204: and decrypting the encrypted information based on the private key of the user to obtain a symmetric key.
Step S205: and generating second verification information of the symmetric key and chaining the verification information to verify the validity of a second commitment value in the block chaining based on the second verification information, wherein the second commitment value comprises the commitment value of the symmetric key generated by the data sender after the first commitment value is legal.
In practical application, the data receiving party can obtain a verification symmetric key and a second verification random number based on the private key decryption encrypted information of the data receiving party in the process of obtaining the symmetric key based on the private key decryption encrypted information of the data receiving party; in the process of generating the second verification information of the symmetric key, a fourth hash value of the symmetric key and the request identifier can be calculated; the symmetric key, the second verification random number and the fourth hash value are used as second verification information; the second commitment value comprises a commitment value generated by the data sender through a commitment function based on the initial commitment value, the second hash value and the second random number; the second hash value comprises a symmetric key obtained by calculation of the data sender and a hash value of the request identifier; the encryption information comprises information obtained by the data sending party through Hash operation on the symmetric key and the second random number based on the public key of the data receiving party.
Step S206: and if the second commitment value is legal, decrypting the target encrypted data based on the symmetric key to obtain target data.
In practical applications, when data of a data sender or a data receiver needs to be verified to be counterfeit, the data receiver may further publish its private key, so that a third-party trusted authority or a blockchain, etc. may determine a counterfeit party based on the private key of the data receiver and the first commitment value, the first verification information, the second commitment value, the second verification information, etc. stored in the blockchain.
The corresponding descriptions of the steps in the data transmission method based on blockchain commitment for the data receiver according to the embodiment of the present application may refer to the corresponding descriptions of the data transmission method based on blockchain commitment for the data sender, which are not described herein again.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a data transmission system based on block chain commitments according to an embodiment of the present application.
The data transmission system based on block chain commitment provided by the embodiment of the application is applied to a data sender, and can include:
a first obtaining module 101, configured to obtain target data to be transmitted;
the first encryption module 102 is configured to encrypt target data based on a symmetric key to obtain target encrypted data;
a first generating module 103, configured to generate a first commitment value corresponding to the target encrypted data, and uplink the first commitment value;
a first transmission module 104, configured to transmit the target encrypted data to a data receiving party, so that the data receiving party generates first verification information of the target encrypted data and chains the first verification information to verify validity of the first commitment value;
a second generating module 105, configured to generate a second commitment value of the symmetric key if the first commitment value is legal, and uplink the second commitment value;
a third generating module 106, configured to generate encryption information of the symmetric key based on the public key of the data receiving party;
the second transmission module 107 is configured to transmit the encrypted information to the data receiving party, so that the data receiving party decrypts the encrypted information based on the private key of the data receiving party to obtain the symmetric key, generates second verification information of the symmetric key, and chains the second verification information to verify validity of the second commitment value, and further, after the second commitment value is legal, decrypts the target encrypted data based on the symmetric key to obtain the target data.
The data transmission system based on block chain commitment provided by the embodiment of the application is applied to a data receiving party and comprises the following components:
the first receiving module is used for receiving target encrypted data transmitted by a data sending party, wherein the target encrypted data comprises data obtained by encrypting the target data by the data sending party based on a symmetric key;
a fourth generation module, configured to generate and uplink first verification information of the target encrypted data, so as to verify validity of a first commitment value in the block chain based on the first verification information, where the first commitment value includes a commitment value of the target encrypted data generated by the data sender;
the second receiving module is used for receiving the encrypted information transmitted by the data sending party, wherein the encrypted information comprises encrypted information of a symmetric key generated by the data sending party based on a public key of the data receiving party;
the first decryption module is used for decrypting the encrypted information based on a private key of the first decryption module to obtain a symmetric key;
a fifth generating module, configured to generate and uplink second verification information of the symmetric key, so as to verify validity of a second commitment value in the block chain based on the second verification information, where the second commitment value includes a commitment value of the symmetric key generated by the data sender after the first commitment value is valid;
and the second decryption module is used for decrypting the target encrypted data based on the symmetric key to obtain the target data if the second commitment value is legal.
For the description of the corresponding modules in the data transmission system based on block chain commitment provided in the embodiment of the present application, please refer to the above embodiments, which are not described herein again.
The present application further provides a data transmission device and a computer-readable storage medium based on blockchain commitment, which both have the corresponding effects of the data transmission method based on blockchain commitment provided by the embodiments of the present application. Referring to fig. 5, fig. 5 is a schematic structural diagram of a data transmission device based on block chain commitment according to an embodiment of the present application.
The data transmission device based on blockchain commitment provided by the embodiment of the present application includes a memory 201 and a processor 202, wherein the memory 201 stores a computer program, and the processor 202 implements the steps of the data transmission method based on blockchain commitment as described in any of the above embodiments when executing the computer program.
Referring to fig. 6, another data transmission device based on block chain commitment according to an embodiment of the present application may further include: an input port 203 connected to the processor 202, for transmitting externally input commands to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and a communication module 205 connected to the processor 202 for enabling the data transmission device to communicate with the outside world based on the block chain commitment. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication method adopted by the communication module 205 includes, but is not limited to, mobile high definition link technology (HML), universal Serial Bus (USB), high Definition Multimedia Interface (HDMI), and wireless connection: wireless fidelity (WiFi), bluetooth communication, bluetooth low energy (low) communication, ieee802.11s based communication.
A computer-readable storage medium is provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the data transmission method based on blockchain commitments as described in any of the above embodiments.
The computer-readable storage media to which this application relates include Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.
For a description of relevant parts in the data transmission system, the data transmission device and the computer-readable storage medium based on the block chain commitment provided in the embodiment of the present application, reference is made to detailed descriptions of corresponding parts in the data transmission method based on the block chain commitment provided in the embodiment of the present application, and details are not repeated here. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A data transmission method based on block chain commitment is characterized in that the method is applied to a data sender and comprises the following steps:
acquiring target data to be transmitted;
encrypting the target data based on the symmetric key to obtain target encrypted data;
generating a first commitment value corresponding to the target encrypted data, and chaining the first commitment value;
transmitting the target encrypted data to a data receiving party so that the data receiving party generates first verification information of the target encrypted data and links the first verification information to verify the validity of the first commitment value;
if the first commitment value is legal, generating a second commitment value of the symmetric key, and chaining the second commitment value;
generating encryption information of the symmetric key based on a public key of the data receiver;
and transmitting the encrypted information to the data receiving party so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain the symmetric key, generates second verification information of the symmetric key, and links the second verification information to verify the validity of the second commitment value, and further, the data receiving party decrypts the target encrypted data based on the symmetric key to obtain the target data after the second commitment value is legal.
2. The method according to claim 1, wherein the generating a first commitment value corresponding to the target encrypted data comprises:
acquiring a globally unique request identifier;
calculating a first hash value of the request identification and the target encrypted data;
generating a first random number, and encrypting the first random number based on the public key of the data receiver to obtain a first encrypted random number;
generating, by a commitment function, the first commitment value based on an initial commitment value, the first hash value, and the first random number;
after said uplinking the first committed value, the method further comprises:
and chaining the request identifier and the first encrypted random number, so that the data receiver decrypts the first encrypted random number based on a private key of the data receiver to obtain the first random number, and generates the first verification information based on the request identifier and the first random number.
3. The method according to claim 2, wherein the generating the second commitment value for the symmetric key comprises:
calculating a second hash value of the symmetric key and the request identifier;
generating a second random number;
generating, by the commitment function, the second commitment value based on the initial commitment value, the second hash value, and the second random number;
the generating encryption information of the symmetric key based on the public key of the data receiver comprises:
and carrying out Hash operation on the symmetric key and the second random number based on the public key of the data receiver to obtain the encrypted information.
4. The method of claim 3, wherein the transmitting the target encrypted data to a data recipient comprises:
transmitting the target encrypted data to the data receiver based on a P2P protocol under a link;
the transmitting the encryption information to the data receiver includes:
and uplinking the encryption information so that the data receiving party acquires the encryption information from the block chain.
5. A data transmission method based on block chain commitment, applied to a data receiver, comprising:
receiving target encrypted data transmitted by a data sender, wherein the target encrypted data comprises data obtained by encrypting the target data by the data sender based on a symmetric key;
generating and chaining first verification information of the target encrypted data to verify validity of a first commitment value in a block chaining based on the first verification information, wherein the first commitment value comprises the commitment value of the target encrypted data generated by the data sender;
receiving encryption information transmitted by the data sender, wherein the encryption information comprises encryption information of the symmetric key generated by the data sender based on a public key of the data receiver;
decrypting the encrypted information based on a private key of the user to obtain the symmetric key;
generating second verification information of the symmetric key and chaining the verification information to verify validity of a second commitment value in the block chaining based on the second verification information, wherein the second commitment value comprises a commitment value of the symmetric key generated by the data sender after the first commitment value is legal;
and if the second commitment value is legal, decrypting the target encrypted data based on the symmetric key to obtain the target data.
6. The method according to claim 5, wherein the generating the first verification information of the target encrypted data includes:
acquiring a request identifier and a first encrypted random number of the uplink of the data sending party from the block chain;
decrypting the first encrypted random number based on a private key of the data receiver to obtain a first check random number;
calculating a third hash value of the target encrypted data and the request identifier;
taking the request identifier, the first check random number and the third hash value as the first verification information;
wherein the first commitment value comprises a commitment value generated by the data sender through a commitment function based on an initial commitment value, a first hash value and a first random number; the first hash value comprises the request identification obtained by the data sender through calculation and the hash value of the target encrypted data; the first encrypted random number includes a random number obtained by the data sender encrypting the first random number based on the public key of the data receiver.
7. The method of claim 6, wherein decrypting the encrypted information based on its own private key to obtain the symmetric key comprises:
decrypting the encrypted information based on a self private key to obtain a verification symmetric key and a second verification random number;
the generating of the second verification information of the symmetric key includes:
calculating a fourth hash value of the symmetric key and the request identifier;
taking the symmetric key, the second check random number, and the fourth hash value as the second verification information;
wherein the second commitment value comprises a commitment value generated by the data sender through the commitment function based on the initial commitment value, a second hash value and a second random number; the second hash value comprises the symmetric key calculated by the data sender and the hash value of the request identifier; the encryption information includes information obtained by the data sending party performing hash operation on the symmetric key and the second random number based on a public key of the data receiving party.
8. A data transmission system based on block chain commitment, applied to a data sending side, comprising:
the first acquisition module is used for acquiring target data to be transmitted;
the first encryption module is used for encrypting the target data based on the symmetric key to obtain target encrypted data;
a first generating module, configured to generate a first commitment value corresponding to the target encrypted data, and uplink the first commitment value;
a first transmission module, configured to transmit the target encrypted data to a data receiving party, so that the data receiving party generates first verification information of the target encrypted data and chains the first verification information to verify validity of the first commitment value;
a second generating module, configured to generate a second commitment value of the symmetric key if the first commitment value is legal, and uplink the second commitment value;
a third generation module, configured to generate encryption information of the symmetric key based on a public key of the data receiver;
the second transmission module is configured to transmit the encrypted information to the data receiving party, so that the data receiving party decrypts the encrypted information based on a private key of the data receiving party to obtain the symmetric key, generates second verification information of the symmetric key, and chains the second verification information to verify validity of the second commitment value, and then the data receiving party decrypts the target encrypted data based on the symmetric key after the second commitment value is legal to obtain the target data.
9. A data transmission device based on blockchain commitments, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for data transmission based on blockchain commitments as claimed in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for data transmission based on blockchain commitments as claimed in any one of claims 1 to 7.
CN202211286842.9A 2022-10-20 2022-10-20 Data transmission method, system, equipment and medium based on blockchain commitment Active CN115664769B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211286842.9A CN115664769B (en) 2022-10-20 2022-10-20 Data transmission method, system, equipment and medium based on blockchain commitment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211286842.9A CN115664769B (en) 2022-10-20 2022-10-20 Data transmission method, system, equipment and medium based on blockchain commitment

Publications (2)

Publication Number Publication Date
CN115664769A true CN115664769A (en) 2023-01-31
CN115664769B CN115664769B (en) 2024-05-31

Family

ID=84989680

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211286842.9A Active CN115664769B (en) 2022-10-20 2022-10-20 Data transmission method, system, equipment and medium based on blockchain commitment

Country Status (1)

Country Link
CN (1) CN115664769B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118585972A (en) * 2024-08-06 2024-09-03 知软技术(上海)有限公司 Block chain-based data credential generation and verification method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108390762A (en) * 2017-12-29 2018-08-10 北京欧链科技有限公司 Data screening method and apparatus based on block chain
CN112383389A (en) * 2021-01-08 2021-02-19 索信达(北京)数据技术有限公司 Block chain random number generation method and system
CN112769548A (en) * 2019-11-05 2021-05-07 深圳市网心科技有限公司 Block chain numerical information transmission method, system, device and computer medium
WO2022126967A1 (en) * 2020-12-15 2022-06-23 平安科技(深圳)有限公司 Blockchain-based data supervision method, apparatus and device, and storage medium
CN115114658A (en) * 2022-06-24 2022-09-27 深圳大学 Verifiable data transaction method, device, equipment and medium based on block chain

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108390762A (en) * 2017-12-29 2018-08-10 北京欧链科技有限公司 Data screening method and apparatus based on block chain
CN112769548A (en) * 2019-11-05 2021-05-07 深圳市网心科技有限公司 Block chain numerical information transmission method, system, device and computer medium
WO2022126967A1 (en) * 2020-12-15 2022-06-23 平安科技(深圳)有限公司 Blockchain-based data supervision method, apparatus and device, and storage medium
CN112383389A (en) * 2021-01-08 2021-02-19 索信达(北京)数据技术有限公司 Block chain random number generation method and system
CN115114658A (en) * 2022-06-24 2022-09-27 深圳大学 Verifiable data transaction method, device, equipment and medium based on block chain

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118585972A (en) * 2024-08-06 2024-09-03 知软技术(上海)有限公司 Block chain-based data credential generation and verification method and system

Also Published As

Publication number Publication date
CN115664769B (en) 2024-05-31

Similar Documents

Publication Publication Date Title
CN111079128B (en) Data processing method and device, electronic equipment and storage medium
KR101366243B1 (en) Method for transmitting data through authenticating and apparatus therefor
EP3779792B1 (en) Two-dimensional code generation method, data processing method, apparatus, and server
CN106470104B (en) Method, device, terminal equipment and system for generating shared key
CN107948736A (en) A kind of audio and video preservation of evidence method and system
CN112702160A (en) Method, device and system for encrypted storage and sharing of cloud data
US20150372813A1 (en) System and method for generating a random number
CN110611670A (en) API request encryption method and device
CN106778285B (en) Method and device for upgrading equipment
CN107306254B (en) Digital copyright protection method and system based on double-layer encryption
CN111970114B (en) File encryption method, system, server and storage medium
CN111970109B (en) Data transmission method and system
CN113346998A (en) Key updating and file sharing method, device, equipment and computer storage medium
CN105553654A (en) Key information query processing method and device and key information management system
CN113890730B (en) Data transmission method and system
CN112597523A (en) File processing method, file conversion encryption machine, terminal, server and medium
CN107332833B (en) Verification method and device
WO2011076274A1 (en) Usage control of digital data exchanged between terminals of a telecommunications network
CN115664769B (en) Data transmission method, system, equipment and medium based on blockchain commitment
CN114173294A (en) Non-peer-to-peer short message transmission method, system, equipment and computer storage medium
CN110611679A (en) Data transmission method, device, equipment and system
CN113221188B (en) AIS data evidence storage method, evidence obtaining method, device and storage medium
CN116709325B (en) Mobile equipment security authentication method based on high-speed encryption algorithm
CN107241341B (en) Access control method and device
CN114297597B (en) Account management method, system, equipment and computer readable storage medium

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