CN114070562A - Data exchange method and device, electronic equipment and storage medium - Google Patents

Data exchange method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114070562A
CN114070562A CN202111348231.8A CN202111348231A CN114070562A CN 114070562 A CN114070562 A CN 114070562A CN 202111348231 A CN202111348231 A CN 202111348231A CN 114070562 A CN114070562 A CN 114070562A
Authority
CN
China
Prior art keywords
communication
data
communication node
key
secret parameter
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.)
Pending
Application number
CN202111348231.8A
Other languages
Chinese (zh)
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.)
China South Power Grid International Co ltd
China Southern Power Grid Co Ltd
Original Assignee
China South Power Grid International Co ltd
China Southern Power Grid 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 China South Power Grid International Co ltd, China Southern Power Grid Co Ltd filed Critical China South Power Grid International Co ltd
Priority to CN202111348231.8A priority Critical patent/CN114070562A/en
Publication of CN114070562A publication Critical patent/CN114070562A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/14Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using a plurality of keys or algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/06Network architectures or network communication protocols for network security for supporting key management in a packet data network
    • H04L63/062Network architectures or network communication protocols for network security for supporting key management in a packet data network for key distribution, e.g. centrally by trusted party
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0869Generation of secret information including derivation or calculation of cryptographic keys or passwords involving random numbers or seeds

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a data exchange method, a data exchange device, electronic equipment and a storage medium, which are used for solving the technical problem of data exchange fairness. The invention distributes different random communication keys for the communication nodes of data exchange through the communication server, generates the secret parameter and ensures the fairness of data exchange through the secret parameter. The communication nodes encrypt their own exchange data using different communication keys, and send them to each other, and then request the communication server to publish the secret parameters. After the data exchange between the communication nodes is completed, the communication server publishes the secret parameter, and the communication nodes can decrypt the encrypted data of the other party by using the secret parameter. The fairness of data exchange is improved.

Description

Data exchange method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data exchange method and apparatus, an electronic device, and a storage medium.
Background
With the development of the internet and electronic commerce, fair exchange of data is more and more emphasized by people, which is the basis of fair transaction, and any transaction on the internet is essentially data exchange. Both communication parties (transaction parties) need to ensure that after sending valid data to each other, each other also sends valid data to itself, for example. Neither communication party wants the other party to get the data of the other party before the other party.
Disclosure of Invention
The invention provides a data exchange method, a data exchange device, electronic equipment and a storage medium, which are used for solving the technical problem of data exchange fairness.
The invention provides a data exchange method, which is applied to a communication server; the method comprises the following steps:
receiving a key distribution request sent by a preset first communication node, and generating a first communication key and a second communication key; the first communication key is different from the second communication key;
generating a secret parameter using the first communication key and the second communication key;
sending the first communication key to the first communication node, and sending the second communication key to a preset second communication node, wherein the first communication key is used for encrypting preset first exchange data to generate first encrypted data, and the second communication key is used for encrypting preset second exchange data to generate second encrypted data;
receiving first confirmation exchange information sent by the first communication node; the first confirmation exchange information is generated after the first communication node receives the second encrypted data sent by the second communication node;
receiving second confirmation exchange information sent by the second communication node; the second acknowledgement exchange information is generated after the second communication node receives the first encrypted data sent by the first communication node;
sending the secret parameter to the first communication node and the second communication node, respectively, in response to the first acknowledgment exchange information and the second acknowledgment exchange information; the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchanged data, and the secret parameter is also used for the second communication node to decrypt the first encrypted data to obtain first exchanged data.
Optionally, the step of generating a secret parameter using the first communication key and the second communication key includes:
and carrying out bitwise XOR on the first communication key and the second communication key to generate a secret parameter.
Optionally, the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain a second exchange data, and the step includes:
and the secret parameter is used for performing bitwise exclusive OR on the second encrypted data, the first communication key and the secret parameter to obtain second exchange data when the first communication node decrypts the second encrypted data.
Optionally, the secret parameter is further used for the second communication node to decrypt the first encrypted data to obtain the first exchanged data, and the step includes:
the secret parameter is further used for the second communication node to perform bitwise exclusive or on the first encrypted data, the second communication key and the secret parameter to obtain first exchange data when decrypting the first encrypted data.
An embodiment of the present invention further provides a data exchanging apparatus, including:
the key generation module is used for receiving a key distribution request sent by a preset first communication node and generating a first communication key and a second communication key; the first communication key is different from the second communication key;
a secret parameter generation module for generating a secret parameter using the first communication key and the second communication key;
a key sending module, configured to send the first communication key to the first communication node, and send the second communication key to a preset second communication node, where the first communication key is used to encrypt preset first exchange data to generate first encrypted data, and the second communication key is used to encrypt preset second exchange data to generate second encrypted data;
a first acknowledgement exchange information receiving module, configured to receive first acknowledgement exchange information sent by the first communication node; the first confirmation exchange information is generated after the first communication node receives the second encrypted data sent by the second communication node;
a second acknowledgement exchange information receiving module, configured to receive second acknowledgement exchange information sent by the second communication node; the second acknowledgement exchange information is generated after the second communication node receives the first encrypted data sent by the first communication node;
a secret parameter sending module, configured to send the secret parameter to the first communication node and the second communication node, respectively, in response to the first acknowledgement exchange information and the second acknowledgement exchange information; the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchanged data, and the secret parameter is also used for the second communication node to decrypt the first encrypted data to obtain first exchanged data.
Optionally, the secret parameter generation module includes:
and the secret parameter generation submodule is used for carrying out bitwise XOR on the first communication key and the second communication key to generate secret parameters.
Optionally, the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchange data, and includes:
and the secret parameter is used for performing bitwise exclusive OR on the second encrypted data, the first communication key and the secret parameter to obtain second exchange data when the first communication node decrypts the second encrypted data.
Optionally, the secret parameter is further used for the second communication node to decrypt the first encrypted data to obtain first exchanged data, and the method includes:
the secret parameter is further used for the second communication node to perform bitwise exclusive or on the first encrypted data, the second communication key and the secret parameter to obtain first exchange data when decrypting the first encrypted data.
An embodiment of the present invention further provides an electronic device, where the device includes a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the data exchange method according to any one of the above instructions in the program code.
An embodiment of the present invention further provides a computer-readable storage medium, which is used for storing a program code, where the program code is used for executing the data exchange method described in any one of the above.
According to the technical scheme, the invention has the following advantages: the invention distributes different random communication keys for the communication nodes of data exchange through the communication server, generates the secret parameter and ensures the fairness of data exchange through the secret parameter. The communication nodes encrypt their own exchange data using different communication keys, and send them to each other, and then request the communication server to publish the secret parameters. After the data exchange between the communication nodes is completed, the communication server publishes the secret parameter, and the communication nodes can decrypt the encrypted data of the other party by using the secret parameter. The fairness of data exchange is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating steps of a data exchange method according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a data exchange method according to an embodiment of the present invention;
fig. 3 is a block diagram of a data exchange device according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a data exchange method, a data exchange device, electronic equipment and a storage medium, which are used for solving the technical problem of low fairness of data exchange.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a data exchange method according to an embodiment of the present invention.
The invention provides a data exchange method, which is applied to a communication server; the method specifically comprises the following steps:
step 101, receiving a key distribution request sent by a preset first communication node, and generating a first communication key and a second communication key; the first communication key is different from the second communication key;
a key is a parameter that is input in an algorithm that converts plaintext into ciphertext or converts ciphertext into plaintext.
In the embodiment of the present invention, when a first communication node needs to perform data exchange with a second communication node, the first communication node may send a key distribution request to a communication server, and request the communication server to randomly generate a communication key for the first communication node and the second communication node that need to perform data exchange. Wherein the first communication key and the second communication key cannot be the same for security and fairness of the data exchange process.
Step 102, generating a secret parameter by adopting a first communication key and a second communication key;
after the first and second communication keys are randomly generated, the secret parameter may be generated using the first and second communication keys.
In one example, the step of generating the secret parameter using the first communication key and the second communication key may include:
and carrying out bitwise XOR on the first communication key and the second communication key to generate a secret parameter.
XOR is also called half-add, which is equivalent to binary addition without carry: if 1 represents true and 0 represents false in binary system, the algorithm of exclusive or is:
Figure BDA0003354760900000051
Figure BDA0003354760900000052
(same as 0, different as 1), these rules are the same as addition, except that there is no carry, so exclusive or is often considered as a no-carry addition. Bitwise xor refers to xoring each bitwise character of the first communication key with a character corresponding to the second communication key.
103, sending a first communication key to the first communication node, and sending a second communication key to a preset second communication node, wherein the first communication key is used for encrypting preset first exchange data to generate first encrypted data, and the second communication key is used for encrypting preset second exchange data to generate second encrypted data;
in the embodiment of the present invention, after randomly generating the first communication key and the second communication key, the communication server may send the first communication key and the second communication key to the first communication node and the second communication node, respectively. The first communication node may encrypt first exchange data to be exchanged with the second communication node using the first communication key. The second communication node may encrypt second exchange data to be exchanged with the first communication node using the second communication key. In one example, bitwise xor operation may be performed on the first communication key and the first exchange data to obtain first encrypted data, and bitwise xor operation may be performed on the second communication key and the second exchange data to obtain second encrypted data.
Since the first communication key and the second communication key are generated randomly, are not equal to each other, and are held by both parties of communication, the first encrypted data and the second encrypted data generated after encryption cannot be directly decrypted by the other party.
In one example, the lengths of the first communication key and the second communication key may be determined according to the lengths of the first exchange data and the second exchange data, respectively, and are generally not less than the length of data exchanged by both communication parties. If the exchanged data is too long, in order to improve efficiency, a suitable key length, such as 512bit, 1024bit, 2048bit, etc., can be selected according to actual conditions, and the key is multiplexed, such as grouping or sectionally encrypting the data.
Further, in order to prevent the first communication key and the second communication key from being eavesdropped during transmission, the first communication key and the second communication key may be encrypted by using public keys of the first communication node and the second communication node, respectively, or by using a key agreed in advance by the communication server and the first communication node and the second communication node.
Step 104, receiving first confirmation exchange information sent by a first communication node; the first confirmation exchange information is generated after the first communication node receives second encrypted data sent by the second communication node;
step 105, receiving second confirmation exchange information sent by the second communication node; the second confirmation exchange information is generated after the second communication node receives the first encrypted data sent by the first communication node;
in an embodiment of the present invention, the first communication node may transmit the first encrypted data to the second communication node, and the second communication node may transmit the second encrypted data to the first communication node. After receiving the encrypted data sent by the other party, the first communication node and the second communication node may respectively send first acknowledgement exchange information and second acknowledgement exchange information to the communication server to inform the communication server that the communication server itself has received the encrypted data from the other party.
Step 106, responding to the first confirmation exchange information and the second confirmation exchange information, and respectively sending secret parameters to the first communication node and the second communication node; the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchange data, and the secret parameter is also used for the second communication node to decrypt the first encrypted data to obtain the first exchange data.
After receiving the first confirmation exchange information of the first communication node and the second confirmation exchange information of the second communication node, the communication server confirms that the first communication node and the second communication node complete the data exchange behavior, and at this time, the communication server can respectively send the secret parameters to the first communication node and the second communication node, so that the first communication node and the second communication node can decrypt the received encrypted data based on the secret parameters.
The secret parameter is used for ensuring the fairness of data exchange, when the secret parameter is lacked, both communication parties can not decrypt the data of the other party independently, only after the two communication parties confirm that the receiving is completed, the communication server can disclose the secret parameter, and the two communication parties can decrypt the data by using the secret parameter. This effectively prevents one of the parties from not transmitting data to the other party after receiving the exchange data.
In one example, the step of using the secret parameter for the first communication node to decrypt the second encrypted data to obtain the second exchanged data includes:
and the secret parameter is used for carrying out bitwise XOR on the second encrypted data, the first communication key and the secret parameter to obtain second exchange data when the first communication node decrypts the second encrypted data.
The secret parameter is further used for the second communication node to decrypt the first encrypted data to obtain the first exchange data, and the method comprises the following steps:
the secret parameter is also used for the second communication node to carry out bitwise XOR on the first encrypted data, the second communication key and the secret parameter to obtain first exchange data when decrypting the first encrypted data.
In a specific implementation, the first communication node may decrypt the second encrypted data using the first communication key and the secret parameter to obtain the exchanged data, and may perform a bitwise xor operation on the second encrypted data, the first communication key, and the secret parameter in sequence to decrypt the second exchanged data.
Similarly, the second communication node may decrypt the first encrypted data using the second communication key and the secret parameter to obtain the exchanged data, and the specific process may be that the first encrypted data, the second communication key, and the secret parameter are sequentially subjected to bitwise xor operation to obtain the first exchanged data through decryption.
It should be noted that, since the communication key allocated to the communication node is required for decryption, even if the other nodes obtain the secret parameter, the other nodes cannot decrypt the ciphertext data without knowing the communication key, and thus publishing the secret parameter does not cause leakage of the encrypted data. Of course, in order to improve security, the secret parameter may be further encrypted when transmitted to the communication node.
In one example, the communication server may also function as an arbitration. After the first communication node or the second communication node decrypts the encrypted data, the decrypted data can be verified, and when the data is found to be invalid, complaints can be made to the communication server. The communication server simultaneously masters the first communication key and the second communication key, so that the first encrypted data and the second encrypted data can be decrypted and verified, when the data are determined to be invalid, an illegal party can be punished, and the punishment mode is not specifically limited in the embodiment of the invention. This can prevent one of the two communicating parties from cheating the other party for valid data through invalid data.
For ease of understanding, the embodiments of the present invention are described below by way of specific examples, and for convenience of calculation, the exchange data and the key are assumed to be 32 bits and expressed by 16-ary.
Secret key K randomly distributed for communication nodes by assuming communication server1And K2Respectively as follows:
K1=0xB2F6B12D
K2=0xE4123C4E
communication server pair key K1And K2Carrying out bitwise XOR to obtain a secret parameter S:
Figure BDA0003354760900000081
assume a communication node's exchange data D1And D2Respectively as follows:
D1=0xF5941F73
D2=0x8C165125
the communication node uses a secret key K1And K2Respectively for exchanging data D1And D2Encrypting to obtain encrypted data E1And E2
Figure BDA0003354760900000082
Figure BDA0003354760900000083
After the communication node completes the encrypted data exchange, the communication server publishes the secret parameter S. For the communication node 1, the communication key K will be utilized1And secret parameter S, the encrypted number transmitted to the communication node 2According to E2Decrypting to obtain D'2
Figure BDA0003354760900000084
For the communication node 2, the communication key K will be utilized2And secret parameter S, encrypted data E sent to the communication node 11Decrypting to obtain D'1
Figure BDA0003354760900000085
From the result, D 'was obtained'2And D2Same, D'1And D1Similarly, the first communication node and the second communication node successfully complete data exchange.
The invention distributes different random communication keys for the communication nodes of data exchange through the communication server, generates the secret parameter and ensures the fairness of data exchange through the secret parameter. The communication nodes encrypt their own exchange data using different communication keys, and send them to each other, and then request the communication server to publish the secret parameters. After the data exchange between the communication nodes is completed, the communication server publishes the secret parameter, and the communication nodes can decrypt the encrypted data of the other party by using the secret parameter. The fairness of data exchange is improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating a data exchange method according to an embodiment of the present invention.
The data exchange method provided by the embodiment of the invention can comprise four stages, including a key and secret parameter generation stage, a data encryption stage, a data exchange stage and a data decryption stage. The specific process is as follows:
key and secret parameter generation stage:
when two communication nodes need to exchange data, one of the communication nodes, such as a first communication node, sends a key distribution request to a communication server;
communication serverAfter receiving the key distribution request, randomly generating a first communication key K1And a second communication key K2
Communication server pair key K1And K2Performing bitwise XOR to generate a secret parameter S,
Figure BDA0003354760900000091
the communication server sends the secret key K1And K2Respectively, to the first and second communication nodes separately.
A data encryption stage:
the first communication node and the second communication node respectively determine exchange data;
first communication node uses key K1For the first exchange data D1Encrypting to obtain first encrypted data E1
Figure BDA0003354760900000092
Second communication node using key K2For second exchange data D2Encrypting to obtain second encrypted data E2
Figure BDA0003354760900000093
And (3) a data exchange stage:
the first communication node encrypts the first encrypted data E1Sending the information to a second communication node; the second communication node encrypts the second encrypted data E2Sending to the first communication node;
after receiving ciphertext data sent by the opposite side, the first communication node and the second communication node respectively generate first confirmation exchange information and second confirmation exchange information;
the first communication node and the second communication node respectively send the first confirmation exchange information and the second confirmation exchange information to the communication server;
after receiving first confirmation exchange information of a first communication node and second confirmation exchange information of a second communication node, the communication server discloses a secret parameter S;
the communication server sends the secret parameter S to the first communication node and the second communication node.
And a data decryption stage:
the first communication node uses the first key K1And secret parameter S to second encrypted data E2Decrypting to obtain the exchange data D2
Figure BDA0003354760900000101
Second communication node using key K2For first encrypted data E with secret parameter S1Decrypting to obtain the exchange data D1
Figure BDA0003354760900000102
The data decryption may be performed by a bitwise exclusive-or operation.
Referring to fig. 3, fig. 3 is a block diagram of a data exchanging apparatus according to an embodiment of the present invention.
The embodiment of the invention provides a data exchange device, which comprises:
a key generation module 301, configured to receive a key distribution request sent by a preset first communication node, and generate a first communication key and a second communication key; the first communication key is different from the second communication key;
a secret parameter generation module 302, configured to generate a secret parameter using the first communication key and the second communication key;
a key sending module 303, configured to send a first communication key to a first communication node, and send a second communication key to a preset second communication node, where the first communication key is used to encrypt preset first exchange data to generate first encrypted data, and the second communication key is used to encrypt preset second exchange data to generate second encrypted data;
a first acknowledgement exchange information receiving module 304, configured to receive first acknowledgement exchange information sent by a first communication node; the first confirmation exchange information is generated after the first communication node receives second encrypted data sent by the second communication node;
a second acknowledgment exchange information receiving module 305, configured to receive second acknowledgment exchange information sent by the second communication node; the second confirmation exchange information is generated after the second communication node receives the first encrypted data sent by the first communication node;
a secret parameter sending module 306, configured to send a secret parameter to the first communication node and the second communication node in response to the first acknowledgment exchange information and the second acknowledgment exchange information, respectively; the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchange data, and the secret parameter is also used for the second communication node to decrypt the first encrypted data to obtain the first exchange data.
In this embodiment of the present invention, the secret parameter generating module 303 includes:
and the secret parameter generation submodule is used for carrying out bitwise XOR on the first communication key and the second communication key to generate secret parameters.
In this embodiment of the present invention, the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain the second exchange data, and includes:
and the secret parameter is used for carrying out bitwise XOR on the second encrypted data, the first communication key and the secret parameter to obtain second exchange data when the first communication node decrypts the second encrypted data.
In this embodiment of the present invention, the secret parameter is further used for the second communication node to decrypt the first encrypted data to obtain the first exchanged data, and includes:
the secret parameter is also used for the second communication node to carry out bitwise XOR on the first encrypted data, the second communication key and the secret parameter to obtain first exchange data when decrypting the first encrypted data.
An embodiment of the present invention further provides an electronic device, where the device includes a processor and a memory:
the memory is used for storing the program codes and transmitting the program codes to the processor;
the processor is used for executing the data exchange method of the embodiment of the invention according to the instructions in the program codes.
The embodiment of the invention also provides a computer-readable storage medium, which is used for storing the program code, and the program code is used for executing the data exchange method of the embodiment of the invention.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present invention are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the embodiments of the invention.
Finally, it should also be 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 terminal 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 terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A data exchange method is applied to a communication server; the method comprises the following steps:
receiving a key distribution request sent by a preset first communication node, and generating a first communication key and a second communication key; the first communication key is different from the second communication key;
generating a secret parameter using the first communication key and the second communication key;
sending the first communication key to the first communication node, and sending the second communication key to a preset second communication node, wherein the first communication key is used for encrypting preset first exchange data to generate first encrypted data, and the second communication key is used for encrypting preset second exchange data to generate second encrypted data;
receiving first confirmation exchange information sent by the first communication node; the first confirmation exchange information is generated after the first communication node receives the second encrypted data sent by the second communication node;
receiving second confirmation exchange information sent by the second communication node; the second acknowledgement exchange information is generated after the second communication node receives the first encrypted data sent by the first communication node;
sending the secret parameter to the first communication node and the second communication node, respectively, in response to the first acknowledgment exchange information and the second acknowledgment exchange information; the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchanged data, and the secret parameter is also used for the second communication node to decrypt the first encrypted data to obtain first exchanged data.
2. The method of claim 1, wherein the step of generating secret parameters using the first communication key and the second communication key comprises:
and carrying out bitwise XOR on the first communication key and the second communication key to generate a secret parameter.
3. The method according to claim 1, wherein the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchanged data, and the method comprises:
and the secret parameter is used for performing bitwise exclusive OR on the second encrypted data, the first communication key and the secret parameter to obtain second exchange data when the first communication node decrypts the second encrypted data.
4. The method according to claim 1, wherein the secret parameter is further used for the second communication node to decrypt the first encrypted data to obtain the first exchanged data, and the method comprises:
the secret parameter is further used for the second communication node to perform bitwise exclusive or on the first encrypted data, the second communication key and the secret parameter to obtain first exchange data when decrypting the first encrypted data.
5. A data exchange device, comprising:
the key generation module is used for receiving a key distribution request sent by a preset first communication node and generating a first communication key and a second communication key; the first communication key is different from the second communication key;
a secret parameter generation module for generating a secret parameter using the first communication key and the second communication key;
a key sending module, configured to send the first communication key to the first communication node, and send the second communication key to a preset second communication node, where the first communication key is used to encrypt preset first exchange data to generate first encrypted data, and the second communication key is used to encrypt preset second exchange data to generate second encrypted data;
a first acknowledgement exchange information receiving module, configured to receive first acknowledgement exchange information sent by the first communication node; the first confirmation exchange information is generated after the first communication node receives the second encrypted data sent by the second communication node;
a second acknowledgement exchange information receiving module, configured to receive second acknowledgement exchange information sent by the second communication node; the second acknowledgement exchange information is generated after the second communication node receives the first encrypted data sent by the first communication node;
a secret parameter sending module, configured to send the secret parameter to the first communication node and the second communication node, respectively, in response to the first acknowledgement exchange information and the second acknowledgement exchange information; the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchanged data, and the secret parameter is also used for the second communication node to decrypt the first encrypted data to obtain first exchanged data.
6. The apparatus of claim 5, wherein the secret parameter generation module comprises:
and the secret parameter generation submodule is used for carrying out bitwise XOR on the first communication key and the second communication key to generate secret parameters.
7. The apparatus according to claim 5, wherein the secret parameter is used for the first communication node to decrypt the second encrypted data to obtain second exchanged data, and includes:
and the secret parameter is used for performing bitwise exclusive OR on the second encrypted data, the first communication key and the secret parameter to obtain second exchange data when the first communication node decrypts the second encrypted data.
8. The apparatus according to claim 5, wherein the secret parameter is further used for the second communication node to decrypt the first encrypted data to obtain first exchanged data, and the method comprises:
the secret parameter is further used for the second communication node to perform bitwise exclusive or on the first encrypted data, the second communication key and the secret parameter to obtain first exchange data when decrypting the first encrypted data.
9. An electronic device, comprising a processor and a memory:
the memory is used for storing program codes and transmitting the program codes to the processor;
the processor is configured to execute the data exchange method of any one of claims 1-4 according to instructions in the program code.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium is configured to store a program code for performing the data exchange method of any one of claims 1-4.
CN202111348231.8A 2021-11-15 2021-11-15 Data exchange method and device, electronic equipment and storage medium Pending CN114070562A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111348231.8A CN114070562A (en) 2021-11-15 2021-11-15 Data exchange method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111348231.8A CN114070562A (en) 2021-11-15 2021-11-15 Data exchange method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114070562A true CN114070562A (en) 2022-02-18

Family

ID=80272223

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111348231.8A Pending CN114070562A (en) 2021-11-15 2021-11-15 Data exchange method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114070562A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020049601A1 (en) * 1998-10-28 2002-04-25 Nadarajah Asokan Optimistic fair exchange protocols
CN1692338A (en) * 2002-10-30 2005-11-02 松下电器产业株式会社 Inter-device data exchange system device used for it exchange completion data management device and program
CN101266672A (en) * 2007-03-14 2008-09-17 电子科技大学 A fair exchange method involving credit mechanism based on Gradual Release
CN101567788A (en) * 2009-04-15 2009-10-28 长沙理工大学 Method for even exchange of signature data for resisting attack of ring enlargement
US20130212388A1 (en) * 2012-02-13 2013-08-15 Alephcloud Systems, Inc. Providing trustworthy workflow across trust boundaries
CN110298661A (en) * 2019-07-01 2019-10-01 贵州大学 Big data Secure Fair based on intelligent contract exchanges method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020049601A1 (en) * 1998-10-28 2002-04-25 Nadarajah Asokan Optimistic fair exchange protocols
CN1692338A (en) * 2002-10-30 2005-11-02 松下电器产业株式会社 Inter-device data exchange system device used for it exchange completion data management device and program
CN101266672A (en) * 2007-03-14 2008-09-17 电子科技大学 A fair exchange method involving credit mechanism based on Gradual Release
CN101567788A (en) * 2009-04-15 2009-10-28 长沙理工大学 Method for even exchange of signature data for resisting attack of ring enlargement
US20130212388A1 (en) * 2012-02-13 2013-08-15 Alephcloud Systems, Inc. Providing trustworthy workflow across trust boundaries
CN110298661A (en) * 2019-07-01 2019-10-01 贵州大学 Big data Secure Fair based on intelligent contract exchanges method

Similar Documents

Publication Publication Date Title
CN113424185B (en) Fast inadvertent transmission
CN113259329B (en) Method and device for data careless transmission, electronic equipment and storage medium
CN102868528B (en) A kind of equipment of the generation verified of public-key cryptography and corresponding authentication center
US8670563B2 (en) System and method for designing secure client-server communication protocols based on certificateless public key infrastructure
EP2014000B1 (en) Method for elliptic curve public key cryptographic validation
JP5544355B2 (en) Method and system for verifying shared secrets
KR101747888B1 (en) Method for generating an encryption/ decryption key
EP1992101A2 (en) Secure data transmission using undiscoverable or black data
EP2962420B1 (en) Network device configured to derive a shared key
US7783045B2 (en) Secure approach to send data from one system to another
CN111478911A (en) Instant messaging encryption method adopting lightweight key exchange algorithm
JP6041864B2 (en) Method, computer program, and apparatus for data encryption
JP2022500920A (en) Systems and methods for sharing common secrets implemented by computers
CN112737783B (en) Decryption method and device based on SM2 elliptic curve
CN101296077A (en) Identity authentication system based on bus type topological structure
CN114070562A (en) Data exchange method and device, electronic equipment and storage medium
CN111488618B (en) Block chain-based one-time pad encryption method, device and storage medium
CN114070550A (en) Information processing method, device, equipment and storage medium
US7327845B1 (en) Transmission of encrypted messages between a transmitter and a receiver utilizing a one-time cryptographic pad
CN110572788A (en) Wireless sensor communication method and system based on asymmetric key pool and implicit certificate
JP2007516633A (en) Method and related apparatus for encoding / decoding messages
JP2007516633A5 (en)
CN117150568A (en) Data set privacy intersection method and system based on unidirectional careless hash function
CN116996291A (en) Nuclear power real-time protection communication-oriented data transmission method, equipment and medium
CN115348012A (en) Key determination method and device, electronic equipment and 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