WO2024001037A1 - 一种消息传输方法、装置、电子设备和存储介质 - Google Patents

一种消息传输方法、装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2024001037A1
WO2024001037A1 PCT/CN2022/135607 CN2022135607W WO2024001037A1 WO 2024001037 A1 WO2024001037 A1 WO 2024001037A1 CN 2022135607 W CN2022135607 W CN 2022135607W WO 2024001037 A1 WO2024001037 A1 WO 2024001037A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
blockchain node
node
key
encrypted
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.)
Ceased
Application number
PCT/CN2022/135607
Other languages
English (en)
French (fr)
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Publication of WO2024001037A1 publication Critical patent/WO2024001037A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • 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/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0819Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s)
    • H04L9/083Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) involving central third party, e.g. key distribution center [KDC] or trusted third party [TTP]
    • H04L9/0833Key transport or distribution, i.e. key establishment techniques where one party creates or otherwise obtains a secret value, and securely transfers it to the other(s) involving central third party, e.g. key distribution center [KDC] or trusted third party [TTP] involving conference or group key
    • 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/0816Key establishment, i.e. cryptographic processes or cryptographic protocols whereby a shared secret becomes available to two or more parties, for subsequent use
    • H04L9/0838Key agreement, i.e. key establishment technique in which a shared key is derived by parties as a function of information contributed by, or associated with, each of these

Definitions

  • the embodiments of this specification belong to the field of blockchain technology, and in particular relate to a message transmission method, device, electronic device and storage medium.
  • Blockchain is a new application model of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • data blocks are combined into a chained data structure in a chronological manner and are cryptographically guaranteed to be an untamperable and unforgeable distributed ledger. Due to the characteristics of blockchain, such as decentralization, non-tamperable information, and autonomy, blockchain has also received more and more attention and applications.
  • each blockchain node directly uses P2P (Peer to Peer, point-to-point) technology to communicate to transmit transactions, blocks, etc.
  • P2P Peer to Peer, point-to-point
  • blockchain nodes often An encrypted channel is established, thereby enabling encrypted communication. Since each encrypted channel is independent and its corresponding keys or encryption strategies are different, in the scenario of multicast or broadcast of messages, the source blockchain node needs to follow the instructions of multiple destination blockchains. Multiple keys corresponding to multiple encrypted channels connected by nodes encrypt the same plaintext message multiple times and then send it to other blockchain nodes respectively, which brings a huge computational burden to the source blockchain node. Affects the efficiency of encrypted communication between blockchain nodes.
  • the purpose of this specification is to provide a message transmission method, device, electronic device and storage medium.
  • a message transmission method is proposed, applied to a source blockchain node, each blockchain node in the blockchain node group to which the source blockchain node belongs All maintain the same shared key; the method includes:
  • the plaintext is modified based on the shared key. Messages are encrypted to obtain encrypted messages;
  • a message transmission device which is applied to a source blockchain node, and each blockchain node in the blockchain node group to which the source blockchain node belongs All maintain the same shared key; the device includes:
  • An encryption unit configured to perform encryption based on the shared secret when the destination blockchain node corresponding to the plaintext message includes at least two blockchain nodes in the blockchain node group except the source blockchain node. Use the key to encrypt the plaintext message to obtain the encrypted message;
  • a sending unit configured to send the encrypted message to the at least two blockchain nodes, and the at least two blockchain nodes are configured to decrypt the encrypted message based on the shared key maintained by each. Get the clear text message.
  • an electronic device including:
  • Memory used to store instructions executable by the processor
  • the processor implements the method described in the first aspect by running the executable instructions.
  • a computer-readable storage medium on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the first aspect are implemented.
  • the source blockchain node when the source blockchain node performs broadcast or multicast, since at least two blockchain nodes of the source blockchain node and the destination blockchain node jointly maintain the same shared key, therefore The source blockchain node can use the shared key to encrypt the plaintext message once and send it to the at least two blockchain nodes, thereby reducing the number of encryption times of the plaintext message in multicast or broadcast scenarios, while ensuring communication security. Reduce the computational burden of source blockchain nodes and improve the efficiency of encrypted communication between blockchain nodes.
  • Figure 1 is a schematic diagram of a scenario of interaction between blockchain nodes provided by an exemplary embodiment.
  • Figure 2 is a flow chart of a message transmission method provided by an exemplary embodiment.
  • Figure 3 is a schematic diagram of a broadcast scenario provided by a source blockchain node according to an exemplary embodiment.
  • Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • Figure 5 is a block diagram of a message transmission device provided in an exemplary embodiment.
  • SSL Secure Socket Layer
  • TLS Transport Layer Security Protocol
  • IPsec Internet Protocol Security (Internet Security Protocol), etc.
  • end-to-end encryption protocols to achieve encrypted communication.
  • the blockchain node Node A needs to send a blockchain message to the blockchain node Node B
  • Node A and Node B can perform key negotiation based on the SSL protocol, so that the negotiated transmission key can be used in the An SSL link is established between Node A and Node B.
  • the blockchain messages are in ciphertext state (encrypted by the above-mentioned transmission key) when transmitted within the SSL link, and only Node A and Node B holding the transmission key can decrypt the corresponding message plaintext. .
  • each encrypted channel established between blockchain nodes is independent.
  • the keys or encryption strategies of multiple encrypted channels established by the same blockchain node and other different blockchain nodes are different, which means For a source blockchain node that needs to broadcast or multicast the same plaintext message to multiple other destination blockchain nodes at the same time, it needs to send the plaintext message according to the multicast message established between multiple destination blockchain nodes.
  • the keys and encryption strategies corresponding to each encrypted channel are encrypted independently multiple times to obtain multiple encrypted messages, and then these multiple encrypted messages are sent to the corresponding other multiple destination blockchain nodes through the corresponding encrypted channels.
  • Figure 1 is a schematic diagram of an interaction scenario between blockchain nodes provided by an exemplary embodiment.
  • this scenario contains a total of 4 blockchain nodes Node A, Node B, Node C and Node D. They all have encrypted channels established with each other to achieve encrypted communication.
  • the encrypted channels established between blockchain nodes are independent of each other.
  • Node A, Node B, Node C, and Node D each establish three unrelated encrypted channels, tunnel_AB, tunnel_AC, and tunnel_AD.
  • Node A when Node A needs to broadcast messages to Node B, Node C, and Node D at the same time, Node A will encrypt the plaintext message to be broadcast based on the keys corresponding to tunnel_AB, tunnel_AC, and tunnel_AD respectively to obtain three different encrypted messages msg_AB, msg_AC, msg_AD, then send msg_AB to Node B through tunnel_AB, send msg_AC to Node C through tunnel_AC, and send msg_AD to Node D through tunnel_AD. It is not difficult to find that in order to broadcast the same plaintext message to the other three blockchain nodes, Node A needs to encrypt the plaintext message three times independently.
  • Blockchain nodes will undertake a large number of message broadcast tasks, which means that as the scale of the blockchain network gradually increases and the number of blockchain nodes increases, its communication overhead will increase with a quadratic function.
  • this specification proposes a message transmission scheme that reduces the number of times of encryption of plain text messages in multicast or broadcast scenarios by establishing a blockchain node group in the blockchain node and maintaining the same shared key. , while also ensuring communication security.
  • Figure 2 is a flow chart of a message transmission method provided by an exemplary embodiment, wherein the method is applied to a source blockchain node, and each block in the blockchain node group to which the source blockchain node belongs All chain nodes maintain the same shared key; the method includes:
  • the source blockchain node refers to the blockchain node that is the message sender in an interaction between blockchain nodes. Therefore, there is generally only one source blockchain node, and the destination area A blockchain node refers to a blockchain node that is the receiver of a message in an interaction between blockchain nodes. Obviously the receiver of a message is not unique, so the number of destination blockchain nodes is not unique either. It can be one or multiple.
  • blockchain nodes that can communicate with each other can be managed according to the group management method of the blockchain node group, so that each blockchain node in the same blockchain node group maintains the same shared key.
  • several blockchain nodes can maintain a common shared key through group key negotiation in advance, and thus be organized into a blockchain node group based on online negotiation; or, several blockchain nodes can be organized offline The same key is manually entered as a shared key, and is organized into a blockchain node group based on offline entry; or, the node devices where several blockchain nodes are located are bound to the same key.
  • these several blockchain nodes will read the same key from the node device where they are located and use it as a shared key, and then they will be jointly organized into a blockchain node group based on device binding.
  • they will first encrypt the plaintext message according to the jointly maintained shared key to obtain the encrypted message, and then transmit the encrypted message. From then on, Regardless of whether the encrypted message undergoes any processing during transmission or is stolen by an attacker, since the shared key is only maintained by blockchain nodes within the same blockchain node group, it is theoretically excluded that the plaintext message is transmitted during transmission. the possibility of being exposed.
  • the shared key involved in the embodiments of this specification is a symmetric key. Therefore, when a blockchain node receives encrypted messages from other blockchain nodes belonging to the same blockchain node group, it can directly use the shared key based on the shared key. key to decrypt to obtain the plaintext message.
  • each blockchain node in the blockchain node group is in the same blockchain network or a different blockchain network.
  • the source blockchain node and the destination block Chain nodes can be on the same blockchain network or different blockchain networks.
  • blockchain node groups and blockchain networks are not the same concept, which means that blockchain node members belonging to the same blockchain node group are not necessarily in the same blockchain network.
  • Each blockchain node in the same blockchain network is not necessarily in the same blockchain node group.
  • the original intention of the blockchain node group involved in the embodiments of this specification is to realize secure communication among members of the blockchain node group.
  • the different blockchain networks are isomorphic or heterogeneous to each other. For example, between the source blockchain node and When the destination blockchain node is in a different blockchain network, the source blockchain network where the source blockchain node is located is the same as the destination blockchain network where the destination blockchain node is located.
  • the blockchain nodes in the blockchain node group are not required to have the same blockchain architecture, that is, multiple blockchain networks involved in each blockchain node in a blockchain node group Isomorphism is not necessarily required. With the same blockchain protocol, consensus protocol, etc., multiple blockchain networks involved can also be heterogeneous.
  • heterogeneous blockchains in a narrow sense usually refer to obvious differences in the values circulating on the blockchain; that is, between two blockchains with obvious differences in the values circulating, it is usually possible to Call it a heterogeneous blockchain.
  • the Bitcoin network and Ethereum are heterogeneous blockchains in a narrow sense.
  • Heterogeneous blockchain in a broad sense means that there are obvious differences in the types of blockchains and/or the blockchain protocols adopted; that is, there are obvious differences in the types of blockchains and/or the blockchain protocols adopted. Between two blockchains, it can usually be called a heterogeneous blockchain.
  • ANT CHAIN and hyperledger fabric blockchain are heterogeneous blockchains in a broad sense.
  • the same blockchain node can belong to multiple different blockchain node groups at the same time. Therefore, for any blockchain node, it can locally maintain multiple nodes that it belongs to. List of members of the blockchain node group and their corresponding shared keys.
  • the source blockchain node first searches for at least one pre-maintained blockchain node group locally and determines the relationship between itself and the destination blockchain.
  • the blockchain node group to which the nodes belong together (there may be multiple), and then encrypts the plain text message based on the shared key corresponding to the locally maintained blockchain node group to obtain the encrypted message, so that the destination blockchain node After receiving the encrypted message, the plaintext message can be decrypted based on the shared key of the blockchain node group.
  • the destination blockchain node includes at least two blockchain nodes, it is necessary to locally find out the source blockchain node and the at least two blockchain nodes that are the destination blockchain node.
  • the blockchain node group is then encrypted based on the corresponding shared key.
  • the source blockchain node When the source blockchain node responds to a multicast or broadcast task, it may not necessarily be triggered to execute the message transmission method involved in the embodiments of this specification. This is because although the multicast and broadcast tasks both send the same message to at least two areas, The blockchain node meets the condition that the destination blockchain node corresponding to the plain text message includes at least two blockchain nodes. However, the triggering condition in this case is actually that the destination blockchain node corresponding to the plain text message includes the above-mentioned blockchain node group. At least two blockchain nodes other than the source blockchain node. In other words, the message transmission method involved in the implementation of this specification not only depends on the scenario of performing multicast or broadcast tasks, but also needs to ensure that it serves as the destination area.
  • At least two blockchain nodes of the blockchain node belong to the same blockchain node group as the source blockchain node, and both are node members in the same blockchain node group. Therefore, for a multicast or broadcast task, the source blockchain node first determines the plaintext message to be sent and the destination blockchain node to be sent, and determines the result by looking up the member list of the locally maintained blockchain node group. After the destination blockchain node belongs to a blockchain node group, the plaintext message will be encrypted according to the shared key corresponding to the determined blockchain node group to obtain the encrypted message, and finally the encrypted message will be sent to the The destination blockchain node of at least two blockchain nodes.
  • FIG. 3 is a schematic diagram of a broadcast scenario provided by a source blockchain node according to an exemplary embodiment, in which the source blockchain node is blockchain node A in the figure, and the destination blockchain node There are a total of 7 blockchain nodes including blockchain nodes B to H. It can be found that blockchain nodes B, C, and D in the destination blockchain node and blockchain node A belong to blockchain node group 1.
  • blockchain nodes A, B, C, and D jointly maintain the shared key corresponding to blockchain node group 1, while blockchain node E in the destination blockchain does not belong to any blockchain node group.
  • blockchain node group F belongs to blockchain node group 3
  • the node members of blockchain node group 3 do not include at least two destination blockchain nodes, nor does it include blockchain node A, so this Some of them will not trigger the execution of the message transmission method involved in this manual, and the blockchain nodes G and H belong to the blockchain node group 2 together with the blockchain node A, and jointly maintain the shares corresponding to the blockchain node group 2. key.
  • blockchain node A will first retrieve the member list of the blockchain node group maintained by itself based on the destination blockchain node, and then in the determination area After blockchain nodes B, C, D and blockchain node A belong to blockchain node group 1, and blockchain nodes G, H and blockchain node A belong to blockchain node group 2, the plaintext message They are encrypted based on the shared key corresponding to blockchain node group 1 and sent to blockchain nodes B, C, and D, and the plaintext message is encrypted based on the shared key corresponding to blockchain node group 2 and sent to Blockchain nodes G and H, as well as blockchain nodes E and F, need to use blockchain node A and their separately established encrypted channels to encrypt and transmit plaintext messages. Therefore, blockchain node A has a total of Four encryption calculations were performed, which is significantly lower than the traditional method of encrypting transmission separately based on the encrypted channel established with each destination blockchain node (requiring seven encryption calculations for the plaintext message). Calculate consumption.
  • encrypting the plaintext message based on the shared key to obtain an encrypted message includes: based on a security parameter index contained in the plaintext message, determining a security association policy corresponding to the security parameter index; The plaintext message is encrypted based on the shared key included in the security association policy to obtain the encrypted message.
  • the source blockchain node determines that the destination blockchain node corresponding to the plaintext message includes at least two blockchain nodes and the at least two blockchain nodes and the source blockchain node belong to the same Blockchain node group.
  • the source blockchain node will encapsulate the plaintext message to be sent according to the preset protocol such as IPsec protocol, add the SPI (security parameters index, security parameter index) field to it and then deliver it to the source blockchain.
  • the encryption computing module in the node performs further encryption processing.
  • the encryption computing module After receiving the plaintext message carrying the SPI, the encryption computing module will retrieve the locally pre-maintained SA (security assist, security association policy) based on the SPI, and then obtain the The shared key contained in the SA (that is, the shared key corresponding to the determined blockchain node group) encrypts the plaintext message to obtain the encrypted message and sends the encrypted message carrying SPI to the destination blockchain node, destination area
  • the block link After the block link receives the encrypted message carrying SPI, it can retrieve the locally pre-maintained SA through the SPI field carried in the encrypted message, and then use the shared key contained in the retrieved SA (that is, the determined blockchain node group corresponding shared key) to decrypt the ciphertext message to obtain the plaintext message.
  • the embodiments of this specification are equivalent to establishing a new encrypted channel between the source blockchain node and the destination blockchain node to implement the message transmission method involved in the embodiments of this specification.
  • the at least two private keys maintained by the source blockchain node and corresponding to the at least two point-to-point encrypted channels respectively established between the at least two blockchain nodes are the shared keys; Encrypting the plaintext message based on the shared key to obtain the encrypted message includes: encrypting the plaintext message based on any one of the at least two private keys to obtain the encrypted message; Sending the encrypted message to the at least two blockchain nodes includes: respectively determining a point-to-point encrypted channel established with the at least two blockchain nodes, and basing the encrypted message on the corresponding point-to-point encrypted channel. Sent to the at least two blockchain nodes respectively.
  • point-to-point encrypted channels are independently established between the source blockchain node and the at least two blockchain nodes.
  • these point-to-point encrypted channels are independent of each other and have different characteristics.
  • the embodiment of this specification allows each blockchain node in the blockchain node group to which the source blockchain node belongs to perform key negotiation, so that after each blockchain node maintains the same shared key, Each blockchain node will replace the private key corresponding to the point-to-point encrypted channel established by other blockchain nodes in the same blockchain node group with a shared key, so that each block in the blockchain node group Communication between chain nodes will only use shared keys for encryption and decryption, thereby realizing key association of encrypted channels within the blockchain node group.
  • the embodiment of this specification also provides a new encryption strategy , that is, when it is detected that at least two blockchain nodes serving as destination blockchain nodes belong to the same blockchain node group as the source blockchain node, although the plaintext message will be encrypted according to the original encrypted channel transmission, but the independent encryption processes corresponding to multiple encrypted channels will be merged.
  • a new encryption strategy that is, when it is detected that at least two blockchain nodes serving as destination blockchain nodes belong to the same blockchain node group as the source blockchain node, although the plaintext message will be encrypted according to the original encrypted channel transmission, but the independent encryption processes corresponding to multiple encrypted channels will be merged.
  • a new encryption strategy that is, when it is detected that at least two blockchain nodes serving as destination blockchain nodes belong to the same blockchain node group as the source blockchain node, although the plaintext message will be encrypted according to the original encrypted channel transmission, but the independent encryption processes corresponding to multiple encrypted channels will be merged.
  • the traditional solution requires the plaintext
  • the message first encrypts the plaintext message through the encrypted
  • the keys corresponding to tunnel_AB and tunnel_AC have been associated, their corresponding keys are the same shared keys corresponding to the blockchain node groups to which Node A, Node B and Node C belong, so there is no need to re-encrypt twice. process, but merge the encryption process into one, and the obtained encrypted message is sent to Node B and Node C through tunnel_AB and tunnel_AC respectively.
  • the embodiments of this specification realize the message transmission method involved in the embodiments of this specification based on the architecture of traditional encrypted channels by performing key association and merging of encryption processes on multiple encrypted channels that are originally independent of each other, without the need to re-establish new encryption. channel.
  • the key storage addresses of the at least two private keys on the source blockchain node are both the key storage addresses of the shared key on the source blockchain node.
  • the dedicated keys in different point-to-point encryption channels will occupy an exclusive storage space.
  • the private keys in the point-to-point encrypted channel are all replaced by the same shared key. Therefore, for the source blockchain node, if the traditional high storage strategy is still used, information redundancy will occur.
  • S204 Send the encrypted message to the at least two blockchain nodes, and the at least two blockchain nodes are used to decrypt the encrypted message based on the shared key maintained by each to obtain the Clear text message.
  • any destination blockchain node will receive After the message is encrypted, the encrypted message will be decrypted based on the shared key to finally obtain the plaintext message. At this point, the entire process of the message transmission solution involved in the lock of the embodiment of this specification is realized.
  • the source blockchain node when the source blockchain node performs broadcast or multicast, since at least two blockchain nodes of the source blockchain node and the destination blockchain node jointly maintain the same shared key, therefore The source blockchain node can use the shared key to encrypt the plaintext message once and send it to the at least two blockchain nodes, thereby reducing the number of encryption times of the plaintext message in multicast or broadcast scenarios, while ensuring communication security. Reduce the computational burden of source blockchain nodes and improve the efficiency of encrypted communication between blockchain nodes.
  • the source blockchain node needs to determine whether there are at least two blockchain nodes in the destination blockchain node that belong to the same node as the source blockchain node by looking up the member list of the locally maintained blockchain node group.
  • Blockchain node group however, the source blockchain node or the destination blockchain node may temporarily lack the member list of the blockchain node group, which makes although the source blockchain node or the destination blockchain node objectively Both belong to the same blockchain node group, but the source blockchain node and the destination blockchain node are unknown, resulting in the inability to apply the message transmission method involved in the embodiments of this specification. For this reason, it is necessary to design a message interaction method so that the source blockchain node can still confirm whether the destination blockchain node and the source blockchain node belong to the same block even when the blockchain node group is incomplete. Link node group.
  • the source blockchain node only maintains multiple shared keys corresponding to multiple blockchain node groups to which it belongs, but does not maintain member lists of these blockchain node groups, or although it maintains members list, but these member lists do not contain the identity information of the destination blockchain node. It should be pointed out that the fact that a certain blockchain node is not included in the member list of the blockchain node group does not mean that the blockchain node must not belong to the
  • the blockchain node group may be temporarily undetermined, which means that if the source blockchain node needs to send a plaintext message to the destination blockchain node, it cannot pass the node ID, node public key, network address, etc.
  • the identity information of the destination blockchain node determines the blockchain node group to which it and the destination blockchain node belong.
  • the source blockchain node can only determine the network address of the destination blockchain node. It is impossible to determine whether there is a blockchain node group that belongs to the destination blockchain node.
  • the source blockchain node will encrypt the plaintext message with multiple shared keys corresponding to all the blockchain node groups it maintains. Obtain multiple encrypted messages, and then send these multiple encrypted messages to the destination blockchain node according to the network address of the destination blockchain node.
  • the number of destination blockchain nodes can be multiple, for example, in order to cooperate with the aforementioned message transmission.
  • the destination blockchain node here can be all destination blockchain nodes corresponding to the plaintext message.
  • the destination blockchain node cannot determine the source blockchain node and the blockchain nodes to which it belongs, it can decrypt the received multiple messages one by one according to the shared key corresponding to at least one blockchain node group it maintains.
  • An encrypted message For example, the destination blockchain node maintains a total of two blockchain node groups, and the corresponding shared keys are key_1 and key_2.
  • the destination blockchain node received a total of 3 encrypted messages, respectively msg_1. , msg_2 and msg_3, then the destination blockchain node will use key_1 and key_2 to try to decrypt msg_1, msg_2 and msg_3 respectively, that is, up to six decryptions are required.
  • the destination blockchain node will know that it and the source blockchain node belong to the blockchain node group corresponding to key_2, so it can maintain the area corresponding to key_2 locally.
  • the identity information of the source blockchain node is written in the member list of the blockchain node group.
  • the destination blockchain node when the destination blockchain node successfully identifies the blockchain node group to which the source blockchain node belongs, it will further notify the source blockchain node.
  • This blockchain node group enables the source blockchain node to determine the destination blockchain node and the blockchain node group it belongs to, so that the source blockchain node subsequently needs to send a plaintext message to the destination blockchain node. , you can directly query the blockchain node group it belongs to and encrypt the plaintext message based on the shared key corresponding to the blockchain node group to obtain the encrypted message, without the need to perform multiple encryptions to generate multiple encrypted messages. Avoid wasting computing and network resources.
  • the destination blockchain node can use various methods to inform the source blockchain node of the blockchain node group to which it belongs. For example, the destination blockchain node can directly return the group ID of the corresponding blockchain node group to the source blockchain node, where the group ID of any blockchain node group can include: any area agreed or disclosed in advance.
  • the identification information of the blockchain node group, the shared key corresponding to the blockchain node group, or any key identifier in the key identification cluster generated based on the shared key, and each key in the key identification cluster The key identification is obtained by encrypting or decrypting the shared key a limited number of times through the shared key.
  • this method may leak the group ID of the blockchain node group, so there are security risks;
  • the destination blockchain node can return to the source blockchain node the group ID of the blockchain node group encrypted based on the shared key corresponding to the shared blockchain node group;
  • the destination blockchain node can return to the source blockchain node an encrypted message that has been successfully decrypted from the multiple encrypted messages previously received from the source blockchain node.
  • the destination blockchain node returns msg_2 to the source blockchain node
  • the source blockchain node can determine the shared key key_2 used to encrypt msg_2, and at the same time determine the blockchain node group corresponding to key_2, thereby adding the identity information of the destination blockchain node to the area. List of members of the blockchain node group.
  • this method will not leak the information plaintext at the transport layer, it is assumed that the attacker simultaneously captures multiple encrypted messages previously sent by the source blockchain node to the destination blockchain node and the destination blockchain.
  • the encrypted message returned by the node can therefore determine that the source blockchain node and the destination blockchain node belong to at least the same blockchain node group;
  • the destination blockchain node can first re-encrypt the successfully decrypted encrypted message among the multiple encrypted messages previously received from the source blockchain node according to the shared key corresponding to the blockchain node group to which the source blockchain node belongs. To obtain the double encrypted message, and then return the double encrypted message to the source blockchain node. If multiple encrypted messages received from the source blockchain node cannot be decrypted, the same as the above two are still returned to the source blockchain node.
  • the re-encrypted message has the same data format but randomly generated garbled messages. In this way, for the source blockchain node, it can calculate in advance the corresponding values of the multiple encrypted messages it previously sent to the destination blockchain node.
  • Double encrypted message (obtained by calculating the shared key of an encrypted message and then encrypting the encrypted message), thereby maintaining a "blockchain node group-shared key-encrypted message-double encryption"
  • the correspondence between the four "messages” allows the source blockchain node to directly determine the corresponding blockchain node group based on the double-encrypted message received from the destination blockchain node, thereby identifying it as Blockchain node group to which they belong together, and when the source blockchain node cannot match the double-encrypted message sent by the destination blockchain node from the existing correspondence, the double-encrypted message can be identified In fact, it is a garbled message randomly generated by the destination blockchain node, so it can be concluded that the destination blockchain node and the source blockchain node do not belong to any blockchain node group.
  • the double-encrypted message does not appear in the multiple encrypted messages sent by the source blockchain node, it is used to indicate that "the source blockchain node and the destination blockchain node at least belong to the same zone.”
  • the double encryption of "blockchain node group” is indistinguishable from the garbled message used to indicate that "the source blockchain node and the destination blockchain node do not belong to any blockchain node group", so the attacker No conclusions can be inferred based on the intercepted message itself, thus protecting the theoretical security of the transmission process against side-channel attacks that target the analysis of the ciphertext structure.
  • the source blockchain node when the source blockchain node cannot determine whether there is a blockchain node group that belongs to the destination blockchain node, the source blockchain node will correspond to all the blockchain node groups it maintains. Multiple shared keys are used to encrypt plaintext messages to obtain multiple encrypted messages, and then send multiple encrypted messages to the destination blockchain node.
  • this method will still leak information: the attacker intercepts multiple For encrypted messages, although the attacker cannot deduce the plaintext message through multiple encrypted messages, he can deduce the number of blockchain node groups to which the source blockchain node belongs based on the number of multiple encrypted messages (equal to The number of encrypted messages), which constitutes the reference information for restoring the member list of the blockchain node group, objectively also brings security risks.
  • the source blockchain node in addition to sending encrypted messages obtained by encrypting plaintext messages using all shared keys maintained by itself, the source blockchain node will also send additional randomly generated garbled messages.
  • the source block All messages sent by the chain node to the destination blockchain node not only contain multiple encrypted messages normally obtained through shared key encryption, but also mixed with a random number of garbled messages, because it is impossible for the attacker to distinguish between garbled messages and Encrypted messages, so this practice can mask multiple encrypted message volumes from an attacker to combat side-channel attacks against encrypted message volumes.
  • the destination blockchain node will further encrypt the updated member list of the blockchain node group maintained by itself through the shared key corresponding to the blockchain node group and return it to the source blockchain node. to instruct the source blockchain node to update the member list of the corresponding blockchain node group.
  • the member list received by the source blockchain node is a ciphertext list encrypted by the shared key
  • the source blockchain node can pass The aforementioned method obtains the blockchain node group to which the destination blockchain node belongs, which means that the source blockchain node does not need to pair the ciphertext one by one according to the shared keys corresponding to the multiple blockchain node groups it maintains.
  • the ciphertext list can be decrypted directly based on the determined shared key corresponding to the blockchain node group that belongs to the same destination blockchain node, saving the consumption of computing resources.
  • the destination blockchain node After the destination blockchain node obtains the encrypted message using shared key encryption, it will further encrypt based on the first key corresponding to the first encrypted channel established between the blockchain relay communication network system to obtain the first layer of encryption. Encrypt the message, and then send the first encrypted message to the blockchain relay communication network system through the first encrypted channel, so that the external attacker is not only restricted by the encryption strategy based on the shared key corresponding to the blockchain node group, It will be further restricted by the encryption strategy based on a specific encrypted channel between the source blockchain node and the blockchain network communication system (the relevant key corresponding to the first encryption channel is only relayed by the source blockchain node and the blockchain communication network system), therefore, even if the attacker obtains the shared key of the blockchain node group to which the source blockchain node and the destination blockchain node belong together through external means, as long as there is no further control of the source blockchain node or The key relay nodes in the blockchain relay communication network system are still unable to recover the plaintext message by intercepting the first encrypted message, thus ensuring the security
  • the shared key is maintained at each blockchain node through group key negotiation by each blockchain node in the blockchain node group.
  • each blockchain node belonging to the same blockchain node group realizes joint maintenance of a shared key by performing group key negotiation in advance.
  • Group key agreement is different from the end-to-end key agreement between two peers, but refers to the key agreement between at least three peers.
  • the purpose is to enable at least three peers to communicate through online interaction.
  • the peers jointly maintain the same shared key, while preventing the shared key from being leaked to third parties other than the at least three peers.
  • the protocols corresponding to the end-to-end key negotiation involved in the embodiments of this specification may include TLS protocol, IKE (Internet key exchange, network key exchange protocol) protocol, DH (Diffie-Hellman) key exchange protocol, etc. This specification will This is not a limitation.
  • each blockchain node in the blockchain node group performs group key negotiation, including: the master node in the blockchain node group communicates with each node in the blockchain node group except the master node.
  • Other blockchain nodes other than the node jointly maintain the shared key through key negotiation.
  • a method for group key negotiation is provided. In this method, it is first necessary to determine a master node in the blockchain node group as the host of the group key negotiation. Then, the master node will Conduct end-to-end key negotiation with other blockchain nodes (slave nodes) in the blockchain node group except the master node.
  • Node A serves as the master node and wants to form a blockchain node group including Node A, Node B and Node C
  • Node A can interact with Node B and Node C respectively or simultaneously.
  • Key negotiation, and the shared key maintained by Node B after key negotiation is the same as the shared key maintained by Node C after key negotiation.
  • Node A itself will also maintain the shared key, so that ultimately This allows Node A, Node B and Node C to maintain the same shared key, thereby jointly participating in forming a new blockchain node group.
  • the master node conducts group key negotiation with any blockchain node (slave node) among the other blockchain nodes, including: the master node and any blockchain node pass
  • the DH key exchange protocol generates and maintains the shared key; or, the master node and any blockchain node jointly maintain the session key through the DH key exchange protocol, and all the keys generated by the master node are
  • the shared key is encrypted based on the session key and sent to any blockchain node, and the any blockchain node is used to decrypt the encrypted shared key based on the session key. to obtain the shared key.
  • the master node when the master node performs key negotiation with any slave node, it can jointly maintain the same shared key directly or indirectly based on the DH key exchange protocol.
  • the DH key exchange protocol is a type of A scheme for generating symmetric keys in an insecure network, which mainly uses the method of two key negotiation parties to disclose generators and publicly computable values to each other, so that each key negotiation party can calculate only the key negotiation Only the other party can learn the same key seed, thereby further generating and maintaining the same symmetric key based on the same key seed.
  • the master node and the slave node can use the keys directly generated by each other through the DH key exchange protocol as a shared key, so that the master node and the slave node maintain the same shared key.
  • the shared key obtained through the DH key exchange protocol each time is uncertain, in order to ensure that the master node and all other slave nodes maintain the same shared key, this is done directly through the DH key agreement protocol.
  • the method of directly generating a shared key is usually only used when the master node performs key negotiation with the first slave node during the group key negotiation process. Subsequently, other methods need to be used to ensure that all slave nodes can maintain the same key. Shared key.
  • the master node and the slave node can first use the key directly generated by the DH key exchange protocol as the session key for subsequent encrypted communication. At this time, the master node can use the randomly generated key.
  • the symmetric key is used as a shared key (or a shared key generated through key negotiation with the first slave node) and is encrypted by the session key and sent to the slave node, so that the slave node decrypts it according to the session key maintained by itself.
  • Shared key and since the session key generated directly by the DH key exchange protocol is not directly used as a shared key, but as a basis for building encrypted communication, this allows each slave node in the blockchain node group to pass This method maintains the same shared key, ultimately achieving group key agreement.
  • the shared key and/or the session key are recorded in the security association policy maintained by the master node and any blockchain node.
  • the association policy specifically refers to the SA (security assist) in the IKE protocol. Different SAs can be indexed through the SPI (security parameters index) field on the message to be processed.
  • messages used for key negotiation can be set to be encrypted with the session key, so the relevant index fields on the messages corresponding to such messages will point to the use of Security association policy for encryption and decryption with session keys; messages used for ordinary communication can be set to be encrypted by the shared key, so the relevant index fields on the messages corresponding to such messages will point to the use of the shared key Security association policy for encryption and decryption.
  • the master node performs group key negotiation with any blockchain node (slave node) among the other blockchain nodes, including: the master node generates the shared key and transfers the shared key to the shared key.
  • the ciphertext key obtained by encrypting the shared key based on the public key of any blockchain node is sent to the any blockchain node; the any blockchain node encrypts the ciphertext key based on The private key of any blockchain node is decrypted to obtain the shared key.
  • the key negotiation between the master node and the slave node is realized through the asymmetric encryption feature, while avoiding leaking the shared key to other third parties during the key negotiation process, so as to further realize the group operation. Key agreement.
  • any other blockchain node encrypts the shared key based on the public key of the master node and returns it to the master node; the master node encrypts the shared key based on the private key of the master node.
  • the encrypted shared key obtained from any other blockchain node is decrypted to obtain the shared key, it is determined that the key negotiation with any other blockchain node has been completed. .
  • the slave node decrypts and obtains the shared key, although objectively both the master node and the slave node have maintained the same shared key at this time, the master node cannot actually determine that the slave node has maintained the shared key without receiving the relevant certificate.
  • the slave node can further use the master node's public key to encrypt and return after decrypting the shared key. to the master node, and after the master node decrypts and obtains the shared key, it can be determined that the slave node has successfully obtained the shared key, which facilitates the arrangement of subsequent key negotiation tasks, or determines that the group key negotiation has been completed (in the determination area When all slave nodes in the blockchain node group maintain shared keys).
  • the master node generates a digital signature for the ciphertext key based on the private key of the master node, and sends the digital signature to any blockchain node;
  • a blockchain node verifies the digital signature based on the public key of the master node, and determines that the ciphertext key originates from the master node if the signature verification is successful.
  • digital signature technology can be used to enable the master node to digitally sign the ciphertext key , and then the slave node verifies the digital signature, and determines the legitimacy of the source of the ciphertext key if the verification is successful. It also ensures that the ciphertext key has not been tampered with during the transmission process.
  • the message transmission method involved in the embodiments of this specification can be implemented based on a network layer protocol or an application layer protocol, and this specification does not place any restrictions on this.
  • the network layer protocol can be IPsec (Internet Protocol Security, Internet Security Protocol).
  • IPsec Internet Protocol Security, Internet Security Protocol
  • the encryption and decryption process based on the shared key and the corresponding decryption process all occur at the network layer, which is very important for forwarding. Efficiency has a smaller performance loss. This is because the encrypted objects in the network layer are IP messages, while the encrypted objects in the application layer are data structures defined by the application. Therefore, network layer encryption is compared to application layer encryption.
  • IP messages are lightweight information carriers
  • the encryption task is smaller in granularity and does not need to consume a lot of computing resources.
  • the encryption scheme based on the network layer protocol has fewer information transmission links and has a higher High execution efficiency.
  • network layer encryption can adapt to different upper-layer architectures, such as being shared and utilized by different applications, thus reflecting a high adaptability.
  • Figure 4 is a schematic structural diagram of a device provided by an exemplary embodiment.
  • the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408 and a non-volatile memory 410.
  • the processor 402 reads the corresponding computer program from the non-volatile memory 410 into the memory 408 and then runs it.
  • the execution subject of the following processing flow is not limited to each A logic unit can also be a hardware or logic device.
  • Figure 5 is a block diagram of a message transmission device provided by an exemplary embodiment.
  • the device can be applied to the equipment shown in Figure 4 to implement the technical solution of this specification; the device is applied For the source blockchain node, each blockchain node in the blockchain node group to which the source blockchain node belongs maintains the same shared key; the device includes:
  • Encryption unit 501 configured to perform encryption based on the sharing when the destination blockchain node corresponding to the plaintext message includes at least two blockchain nodes in the blockchain node group except the source blockchain node.
  • the key encrypts the plaintext message to obtain the encrypted message.
  • Sending unit 502 configured to send the encrypted message to the at least two blockchain nodes, and the at least two blockchain nodes are configured to decrypt the encrypted message based on the shared key maintained by each. to obtain the clear text message.
  • the encryption unit 501 is specifically used to:
  • the plaintext message is encrypted based on the shared key included in the security association policy to obtain the encrypted message.
  • the at least two private keys maintained by the source blockchain node and corresponding to the at least two point-to-point encrypted channels respectively established between the at least two blockchain nodes are the shared keys;
  • the encryption unit 501 is specifically used for:
  • the sending unit 502 is specifically used for:
  • Point-to-point encrypted channels established with the at least two blockchain nodes are respectively determined, and the encrypted messages are respectively sent to the at least two blockchain nodes based on the corresponding point-to-point encrypted channels.
  • the key storage addresses of the at least two private keys on the source blockchain node are both the key storage addresses of the shared key on the source blockchain node.
  • the shared key is maintained at each blockchain node through group key negotiation by each blockchain node in the blockchain node group.
  • each blockchain node in the blockchain node group conducts group key negotiation, including:
  • the master node in the blockchain node group jointly maintains the shared key through key negotiation with other blockchain nodes in the blockchain node group except the master node.
  • the master node conducts key negotiation with any of the other blockchain nodes, including:
  • the master node and any blockchain node generate and maintain the shared key through a DH key exchange protocol; or,
  • the master node and any blockchain node jointly maintain a session key through the DH key exchange protocol, and encrypt the shared key generated by the master node based on the session key and send it to the Any blockchain node, the any blockchain node is configured to decrypt the encrypted shared key based on the session key to obtain the shared key.
  • the shared key and/or the session key are recorded in the security association policy maintained by the master node and any blockchain node.
  • the master node conducts key negotiation with any of the other blockchain nodes, including:
  • the master node generates the shared key and sends the ciphertext key obtained by encrypting the shared key based on the public key of any blockchain node to the any blockchain node;
  • the any blockchain node decrypts the ciphertext key based on the private key of any blockchain node to obtain the shared key.
  • Optional also includes:
  • the master node generates a digital signature for the ciphertext key based on the private key of the master node, and sends the digital signature to any blockchain node;
  • the any blockchain node verifies the digital signature based on the public key of the master node, and determines that the ciphertext key originates from the master node if the signature verification is successful.
  • each blockchain node in the blockchain node group is in the same blockchain network or different blockchain networks.
  • the different blockchain networks are homogeneous or heterogeneous to each other.
  • the device is implemented based on a network layer protocol.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor. , logic gates, switches, Application Specific Integrated Circuit (ASIC), programmable logic controllers and embedded microcontrollers.
  • controllers include but are not limited to the following microcontrollers: ARC 625D, Atmel AT91SAM, For Microchip PIC18F26K20 and Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller in addition to implementing the controller in the form of pure computer-readable program code, the controller can be completely programmed with logic gates, switches, application-specific integrated circuits, programmable logic controllers and embedded logic by logically programming the method steps. Microcontroller, etc. to achieve the same function. Therefore, this controller can be considered as a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the means for implementing various functions can be considered as structures within hardware components as well as software modules implementing the methods.
  • the systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions.
  • a typical implementation device is a server system.
  • the computer that implements the functions of the above embodiments may be, for example, a personal computer, a laptop computer, a vehicle-mounted human-computer interaction device, a cellular phone, a camera phone, a smart phone, or a personal digital assistant. , media player, navigation device, email device, game console, tablet, wearable device, or a combination of any of these devices.
  • the functions are divided into various modules and described separately.
  • the functions of each module can be implemented in the same or multiple software and/or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. .
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data processing apparatus to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data processing device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may be computer-readable instructions, data structures, modules of programs, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape magnetic tape storage, graphene storage or other magnetic storage devices or any other non-transmission medium can be used to store information that can be accessed by a computing device.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment that combines software and hardware aspects. Furthermore, one or more embodiments of the present description may employ a computer program implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein. Product form.
  • computer-usable storage media including, but not limited to, disk storage, CD-ROM, optical storage, etc.
  • program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types.
  • program modules may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communications network.
  • program modules may be located in both local and remote computer storage media including storage devices.

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)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本说明书提供一种消息传输方法、装置、电子设备和存储介质,应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述方法包括:在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息;将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。

Description

一种消息传输方法、装置、电子设备和存储介质
本申请要求于2022年06月29日提交中国专利局、申请号为202210760927.X、发明名称为“一种消息传输方法、装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本说明书实施例属于区块链技术领域,尤其涉及一种消息传输方法、装置、电子设备和存储介质。
背景技术
区块链(Blockchain)是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链系统中按照时间顺序将数据区块以顺序相连的方式组合成链式数据结构,并以密码学方式保证的不可篡改和不可伪造的分布式账本。由于区块链具有去中心化、信息不可篡改、自治性等特性,区块链也受到人们越来越多的重视和应用。
在传统的区块链技术中,各个区块链节点之间直接采用P2P(Peer to Peer,点对点)技术进行通信,以传输交易、区块等,为了确保信息安全,区块链节点之间往往会建立加密信道,由此实现加密通信。而由于每个加密信道都具有独立性,其对应的密钥或加密策略并不相同,因此在对消息进行组播或广播的场景下,源区块链节点需要按照与多个目的区块链节点相连的多个加密信道对应的多个密钥,对同一明文消息进行多次加密后再分别发送至其他区块链节点,由此给源区块链节点带来了极大的计算负担,影响区块链节点之间的加密通信效率。
发明内容
本说明书的目的在于提供一种消息传输方法、装置、电子设备和存储介质。
根据本说明书一个或多个实施例的第一方面,提出了一种消息传输方法,应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述方法包括:
在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息;
将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。
根据本说明书一个或多个实施例的第二方面,提出了一种消息传输装置,应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述装置包括:
加密单元,用于在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息;
发送单元,用于将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。
根据本说明书一个或多个实施例的第三方面,提出了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器通过运行所述可执行指令以实现如第一方面所述的方法。
根据本说明书一个或多个实施例的第四方面,提出了一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如第一方面所述方法的步骤。
在本说明书实施例中,源区块链节点在进行广播或组播时,由于源区块链节点与目的区块链节点中至少两个区块链节点共同维护有相同的共享密钥,因此源区块链节点可以使用共享密钥对明文消息进行一次加密后发送给所述至少两个区块链节点,从而降低组播或广播场景中对明文消息的加密次数,在确保通讯安全前提下减少源区块链节点的计算负担,提高区块链节点之间的加密通信效率。
附图说明
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是一示例性实施例提供的一种区块链节点之间进行交互的场景示意图。
图2是一示例性实施例提供的一种消息传输方法的流程图。
图3是一示例性实施例提供的一种源区块链节点进行广播的场景示意图。
图4是一示例性实施例提供的一种设备的结构示意图。
图5是一示例性实施例提供的一种消息传输装置的框图。
具体实施方式
为了使本技术领域的人员更好地理解本说明书中的技术方案,下面将结合本说明书实施例中的附图,对本说明书实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本说明书一部分实施例,而不是全部的实施例。基于本说明书中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本说明书保护的范围。
当区块链节点之间在基于P2P技术进行端到端直连时,可以使用SSL(Secure Socket Layer,安全套接字层)链路、TLS(Transport Layer Security,传输层安全协议)、IPsec(Intemet Protocol Security,互联网安全协议)等基于端到端加密协议来实现加密通信。例如,当区块链节点Node A需要向区块链节点Node B发送区块链消息时,Node A与Node B之间可以基于SSL协议进行密钥协商,从而基于协商出的传输密钥在该Node A与Node B之间建立起SSL链路。那么,区块链消息在该SSL链路内部传输时都处于密文状态(由上述的传输密钥加密),仅由持有该传输密钥的Node A与Node B能够解密出相应的消息明文。
然而,区块链节点之间建立的各个加密信道均具有独立性,同一区块链节点与其他不同区块链节点所建立的多个加密信道的密钥或加密策略均不相同,这意味着对于一个需要同时向其他多个目的区块链节点广播或组播同一明文消息的源区块链节点而言,其需要将明文消息分别按照与其他多个目的区块链节点之间建立的多个加密信道对应的密钥和加密策略进行多次独立地加密,从而得到多个加密消息,然后再将这多个加密消息分别通过相应的加密信道发送至对应的其他多个目的区块链节点,这加重了区块链节点执行广播或组播的计算开销,特别是在作为目的区块链节点的数量众多时,将成倍地增加源区块链节点执行加密任务的计算负担,影响区块链节点之间的通信效率。
以图1为例,图1是一示例性实施例提供的一种区块链节点之间进行交互的场景示意图。如图1所 示,该场景中共包含4个区块链节点Node A、Node B、Node C和Node D,它们彼此之间均建立有加密信道,以实现加密通信。然而,在传统架构中,区块链节点之间所建立的加密信道互相具有独立性,例如Node A与Node B、Node C、Node D分别建立有三个互不相关的加密信道tunnel_AB、tunnel_AC、tunnel_AD,在Node A需要同时向Node B、Node C、Node D广播消息时,Node A会分别基于tunnel_AB、tunnel_AC、tunnel_AD对应的密钥对待广播的明文消息进行加密以获取三个不同的加密消息msg_AB、msg_AC、msg_AD,再将msg_AB通过tunnel_AB发送至Node B,将msg_AC通过tunnel_AC发送至Node C,将msg_AD通过tunnel_AD发送至Node D。不难发现,Node A为了向其他三个区块链节点广播同一明文消息,需要对该明文消息独立地进行三次加密。特别是在场景中的区块链节点例如Node A、Node B、Node C和Node D处于同一区块链网络中时,由于交易共识、区块同步等需求,区块链网络中的每个区块链节点都会承担大量消息广播任务,这使得随着区块链网络规模逐渐增大,区块链节点数量越来愈多,其通信开销会以二次函数增长。
为解决上述问题,本说明书提出了一种消息传输方案,通过在区块链节点中建立区块链节点组并维护相同的共享密钥,从而降低组播或广播场景中对明文消息的加密次数,同时还能够确保通讯安全。
下面结合图2对本说明书涉及的消息传输方法进行详细说明。图2是一示例性实施例提供的一种消息传输方法的流程图,其中,所述方法应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述方法包括:
S202:在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息。
在本说明书实施例中,源区块链节点指的是在一次区块链节点之间的交互中处于消息发送方地位的区块链节点,因此源区块链节点一般只有一个,而目的区块链节点则指的是在一次区块链节点之间的交互中处于消息接收方地位的区块链节点,显然消息的接收方并不唯一,因此目的区块链节点的数量也不唯一,可以为一个,也可以为多个。
在本说明书实施例中,可以将能够互相通信的区块链节点按照区块链节点组的群组管理方式进行管理,从而使得处于同一区块链节点组中的各个区块链节点维护有相同的共享密钥。例如,若干个区块链节点可以事先通过组密钥协商来维护共同的共享密钥,从而基于线上协商的方式共同组织成为一个区块链节点组;或者,若干个区块链节点在线下被手动录入了相同的密钥作为共享密钥,从而基于线下录入的方式共同组织成为一个区块链节点组;或者,若干个区块链节点所处的节点设备绑定有相同的密钥,那么这若干个区块链节点会从自身所处节点设备上读取得到该相同的密钥并作为共享密钥,从而基于设备绑定的方式共同组织成为一个区块链节点组。区块链节点组内的区块链节点在进行相互通信的过程中,首先会根据共同维护的共享密钥对明文消息进行加密以获得加密消息,然后再对加密消息进行传输,由此以来,无论加密消息在传输过程中经过任何处理、或者被攻击者所窃取,由于共享密钥仅被同一区块链节点组内的区块链节点所维护,因此从理论上排除了明文消息在传输过程中被暴露的可能性。本说明书实施例所涉及的共享密钥为对称密钥,因此,在区块链节点接收到来自与其属于同一区块链节点组内的其他区块链节点的加密消息时,可以直接基于共享密钥进行解密以获取明文消息。
在本说明书实施例中,所述区块链节点组中的各区块链节点处于相同的区块链网络或不同的区块链网络,例如,所述源区块链节点与所述目的区块链节点可以处于相同的区块链网络或不同的区块链网络。需要指出的是,区块链节点组与区块链网络之间并非同一概念,这意味着,同属于一个区块链节点组中 的区块链节点成员并非一定处于同一区块链网络中,同一区块链网络中的各区块链节点也不一定处于同一区块链节点组中,本说明书实施例所涉及的区块链节点组其初衷在于实现区块链节点组内成员的安全通信,这不仅可以适应区块链网络内部各区块链节点针对交易共识、区块同步的链内交互需求(通过将统同一区块链网络中的所有区块链节点设置为同一区块链节点组),也可以适应不同区块链网络中的区块链节点之间的跨链交互需求(通过将处于不同区块链网络中的区块链节点设置为同一区块链节点组)。区块链网络组中的各区块链节点同处于不同区块链网络的情况下,所述不同的区块链网络之间彼此同构或异构,例如,在所述源区块链节点与所述目的区块链节点处于不同的区块链网络的情况下,所述源区块链节点所处的源区块链网络与所述目的区块链节点所处的目的区块链网络同构或异构,区块链节点组中的区块链节点并不被要求需要具有相同的区块链架构,即一个区块链节点组中各区块链节点所涉及的多个区块链网络并非一定要求同构,具有相同的区块链协议、共识协议等,涉及的多个区块链网络之间也可以是异构的。
需要说明的是,狭义上的异构区块链,通常是指在区块链上流通的价值存在明显差异;也即,所流通的价值存在明显差异的两个区块链之间,通常可以称之为异构区块链。比如,比特币网络和以太坊就是狭义上的异构区块链。
而广义上的异构区块链,是指区块链的类型和/或采用的区块链协议存在明显差异;也即,区块链的类型和/或采用的区块链协议存在明显的两个区块链之间,通常也可以称之为异构区块链。比如,蚂蚁区块链(ANT CHAIN)和hyperledger fabric区块链就是广义上的异构区块链。
在本说明书实施例中,同一个区块链节点可以同时隶属于多个不同的区块链节点组,因而对于任一区块链节点而言,其本地可以分别维护有自身共同所属的多个区块链节点组的成员列表及其对应的共享密钥。而在源区块链节点需要向目的区块链节点发送明文消息的情况下,源区块链节点首先通过在本地查找预先维护的至少一个区块链节点组,并确定自身与目的区块链节点共同所属的区块链节点组(可能有多个),然后基于本地维护的该区块链节点组对应的共享密钥对明文消息进行加密以获取加密消息,从而使得目的区块链节点在接收到该加密消息后能够基于该区块链节点组的共享密钥解密得到明文消息。显然,在目的区块链节点包括至少两个区块链节点时的情况下,需要在本地查找出源区块链节点与作为目的区块链节点的至少两个区块链节点所共同所属的区块链节点组,然后再基于对应的共享密钥进行加密。
在源区块链节点响应于组播或者广播任务时,不一定会触发执行本说明书实施例涉及的消息传输方法,这是由于组播和广播任务虽然都是将同一消息发送至至少两个区块链节点,符合明文消息对应的目的区块链节点包括至少两个区块链节点的条件,但本案的触发条件实际上为明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点,也就是说,本说明书实施所涉及的消息传输方法不仅依赖于执行组播或者广播任务的场景,还需要确保作为目的区块链节点的至少两个区块链节点与源区块链节点同属于一个区块链节点组,均为同一区块链节点组内的节点成员。因此,针对一个组播或者广播任务,源区块链节点首先会确定待发送的明文消息以及待发往的目的区块链节点,通过查找本地维护的区块链节点组的成员列表以在确定与目的区块链节点共同所属的一个区块链节点组后,才会根据确定得到的区块链节点组对应的共享密钥对明文消息进行加密以得到加密消息,最终将加密消息发送至包含至少两个区块链节点的目的区块链节点。
需要说明的是,目的区块链节点中包含的所有区块链节点不一定全都与源区块链节点同属一个区块 链节点组,目的区块链节点中的各区块链节点完全有可能同时涉及多个区块链节点组,或者不属于任何区块链节点组。以图3为例,图3是一示例性实施例提供的一种源区块链节点进行广播的场景示意图,其中源区块链节点为图中的区块链节点A,目的区块链节点包含区块链节点B~H共7个区块链节点,可以发现,目的区块链节点中的区块链节点B、C、D与区块链节点A同属于区块链节点组1,这意味着区块链节点A、B、C、D共同维护有区块链节点组1对应的共享密钥,而目的区块链中的区块链节点E不属于任何区块链节点组,区块链节点组F则虽然属于区块链节点组3,但区块链节点组3的节点成员中并不包含至少两个目的区块链节点,也没有包含区块链节点A,因此这部分不会触发执行本说明书所涉及的消息传输方法,而区块链节点G、H则与区块链节点A同属于区块链节点组2,共同维护有区块链节点组2对应的共享密钥,于是,区块链节点A在执行向区块链节点B~H广播消息过程中,会基于目的区块链节点首先检索自身维护的区块链节点组的成员列表,并在确定区块链节点B、C、D与区块链节点A同属于区块链节点组1,而区块链节点G、H与区块链节点A同属于区块链节点组2后,将明文消息分别基于区块链节点组1对应的共享密钥进行加密后发送至区块链节点B、C、D,并将明文消息再基于区块链节点组2对应的共享密钥进行加密后发送至区块链节点G、H,至于区块链节点E和F,则需要利用区块链节点A与它们单独建立的加密信道对明文消息进行加密传输,因此,区块链节点A对明文消息一共进行了4次加密计算,相较于传统方法中分别根据与每个目的区块链节点所建立的加密信道来分别加密传输相比(需要对明文消息进行7次加密计算)明显具有更低的计算消耗。
可选的,所述基于所述共享密钥对所述明文消息进行加密以获取加密消息,包括:基于所述明文消息包含的安全参数索引,确定对应于所述安全参数索引的安全关联策略;基于所述安全关联策略中包含的所述共享密钥对所述明文消息进行加密以获取所述加密消息。在本说明书实施例中,如果源区块链节点确定明文消息对应的目的区块链节点包括至少两个区块链节点且所述至少两个区块链节点与源区块链节点同属于一个区块链节点组,此时源区块链节点将按照预设的协议例如IPsec协议对待发送的明文消息进行封装,为其添加SPI(security parameters index,安全参数索引)字段后交付源区块链节点中的加密计算模组进行进一步加密处理,加密计算模组在接收到携带有SPI的明文消息后,会根据该SPI检索本地预先维护的SA(security assist,安全关联策略),然后根据检索得到的SA中包含的共享密钥(即确定的区块链节点组对应的共享密钥)对明文消息进行加密以获取加密消息并将携带有SPI的加密消息发送至目的区块链节点,目的区块链接收到携带有SPI的加密消息后,可以通过加密消息所携带的SPI字段检索本地预先维护的SA,然后根据检索得到的SA中包含的共享密钥(即确定的区块链节点组对应的共享密钥)对密文消息进行解密以获取明文消息。本说明书实施例相当于在源区块链节点与目的区块链节点之间建立了新的加密信道以实现本说明书实施例所涉及的消息传输方法。
可选的,所述源区块链节点维护的与所述至少两个区块链节点之间分别建立的至少两个点对点加密信道对应的至少两个专用密钥均为所述共享密钥;所述基于所述共享密钥对明文消息进行加密以获取加密消息,包括:基于所述至少两个专用密钥中的任一密钥,对明文消息进行加密以获取所述加密消息;所述将所述加密消息发送至所述至少两个区块链节点,包括:分别确定与所述至少两个区块链节点之间建立的点对点加密信道,将所述加密消息基于相应的点对点加密信道分别发送至所述至少两个区块链节点。在本说明书实施例中,源区块链节点与所述至少两个区块链节点之间分别单独建立有点对点加密信道,如前所述,这些点对点加密信道彼此之间是独立的,具有不同的专用密钥,然而,本说明书实施例通过使得源区块链节点所属区块链节点组中的各区块链节点进行密钥协商,而使得各区块链节点维护有 相同的共享密钥后,每个区块链节点都会将其维护的与同区块链节点组内其他区块链节点建立的点对点加密信道对应的专用密钥替换为共享密钥,从而使得区块链节点组内各区块链节点之间的通讯将仅使用共享密钥进行加解密,从而实现了区块链节点组内加密信道的密钥关联,同时,为了避免重复加密,本说明书实施例还提供了新的加密策略,即在检测到作为目的区块链节点的至少两个区块链节点与源区块链节点同属一个区块链节点组的情况下,虽然会按照原始的加密信道对进行明文消息进行加密后传输,但是多个加密信道对应的独立的加密过程将被合并,例如图1中Node A向与Node A同属于一个区块链节点组的Node B和Node C发送消息时,传统方案需要将明文消息先通过Node A与Node B之间的加密信道tunnel_AB对明文消息进行一次加密,然后还需要通过Node A与Node C之间的加密信道tunnel_AC对明文消息再进行一次加密,然而在本说明书实施例中,由于tunnel_AB与tunnel_AC对应的密钥已经关联,其对应的密钥相同均为Node A、Node B和Node C所属的区块链节点组对应的共享密钥,因此不需要进行两次重复加密过程,而是将加密过程合并为一次,得到的加密消息再分别通过于tunnel_AB与tunnel_AC发送至Node B和Node C。本说明书实施例通过对原本彼此独立的多个加密信道进行密钥关联和加密过程合并,从而基于传统加密信道的架构实现了本说明书实施例所涉及的消息传输方法,而无需重新建立新的加密信道。
可选的,所述至少两个专用密钥于所述源区块链节点的密钥存储地址均为所述共享密钥于所述源区块链节点的密钥存储地址。在传统的密钥存储策略中,不同点对点加密信道中的专用密钥会独占一份存储空间,而由于本说明书实施例已经将源区块链节点与所述至少两个区块链节点之间的点对点加密信道中的专用密钥均替换为相同的共享密钥,因此对于源区块链节点而言,如果依然采用传统高的存储策略将造成信息冗余。因此,可以在将专用密钥替换为共享密钥时,仅对不同点对点加密信道的密钥存储地址进行修改,以将它们统一为共享密钥所在的密钥存储地址,然后将原本独立存储的各点对点加密信道对应的各专用密钥进行删除以释放存储空间,降低源区块链节点的存储消耗。
S204:将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。
如前所述,由于所述至少两个区块链节点与源区块链节点处于同一区块链节点组,同时维护有相同的共享密钥,因此,任一目的区块链节点在接收到加密消息后,都将基于所述共享密钥对加密消息进行解密以最终获取明文消息,至此实现本说明书实施例锁所涉及的消息传输方案的全流程。
在本说明书实施例中,源区块链节点在进行广播或组播时,由于源区块链节点与目的区块链节点中至少两个区块链节点共同维护有相同的共享密钥,因此源区块链节点可以使用共享密钥对明文消息进行一次加密后发送给所述至少两个区块链节点,从而降低组播或广播场景中对明文消息的加密次数,在确保通讯安全前提下减少源区块链节点的计算负担,提高区块链节点之间的加密通信效率。
如前所述,源区块链节点需要通过查找本地维护的区块链节点组的成员列表来确定目的区块链节点中是否存在至少两个区块链节点与源区块链节点同属于一个区块链节点组,然而,源区块链节点或目的区块链节点都有可能暂时缺失区块链节点组的成员列表,这使得虽然源区块链节点或目的区块链节点在客观上同属于一个区块链节点组,但源区块链节点和目的区块链节点却无从知晓,从而导致无法适用本说明书实施例所涉及的消息传输方法。为此,有必要设计一种消息交互方式来使得源区块链节点能够在区块链节点组残缺的情况下依然可以确认目的区块链节点是否与源区块链节点是否同属于一个区块链节点组。
在一实施例中,源区块链节点仅维护有自身所属的多个区块链节点组对应的多个共享密钥,而未维护这些区块链节点组的成员列表,或者虽然维护有成员列表但这些成员列表中不包含目的区块链节点的身份标识信息,需要指出的是,区块链节点组的成员列表中未包含某区块链节点不代表该区块链节点一定不属于该区块链节点组,因为有可能是暂时未确定到导致的,这意味着如果源区块链节点需要向目的区块链节点发送明文消息,则无法通过节点ID、节点公钥、网络地址等目的区块链节点的身份标识信息确定自身与目的区块链节点共同所属的区块链节点组,因此,在这种情况下,源区块链节点仅能确定目的区块链节点的网络地址而无法确定是否存在与目的区块链节点共同所属的区块链节点组,源区块链节点会将自身维护的全部区块链节点组对应的多个共享密钥分别对明文消息进行加密以获取多个加密消息,然后将这多个加密消息按照目的区块链节点的网络地址一同发送至目的区块链节点,目的区块链节点的数量可以为多个,例如为了配合前述的消息传输方法,这里的目的区块链节点可以为所述明文消息对应的所有目的区块链节点。由此,目的区块链节点如果也无法判断源区块链节点与其所同属的区块链节点,就可以按照自身维护的至少一个区块链节点组对应的共享密钥逐一解密接收到的多个加密消息,例如,目的区块链节点共维护有两个区块链节点组,对应的共享密钥分别为key_1和key_2,同时目的区块链节点共接收到3个加密消息,分别为msg_1、msg_2和msg_3,那么目的区块链节点就会先后使用key_1和key_2分别尝试对msg_1、msg_2和msg_3进行解密,即最多需要进行六次解密,而在上述解密过程中如果有至少一个加密消息被成功解密,例如msg_2通过key_2成功解密得到明文消息,那么目的区块链节点就会知晓自身与源区块链节点同属于key_2对应的区块链节点组,因此可以在本地维护的key_2对应的区块链节点组的成员列表中写入源区块链节点的身份标识信息。
而为了进一步方便后续与源区块链节点之间进行通信,当目的区块链节点成功识别与源区块链节点共同所属的区块链节点组后,还会进一步向源区块链节点告知该区块链节点组,从而使源区块链节点能够确定目的区块链节点与其同属的区块链节点组,由此源区块链节点后续在需要向目的区块链节点发送明文消息时,就可以直接查询到与其同属的区块链节点组并基于该区块链节点组对应的共享密钥对明文消息进行加密以获取加密消息,而无需进行多次加密以生成多个加密消息,避免浪费计算和网络资源。
目的区块链节点可以采取多种方式向源区块链节点告知与其共同所属的区块链节点组。例如,目的区块链节点可以直接向源区块链节点返回对应区块链节点组的组ID,其中,任一区块链节点组的组ID可以包括:事先约定或公开的该任一区块链节点组的标识信息、该任一区块链节点组对应的共享密钥或基于该共享密钥生成的密钥标识簇中的任一密钥标识,密钥标识簇中的每一个密钥标识都是通过共享密钥对共享密钥进行有限次的加密或解密得到的。但这种方式可能会泄露区块链节点组的组ID,因此存在安全隐患;
或者,目的区块链节点可以向源区块链节点返回基于共同所属区块链节点组对应共享密钥加密后的该区块链节点组的组ID;
或者,目的区块链节点可以向源区块链节点返回之前从源区块链节点接收的多个加密消息中解密成功的加密消息,例如目的区块链节点向源区块链节点返回msg_2,此时源区块链节点就能够因此确定当初加密得到msg_2所使用的共享密钥key_2,同时确定得到key_2对应的区块链节点组,由此将目的区块链节点的身份标识信息加入该区块链节点组的成员列表,该方式虽然不会在传输层泄露信息明文,但是假设攻击者同时捕获了源区块链节点之前向目的区块链节点发送的多个加密消息以及目的区块链节点返回的加密消息,就能够因此确定源区块链节点与目的区块链节点至少同属于一个区块链节点组;
或者,目的区块链节点可以先对之前从源区块链节点接收的多个加密消息中解密成功的加密消息按照与源区块链节点共同所属区块链节点组对应共享密钥进行重加密以获取二重加密消息,然后将该二重加密消息返回源区块链节点,而假如从源区块链节点接收的多个加密消息都无法解密,仍然向源区块链节点返回与上述二重加密消息具有相同数据格式但内容随机生成的乱码消息,这样一来,对于源区块链节点而言,其可以预先分别计算出其之前向目的区块链节点发送的多个加密消息对应的二重加密消息(通过计算出某一加密消息的共享密钥对该某一加密消息再进行加密以获得),从而维护得到一个“区块链节点组-共享密钥-加密消息-二重加密消息”四者之间的对应关系,这使得源区块链节点可以基于从目的区块链节点所接收到的二重加密消息来直接确定出对应的区块链节点组,从而将其认定为共同所属的区块链节点组,而当源区块链节点无法从已有的对应关系中匹配出目的区块链节点所发出的二重加密消息的情况下,就可以认定该二重加密消息实则是目的区块链节点随机生成的乱码消息,于是可以得出目的区块链节点与源区块链节点不同属于任何一个区块链节点组。而对于攻击者而言,由于该二重加密消息并未出现在源区块链节点发送的多个加密消息中,用于表征“源区块链节点与目的区块链节点至少同属于一个区块链节点组”的二重加密与用于表征“源区块链节点与目的区块链节点不同属于任何一个区块链节点组”的乱码消息二者之间是无法区分的,因此攻击者无法基于截获的消息本身推断出任何结论,从而保护了传输过程的理论安全性,以对抗针对密文结构进行分析的侧信道攻击。
如前所述,源区块链节在无法确定是否存在与目的区块链节点共同所属的区块链节点组的情况下,源区块链节点会将自身维护的全部区块链节点组对应的多个共享密钥分别对明文消息进行加密以获取多个加密消息,然后将多个加密消息发送至目的区块链节点,然而,这种方式依然会泄露信息:攻击者通过截获包含多个加密消息的报文,虽然攻击者无法通过多个加密消息反推出明文消息,但却可以根据多个加密消息的数量来反推出源区块链节点所属的区块链节点组的数量(等于多个加密消息的数量),这构成了还原区块链节点组的成员列表的参考信息,客观上也会带来安全隐患。而为了避免上述问题,源区块链节点除了发送通过自身维护的所有共享密钥对明文消息分别进行加密得到的加密消息外,还会发送额外随机生成的乱码消息,这样一来,源区块链节点发送至目的区块链节点的所有消息中就不仅包含正常通过共享密钥加密得到的多个加密消息,还会混入有随机数量的乱码消息,由于对于攻击者而言无法区分乱码消息与加密消息,因此这种做法可以对攻击者掩盖多个加密消息的数量,以对抗针对加密消息数量的侧信道攻击。
在一实施例中,目的区块链节点会进一步将自身维护的更新后的该区块链节点组的成员列表通过该区块链节点组对应的共享密钥加密后返回源区块链节点,以指示源区块链节点更新对应区块链节点组的成员列表,虽然源区块链节点所接收到的成员列表是通过共享密钥加密后的密文列表,但源区块链节点可以通过前述方法获知其与目的区块链节点所同属的区块链节点组,这意味着源区块链节点无需按照自身所维护的多个区块链节点组对应的共享密钥逐一对该密文列表进行解密以获取成员列表,而是可以直接基于确定得到的与目的区块链节点同属的区块链节点组对应的共享密钥对密文列表进行解密,节省了计算资源的消耗。
目的区块链节点在利用共享密钥加密得到加密消息后,还会进一步根据与区块链中继通信网络系统之间建立的第一加密信道对应的第一密钥进行加密以获取第一重加密消息,再通过第一加密信道向区块链中继通信网络系统发送该第一重加密消息,从而使得外部攻击者不仅受到基于区块链节点组对应的共享密钥的加密策略的制约,还会进一步受到基于源区块链节点与区块链网络通信系统之间特定加密信道 的加密策略的制约(第一加密信道对应的相关密钥仅由源区块链节点与区块链中继通信网络系统所掌握),因此,即使攻击者通过外部手段获取了源区块链节点与目的区块链节点共同所属区块链节点组的共享密钥,只要没有进一步控制源区块链节点或区块链中继通信网络系统中的关键中继节点,也依然无法通过截获第一重加密消息来还原得到明文消息,从而能够确保系统的安全性。
可选的,所述共享密钥通过所述区块链节点组中的各区块链节点进行组密钥协商以维护于所述各区块链节点。在本说明书实施例中,同属于一个区块链节点组中的各区块链节点通过事先进行组密钥协商实现共同维护有共享密钥。组密钥协商不同于两个对等体之间的端到端的密钥协商,而是指至少三个对等体之间的密钥协商,其目的在于通过线上交互的方式,使至少三个对等体共同维护有相同的共享密钥,同时避免该共享密钥泄露给除是所述至少三个对等体以外的第三方。本说明书实施例所涉及的端到端的密钥协商对应的协议可以包括TLS协议、IKE(Internet key exchange,网络密钥交换协议)协议、DH(Diffie-Hellman)密钥交换协议等,本说明书对此并不做限制。
可选的,所述区块链节点组中的各区块链节点进行组密钥协商,包括:所述区块链节点组中的主节点分别与所述区块链节点组中除所述主节点以外的其他区块链节点通过密钥协商以共同维护所述共享密钥。在本说明书实施例中,提供了一种组密钥协商的方法,在该方法中,首先需要在区块链节点组中确定一个主节点作为组密钥协商的主持者,然后,主节点会与所述区块链节点组中除所述主节点以外的其他区块链节点(从节点)分别进行端到端的密钥协商。例如在图1所示的场景,假设Node A作为主节点且希望组建一个包含Node A、Node B与Node C的区块链节点组,那么Node A可以依次或同时分别与Node B和Node C进行密钥协商,并且使Node B在密钥协商后所维护的共享密钥与Node C在密钥协商后所维护的共享密钥相同,同时Node A自身也会维护有该共享密钥,从而最终使得Node A、Node B与Node C维护有相同的共享密钥,从而共同参与组成一个新的区块链节点组。
可选的,所述主节点与所述其他区块链节点中的任一区块链节点(从节点)进行组密钥协商,包括:所述主节点与所述任一区块链节点通过DH密钥交换协议生成并维护所述共享密钥;或者,所述主节点与所述任一区块链节点通过DH密钥交换协议共同维护会话密钥,并将所述主节点生成的所述共享密钥基于所述会话密钥加密后发送至所述任一区块链节点,所述任一区块链节点用于将加密后的所述共享密钥基于所述会话密钥进行解密以获取所述共享密钥。在本说明书实施例中,主节点在与任一从节点进行密钥协商时,都可以直接或间接基于DH密钥交换协议来实现共同维护相同的共享密钥,DH密钥交换协议是一类在不安全网络中生成对称密钥的方案,其主要通过两个密钥协商方之间相互公开生成元和可公开计算值的方式,使每一密钥协商方都能计算出只有密钥协商方才能获知的相同的密钥种子,从而进一步基于相同的密钥种子生成并维护相同的对称密钥。
在一实施例中,主节点与从节点之间可以将彼此之间通过DH密钥交换协议直接生成的密钥作为共享密钥,从而使得主节点与该从节点之间维护相同的共享密钥,但由于每次通过DH密钥交换协议得到的共享密钥是不确定的,因此为了确保主节点与其他所有从节点均维护有相同的共享密钥,这种直接通过DH密钥协商协议来直接生成共享密钥的做法通常只会用在主节点进行组密钥协商过程中与第一个从节点进行密钥协商时,而后续则需要采用其他方式来确保所有从节点均能维护相同的共享密钥。
在另一实施例中,主节点与从节点之间可以首先将DH密钥交换协议直接生成的密钥作为会话密钥,以用于后续进行加密通信,此时主节点就能够将随机生成的对称密钥作为共享密钥(或与第一个从节点通过密钥协商生成的共享密钥)并通过会话密钥加密后发送给从节点,从而使得从节点根据自身维护的 会话密钥解密得到共享密钥,并且由于DH密钥交换协议直接生成的会话密钥并不直接作为共享密钥,而是作为构建加密通信的基础,这使得区块链节点组中的每个从节点均可通过该方式维护相同的共享密钥,从而最终实现组密钥协商。
可选的,所述共享密钥和/或所述会话密钥记录在所述主节点与所述任一区块链节点维护的安全关联策略中。为了区分不同的加密策略,同时有效地安排密钥协商的流程,因此需要对不同类型的消息施加以不同的安全关联策略,以使其按照规定的方式进行加密,本说明书实施例所涉及的安全关联策略具体是指IKE协议中的SA(security assist),不同SA可以通过待处理消息上的SPI(security parameters index,安全参数索引)字段进行索引。例如,用于进行密钥协商的消息(如DH密钥协商过程中发送的消息)就可以被设置为通过会话密钥进行加密,因此这类消息对应的报文上的相关索引字段将指向使用会话密钥进行加解密的安全关联策略;而用于进行普通通讯的消息就可以被设置为通过共享密钥进行加密,因此这类消息对应的报文上的相关索引字段将指向使用共享密钥进行加解密的安全关联策略。
可选的,所述主节点与所述其他区块链节点中的任一区块链节点(从节点)进行组密钥协商,包括:所述主节点生成所述共享密钥,并将所述共享密钥基于所述任一区块链节点的公钥加密得到的密文密钥发送至所述任一区块链节点;所述任一区块链节点将所述密文密钥基于所述任一区块链节点的私钥进行解密以获取所述共享密钥。在本说明书实施例中,通过非对称加密特性来实现主节点与从节点之间密钥协商的工作,同时避免在密钥协商的过程中向其他第三方泄露共享密钥,从而在进一步实现组密钥协商。
可选的,还包括:所述其他任一区块链节点将所述共享密钥基于所述主节点公钥加密后返回所述主节点;所述主节点在基于所述主节点的私钥对从所述其他任一区块链节点获取的加密后的所述共享密钥进行解密得到所述共享密钥的情况下,确定与所述其他任一区块链节点的密钥协商已完成。在从节点解密得到共享密钥后,虽然客观上主节点与从节点此刻均已维护有相同的共享密钥,但主节点其实在未接收到相关证明的情况下无法确定从节点已经维护有共享密钥,因此为了使主节点能够确定参与某一次密钥协商的从节点确实已经获取了共享密钥,可以让从节点在解密得到共享密钥后,进一步使用主节点的公钥进行加密后返回至主节点,而主节点解密得到共享密钥后,便可以确定该从节点已经成功获取共享密钥,从而方便安排进行后续的密钥协商任务,或确定组密钥协商已经完成(在确定区块链节点组中所有从节点均维护有共享密钥的情况下)。
可选的,还包括:所述主节点基于所述主节点的私钥为所述密文密钥生成数字签名,并将所述数字签名发送至所述任一区块链节点;所述任一区块链节点基于所述主节点的公钥对所述数字签名进行验签,在验签成功的情况下确定所述密文密钥来源于所述主节点。在本说明书实施例中,为了使从节点能够验证主节点的身份,防止其他第三方假冒主节点与从节点进行密钥验证,可以利用数字签名技术,使主节点对密文密钥进行数字签名,而后从节点对数字签名进行验签,并在验签成功的情况下确定密文密钥来源的合法性,同时还可以确保密文密钥在传输过程中未被篡改。
本说明书实施例所涉及的消息传输方法可以基于网络层协议实现,也可以基于应用层协议实现,本说明书对此并不做任何限制。而当基于网络层协议实现时,该网络层协议可以是IPsec(Internet Protocol Security,互联网安全协议),此时基于共享密钥的加解密过程和相应的解密过程均发生在网络层,其对转发效率具有较小的性能损耗,这是由于网络层中加密的对象为IP报文,而应用层中加密的对象为应用程序定义的数据结构体,因此网络层加密相较于应用层加密而言,由于IP报文属于轻量级的信息载体,因此加密任务的细粒度更小,不需要消耗大量的计算资源,同时基于网络层协议实现的加密方案 在信息传递的环节上更少,具有更高的执行效率,另外网络层加密能够适配不同的上层架构,例如被不同的应用所共同享有和利用,从而体现为一种高适配性。
图4是一示例性实施例提供的一种设备的示意结构图。请参考图4,在硬件层面,该设备包括处理器402、内部总线404、网络接口406、内存408以及非易失性存储器410,当然还可能包括其他功能所需要的硬件。本说明书一个或多个实施例可以基于软件方式来实现,比如由处理器402从非易失性存储器410中读取对应的计算机程序到内存408中然后运行。当然,除了软件实现方式之外,本说明书一个或多个实施例并不排除其他实现方式,比如逻辑器件抑或软硬件结合的方式等等,也就是说以下处理流程的执行主体并不限定于各个逻辑单元,也可以是硬件或逻辑器件。
如图5所示,图5是一示例性实施例提供的一种消息传输装置的框图,该装置可以应用于如图4所示的设备中,以实现本说明书的技术方案;所述装置应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述装置包括:
加密单元501,用于在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息。
发送单元502,用于将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。
可选的,所述加密单元501具体用于:
基于所述明文消息包含的安全参数索引,确定对应于所述安全参数索引的安全关联策略;
基于所述安全关联策略中包含的所述共享密钥对所述明文消息进行加密以获取所述加密消息。
可选的,所述源区块链节点维护的与所述至少两个区块链节点之间分别建立的至少两个点对点加密信道对应的至少两个专用密钥均为所述共享密钥;
所述加密单元501具体用于:
基于所述至少两个专用密钥中的任一密钥,对明文消息进行加密以获取所述加密消息;
所述发送单元502具体用于:
分别确定与所述至少两个区块链节点之间建立的点对点加密信道,将所述加密消息基于相应的点对点加密信道分别发送至所述至少两个区块链节点。
可选的,所述至少两个专用密钥于所述源区块链节点的密钥存储地址均为所述共享密钥于所述源区块链节点的密钥存储地址。
可选的,所述共享密钥通过所述区块链节点组中的各区块链节点进行组密钥协商以维护于所述各区块链节点。
可选的,所述区块链节点组中的各区块链节点进行组密钥协商,包括:
所述区块链节点组中的主节点分别与所述区块链节点组中除所述主节点以外的其他区块链节点通过密钥协商以共同维护所述共享密钥。
可选的,所述主节点与所述其他区块链节点中的任一区块链节点进行密钥协商,包括:
所述主节点与所述任一区块链节点通过DH密钥交换协议生成并维护所述共享密钥;或者,
所述主节点与所述任一区块链节点通过DH密钥交换协议共同维护会话密钥,并将所述主节点生成 的所述共享密钥基于所述会话密钥加密后发送至所述任一区块链节点,所述任一区块链节点用于将加密后的所述共享密钥基于所述会话密钥进行解密以获取所述共享密钥。
可选的,所述共享密钥和/或所述会话密钥记录在所述主节点与所述任一区块链节点维护的安全关联策略中。
可选的,所述主节点与所述其他区块链节点中的任一区块链节点进行密钥协商,包括:
所述主节点生成所述共享密钥,并将所述共享密钥基于所述任一区块链节点的公钥加密得到的密文密钥发送至所述任一区块链节点;
所述任一区块链节点将所述密文密钥基于所述任一区块链节点的私钥进行解密以获取所述共享密钥。
可选的,还包括:
所述主节点基于所述主节点的私钥为所述密文密钥生成数字签名,并将所述数字签名发送至所述任一区块链节点;
所述任一区块链节点基于所述主节点的公钥对所述数字签名进行验签,在验签成功的情况下确定所述密文密钥来源于所述主节点。
可选的,所述区块链节点组中的各区块链节点处于相同的区块链网络或不同的区块链网络。
可选的,所述不同的区块链网络之间彼此同构或异构。
可选的,所述装置基于网络层协议实现。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式, 控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为服务器系统。当然,本发明不排除随着未来计算机技术的发展,实现上述实施例功能的计算机例如可以为个人计算机、膝上型计算机、车载人机交互设备、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任何设备的组合。
虽然本说明书一个或多个实施例提供了如实施例或流程图所述的方法操作步骤,但基于常规或者无创造性的手段可以包括更多或者更少的操作步骤。实施例中列举的步骤顺序仅仅为众多步骤执行顺序中的一种方式,不代表唯一的执行顺序。在实际中的装置或终端产品执行时,可以按照实施例或者附图所示的方法顺序执行或者并行执行(例如并行处理器或者多线程处理的环境,甚至为分布式数据处理环境)。术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、产品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、产品或者设备所固有的要素。在没有更多限制的情况下,并不排除在包括所述要素的过程、方法、产品或者设备中还存在另外的相同或等同要素。例如若使用到第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
为了描述的方便,描述以上装置时以功能分为各种模块分别描述。当然,在实施本说明书一个或多个时可以把各模块的功能在同一个或多个软件和/或硬件中实现,也可以将实现同一功能的模块由多个子模块或子单元的组合实现等。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
本发明是参照根据本发明实施例的方法、装置(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程 设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储、石墨烯存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。
本领域技术人员应明白,本说明书一个或多个实施例可提供为方法、系统或计算机程序产品。因此,本说明书一个或多个实施例可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本说明书一个或多个实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本说明书一个或多个实施例可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、数据结构等等。也可以在分布式计算环境中实践本本说明书一个或多个实施例,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本说明书的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必须针对的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。
以上所述仅为本说明书一个或多个实施例的实施例而已,并不用于限制本本说明书一个或多个实施例。对于本领域技术人员来说,本说明书一个或多个实施例可以有各种更改和变化。凡在本说明书的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在权利要求范围之内。

Claims (16)

  1. 一种消息传输方法,应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述方法包括:
    在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息;
    将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。
  2. 根据权利要求1所述的方法,所述基于所述共享密钥对所述明文消息进行加密以获取加密消息,包括:
    基于所述明文消息包含的安全参数索引,确定对应于所述安全参数索引的安全关联策略;
    基于所述安全关联策略中包含的所述共享密钥对所述明文消息进行加密以获取所述加密消息。
  3. 根据权利要求1所述的方法,所述源区块链节点维护的与所述至少两个区块链节点之间分别建立的至少两个点对点加密信道对应的至少两个专用密钥均为所述共享密钥;
    所述基于所述共享密钥对明文消息进行加密以获取加密消息,包括:
    基于所述至少两个专用密钥中的任一密钥,对明文消息进行加密以获取所述加密消息;
    所述将所述加密消息发送至所述至少两个区块链节点,包括:
    分别确定与所述至少两个区块链节点之间建立的点对点加密信道,将所述加密消息基于相应的点对点加密信道分别发送至所述至少两个区块链节点。
  4. 根据权利要求3所述的方法,所述至少两个专用密钥于所述源区块链节点的密钥存储地址均为所述共享密钥于所述源区块链节点的密钥存储地址。
  5. 根据权利要求1所述的方法,所述共享密钥通过所述区块链节点组中的各区块链节点进行组密钥协商以维护于所述各区块链节点。
  6. 根据权利要求5所述的方法,所述区块链节点组中的各区块链节点进行组密钥协商,包括:
    所述区块链节点组中的主节点分别与所述区块链节点组中除所述主节点以外的其他区块链节点通过密钥协商以共同维护所述共享密钥。
  7. 根据权利要求6所述的方法,所述主节点与所述其他区块链节点中的任一区块链节点进行密钥协商,包括:
    所述主节点与所述任一区块链节点通过DH密钥交换协议生成并维护所述共享密钥;或者,
    所述主节点与所述任一区块链节点通过DH密钥交换协议共同维护会话密钥,并将所述主节点生成的所述共享密钥基于所述会话密钥加密后发送至所述任一区块链节点,所述任一区块链节点用于将加密后的所述共享密钥基于所述会话密钥进行解密以获取所述共享密钥。
  8. 根据权利要求7所述的方法,所述共享密钥和/或所述会话密钥记录在所述主节点与所述任一区块链节点维护的安全关联策略中。
  9. 根据权利要求6所述的方法,所述主节点与所述其他区块链节点中的任一区块链节点进行密钥协商,包括:
    所述主节点生成所述共享密钥,并将所述共享密钥基于所述任一区块链节点的公钥加密得到的密文密钥发送至所述任一区块链节点;
    所述任一区块链节点将所述密文密钥基于所述任一区块链节点的私钥进行解密以获取所述共享密钥。
  10. 根据权利要求9所述的方法,还包括:
    所述主节点基于所述主节点的私钥为所述密文密钥生成数字签名,并将所述数字签名发送至所述任一区块链节点;
    所述任一区块链节点基于所述主节点的公钥对所述数字签名进行验签,在验签成功的情况下确定所述密文密钥来源于所述主节点。
  11. 根据权利要求1所述的方法,所述区块链节点组中的各区块链节点处于相同的区块链网络或不同的区块链网络。
  12. 根据权利要求10所述的方法,所述不同的区块链网络之间彼此同构或异构。
  13. 根据权利要求1所述的方法,所述方法基于网络层协议实现。
  14. 一种消息传输装置,应用于源区块链节点,所述源区块链节点所属的区块链节点组中的各区块链节点均维护有相同的共享密钥;所述装置包括:
    加密单元,用于在明文消息对应的目的区块链节点包括所述区块链节点组中除所述源区块链节点以外的至少两个区块链节点的情况下,基于所述共享密钥对所述明文消息进行加密以获取加密消息;
    发送单元,用于将所述加密消息发送至所述至少两个区块链节点,所述至少两个区块链节点用于基于各自维护的所述共享密钥对所述加密消息进行解密以获取所述明文消息。
  15. 一种电子设备,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器通过运行所述可执行指令以实现如权利要求1-13中任一项所述的方法。
  16. 一种计算机可读存储介质,其上存储有计算机指令,该指令被处理器执行时实现如权利要求1-13中任一项所述方法的步骤。
PCT/CN2022/135607 2022-06-29 2022-11-30 一种消息传输方法、装置、电子设备和存储介质 Ceased WO2024001037A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210760927.XA CN115174188A (zh) 2022-06-29 2022-06-29 一种消息传输方法、装置、电子设备和存储介质
CN202210760927.X 2022-06-29

Publications (1)

Publication Number Publication Date
WO2024001037A1 true WO2024001037A1 (zh) 2024-01-04

Family

ID=83489420

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135607 Ceased WO2024001037A1 (zh) 2022-06-29 2022-11-30 一种消息传输方法、装置、电子设备和存储介质

Country Status (2)

Country Link
CN (1) CN115174188A (zh)
WO (1) WO2024001037A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119416231A (zh) * 2024-09-06 2025-02-11 天冕信息技术(深圳)有限公司 数据加密方法、装置、服务器及存储介质

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174188A (zh) * 2022-06-29 2022-10-11 蚂蚁区块链科技(上海)有限公司 一种消息传输方法、装置、电子设备和存储介质
CN116319840A (zh) * 2023-02-13 2023-06-23 远光软件股份有限公司 一种数据跨链共享方法、系统和电子设备
CN119628823A (zh) * 2023-09-13 2025-03-14 华为技术有限公司 密钥管理方法、装置、设备、存储介质及程序产品

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712261A (zh) * 2018-05-10 2018-10-26 杭州智块网络科技有限公司 一种基于区块链的密钥生成方法、装置及介质
KR20200048722A (ko) * 2018-10-30 2020-05-08 주식회사 머니브레인 블록체인에 기반한, 분산형 컴퓨팅 자원 공유 시스템 상에서의 워킹 그룹별 동일한 키를 사용하는 보안 통신 제공 방법
CN113992418A (zh) * 2021-10-29 2022-01-28 南京联了么信息技术有限公司 一种基于区块链技术的IoT设备管理方法
CN114285555A (zh) * 2021-12-15 2022-04-05 支付宝(杭州)信息技术有限公司 基于区块链的组播方法及装置
CN115174188A (zh) * 2022-06-29 2022-10-11 蚂蚁区块链科技(上海)有限公司 一种消息传输方法、装置、电子设备和存储介质

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102034449B1 (ko) * 2017-12-12 2019-10-21 주식회사 디지캡 콘텐츠 블록체인에서의 콘텐츠 암호키 관리 및 배포 방법
CN111404950B (zh) * 2020-03-23 2021-12-10 腾讯科技(深圳)有限公司 一种基于区块链网络的信息共享方法、装置和相关设备
CN112131316B (zh) * 2020-11-20 2021-02-12 腾讯科技(深圳)有限公司 应用于区块链系统的数据处理方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108712261A (zh) * 2018-05-10 2018-10-26 杭州智块网络科技有限公司 一种基于区块链的密钥生成方法、装置及介质
KR20200048722A (ko) * 2018-10-30 2020-05-08 주식회사 머니브레인 블록체인에 기반한, 분산형 컴퓨팅 자원 공유 시스템 상에서의 워킹 그룹별 동일한 키를 사용하는 보안 통신 제공 방법
CN113992418A (zh) * 2021-10-29 2022-01-28 南京联了么信息技术有限公司 一种基于区块链技术的IoT设备管理方法
CN114285555A (zh) * 2021-12-15 2022-04-05 支付宝(杭州)信息技术有限公司 基于区块链的组播方法及装置
CN115174188A (zh) * 2022-06-29 2022-10-11 蚂蚁区块链科技(上海)有限公司 一种消息传输方法、装置、电子设备和存储介质

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119416231A (zh) * 2024-09-06 2025-02-11 天冕信息技术(深圳)有限公司 数据加密方法、装置、服务器及存储介质

Also Published As

Publication number Publication date
CN115174188A (zh) 2022-10-11

Similar Documents

Publication Publication Date Title
US11316677B2 (en) Quantum key distribution node apparatus and method for quantum key distribution thereof
CN104160674B (zh) 内容中心网络
US11683160B2 (en) Encrypted group communications
TWI714270B (zh) 在用戶和可信計算群集之間建立可信通道的方法及裝置
CN115174188A (zh) 一种消息传输方法、装置、电子设备和存储介质
CN103036872B (zh) 数据传输的加密和解密方法、设备及系统
US20170149748A1 (en) Secure Group Messaging and Data Steaming
CN106487749A (zh) 密钥生成方法及装置
WO2024001035A1 (zh) 基于区块链中继通信网络系统的消息传输方法及装置
WO2020252611A1 (zh) 一种数据交互方法及相关设备
CN115174267A (zh) 一种tls协议协商方法、设备及介质
US20140181508A1 (en) Communication device and computer program product
WO2020237880A1 (zh) 基于非对称加密技术的数据交换方法、发送终端和计算机可读存储介质
CN115941278A (zh) 数据传输方法、装置、电子设备和计算机可读介质
WO2024001022A1 (zh) 跨子网调用
CN114142995B (zh) 面向区块链中继通信网络的密钥安全分发方法及装置
US12015702B2 (en) Key sharing for media frames using blockchain
CN107425959A (zh) 一种实现加密处理的方法、系统、客户端及服务端
WO2016134631A1 (zh) 一种OpenFlow报文的处理方法及网元
CN109905310B (zh) 数据传输方法、装置、电子设备
CN120582782B (zh) 基于量子密钥的网关拓扑组网方法、装置、设备和介质
US20200177557A1 (en) System and method for providing end-to-end security of data and metadata
US20240356909A1 (en) Signing messages using public key cryptography and certificate verification
CN115567195A (zh) 安全通信方法、客户端、服务器、终端和网络侧设备
WO2023024540A1 (zh) 处理报文、获取sa信息的方法、装置、系统及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22949116

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22949116

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 22949116

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25.06.2025)