A secure encryption method based on hop-by-hop routing

By adopting a double-layer encryption method in hop-by-hop routing, each relay node generates a shared key with its up-hop and down-hop nodes, and AES-CTR encryption is performed on the message, solving the problem of insufficient data security in hop-by-hop routing. , improves data privacy protection capabilities and routing flexibility, and reduces the computing load of the sender.

CN118677705BActive Publication Date: 2024-11-19MILITARY INTELLIGENCE RES INST OF THE CHINESE PEOPLES LIBERATION ARMY ACAD OF MILITARY SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411157403.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-22
Publication Date
2024-11-19
Estimated Expiration
2044-08-22

AI Technical Summary

Technical Problem

The hop-by-hop routing has shortcomings in data security, and it is impossible to determine the subsequent nodes in advance, so the message cannot be encrypted at a hierarchical level, resulting in the message content being easily observed and associated by malicious nodes during transmission.

Method used

Using the two-layer encryption method, each relay node generates a shared key with its up-hop and down-hop nodes, and the messages are encrypted and decrypted through the AES-CTR encryption algorithm to ensure that each link has two layers of encryption to prevent malicious intentions. The nodes are associated with the message content.

Benefits of technology

It improves data privacy protection capabilities, reduces the computing load of the sender, and improves the flexibility of the routing, so that when subsequent path nodes fail, alternative nodes can be selected to prevent attacks from malicious nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118677705B_ABST
    Figure CN118677705B_ABST
Patent Text Reader

Abstract

The invention discloses a secure encryption method based on hop-by-hop routing, comprising the following steps: S1. System initialization, user generates a shared key, and obtains necessary routing information through an administrator; S2. Sender encryption; the sender uses the shared key with the next hop to encrypt the message and sends it to the relay; S3. Relay encryption and decryption, the relay uses the shared key with the previous hop to decrypt the message, and uses the shared key with the next hop to encrypt the message and send it to the next hop; S4. Terminal relay decryption, the terminal relay uses the shared key with the previous hop to decrypt the message and sends it to the receiver; S5. Receiver decryption. The invention can be used for anonymous communication based on hop-by-hop routing, for increasing the data security of hop-by-hop routing, and for reducing the load of the sender.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of computer network security, in particular to a security encryption method based on hop-by-hop routing. Background Art

[0002] In recent years, network communication privacy leaks have emerged one after another, and the current situation of privacy protection in network communications has become increasingly severe. Although end-to-end encryption protects data privacy, the identity privacy of the host cannot be guaranteed because metadata such as the source and destination addresses and message length during the communication process will still be exposed to eavesdroppers. Anonymous communication mainly protects metadata during the communication process while protecting data privacy, thereby protecting identity privacy.

[0003] In layman's terms, anonymous communication can hide "who is communicating with whom, where and when". Some anonymous communication networks use source routing, that is, the source directly or indirectly determines the next hop of all relay nodes in the network. The relay nodes are only responsible for forwarding and have no decision-making power. Source routing usually brings the following problems:

[0004] 1. Scalability issues. The source needs to obtain a global view of the entire network, so it needs to download information about all nodes, including addresses, public keys, and other routing-related information.

[0005] 2. Poor flexibility. Once a node in the network is attacked, other nodes cannot help decrypt the message, forcing the user to resend the message.

[0006] 3. Load balancing problem. The source needs to understand the real-time load situation of the entire network and make routing decisions based on it, which often greatly increases the load on the source.

[0007] An anonymous communication system based on hop-by-hop routing can solve the above problems. In hop-by-hop routing, each relay node determines the next hop of the path locally, so that the source does not need to obtain a global view of the entire network. In the event of node failure, other nodes can still help forward, which has strong flexibility.

[0008] However, hop-by-hop routing has shortcomings in data security. When forwarding messages, hop-by-hop routing cannot determine the subsequent nodes in advance, so it is not possible to encrypt messages hierarchically. Typical protocols such as Crowds do not protect the content of messages, so it is not possible to prevent the association of messages entering and leaving the nodes. An improved way is to use single-hop encryption and decryption, that is, to generate a shared key between every two nodes, and then use the shared key to encrypt the message for protection. However, even so, a single malicious relay node can still easily observe the message content. Summary of the invention

[0009] In view of the problems existing in the prior art, the purpose of the present invention is to provide a secure encryption method for hop-by-hop routing, which can not only improve data security, but also reduce the source load compared to onion encryption, and is suitable for scenarios such as lightweight Internet of Things.

[0010] To achieve the above object, the present invention designs a secure encryption method based on hop-by-hop routing, comprising the following steps:

[0011] S1. System initialization: Before sending a message, users in the system first generate a shared key;

[0012] S2. The sender encrypts and generates Two-layer encrypted message Send to node ;

[0013] S3. Relay node encryption and decryption, when the node Received node Two-layer encrypted message , decrypt the message using the shared key with the previous hop node, and then encrypt the message using the shared key with the next hop node to obtain Two-layer encrypted message , and finally Send to node ;in, ;

[0014] S4. End relay decryption, when the node Received Two-layer encrypted message , decrypt the message using the shared key with the previous hop node, and get A layer of encrypted message And send it to the node ;

[0015] S5. Decryption by the receiver.

[0016] Further, step S1 includes the following sub-steps:

[0017] S1.1. For a node on a forwarding path , each node Both maintain a pair of asymmetric keys ;in, , is the private key, is the public key, is the number of nodes in the system, For the sender, node For the recipient;

[0018] S1.2. Node With Node Generate a shared key based on the DH key exchange protocol ;at the same time Generate and Shared key .

[0019] Further, in step S1.1, , It is the generator of the elliptic curve x25519.

[0020] Furthermore, in step S1.2, the DH key exchange protocol is RFC2631.

[0021] Further, in step S1.2, node Using its private key With Node The public key Generate a shared key based on the DH key exchange protocol .

[0022] Further, in step S1.2, Using its private key and nodes The public key According to the DH key exchange protocol, generate Shared key .

[0023] Further, step S2 includes the following sub-steps:

[0024] S2.1. Node Use and node and nodes Shared key and , for the message After encryption, the node is obtained Two-layer encrypted message : ,in and Represents the use of key and , to encrypt;

[0025] S2.2. Node The two-layer encrypted message Send to node .

[0026] Further, in step S2, encryption is performed based on the AES-CTR encryption algorithm.

[0027] Further, in step S3, encryption and decryption are performed based on the AES-CTR encryption algorithm.

[0028] Further, step S5 includes the following sub-steps:

[0029] S5.1. When the node Received node A layer of encrypted message , using the node Shared key For Node A layer of encrypted message Decrypt the message .

[0030] The security encryption method based on hop-by-hop routing of the present invention has the following beneficial effects:

[0031] 1. The present invention can improve the data privacy protection capability for hop-by-hop routing. Compared with the single-layer link encryption of Crowds, the present invention implements double-layer encryption.

[0032] 2. The present invention can reduce the computational load of the sender. Compared with onion encryption, the sender does not need to calculate a shared key with each relay.

[0033] 3. The present invention can support routing flexibility, and the subsequent relay does not generate a shared key with the source. When the subsequent path node fails, other nodes can be selected as replacements. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of the overall process of the secure encryption method based on hop-by-hop routing of the present invention;

[0035] Figure 2 The present invention is compared with several typical encryption methods in anonymous communication networks;

[0036] Figure 3 A schematic diagram of the basic principle of the secure encryption method based on hop-by-hop routing proposed by the present invention;

[0037] Figure 4 Schematic diagram of the delay comparison of source-generated messages in different encryption schemes. DETAILED DESCRIPTION

[0038] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0039] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.

[0040] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0041] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0042] like Figure 1-Figure 4 As shown, the present invention proposes a new encryption method to solve the problem of insufficient data privacy protection in hop-by-hop routing. The present invention is based on a stream encryption algorithm, which can reduce the computing overhead of the sender and improve the data security of hop-by-hop routing.

[0043] In the encryption method proposed by the present invention, each node shares a key with its next-down-hop node, and the encryption of any relay node is decrypted by its next-down-hop node. This makes each link on the forwarding path have two layers of encryption, and each relay node can only decrypt one layer of encryption. Therefore, even if there is a malicious relay node on the path, it cannot easily see the message content as in hop-by-hop routing. In addition, if Figure 2 As shown, compared with onion encryption, in the present invention, the sender does not need to calculate the shared key with all relay nodes, which reduces the computational overhead.

[0044] like Figure 1 As shown, the security encryption method based on hop-by-hop routing of the present invention mainly includes the following specific steps:

[0045] S1. System initialization: Before sending a message, users in the system first generate a key key. This includes the following sub-steps:

[0046] S1.1. For a node on a forwarding path , each node Both maintain a pair of asymmetric keys ;in, , is the private key, is the public key, , is the generator of the elliptic curve x25519, is the number of nodes in the system, For the sender, node For the receiver.

[0047] S1.2 Node Using its private key With Node The public key Generate a shared key based on the DH key exchange protocol , DH key exchange protocol refers to RFC2631;

[0048] at the same time Using its private key and nodes The public key Generate and Shared key .

[0049] Here, for the consistency of subsequent symbolic expressions, Reference .like Figure 3 As shown, the node For the sender, node For the receiver, the node It is a relay node. and its next hop node ,node and its next hop node ,node and its next hop node A shared key is generated between them.

[0050] Step S2: The sender encrypts. The sender generates Two-layer encrypted message Send to node ; Specifically includes the following sub-steps:

[0051] S2.1. Node Use and node and nodes Shared key and , for the message After encryption, we get Two-layer encrypted message : ,in and Represents the use of key and , encrypted based on the AES-CTR encryption algorithm.

[0052] S2.2, Node Will Two-layer encrypted message Send to node .

[0053] S3. Relay node encryption and decryption. Received node Two-layer encrypted message , perform the following substeps:

[0054] S3.1. Node Utilize and node Shared key right Decrypt it to get A layer of encrypted message .

[0055] in, Shared key , decrypted based on the AES-CTR algorithm. If it is a malicious node, it may try to obtain the message content Or perform correlation analysis on the message content, but it can only decrypt one layer of encryption, and the encrypted message after decryption Still ciphertext.

[0056] S3.2, Node Utilize and node Shared key right A layer of encrypted message Encrypted Two-layer encrypted message : .

[0057] in, Shared key , encrypted based on the AES-CTR algorithm.

[0058] S3.3. Node Will Two-layer encrypted message Send to node .

[0059] Step S4: Decryption at the end relay. Received Two layers of encrypted messages , perform the following substeps:

[0060] S4.1. Node Utilize and node Shared key right Decrypt to get A layer of encrypted message .

[0061] in, Shared key , decryption is performed based on the AES-CTR algorithm.

[0062] S4.2. Node The node A layer of encrypted message Send to node .

[0063] Step S5. The receiver decrypts. Received A layer of encrypted message , using the node Shared key right A layer of encrypted message Decrypt the message : .

[0064] The present invention compares the delay of source-generated messages and the delay of relay-processed messages in different encryption schemes. The data forwarding stage mainly analyzes the delay of data processing. The message load is set to 1024 bytes-10240 bytes respectively, and the number of path hops for onion encryption is set to 2-5 hops respectively, and then the message processing delay of onion encryption and the present invention is tested. For the source, Figure 4 It reflects the latency comparison of the source generating messages in the data processing stage. It can be seen that compared with onion encryption, the latency of the message generated by the present invention is smaller and the gap increases significantly with the increase of the number of hops. Even when the link has only two hops, the latency is the largest compared to other schemes. This is because the encryption of messages in onion encryption is performed by the source, while in the present invention, the source does not need to perform a large number of repeated encryption operations.

[0065] From the perspective of security analysis, for passive attacks, attackers can only conduct unauthorized eavesdropping, monitor transmissions, or collect information. This solution obfuscates the messages of each link, and the messages in different link segments of a path are encrypted by different keys, so that attackers cannot distinguish them without knowing the keys. In addition, for association based on message size. During the data transmission phase, each message will be padded to the same length, so that attackers cannot use the message length for association. The existing Crowds solution cannot prevent such attacks, and attackers can associate messages on different links.

[0066] In addition, the attacker may try to conduct active attacks by controlling malicious nodes to correlate messages. For a single malicious node on the path, or multiple discontinuous malicious nodes, the present invention can prevent this attack because the inner end-to-end encrypted message still has a layer of encryption protection. For Crowd and single-layer link encryption, malicious nodes can correlate messages.

[0067] Any process or method description in the flowchart of the present invention or described in other ways herein can be understood as a module, segment or part of a code including one or more executable instructions for implementing the steps of a specific logical function or process, which can be implemented in any computer-readable medium for use by an instruction execution system, device or equipment, and the computer-readable medium can be any medium containing storage, communication, propagation or transmission programs for use by execution systems, devices or equipment, including read-only memories, magnetic disks or optical disks, etc.

[0068] In the description of this specification, the description with reference to the terms "embodiment", "example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. In addition, those skilled in the art can combine or combine different embodiments or examples described in this specification and the features therein without causing any contradiction.

[0069] Although the above content has shown and described the embodiments of the present invention, it can be understood that the above embodiments are exemplary and cannot be understood as limitations of the present invention. Ordinary technicians in the field can change, modify, replace, modify and other update operations on the above embodiments within the scope of the present invention.

Claims

1. A secure encryption method based on hop-by-hop routing, It is characterized in that The following steps are involved: S1. System initialization: Before sending a message, users in the system first generate a shared key; S2. The sender encrypts and generates a node using a shared key Two layers of encrypted messages Send to node ; S3. Relay node encryption and decryption, when the node Received node Two layers of encrypted messages , decrypt the message using the shared key with the previous hop node, and then encrypt the message using the shared key with the next hop node to get the node Two layers of encrypted messages , and finally Send to node ;in, , is the number of nodes in the system; S4. End relay decryption, when the node Received node Two layers of encrypted messages , decrypt the message using the shared key with the previous hop node and get the node A layer of encrypted message And send it to the node ; S5. The receiver decrypts the data; Step S2 includes the following sub-steps: S2.

1. Node Use and node and nodes Shared key and , for the message After encryption, the node is obtained Two layers of encrypted messages ,in and Represents the use of key and Encryption is performed; S2.

2. Node The two-layer encrypted message Send to node .

2. A secure encryption method based on hop-by-hop routing according to claim 1, It is characterized in that Step S1 includes the following sub-steps: S1.

1. For a node on a forwarding path , each node Both maintain a pair of asymmetric keys ;in, , is the private key, is the public key, node For the sender, node For the recipient; S1.

2. Node With Node Generate a shared key based on the DH key exchange protocol ;at the same time Generate and Shared key .

3. A secure encryption method based on hop-by-hop routing as claimed in claim 2, It is characterized in that In step S1.1, , It is the generator of the elliptic curve x25519.

4. A secure encryption method based on hop-by-hop routing as claimed in claim 2, It is characterized in that In step S1.2, the DH key exchange protocol is RFC2631.

5. A secure encryption method based on hop-by-hop routing as claimed in claim 2, It is characterized in that In step S1.2, node Using its private key With Node The public key Generate a shared key based on the DH key exchange protocol .

6. A secure encryption method based on hop-by-hop routing as claimed in claim 2, It is characterized in that In step S1.2, node Using its private key and nodes The public key According to the DH key exchange protocol, generate Shared key .

7. A secure encryption method based on hop-by-hop routing as claimed in claim 5, It is characterized in that In step S2, encryption is performed based on the AES-CTR encryption algorithm.

8. A secure encryption method based on hop-by-hop routing as claimed in claim 1, It is characterized in that In step S3, encryption and decryption are performed based on the AES-CTR encryption algorithm.

9. A secure encryption method based on hop-by-hop routing as claimed in claim 1, It is characterized in that Step S5 includes the following sub-steps: S5.

1. When the node Received node A layer of encrypted message , using the node Shared key For Node A layer of encrypted message Decrypt the message : ,in, Shared key , decryption is performed based on the AES-CTR algorithm.