[go: up one dir, main page]

CN109428867B - Message encryption and decryption method, network equipment and system - Google Patents

Message encryption and decryption method, network equipment and system Download PDF

Info

Publication number
CN109428867B
CN109428867B CN201710763841.1A CN201710763841A CN109428867B CN 109428867 B CN109428867 B CN 109428867B CN 201710763841 A CN201710763841 A CN 201710763841A CN 109428867 B CN109428867 B CN 109428867B
Authority
CN
China
Prior art keywords
network device
subkey
field
value
serial number
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710763841.1A
Other languages
Chinese (zh)
Other versions
CN109428867A (en
Inventor
吴华佳
程志军
赖朝辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201710763841.1A priority Critical patent/CN109428867B/en
Publication of CN109428867A publication Critical patent/CN109428867A/en
Application granted granted Critical
Publication of CN109428867B publication Critical patent/CN109428867B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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
    • H04L63/0442Network 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 wherein the sending and receiving network entities apply asymmetric encryption, i.e. different keys for encryption and decryption

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A message encryption and decryption method, network equipment and system are provided, the method comprises: the method comprises the steps that a first network device and a second network device negotiate in advance to determine an original key, then the first network device generates a sub-key set by using the original key, further determines a sub-key from the sub-key set, and performs encryption processing by using the sub-key and a first field of a serial number of a data message generated by the first network device, so that an encryption field is generated, the first network device replaces the first field of the serial number by using the encryption field, then obtains a modified data message, and sends the modified data message to the second network device.

Description

一种报文加解密方法、网路设备及系统A message encryption and decryption method, network device and system

技术领域technical field

本申请涉及信息技术领域,尤其涉及一种报文加解密方法、网路设备及系统。The present application relates to the field of information technology, and in particular, to a message encryption and decryption method, network device and system.

背景技术Background technique

目前,随着网络通信在越来越多的政府部门和企业机构的广泛应用,共享信息与网上业务的不断增加,网络攻击和犯罪活动猖獗。如何防止网络中机密信息的泄露和篡改、阻止与打击信息犯罪、保障网络与信息安全,给人们提出了严峻的挑战。网络通信每天都面临着大量的各种方式的攻击,攻击可以分为主动攻击和被动攻击。主动攻击是指以各种方式有选择地破坏信息,如修改、删除、伪造、添加、重放、乱序冒充等。被动攻击是指在不干扰网络系统正常工作的情况下,进行侦收、截获、窃取、破译等。其中,重放是一种重要的攻击手段。At present, with the wide application of network communication in more and more government departments and enterprises, the sharing of information and online business is increasing, and network attacks and criminal activities are rampant. How to prevent the leakage and tampering of confidential information in the network, prevent and combat information crime, and ensure the security of the network and information, poses a serious challenge to people. Network communication is faced with a large number of attacks in various ways every day. Attacks can be divided into active attacks and passive attacks. Active attack refers to selectively destroying information in various ways, such as modification, deletion, forgery, addition, replay, out-of-order impersonation, etc. Passive attacks refer to reconnaissance, interception, stealing, and deciphering without interfering with the normal operation of the network system. Among them, replay is an important attack method.

重放攻击是指攻击者首先通过网络截取通信对等双方正常通信的数据包,然后将数据包原封不动,或经过修改,在等待一段时间之后,再发给数据包的接收者,即“重放”。重放的目的是为了冒充合法的一方和另一方进行通信。之所以采用重放的方式而不是直接发送伪造的数据包,是因为有的系统会将部分信息进行加密和认证,伪造的数据包可能无法取得数据包接收方的信任,而采用重放原本合法的数据包则可以达到此目的。A replay attack means that the attacker first intercepts the data packets of the normal communication between the communication peers through the network, and then leaves the data packets intact, or modifies them, and then sends them to the receiver of the data packets after waiting for a period of time, that is, " replay". The purpose of the replay is to impersonate a legitimate party to communicate with another party. The reason why the replay method is used instead of sending the forged data packets directly is because some systems will encrypt and authenticate some information. The data package can achieve this purpose.

现有技术为了解决重放攻击的问题,在每个安全性网络协议(internet protocolsecurity,IPSec)报头内,都包含了一个独一无二、且单调递增的序列号,通过每个数据包的序列号和一个“滑动”的接收窗口来主动筛选出重放报文,但是由于序列号单调递增,易猜测,容易造成防重放机制失效。In order to solve the problem of replay attacks in the prior art, each security network protocol (internet protocol security, IPSec) header contains a unique and monotonically increasing sequence number, through the sequence number of each data packet and a sequence number. The "sliding" receiving window is used to actively filter out the replayed packets. However, because the serial number is monotonically increasing, it is easy to guess, and it is easy to cause the failure of the anti-replaying mechanism.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本申请提供了一种报文加解密方法、网络设备及系统,用以解决有效地预防重放攻击的问题。In view of this, the present application provides a message encryption and decryption method, network device and system to solve the problem of effectively preventing replay attacks.

第一方面,本申请实施例提供了一种报文加密方法,该方法包括:第一网络设备与第二网络设备预先协商确定原始密钥,然后第一网络设备利用原始密钥生成子密钥集合,进而从子密钥集合中确定出一个子密钥,并利用这个子密钥与生成的数据报文的序列号的第一字段进行加密处理,从而生成加密字段,第一网络设备利用这个加密字段替换该数据报文的序列号的第一字段,然后得到修改后的数据报文,将修改后的数据报文发送至第二网络设备。In a first aspect, an embodiment of the present application provides a message encryption method. The method includes: a first network device and a second network device pre-negotiate to determine an original key, and then the first network device uses the original key to generate a subkey set, and then determine a subkey from the subkey set, and use this subkey and the first field of the serial number of the generated data packet to perform encryption processing, thereby generating an encrypted field, and the first network device uses this The encrypted field replaces the first field of the serial number of the data packet, and then the modified data packet is obtained, and the modified data packet is sent to the second network device.

因为数据报文中的序列号被加密了,所以攻击者即使截取了数据报文也无法解密得到原始序列号,所以可以有效地预防重放攻击的问题。Because the sequence number in the data packet is encrypted, the attacker cannot decrypt the original sequence number even if he intercepts the data packet, so the problem of replay attacks can be effectively prevented.

其中,第一网络设备与第二网络设备预先协商确定原始密钥的方式主要是采用IKE协商,协商过程是第一网络设备向所述第二网络设备发送因特网密钥交换IKE协商请求报文,其中IKE协商请求报文中的预定标识位的值指示第一网络设备支持对序列号加密传输;然后第二网络设备向第一网络设备发送IKE协商响应报文,其中,IKE协商响应报文中的预定标识位的值指示所述第二网络设备支持对序列号加密传输,并且在协商过程中利用密钥种子生成一个原始密钥。The first network device and the second network device pre-negotiate to determine the original key by using IKE negotiation, and the negotiation process is that the first network device sends an Internet key exchange IKE negotiation request message to the second network device, The value of the predetermined identification bit in the IKE negotiation request message indicates that the first network device supports encrypted transmission of the sequence number; then the second network device sends an IKE negotiation response message to the first network device, wherein the IKE negotiation response message The value of the predetermined identification bit indicates that the second network device supports encrypted transmission of the serial number, and uses the key seed to generate an original key in the negotiation process.

进而,第一网络设备将与所述第二网络设备协商确定的原始密钥拆分为N个字段,然后将所述N个字段复制成M个字段,并生成由M个字段组成的子密钥集合,之所以这样做,是为了增加子密钥的随机性和复杂性,避免被攻击者猜测出来。Further, the first network device splits the original key negotiated with the second network device into N fields, then copies the N fields into M fields, and generates a sub-key consisting of the M fields The key set, the reason for doing this, is to increase the randomness and complexity of the subkey and avoid being guessed by an attacker.

在一种可能的设计中,第一网络设备从子密钥集合中确定出一个子密钥的方法可以是第一网络设备将所述数据报文的序列号中包含的第二字段对M取模得到模值;然后以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。这样做的好处是序列号不同所以取模对应的模值也不相同,故确定出的子密钥也是动态的,所以攻击者很难破解得到子密钥,因此提高了加密方法的可靠性。In a possible design, the method for the first network device to determine a subkey from the subkey set may be that the first network device takes the second field included in the sequence number of the data packet to M modulo obtains a modulo value; then, using the modulo value as an index value, the subkey corresponding to the index value is found from the subkey set. The advantage of this is that the serial numbers are different, so the modulo values corresponding to the modulo are also different, so the determined subkey is also dynamic, so it is difficult for an attacker to crack the subkey, thus improving the reliability of the encryption method.

其中,第一网路设备对数据报文的加密方法有多种,在一种可能的设计中,第一网络设备将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到加密字段。一般,为了保证数据报文的长度尽可能不变,子密钥的字节数目一般与第一字段的数目相同。如果数据报文长度变长会增大开销,若变短则容易被攻击者破解,需要说明的是,上述加密方法也可以采用同或替代,即将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行同或操作,得到加密字段。相比而言,异或加密方式,不用像同或操作在解密时先取反,因此解密过程相对简便一些。There are various methods for encrypting the data packet by the first network device. In a possible design, the first network device encrypts the first field included in the serial number of the data packet and the determined sub-field. The key is XORed to get the encrypted field. Generally, in order to ensure that the length of the data packet is as constant as possible, the number of bytes of the subkey is generally the same as the number of the first field. If the length of the data packet becomes longer, it will increase the overhead. If the length of the data packet becomes shorter, it is easy to be cracked by the attacker. It should be noted that the above encryption method can also be replaced by the same or, that is, the first field included in the serial number of the data packet. Perform the same OR operation with the determined subkey to obtain the encrypted field. In contrast, the XOR encryption method does not need to negate the same or operation during decryption, so the decryption process is relatively simple.

另外,上面第一字段可以是序列号的高位字节部分,也可以是低位字节部分,假设说序列号包括L个字节,那么第一字段可以为所述序列号L/2个字节的高位字节部分,第二字段则为所述序列号L/2个字节的低位字节部分;或者所述第一字段可以为所述序列号L/2个字节的低位字节部分,则第二字段为所述序列号L/2个字节的高位字节部分。In addition, the first field above can be the high-order byte part of the serial number or the low-order byte part. Assuming that the serial number includes L bytes, the first field can be the serial number L/2 bytes The high-order byte part of the serial number, and the second field is the low-order byte part of the serial number L/2 bytes; or the first field can be the low-order byte part of the serial number L/2 bytes. , the second field is the high-order byte part of L/2 bytes of the serial number.

第二方面,与上面加密方法相对应,本发明实施例进一步地提供一种报文解密方法,该方法包括第二网络设备在接收到第一网络设备发送的数据报文之后,按照与第一网络设备相同的方式确定出一个子密钥,然后利用该子密钥对接收到的数据报文中序列号进行解密,解密方法与加密方法相对应,即将接收到的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行解密处理,得到解密字段,再利用所述解密字段替换所述数据报文的序列号中的第一字段,从而得到解密后的报文。In the second aspect, corresponding to the above encryption method, an embodiment of the present invention further provides a packet decryption method, the method includes that after the second network device receives the data packet sent by the first network device, according to the first network device The network device determines a subkey in the same way, and then uses the subkey to decrypt the serial number in the received data message. The decryption method corresponds to the encryption method. The included first field and the determined subkey are decrypted to obtain a decrypted field, and then the decrypted field is used to replace the first field in the sequence number of the data message, thereby obtaining a decrypted message .

这样即使数据报文中的序列号被加密了,第二网络设备可以按照解密方法对其进行正确解密,得到原始序列号,而攻击者即使截取了数据报文也无法解密得到原始序列号,所以可以有效地预防重放攻击的问题。In this way, even if the serial number in the data packet is encrypted, the second network device can correctly decrypt it according to the decryption method to obtain the original serial number, and even if the attacker intercepts the data packet, the original serial number cannot be decrypted. It can effectively prevent the problem of replay attacks.

当然,第二网络设备预先执行了与第一网络设备的IKE协商过程,协商过程与上文一致,因此该处不再赘述。另外,生成子密钥集合的方式以及从子密钥集合中确定出子密钥的过程也与上文相一致。Of course, the second network device has pre-executed the IKE negotiation process with the first network device, and the negotiation process is the same as the above, so it is not repeated here. In addition, the manner of generating the sub-key set and the process of determining the sub-key from the sub-key set are also consistent with the above.

第二网路设备对报文的解密方法是与加密方法相对应的,在一种可能的设计中,若第一网络设备采用的加密操作是异或,那么第二网络设备将接收到的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到解密字段;在另一种可能的设计中,若第一网络设备采用的加密操作是同或,那么第二网络设备将接收的序列号先取反,然后将接收的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,就可以得到解密字段。相比而言,异或加密方式,不用像同或操作在解密时先取反,因此解密过程相对简便一些。The decryption method of the packet by the second network device corresponds to the encryption method. In a possible design, if the encryption operation adopted by the first network device is XOR, the second network device will The first field contained in the serial number of the message is XORed with the determined subkey to obtain the decrypted field; in another possible design, if the encryption operation adopted by the first network device is XOR , then the second network device first inverts the received serial number, and then performs the XOR operation on the first field included in the serial number of the received data packet and the determined subkey to obtain the decrypted field. In contrast, the XOR encryption method does not need to negate the same or operation during decryption, so the decryption process is relatively simple.

第三方面,本申请实施例还提供了一种网络设备,该网络设备具有实现上述第一方面方法示例中报文加密行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或所述软件包括一个或多个与上述功能相对应的模块。In a third aspect, an embodiment of the present application further provides a network device, where the network device has a function of implementing the packet encryption behavior in the method example of the first aspect. The functions can be implemented by hardware, or can be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules corresponding to the above functions.

在一个可能的设计中,所述网络设备的结构中包括确定单元、加密单元、处理单元、发送单元,这些单元可以执行上述方法示例中相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible design, the structure of the network device includes a determination unit, an encryption unit, a processing unit, and a sending unit, and these units can perform the corresponding functions in the above method examples. For details, please refer to the detailed description in the method examples. Do repeat.

第四方面,本申请实施例还提供了一种第一网络设备,该第一网络设备具有实现上述第一方面方法示例中报文加密行为的功能。所述功能可以通过硬件实现。所述第一网络设备的结构中包括通信接口、处理器、以及存储器,其中,所述处理器调用存储在所述存储器中的指令,执行以下处理:In a fourth aspect, an embodiment of the present application further provides a first network device, where the first network device has a function of implementing the packet encryption behavior in the method example of the first aspect. The functions can be implemented by hardware. The structure of the first network device includes a communication interface, a processor, and a memory, wherein the processor invokes an instruction stored in the memory to perform the following processing:

从子密钥集合中确定出一个子密钥,将生成的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行加密处理,得到加密字段,并利用所述加密字段替换所述数据报文的序列号中的第一字段,从而得到修改后的数据报文;然后通过所述通信接口将包含所述序列号密文的数据报文发送至所述第二网络设备。Determine a subkey from the subkey set, encrypt the first field contained in the serial number of the generated data message and the determined subkey to obtain an encrypted field, and use the encrypted field to replace the first field in the serial number of the data message, so as to obtain the modified data message; and then send the data message containing the ciphertext of the serial number to the second network through the communication interface equipment.

因为数据报文中的序列号被加密了,所以攻击者即使截取了数据报文也无法解密得到原始序列号,所以可以有效地预防重放攻击的问题。Because the sequence number in the data packet is encrypted, the attacker cannot decrypt the original sequence number even if he intercepts the data packet, so the problem of replay attacks can be effectively prevented.

其中,第一网络设备与第二网络设备预先协商确定原始密钥的方式主要是采用IKE协商,协商过程是,在确定子密钥之前,所述处理器还用于:通过所述通信接口向所述第二网络设备发送的因特网密钥交换IKE协商请求报文,所述IKE协商请求报文中的预定标识位的值为第一值,其中第一值指示支持对序列号加密传输;通过所述通信接口接收所述第二网络设备发送的IKE协商响应报文,其中IKE协商响应报文中的预定标识位也是第一值的情况下,处理器确定所述第二网络设备支持对序列号加密传输。并且在协商过程中利用密钥种子生成一个原始密钥。The first network device and the second network device pre-negotiate to determine the original key mainly through IKE negotiation, and the negotiation process is that, before determining the subkey, the processor is further configured to: send a message to the communication interface through the communication interface. In the Internet Key Exchange IKE negotiation request message sent by the second network device, the value of the predetermined identification bit in the IKE negotiation request message is a first value, wherein the first value indicates that encrypted transmission of the serial number is supported; The communication interface receives the IKE negotiation response message sent by the second network device, where the predetermined identification bit in the IKE negotiation response message is also the first value, the processor determines that the second network device supports the pairing sequence. encrypted transmission. And use the key seed to generate an original key during the negotiation process.

进而,处理器将与所述第二网络设备协商确定的原始密钥拆分为N个字段;将所述N个字段复制成M个字段,并生成由M个字段组成的子密钥集合。之所以这样做,是为了增加子密钥的随机性和复杂性,避免被攻击者猜测出来。Further, the processor splits the original key negotiated with the second network device into N fields; copies the N fields into M fields, and generates a sub-key set consisting of the M fields. The reason for this is to increase the randomness and complexity of the subkey and avoid being guessed by an attacker.

在一种可能的设计中,处理器将所述序列号中包含的第二字段对M取模得到模值;然后以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。In a possible design, the processor obtains a modulus value by taking the second field contained in the serial number modulo M; then, using the modulus value as an index value, find the The subkey corresponding to the index value described above.

其中,对报文的加密方法有多种,在一种可能的设计中,处理器将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到加密字段。一般,为了保证数据报文的长度尽可能不变,子密钥的字节数目一般与第一字段的数目相同。There are various encryption methods for the message. In a possible design, the processor performs an XOR operation on the first field included in the serial number of the data message and the determined subkey to obtain Encrypted fields. Generally, in order to ensure that the length of the data packet is as constant as possible, the number of bytes of the subkey is generally the same as the number of the first field.

另外,上面第一字段可以是序列号的高位字节部分,也可以是低位字节部分,假设说序列号包括L个字节,那么第一字段可以为所述序列号L/2个字节的高位字节部分,第二字段则为所述序列号L/2个字节的低位字节部分;或者所述第一字段可以为所述序列号L/2个字节的低位字节部分,则第二字段为所述序列号L/2个字节的高位字节部分。In addition, the first field above can be the high-order byte part of the serial number or the low-order byte part. Assuming that the serial number includes L bytes, the first field can be the serial number L/2 bytes The high-order byte part of the serial number, and the second field is the low-order byte part of the serial number L/2 bytes; or the first field can be the low-order byte part of the serial number L/2 bytes. , the second field is the high-order byte part of L/2 bytes of the serial number.

第五方面,本申请实施例还提供了一种第二网络设备,该第二网络设备具有实现上述第二方面方法示例中报文解密行为的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或所述软件包括一个或多个与上述功能相对应的模块。In a fifth aspect, an embodiment of the present application further provides a second network device, where the second network device has a function of implementing the packet decryption behavior in the method example of the second aspect. The functions can be implemented by hardware, or can be implemented by hardware executing corresponding software. The hardware or the software includes one or more modules corresponding to the above functions.

在一个可能的设计中,所述第二网络设备的结构中包括确定单元、接收单元、解密单元、处理单元,这些单元可以执行上述方法示例中相应功能,具体参见方法示例中的详细描述,此处不做赘述。In a possible design, the structure of the second network device includes a determining unit, a receiving unit, a decrypting unit, and a processing unit, and these units can perform the corresponding functions in the above method examples. For details, please refer to the detailed description in the method examples. No further elaboration here.

第六方面,本申请实施例还提供了一种第二网络设备的另一种结构,该第二网络设备具有实现上述第二方面方法示例中报文解密行为的功能。所述功能可以通过硬件实现。所述网络设备的结构中包括通信接口、处理器、以及存储器,其中,所述处理器和所述存储器通过总线连接;所述处理器调用存储在所述存储器中的指令,执行上述方法,该处不再赘述。In a sixth aspect, an embodiment of the present application further provides another structure of a second network device, where the second network device has a function of implementing the packet decryption behavior in the method example of the second aspect. The functions can be implemented by hardware. The structure of the network device includes a communication interface, a processor, and a memory, wherein the processor and the memory are connected through a bus; the processor invokes an instruction stored in the memory to execute the above method, the It is not repeated here.

第七方面,本申请实施例中还提供一种计算机存储介质,该存储介质中存储软件程序,该软件程序在被一个或多个处理器读取并执行时可实现第一方面或上述第一方面的任意一种设计提供的方法。In a seventh aspect, the embodiments of the present application further provide a computer storage medium, where a software program is stored in the storage medium, and when the software program is read and executed by one or more processors, the first aspect or the above-mentioned first aspect can be implemented. A method provided by any design of the aspect.

第八方面,本申请实施例中还提供一种计算机存储介质,该存储介质中存储软件程序,该软件程序在被一个或多个处理器读取并执行时可实现第二方面或上述第二方面的任意一种设计提供的方法。In an eighth aspect, the embodiments of the present application further provide a computer storage medium, where a software program is stored in the storage medium, and when the software program is read and executed by one or more processors, the second aspect or the above-mentioned second aspect can be implemented. A method provided by any design of the aspect.

第九方面,本申请还提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述各方面或各种可能的实现方式所述的报文加密方法。In a ninth aspect, the present application also provides a computer program product containing instructions, which, when run on a computer, enables the computer to execute the message encryption method described in the above aspects or various possible implementation manners.

第十方面,本申请还提供了一种计算机程序,当其在计算机上运行时,使得计算机执行上述各方面或各种可能的实现方式所述的报文解密方法。In a tenth aspect, the present application further provides a computer program, which, when running on a computer, enables the computer to execute the message decryption method described in the above aspects or various possible implementation manners.

本申请中,因为子密钥在第一网络设备和第二网络设备之间协商确定的加密通道中传输,且是动态变化的,所述加密后的数据报文安全性高,另外对序列号进行加密的子密钥通过取模的方式确定,所以随机性高,加密后的序列号不可猜测,因此可以有效地防止重放攻击。In this application, because the sub-key is transmitted in the encrypted channel negotiated and determined between the first network device and the second network device, and is dynamically changed, the encrypted data message has high security, and the serial number The encrypted sub-key is determined by modulo, so the randomness is high, and the encrypted serial number cannot be guessed, so replay attacks can be effectively prevented.

附图说明Description of drawings

图1为本申请实施例提供的一种系统架构示意图;FIG. 1 is a schematic diagram of a system architecture provided by an embodiment of the present application;

图2为本申请实施例提供的一种基于IKE协商的系统架构示意图;2 is a schematic diagram of a system architecture based on IKE negotiation provided by an embodiment of the present application;

图3为本申请实施例提供的一种报文加密方法的流程示意图;3 is a schematic flowchart of a message encryption method provided by an embodiment of the present application;

图4为本申请实施例提供的IKE协商交互示意图;FIG. 4 is a schematic diagram of IKE negotiation interaction provided by an embodiment of the present application;

图5a~图5b为本申请实施例提供的报文保留字段位置示意图;5a-5b are schematic diagrams of the locations of message reserved fields provided by the embodiments of the present application;

图6为本申请实施例提供的一种报文解密方法的流程示意图;6 is a schematic flowchart of a message decryption method provided by an embodiment of the present application;

图7为本申请实施例提供的一种网路设备的装置示意图一;FIG. 7 is a first device schematic diagram of a network device according to an embodiment of the present application;

图8为本申请实施例提供的一种网路设备的装置示意图二;FIG. 8 is a second device schematic diagram of a network device according to an embodiment of the present application;

图9为本申请实施例提供的一种网路设备的结构示意图。FIG. 9 is a schematic structural diagram of a network device according to an embodiment of the present application.

具体实施方式Detailed ways

下面将结合附图对本申请作进一步地详细描述。The present application will be described in further detail below with reference to the accompanying drawings.

本申请中的报文加解密方法可适用于多种系统架构,图1为本申请适用的一种系统架构示意图。如图1所示,该系统架构中包括:发送端服务器101、发送端网关102、接收端网关103、接收端服务器104。The message encryption and decryption method in the present application can be applied to various system architectures, and FIG. 1 is a schematic diagram of a system architecture to which the present application is applied. As shown in FIG. 1 , the system architecture includes: a sending end server 101 , a sending end gateway 102 , a receiving end gateway 103 , and a receiving end server 104 .

其中,为了保证发送端网关102和接收端网关103传输数据包的安全性,发送端网关102和接收端网关103之间采用IPSec协议传输报文。Among them, in order to ensure the security of the data packet transmission between the sending end gateway 102 and the receiving end gateway 103 , the IPSec protocol is used to transmit packets between the sending end gateway 102 and the receiving end gateway 103 .

需要说明的是,IPSec是国际互联网工程任务组(the internet engineeringtask force,IETF)制定的为保证在因特网上传送数据的安全保密性能的三层隧道加密协议。IPSec在网络层(internet protocol,IP)对IP报文提供安全服务。IPSec协议本身定义了如何在IP数据包中增加字段来保证IP数据包的完整性、私有性和真实性,以及如何加密数据包。使用IPsec,数据就可以安全地在公网上传输。IPsec提供了两个主机之间、两个安全网关之间或主机和安全网关之间的保护。It should be noted that IPSec is a three-layer tunnel encryption protocol formulated by the Internet Engineering Task Force (IETF) to ensure the security and confidentiality of data transmitted on the Internet. IPSec provides security services for IP packets at the network layer (internet protocol, IP). The IPSec protocol itself defines how to add fields to IP data packets to ensure the integrity, privacy and authenticity of IP data packets, and how to encrypt data packets. Using IPsec, data can be securely transmitted over the public network. IPsec provides protection between two hosts, between two security gateways, or between a host and a security gateway.

IPSec包括报文验证头协议(authentication header,AH)(协议号51)和报文安全封装协议(encapsulated security payload,ESP)(协议号50)两个协议。AH可提供数据源验证和数据完整性校验功能;ESP除可提供数据验证和完整性校验功能外,还提供对IP报文的加密功能。IPSec协议的安全特点是1、数据机密性,即IPSec发送方在通过网络传输包前对包进行加密。2、数据完整性,即IPSec接收方对发送方发送来的包进行认证,以确保数据在传输过程中没有被篡改。3、数据来源认证,即IPSec接收方对IPSec包的源地址进行认证。这项服务基于数据完整性服务。4、反重放攻击,即IPSec接收方可检测并拒绝接收过时或重复的报文。IPSec includes two protocols, a packet authentication header (authentication header, AH) (protocol number 51) and a packet security encapsulation protocol (encapsulated security payload, ESP) (protocol number 50). AH can provide data source verification and data integrity verification functions; ESP can provide data verification and integrity verification functions as well as encryption functions for IP packets. The security features of the IPSec protocol are 1. Data confidentiality, that is, the IPSec sender encrypts the packets before transmitting them through the network. 2. Data integrity, that is, the IPSec receiver authenticates the packets sent by the sender to ensure that the data has not been tampered with during transmission. 3. Data source authentication, that is, the IPSec receiver authenticates the source address of the IPSec packet. This service is based on the Data Integrity Service. 4. Anti-replay attack, that is, the IPSec receiver can detect and refuse to receive outdated or duplicate packets.

所谓重放攻击是指攻击者首先通过网络截取通信对等双方正常通信的数据包,然后将数据包原封不动,或经过修改,在等待一段时间之后,再发给数据包的接收者,即“重放”。重放的目的是为了冒充合法的一方和另一方进行通信。之所以攻击者采用重放的方式而不是直接发送伪造的数据包,是因为有的系统会将部分信息进行加密和认证,伪造的数据包可能无法取得数据包接收方的信任,而采用重放原本合法的数据包则可以达到此目的。比如说,在移动IP中,当移动节点发现它的网络从一条链路切换到另一条链路上的时候,就要进行注册。注册的目的,一方面可以使移动节点得到外地链路上的外地代理的路由服务,另一方面可以通知家乡代理移动节点转交地址。注册消息是一个用户数据报协议(User Datagram Protocol,UDP)数据包,包含在IP数据包内。如果有攻击者截取了这个数据包,然后修改转交地址字段,然后再重发这个消息,则攻击者便注册到了一个伪造的转交地址。那么以后网络中所有发送给移动节点的数据包都会被转发到攻击者注册的那个转交地址那里,移动节点再也不会收到任何信息了。The so-called replay attack means that the attacker first intercepts the data packets of the normal communication between the communication peers through the network, and then leaves the data packets intact, or modifies them, and then sends them to the receiver of the data packets after waiting for a period of time, that is, "Replay". The purpose of the replay is to impersonate a legitimate party to communicate with another party. The reason why attackers use replay instead of directly sending forged data packets is because some systems encrypt and authenticate some information, and the forged data packets may not be trusted by the recipient of the data packets, and replay is used. Originally legitimate data packets can achieve this purpose. For example, in Mobile IP, a mobile node registers when it finds that its network has switched from one link to another. For the purpose of registration, on the one hand, the mobile node can obtain the routing service of the foreign agent on the foreign link, and on the other hand, it can notify the home agent of the mobile node's care-of address. The registration message is a User Datagram Protocol (UDP) data packet contained in an IP data packet. If an attacker intercepts the packet, modifies the care-of address field, and then resends the message, the attacker is registered with a fake care-of address. Then all the data packets sent to the mobile node in the network will be forwarded to the care-of address registered by the attacker, and the mobile node will never receive any information.

虽然利用IPSec协议传输报文,接收方可检测并拒绝接收过时或重复的报文,一定程度上可以防止重放攻击,但是因为IPSec协议传输的报文的序列号是明文,序列号具有单调递增或者递减的特点,所以攻击者一旦截取了一个报文,很容易根据该报文的序列号猜测后续报文的序列号,进而冒充发送方与接收方进行通信,而接收方单纯通过解析序列号,如果判断不是重复或者过时的,就会认为报文是合法的,所以无法准确地识别出攻击者的非法报文,这样容易造成IPSec协议的防重放作用失效。Although the IPSec protocol is used to transmit packets, the receiver can detect and refuse to receive outdated or duplicate packets, which can prevent replay attacks to a certain extent. However, because the serial number of the packet transmitted by the IPSec protocol is plaintext, the serial number has a monotonically increasing sequence number. Or the characteristics of decreasing, so once an attacker intercepts a message, it is easy to guess the serial number of the subsequent message based on the serial number of the message, and then pretend to be the sender to communicate with the receiver, and the receiver simply parses the serial number by parsing the serial number. , if the judgment is not repeated or outdated, the packet will be considered legitimate, so the attacker's illegal packet cannot be accurately identified, which will easily cause the IPSec protocol's anti-replay function to fail.

现有技术中也有新增校验字段对报文的序列号进行额外的校验方式,这样攻击者可以获取有效的序列号,但是无法通过报文验证,但是这样做的缺点是由于在报文头中新增了字段,所以需要调整报文的长度,带来额外的开销较大。In the prior art, a new check field is also added to perform additional check on the serial number of the message, so that an attacker can obtain a valid serial number, but cannot pass the message verification, but the disadvantage of this is that the A new field is added to the header, so the length of the message needs to be adjusted, which brings a lot of extra overhead.

考虑到现有IPSec报文还包含因特网密钥交换(internet key exchange,IKE)协议,IKE协商的主要功能是通信双方实现密钥协商,通过协商过程可以验证通信双方的身份是否合法,并在合法的情况下建立IPsec安全联盟(Security Association,SA)。基于上述原因,本申请实施例提供一种报文加解密方法,该方法结合利用了IKE协商机制,通过采用IKE协商确定的密钥种子,生成密钥,并利用该密钥将明文的序列号加密成密文,这样攻击者因为无法破解密钥,所以攻击者即使截取了数据报文,也无法猜测出后续的序列号,因此可以有效地预防重放攻击。Considering that the existing IPSec packets also include the Internet key exchange (IKE) protocol, the main function of IKE negotiation is to achieve key negotiation between the two parties. In the case of IPsec Security Association (Security Association, SA). Based on the above reasons, an embodiment of the present application provides a packet encryption and decryption method, which combines the use of the IKE negotiation mechanism, generates a key by using the key seed determined by the IKE negotiation, and uses the key to convert the serial number of the plaintext Encrypt it into cipher text, so that the attacker cannot crack the key, so even if the attacker intercepts the data packet, he cannot guess the subsequent sequence number, so replay attacks can be effectively prevented.

详细来说,IPSec报文所包含的IKE协议其主要功能就是在不安全的网络上安全地协商、分发、管理密钥、验证身份、建立安全联盟。SA是通信双方达成的一个协定,只有知道协定的全部信息,才能进行正确的IPSec处理。例如,协定好使用ESP方式进行封装,就不能使用AH方式进行解封装;同样,协定好使用3DES加密,就不能使用AES方式解密。In detail, the main function of the IKE protocol contained in IPSec packets is to negotiate, distribute, manage keys, verify identities, and establish security associations securely on an insecure network. SA is an agreement reached by both communication parties. Only when all the information of the agreement is known, the correct IPSec processing can be performed. For example, if it is agreed to use the ESP method for encapsulation, the AH method cannot be used for decapsulation; similarly, if the agreement is to use 3DES encryption, the AES method cannot be used for decryption.

为确保顺利进行IPSec通信,IKE协议执行双阶段协商。这两个阶段分别是主模式(Main Mode)协商和快速模式(Quick Mode)协商。To ensure smooth IPSec communication, the IKE protocol performs two-phase negotiation. The two phases are Main Mode negotiation and Quick Mode negotiation.

1、主模式(也称为第1阶段)IKE协商在两台计算机之间建立一个称为ISAKMP SA的安全通道。该安全通道主要是用于保护安全协商。1. Main mode (also known as Phase 1) IKE negotiation establishes a secure channel called an ISAKMP SA between two computers. The secure channel is mainly used to protect secure negotiation.

2、快速模式(也称为第2阶段)IKE协商在两台计算机之间建立一个通道来保护数据。由于这个阶段涉及SA的创建,因此在快速模式期间建立的SA称为IPSec SA。在快速模式期间,加密材料将被刷新,或在必要时生成新的密钥。在此期间还会选择一个用于保护特定IP流量的保护套件。2. Quick Mode (also known as Phase 2) IKE negotiation establishes a tunnel between two computers to protect data. Since this phase involves the creation of SAs, the SAs established during Quick Mode are called IPSec SAs. During fast mode, the cryptographic material will be refreshed, or new keys generated if necessary. A protection suite for protecting specific IP traffic is also selected during this period.

通过上述协商后可以生成一个共享密钥材料即密钥种子(SKEYSEED)。密钥种子的计算公式如下:After the above negotiation, a shared key material, that is, a key seed (SKEYSEED), can be generated. The formula for calculating the key seed is as follows:

SKEYSEED=prf(Ni|Nr,gΛir)………………………….公式[1]SKEYSEED=prf(Ni|Nr, gΛir )………………………….Formula [1]

SKEYSEED={SK_d|SK_ai|SK_ar|SK_ei|SK_er|SK_pi|SK_pr}SKEYSEED={SK_d|SK_ai|SK_ar|SK_ei|SK_er|SK_pi|SK_pr}

=prf+(SKEYSEED,Ni|Nr|SPIi|SPIr)……………公式[2] =prf+(SKEYSEED,Ni|Nr|SPIi|SPIr)………………Formula [2]

其中,SK_d用于第二阶段扩展密钥(只有它是不分方向的),SK_ai和SK_ar分别用作发起方和响应方的MAC密钥,SK_ei和SK_er分别用作发起方和响应方的加密密钥,SK_pi和SK_pr用于发起方和响应方的认证载荷计算。Among them, SK_d is used for the second-stage extended key (only it is non-directional), SK_ai and SK_ar are used as the MAC keys of the initiator and the responder, respectively, and SK_ei and SK_er are used for the encryption of the initiator and the responder, respectively. The keys, SK_pi and SK_pr are used in the authentication payload calculation for the initiator and responder.

另外,通过上述协商,双方可以根据协商结果确定后续在收到对方发送的数据报文时,是否需要进行解密,比如,协商结果是对方不支持加密,那么发送方就不会对待发送的数据报文加密,而是直接向接收侧发送,同时接收侧收到数据报文不进行解密操作,而是直接获取序列号进行校验。当然,如果协商结果是对方支持加密,那么发送方就会对待发送的数据报文加密,然后将加密后的数据报文发送至接收侧,同时接收侧收到数据报文进行解密操作。In addition, through the above negotiation, the two parties can determine whether they need to decrypt the data packets sent by the other party in the future according to the negotiation results. For example, if the negotiation result is that the other party does not support encryption, the sender will not treat the data packets sent The data is encrypted and sent directly to the receiving side. At the same time, the receiving side receives the data packet without decrypting it, but directly obtains the serial number for verification. Of course, if the negotiation result is that the other party supports encryption, the sender will encrypt the data packet to be sent, and then send the encrypted data packet to the receiving side, and the receiving side will decrypt the data packet received at the same time.

具体来说,本申请实施例提供的报文加解密方法包括报文加密方法和报文解密方法,适用本申请实施例提供的报文加解密方法的通信系统如图2所示,图2中主要包含如下过程:发送端网关102和接收端网关103之间先建立IKE的SA协商,然后发送端网关102利用协商确定的加密算法对IPSec报文进行加密,生成加密后的IPSec报文,然后将加密后的IPSec报文发送至接收端网关103,其中,接收端网关103用协商确定的解密算法对加密后的数据报文解密,还原得到原始的IPSec报文的序列号。Specifically, the packet encryption and decryption methods provided by the embodiments of the present application include a packet encryption method and a packet decryption method. A communication system applying the packet encryption and decryption methods provided by the embodiments of the present application is shown in FIG. 2 . It mainly includes the following process: firstly establish IKE SA negotiation between the sending end gateway 102 and the receiving end gateway 103, and then the sending end gateway 102 encrypts the IPSec message by using the encryption algorithm determined by the negotiation, generates an encrypted IPSec message, and then The encrypted IPSec packet is sent to the receiving end gateway 103, wherein the receiving end gateway 103 decrypts the encrypted data packet with the decryption algorithm determined by negotiation, and restores the serial number of the original IPSec packet.

下文拆解为加密过程和解密过程这两个过程分别对其进行详细阐述。The following is disassembled into the two processes of the encryption process and the decryption process, which will be described in detail respectively.

如图3所示,本申请实施例提供的一种报文加密方法的流程示意图,具体步骤如下:As shown in FIG. 3 , a schematic flowchart of a message encryption method provided by an embodiment of the present application, the specific steps are as follows:

步骤301,第一网络设备生成一个数据报文。Step 301, the first network device generates a data packet.

步骤302,所述第一网络设备从子密钥集合中确定出一个子密钥。例如,第一网络设备可以是附图2中的发送端网关102。Step 302, the first network device determines a subkey from the subkey set. For example, the first network device may be the sender gateway 102 in FIG. 2 .

步骤303,所述第一网络设备将待发送报文的序列号中包含的第一字段和所述确定出的子密钥进行加密处理,得到加密字段。Step 303, the first network device encrypts the first field included in the sequence number of the message to be sent and the determined subkey to obtain an encrypted field.

步骤304,所述第一网络设备利用所述加密字段替换所述数据报文的序列号中的第一字段,从而得到修改后的数据报文。Step 304, the first network device replaces the first field in the serial number of the data packet with the encrypted field, thereby obtaining a modified data packet.

步骤305,所述第一网络设备向第二网络设备发送所述修改后的数据报文。例如,第二网络设备可以是附图2中的接收端网关103。Step 305, the first network device sends the modified data packet to the second network device. For example, the second network device may be the receiving end gateway 103 in FIG. 2 .

需要说明的在执行步骤301之前,第一网络设备需要确定对端的第二网络设备是支持加密传输的,也就是说,第二网络设备接收到加密后的数据报文可以对其进行解密。因此在执行步骤301之前,第一网络设备和第二网络设备之间需要先进行IKE协商过程,协商的交互示意图如图4所示,包括:It should be noted that before step 301 is executed, the first network device needs to determine that the second network device at the opposite end supports encrypted transmission, that is, the second network device can decrypt the encrypted data packet after receiving it. Therefore, before performing step 301, an IKE negotiation process needs to be performed between the first network device and the second network device. The schematic diagram of the negotiation interaction is shown in Figure 4, including:

步骤401,第一网络设备向所述第二网络设备发送IKE协商请求报文。Step 401: The first network device sends an IKE negotiation request message to the second network device.

步骤402,第一网络设备接收所述第二网络设备发送的IKE协商响应报文。Step 402: The first network device receives the IKE negotiation response message sent by the second network device.

其中,第一网络设备发送的IKE协商请求报文携带预定标识位,而且预定标识位为第一值,第一值指示第一网络设备支持对序列号的加密传输,如果第二网络设备也支持对序列号的加密传输,则第二网络设备反馈的IKE协商响应报文中也携带该预定标识位,且预定标识为的值也为第一值。这样,第一网络设备根据所述IKE协商响应报文中的标识位的第一值可以确定所述第二网络设备支持对序列号加密传输。The IKE negotiation request message sent by the first network device carries a predetermined identification bit, and the predetermined identification bit is a first value, and the first value indicates that the first network device supports encrypted transmission of the sequence number. If the second network device also supports For encrypted transmission of the sequence number, the IKE negotiation response message fed back by the second network device also carries the predetermined identifier, and the value of the predetermined identifier is also the first value. In this way, the first network device may determine that the second network device supports encrypted transmission of the sequence number according to the first value of the identification bit in the IKE negotiation response message.

当第一网络设备确定对端的第二网络设备支持加密传输后,则第一网络设备对数据报文执行上述图3所述的加密过程,然后向第二网络设备发送加密后的数据报文;否则,第一网络设备省略加密过程,直接向第二网络设备发送未加密的数据报文。这样做可以兼容不支持加密传输的网络设备,避免发生通信失败的问题。After the first network device determines that the second network device at the opposite end supports encrypted transmission, the first network device performs the encryption process described in FIG. 3 on the data message, and then sends the encrypted data message to the second network device; Otherwise, the first network device omits the encryption process, and directly sends the unencrypted data packet to the second network device. Doing so can be compatible with network devices that do not support encrypted transmission and avoid communication failures.

其中,第一网络设备和第二网络设备所采用的标识位是IKE报文中未被使用的保留字段,例如,第一网络设备使用Security Association payload(安全联盟负载)头中RESERVED(保留字段)的7bit中的第一bit来标识第一网络设备是否支持对序列号进行加密,在整个Payload(负载)头中占位为第10bit。如图5a所示,E表示所使用的标识位,该标识位的值为0表示不支持对序列号进行加密,该标识位的值为1表示支持对序列号进行加密。这样,当第二网络设备收到该IKE协商请求报文,对Security Association payload(安全联盟负载)头中RESERVED(保留字段)中的第一bit进行解析判断,如果值为1,则认为第一网络设备支持对数据报文加密,后续在收到第一网络设备发送的数据报文时,首先对其进行解密操作。The identification bits used by the first network device and the second network device are unused reserved fields in the IKE packet. For example, the first network device uses RESERVED (reserved field) in the Security Association payload header. The first bit in the 7bit of the 1st network device is used to identify whether the first network device supports encryption of the serial number, and the 10th bit is occupied in the entire Payload (load) header. As shown in Fig. 5a, E represents the used identification bit, the value of the identification bit is 0, which means that the serial number is not supported to be encrypted, and the value of the identification bit is 1, which means that the encryption of the serial number is supported. In this way, when the second network device receives the IKE negotiation request message, it parses and judges the first bit in the RESERVED (reserved field) in the Security Association payload header. The network device supports encryption of the data packet, and when subsequently receiving the data packet sent by the first network device, it first performs a decryption operation on it.

另外,也可以如图5b所示,E表示所使用的标识位,值为0表示不支持对序列号进行加密,值为1表示支持对序列号进行加密。第二网络设备收到IKE协商请求报文,判断负荷中的标识位的值,如果值为1,则认为第一网络设备支持对数据报文加密,后续在收到第一网络设备发送的数据报文时,首先对其进行解密操作。In addition, as shown in FIG. 5b, E represents the used identification bit, the value of 0 means that the serial number is not supported to be encrypted, and the value of 1 means that the serial number is supported to be encrypted. The second network device receives the IKE negotiation request message, and judges the value of the flag in the payload. If the value is 1, it is considered that the first network device supports encryption of the data message, and subsequently receives the data sent by the first network device. When the message is sent, it is first decrypted.

另外,当第一网络设备与对端的第二网络设备完成IKE协商,确定对端支持加密传输之后,第一网络设备首先利用协商确定的密钥种子公式,生成原始密钥,再利用原始密钥生成子密钥集合。具体地,所述第一网络设备将与所述第二网络设备协商确定的原始密钥拆分为N个字段;然后所述第一网络设备将所述N个字段复制成M个字段,进而生成由M个字段组成的子密钥集合,一般M会大于N。In addition, after the first network device completes the IKE negotiation with the second network device of the opposite end and determines that the opposite end supports encrypted transmission, the first network device first uses the key seed formula determined by the negotiation to generate the original key, and then uses the original key Generate a set of subkeys. Specifically, the first network device splits the original key negotiated with the second network device into N fields; then the first network device copies the N fields into M fields, and then Generate a subkey set consisting of M fields, generally M will be greater than N.

例如说,将表一中的原始密钥Key值拆分为8个2字节,将这8个2字节按照值从大到小的顺序排列,依次循环填满一个长度为100的表二所示的Key表。For example, split the original key Key value in Table 1 into 8 2-bytes, arrange the 8 2-bytes in descending order of value, and fill a table 2 with a length of 100 in turn in a loop Key table shown.

表一Table I

0x2fe00x2fe0 0x1fd90x1fd9 0x1ee10x1ee1 0x1fe50x1fe5 0x1fa00x1fa0 0x11a10x11a1 0x21c30x21c3 0x1fe90x1fe9

表二Table II

0x2fe00x2fe0 0x21c30x21c3 0x1fe90x1fe9 0x1fe50x1fe5 0x1fd90x1fd9 0x1fa00x1fa0 0x1ee10x1ee1 ……... 0x1fe50x1fe5 0x1fd90x1fd9 0x1fa00x1fa0 0x1ee10x1ee1

另外,将表一中的原始密钥Key值拆分为8个2字节之后,也可以对表一中每个2字节进行变形,再用变形后的2字节生成Key表,变形方法可以是加1,或者其它现有方法,在此不再赘述。In addition, after dividing the original key Key value in Table 1 into 8 2-bytes, you can also deform each 2-byte in Table 1, and then use the deformed 2-bytes to generate the Key table. The deformation method It may be adding 1, or other existing methods, which will not be repeated here.

在一种可能的设计中,第一网络设备从子密钥集合中确定出一个子密钥,确定方法可以是所述第一网络设备将数据报文的序列号中包含的第二字段对M取模得到模值;所述第一网络设备以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。In a possible design, the first network device determines a subkey from the subkey set, and the determination method may be that the first network device compares the second field included in the serial number of the data packet to M The modulus value is obtained by taking the modulus; the first network device uses the modulus value as an index value to find the subkey corresponding to the index value from the subkey set.

比如说,将序列号0xefac 0x1b21的低16位0x1b21对M(例如M为100)取模,得到模值45,查找表二中Key表中第45个子密钥0x1fd9。当然,除此之外,也可以在IKE协商阶段,第一网络设备和第二网络设备协商指定子密钥集合某一个索引号为子密钥,比如说指定表二中KEY表中的第45个值0x1fd9作为子密钥。显然,利用取模方式可以更加动态地确定出子密钥,不容易被攻击者破解。For example, the lower 16-bit 0x1b21 of the serial number 0xefac 0x1b21 is modulo M (for example, M is 100) to obtain a modulo value of 45, and look up the 45th subkey 0x1fd9 in the Key table in Table 2. Of course, in addition to this, in the IKE negotiation stage, the first network device and the second network device can negotiate to specify a certain index number of the subkey set as a subkey, for example, specify the 45th index number in the KEY table in Table 2. A value of 0x1fd9 is used as a subkey. Obviously, the subkey can be determined more dynamically by using the modulo method, which is not easy to be cracked by an attacker.

当确定出子密钥之后,就可以利用确定出来的子密钥对序列号进行加密,在一种可能的设计中,第一网络设备将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到加密字段。例如,将子密钥0x1fd9与序列号的高16位0xefac进行异或操作,得到新的加密值0xf075,用新的加密值0xf075替换序列号的高16位0xefac后得到新的序列号0xf075 0x1b21,用新的序列号0xf075 0x1b21替换原数据报文中的序列号,将替换之后的数据报文发送至对端第二网络设备。这样,第二网络设备仍然采用异或操作就可以还原出原序列号,解密算法也很简便。After the sub-key is determined, the serial number can be encrypted by using the determined sub-key. In a possible design, the first network device encrypts the first field included in the serial number of the data packet and all the Perform the XOR operation on the determined subkey to obtain the encrypted field. For example, XOR the subkey 0x1fd9 with the high-order 16-bit 0xefac of the serial number to obtain a new encrypted value 0xf075, and replace the high-order 16-bit 0xefac of the serial number with the new encrypted value 0xf075 to obtain a new serial number 0xf075 0x1b21, Replace the serial number in the original data packet with the new serial number 0xf075 0x1b21, and send the replaced data packet to the peer second network device. In this way, the second network device can still restore the original serial number by using the XOR operation, and the decryption algorithm is also very simple.

一般,为了保证数据报文的长度尽可能不变,子密钥的字节数目一般与第一字段的数目相同。一方面,便于进行异或操作,另一方面数据报文长度变长会增大开销,若变短则容易被攻击者破解。需要说明的是,上述加密方法也可以采用同或替代,即将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行同或操作,得到加密字段。相比异或加密方式,采用同或操作,第二网络设备在解密时就需要先取反,再进行异或操作,解密过程相对复杂一些。Generally, in order to ensure that the length of the data packet is as constant as possible, the number of bytes of the subkey is generally the same as the number of the first field. On the one hand, it is convenient to perform the XOR operation, on the other hand, the length of the data packet will increase the overhead, and if the length of the data packet is shortened, it is easy to be cracked by the attacker. It should be noted that, the above encryption method can also adopt the same-or substitution, that is, perform the same-or operation on the first field included in the serial number of the data packet and the determined subkey to obtain the encrypted field. Compared with the XOR encryption method, in which the XOR operation is adopted, the second network device needs to negate first and then perform the XOR operation during decryption, and the decryption process is relatively complicated.

上面例子中,第一字段是序列号的高16位0xefac,第二字段是低16位0x1b21,需要说明的是,在其它可能的设计中,第一字段也可以不是序列号的一半字节,例如序列号是4字节,第一字段是1字节部分,第二字段是3字节部分,这样划分也可以实现上述方法,即对第二字段取模确定子密钥,然后进行加密运算。同样地,上面例子中,第一字段也可以是序列号的低16位0x1b21,第二字段是高16位0xefac,即对高16位取模,得到模值,然后低16位与模值对应的密钥值进行加密运算。In the above example, the first field is the high-order 16-bit 0xefac of the serial number, and the second field is the low-order 16-bit 0x1b21. It should be noted that in other possible designs, the first field may not be half of the serial number. For example, the serial number is 4 bytes, the first field is a 1-byte part, and the second field is a 3-byte part. In this way, the above method can also be implemented, that is, the second field is modulo determined to determine the subkey, and then the encryption operation is performed. . Similarly, in the above example, the first field can also be the lower 16-bit 0x1b21 of the serial number, and the second field is the upper 16-bit 0xefac, that is, the upper 16 bits are modulo to obtain the modulo value, and then the lower 16 bits correspond to the modulo value The key value of the encryption operation is performed.

与上述报文加密方法相对应,本申请实施例进一步对报文解密方法的具体过程进行详细说明,具体步骤如图6所示。Corresponding to the above message encryption method, the embodiment of the present application further describes the specific process of the message decryption method in detail, and the specific steps are shown in FIG. 6 .

步骤601,第二网络设备接收第一网络设备发送的数据报文。例如,第一网络设备可以是附图2中的发送端网关102,第二网络设备可以是附图2中的接收端网关103。Step 601: The second network device receives the data packet sent by the first network device. For example, the first network device may be the sending end gateway 102 in FIG. 2 , and the second network device may be the receiving end gateway 103 in FIG. 2 .

步骤602,第二网络设备从子密钥集合中确定出一个子密钥。Step 602, the second network device determines a subkey from the subkey set.

步骤602,所述第二网络设备接收所述第一网络设备发送的报文。Step 602, the second network device receives the packet sent by the first network device.

步骤603,所述第二网络设备将接收的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行解密处理,得到解密字段。Step 603: The second network device decrypts the first field included in the serial number of the received data packet and the determined subkey to obtain a decrypted field.

步骤604,所述第二网络设备利用所述解密字段替换所述数据报文的序列号中的第一字段,从而得到解密后的数据报文。Step 604, the second network device replaces the first field in the serial number of the data packet with the decryption field, thereby obtaining a decrypted data packet.

与上述报文加密方法类似,第二网络设备在接收到第一网络设备发送的数据报文之前,已经与第一网络设备完了IKE协商,利用协商确定的密钥种子公式,生成原始密钥,再利用原始密钥生成子密钥集合,其中子密钥集合的生成方式与上文相同,因此此处不再赘述。Similar to the above message encryption method, before receiving the data message sent by the first network device, the second network device has completed the IKE negotiation with the first network device, and uses the key seed formula determined by the negotiation to generate the original key, The original key is then used to generate a sub-key set, wherein the generation method of the sub-key set is the same as the above, so it is not repeated here.

也就是说,第二网络设备也按照与第一网络设备相同的方法,确定出子密钥集合,进一步再按照与第一网络设备一样的规则从子密钥集合中确定出一个子密钥,比如说,第一网络设备是对第二字段取模,利用模值作为索引值确定出子密钥,那么第二网络设备也是按照相同的规则确定出子密钥。That is to say, the second network device also determines a subkey set according to the same method as the first network device, and further determines a subkey from the subkey set according to the same rules as the first network device, For example, if the first network device takes the modulo of the second field, and uses the modulo value as an index value to determine the subkey, then the second network device also determines the subkey according to the same rule.

在一种可能的设计中,所述第二网络设备将所述数据报文的序列号中包含的第二字段对M取模得到模值;所述第二网络设备以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。In a possible design, the second network device obtains a modulo value by modulo M in the second field included in the serial number of the data packet; the second network device uses the modulo value as an index value, and find the subkey corresponding to the index value from the subkey set.

比如说,仍然以序列号0xefac 0x1b21为例,在上文中,第一网络设备用表2的Key表中第45个子密钥0x1fd9对其进行加密得到新的序列号0xf075 0x1b21,那么第二网络设备收到包含该序列号0xf075 0x1b21的数据报文,仍然利用第45个子密钥0x1fd9对0xf0750x1b21的高16位0xf075进行异或操作,将得到新的解密值0xefac,用新的解密值0xefac替换序列号的高16位0xf075后得到新的序列号0xefac 0x1b21,即还原得到第一网络设备所发送的数据报文对应的原始序列号。当然,若第一网络设备采取其它的规则确定出子密钥,并利用子密钥对序列号进行加密,例如对低位字节部分进行异或操作,得到新的加密值,这时第二网络设备也是对低位字节部分进行异或操作,得到新的解密值。For example, still taking the serial number 0xefac 0x1b21 as an example, in the above, the first network device encrypts it with the 45th subkey 0x1fd9 in the Key table of Table 2 to obtain a new serial number 0xf075 0x1b21, then the second network device After receiving the data message containing the serial number 0xf075 0x1b21, the 45th subkey 0x1fd9 is still used to perform XOR operation on the high 16-bit 0xf075 of 0xf0750x1b21, and a new decrypted value 0xefac will be obtained, and the serial number will be replaced with the new decrypted value 0xefac After the high 16 bits of 0xf075, a new serial number 0xefac 0x1b21 is obtained, that is, the original serial number corresponding to the data message sent by the first network device is obtained by restoration. Of course, if the first network device adopts other rules to determine the sub-key, and uses the sub-key to encrypt the serial number, such as XOR operation on the lower byte part, to obtain a new encrypted value, then the second network The device also performs an XOR operation on the lower byte part to obtain a new decrypted value.

在另一种可能的设计中,若第一网络设备将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行同或操作,得到加密字段,那么第二网络设备在解密时就需要先取反,再进行异或操作。例如,第一网络设备利用第45个子密钥0x1fd9对0xf075 0x1b21的高16位0xf075进行同或操作,那么,第二网络设备就需要先对数据报文的序列号0xf0750x1b21先取反,然后再对取反之后的序列号按照上面的例子中的方法解密。In another possible design, if the first network device performs an exclusive OR operation on the first field included in the serial number of the data packet and the determined subkey to obtain the encrypted field, then the second network device When decrypting, it needs to be negated first, and then the XOR operation is performed. For example, the first network device uses the 45th subkey 0x1fd9 to perform the same-or operation on the high 16-bit 0xf075 of 0xf075 0x1b21, then the second network device needs to first invert the serial number 0xf0750x1b21 of the data packet, and then The serial number after the inversion is decrypted according to the method in the above example.

针对上述方法流程,本申请提供一种网络设备,该网络设备的具体执行内容可参照上述报文加密方法对应实施例。In view of the above method flow, the present application provides a network device. For the specific execution content of the network device, reference may be made to the corresponding embodiments of the above message encryption method.

图7为本申请提供的一种第一网络设备的结构示意图,如图7所示,所述第一网络设备包括:FIG. 7 is a schematic structural diagram of a first network device provided by this application. As shown in FIG. 7 , the first network device includes:

生成单元701,用于生成一个数据报文。The generating unit 701 is used for generating a data message.

确定单元702,用于从子密钥集合中确定出一个子密钥,所述子密钥集合包含M个子密钥,所述M个子密钥是根据原始密钥拆分得到的N个字段生成的,所述原始秘钥是所述第一网络设备与第二网络设备预先协商确定的,M大于等于N。Determining unit 702, configured to determine a subkey from a subkey set, where the subkey set includes M subkeys, and the M subkeys are generated according to N fields obtained by splitting the original key Yes, the original key is pre-negotiated and determined by the first network device and the second network device, and M is greater than or equal to N.

加密单元703,用于将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行加密处理,得到加密字段,其中,所述序列号中包含多个字段。The encryption unit 703 is configured to perform encryption processing on the first field included in the serial number of the data packet and the determined subkey to obtain an encrypted field, wherein the serial number includes multiple fields.

处理单元704,用于利用所述加密字段替换所述数据报文的序列号中的第一字段,从而得到修改后的数据报文。The processing unit 704 is configured to replace the first field in the sequence number of the data packet with the encrypted field, so as to obtain the modified data packet.

发送单元705,用于向所述第二网络设备发送所述修改后的数据报文。The sending unit 705 is configured to send the modified data packet to the second network device.

可选地,所述确定单元702具体用于:将所述序列号中包含的第二字段对M取模得到模值;以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。Optionally, the determining unit 702 is specifically configured to: obtain a modulo value by taking the second field included in the serial number modulo M; and use the modulo value as an index value to search from the subkey set to the subkey corresponding to the index value.

可选地,所述加密单元703具体用于:将数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到加密字段,其中,所述确定出的子密钥的字节数目与所述第一字段的字节数目相同。Optionally, the encryption unit 703 is specifically configured to: perform an XOR operation on the first field included in the serial number of the data packet and the determined subkey to obtain an encrypted field, wherein the determined The number of bytes of the subkey is the same as the number of bytes of the first field.

其中,所述序列号包括L个字节,则所述第一字段为所述序列号L/2个字节的高位字节部分,所述第二字段为所述序列号L/2个字节的低位字节部分;或者所述第一字段为所述序列号L/2个字节的低位字节部分,所述第二字段为所述序列号L/2个字节的高位字节部分。Wherein, the serial number includes L bytes, the first field is the high-order byte part of the serial number L/2 bytes, and the second field is the serial number L/2 words The lower byte part of the section; or the first field is the lower byte part of the L/2 bytes of the sequence number, and the second field is the upper byte of the L/2 bytes of the sequence number part.

所述第一网络设备还包括:生成单元701,用于将与所述第二网络设备协商确定的原始密钥拆分为N个字段;将所述N个字段复制成M个字段,并生成由M个字段组成的子密钥集合。The first network device further includes: a generating unit 701, configured to split the original key negotiated with the second network device into N fields; copy the N fields into M fields, and generate A subkey set consisting of M fields.

可选地,所述发送单元705还用于:向所述第二网络设备发送因特网密钥交换IKE协商请求报文,所述IKE协商请求报文中的标识位的值指示自身支持对序列号加密传输;Optionally, the sending unit 705 is further configured to: send an Internet Key Exchange IKE negotiation request message to the second network device, where the value of the identification bit in the IKE negotiation request message indicates that it supports the pairing of the serial number. encrypted transmission;

所述网络设备还包括:接收单元706,还用于接收所述第二网络设备发送的IKE协商响应报文;The network device further includes: a receiving unit 706, further configured to receive an IKE negotiation response message sent by the second network device;

可选地,所述确定单元702,还用于根据所述IKE协商响应报文中的标识位的值确定所述第二网络设备支持对序列号加密传输。Optionally, the determining unit 702 is further configured to determine, according to the value of the identification bit in the IKE negotiation response message, that the second network device supports encrypted transmission of the sequence number.

图8为本申请提供的与报文解密方法相对应的第二网络设备的结构示意图,如图8所示,所述第二网络设备包括:确定单元801、接收单元802、解密单元803和处理单元804;具体地:FIG. 8 is a schematic structural diagram of a second network device corresponding to the packet decryption method provided by this application. As shown in FIG. 8 , the second network device includes: a determining unit 801, a receiving unit 802, a decrypting unit 803, and a processing unit 801. Unit 804; specifically:

接收单元801,用于接收第一网络设备发送的数据报文。The receiving unit 801 is configured to receive a data packet sent by a first network device.

确定单元802,用于从子密钥集合中确定出一个子密钥,所述子密钥集合包含M个子密钥,所述M个子密钥是根据原始密钥拆分得到的N个字段生成的,所述原始秘钥是第一网络设备与所述第二网络设备预先协商确定的,M大于等于N。Determining unit 802, configured to determine a subkey from a subkey set, where the subkey set includes M subkeys, and the M subkeys are generated according to N fields obtained by splitting the original key Yes, the original key is pre-negotiated and determined by the first network device and the second network device, and M is greater than or equal to N.

解密单元803,用于将接收的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行解密处理,得到解密字段,其中,所述序列号中包含多个字段。The decryption unit 803 is configured to perform decryption processing on the first field included in the serial number of the received data packet and the determined subkey to obtain a decrypted field, wherein the serial number includes multiple fields.

处理单元804,用于利用所述解密字段替换所述数据报文的序列号中的第一字段,从而得到解密后的报文。The processing unit 804 is configured to replace the first field in the sequence number of the data packet with the decrypted field, so as to obtain the decrypted packet.

可选地,所述确定单元802具体用于:将所述序列号中包含的第二字段对M取模得到模值;以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。Optionally, the determining unit 802 is specifically configured to: take the second field included in the serial number modulo M to obtain a modulo value; use the modulo value as an index value to search from the subkey set to the subkey corresponding to the index value.

可选地,所述解密单元803具体用于:将接收的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到解密字段,其中,所述确定出的子密钥的字节数目与所述第一字段的字节数目相同。Optionally, the decryption unit 803 is specifically configured to: perform an XOR operation on the first field included in the serial number of the received data packet and the determined subkey to obtain a decrypted field, wherein the The determined number of bytes of the subkey is the same as the number of bytes of the first field.

其中,所述序列号包括L个字节,则所述第一字段为所述序列号L/2个字节的高位字节部分,所述第二字段为所述序列号L/2个字节的低位字节部分;或者所述第一字段为所述序列号L/2个字节的低位字节部分,所述第二字段为所述序列号L/2个字节的高位字节部分。Wherein, the serial number includes L bytes, the first field is the high-order byte part of the serial number L/2 bytes, and the second field is the serial number L/2 words The lower byte part of the section; or the first field is the lower byte part of the L/2 bytes of the sequence number, and the second field is the upper byte of the L/2 bytes of the sequence number part.

所述第二网络设备还包括:The second network device further includes:

生成单元805,用于将与所述第一网络设备协商确定的原始密钥拆分为N个字段;并将所述N个字段复制成M个字段,并生成由M个字段组成的子密钥集合。The generating unit 805 is configured to split the original key negotiated with the first network device into N fields; copy the N fields into M fields, and generate a sub-key consisting of the M fields key set.

可选地,所述接收单元802,还用于接收所述第一网络设备发送的IKE协商请求报文,所述IKE协商请求报文中的标识位的值指示所述第一网络设备支持对序列号加密传输;Optionally, the receiving unit 802 is further configured to receive an IKE negotiation request message sent by the first network device, where the value of the identification bit in the IKE negotiation request message indicates that the first network device supports pairing. Serial number encrypted transmission;

所述第二网络设备还包括:The second network device further includes:

发送单元806,用于向所述第一网络设备发送IKE协商响应报文,其中,所述IKE协商响应报文中的所述标识位的值指示所述第二网络设备支持对序列号的加密传输。A sending unit 806, configured to send an IKE negotiation response message to the first network device, wherein the value of the identification bit in the IKE negotiation response message indicates that the second network device supports encryption of the sequence number transmission.

图9为本申请提供的另一种网络设备的结构示意图,该网络设备可以执行上述报文加密方法或者报文解密方法,如图9所示,所述网络设备900包括:通信接口901、处理器902、存储器903和总线系统904;FIG. 9 is a schematic structural diagram of another network device provided by this application. The network device can execute the above message encryption method or message decryption method. As shown in FIG. 9 , the network device 900 includes: a communication interface 901 , a processing 902, memory 903 and bus system 904;

其中,存储器903,用于存放程序。具体地,程序可以包括程序代码,程序代码包括计算机操作指令。存储器903可能为随机存取存储器(random-access memory,RAM),也可能为非易失性存储器(non-volatile memory,NVM),例如至少一个磁盘存储器。图中仅示出了一个存储器,当然,存储器也可以根据需要,设置为多个。存储器903也可以是处理器902中的存储器。Among them, the memory 903 is used for storing programs. Specifically, the program may include program code, and the program code includes computer operation instructions. The memory 903 may be random-access memory (RAM), or may be non-volatile memory (NVM), such as at least one disk storage. Only one memory is shown in the figure, of course, the number of memories can also be set as many as required. Memory 903 may also be memory in processor 902 .

存储器903存储了如下的元素,可执行模块或者数据结构,或者它们的子集,或者它们的扩展集:Memory 903 stores the following elements, executable modules or data structures, or a subset thereof, or an extended set of them:

操作指令:包括各种操作指令,用于实现各种操作。Operation instructions: including various operation instructions, which are used to realize various operations.

操作系统:包括各种系统程序,用于实现各种基础业务以及处理基于硬件的任务。Operating System: Includes various system programs for implementing various basic services and handling hardware-based tasks.

处理器902控制网络设备900的操作,处理器902还可以称为中央处理单元(英文:central processing unit,CPU)。具体的应用中,网络设备900的各个组件通过总线系统904耦合在一起,其中总线系统904除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图中将各种总线都标为总线系统904。为便于表示,图9中仅是示意性画出。The processor 902 controls the operation of the network device 900, and the processor 902 may also be referred to as a central processing unit (English: central processing unit, CPU). In a specific application, various components of the network device 900 are coupled together through a bus system 904, where the bus system 904 may include a power bus, a control bus, a status signal bus, and the like in addition to a data bus. For clarity, however, the various buses are labeled as bus system 904 in the figure. For convenience of representation, only a schematic drawing is shown in FIG. 9 .

具体来说,如果网络设备900所执行的方法是报文加密方法,那么网络设备900就对应图2中的发送端网关102,结合图3来说,通信接口901用于执行步骤305,即向第二网络设备发送所述修改后的数据报文。如果网络设备900所执行的方法是报文解密方法,那么网络设备900就对应图2中的接收端网关103,结合图6来说,通信接口901用于执行步骤601,即接收第一网络设备发送的数据报文。Specifically, if the method executed by the network device 900 is a message encryption method, then the network device 900 corresponds to the sending end gateway 102 in FIG. 2 . Referring to FIG. 3 , the communication interface 901 is used to execute step 305, that is, to The second network device sends the modified data message. If the method executed by the network device 900 is a packet decryption method, then the network device 900 corresponds to the receiving end gateway 103 in FIG. 2 . Referring to FIG. 6 , the communication interface 901 is used to perform step 601, that is, to receive the first network device data packets sent.

同样地,如果网络设备900所执行的方法是报文加密方法,那么处理器902就用于执行图3中的步骤301至步骤304。如果网络设备900所执行的方法是报文解密方法,那么处理器902就用于执行图6中的步骤602至步骤604。关于处理器902的执行细节请参考前面方法实施例中的描述,在这里不再详述。Likewise, if the method executed by the network device 900 is a packet encryption method, the processor 902 is configured to execute steps 301 to 304 in FIG. 3 . If the method executed by the network device 900 is a packet decryption method, the processor 902 is configured to execute steps 602 to 604 in FIG. 6 . For details of the execution of the processor 902, please refer to the descriptions in the foregoing method embodiments, which will not be described in detail here.

其中,处理器902可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器902中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器902可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器903,处理器902读取存储器903中的信息,结合其硬件执行以上方法步骤。The processor 902 may be an integrated circuit chip with signal processing capability. In the implementation process, each step of the above-mentioned method may be completed by an integrated logic circuit of hardware in the processor 902 or an instruction in the form of software. The above-mentioned processor 902 may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory 903, and the processor 902 reads the information in the memory 903, and performs the above method steps in combination with its hardware.

从上述内容可以看出:本申请实施例中,因为子密钥在第一网络设备和第二网络设备之间协商确定的加密通道中传输,且是动态变化的,所述加密后的数据报文安全性高,另外对序列号进行加密的子密钥通过取模的方式确定,所以随机性高,加密后的序列号不可猜测,因此可以有效地防止重放攻击;第一网络设备和第二网络设备仅使用未被使用的保留字段来标识自身是否对数据报文加密,因此不会增加数据报文的长度,开销并没有增加。It can be seen from the above that in this embodiment of the present application, because the subkey is transmitted in the encrypted channel negotiated between the first network device and the second network device and changes dynamically, the encrypted datagram In addition, the sub-key for encrypting the serial number is determined by modulo, so the randomness is high, and the encrypted serial number cannot be guessed, so replay attacks can be effectively prevented; The second network device only uses the unused reserved field to identify whether it encrypts the data packet, so the length of the data packet is not increased, and the overhead is not increased.

本领域内的技术人员应明白,本发明实施例可提供为方法、系统、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。It should be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, a system, or a computer program product. Accordingly, embodiments of the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present invention may take the form of a computer program product implemented on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, CD-ROM, optical storage, and the like.

本发明实施例是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present invention are described with reference to flowcharts and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

显然,本领域的技术人员可以对本发明实施例进行各种改动和变型而不脱离本申请的范围。这样,倘若本发明实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present invention without departing from the scope of the present application. Thus, if these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims (17)

1.一种报文加密方法,其特征在于,该方法包括:1. a message encryption method, is characterized in that, this method comprises: 第一网络设备生成一个数据报文;The first network device generates a data packet; 所述第一网络设备从子密钥集合中确定出一个子密钥,所述子密钥集合包含M个子密钥,所述M个子密钥是根据原始密钥拆分得到的N个字段生成的,所述原始密钥是所述第一网络设备与第二网络设备预先协商确定的,M大于等于N;The first network device determines a subkey from the subkey set, the subkey set includes M subkeys, and the M subkeys are generated according to N fields obtained by splitting the original key , the original key is pre-negotiated and determined by the first network device and the second network device, and M is greater than or equal to N; 所述第一网络设备将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行加密处理,得到加密字段,其中,所述序列号中包含多个字段;The first network device encrypts the first field contained in the serial number of the data packet and the determined subkey to obtain an encrypted field, wherein the serial number includes multiple fields; 所述第一网络设备利用所述加密字段替换所述数据报文的序列号中的第一字段,从而得到修改后的数据报文;The first network device uses the encrypted field to replace the first field in the serial number of the data packet, thereby obtaining a modified data packet; 所述第一网络设备向所述第二网络设备发送所述修改后的数据报文。The first network device sends the modified data message to the second network device. 2.根据权利要求1所述的方法,其特征在于,所述子密钥集合还包括每个子密钥对应的索引值,所述第一网络设备从子密钥集合中确定出一个子密钥,包括:2. The method according to claim 1, wherein the subkey set further comprises an index value corresponding to each subkey, and the first network device determines a subkey from the subkey set ,include: 所述第一网络设备将所述序列号中包含的第二字段对M取模得到模值;The first network device obtains a modulo value by taking the second field included in the serial number modulo M; 所述第一网络设备以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。The first network device uses the modulus value as an index value to find a subkey corresponding to the index value from the subkey set. 3.根据权利要求1或2所述的方法,其特征在于,所述第一网络设备将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行加密处理,得到加密字段,包括:3. The method according to claim 1 or 2, wherein the first network device performs encryption processing on the first field included in the serial number of the data packet and the determined subkey , get encrypted fields, including: 所述第一网络设备将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到加密字段,其中,所述确定出的子密钥的字节数目与所述第一字段的字节数目相同。The first network device performs an XOR operation on the first field included in the serial number of the data packet and the determined subkey to obtain an encrypted field, wherein the determined subkey is The number of bytes is the same as the number of bytes of the first field. 4.根据权利要求1至2任一项所述的方法,其特征在于,所述第一网络设备从子密钥集合中确定出第一子密钥之前,还包括:4. The method according to any one of claims 1 to 2, wherein before the first network device determines the first subkey from the subkey set, the method further comprises: 所述第一网络设备向所述第二网络设备发送因特网密钥交换IKE协商请求报文,所述IKE协商请求报文中的预定标识位的值被设置为第一值,所述第一值指示支持对序列号加密传输;The first network device sends an Internet Key Exchange IKE negotiation request message to the second network device, and the value of the predetermined identification bit in the IKE negotiation request message is set to a first value, and the first value Indicates support for encrypted transmission of serial numbers; 所述第一网络设备接收所述第二网络设备发送的IKE协商响应报文,所述IKE协商响应报文中的预定标识位的值被设置为所述第一值;The first network device receives the IKE negotiation response message sent by the second network device, and the value of the predetermined identification bit in the IKE negotiation response message is set to the first value; 所述第一网络设备根据所述IKE协商响应报文中的预定标识位的值确定所述第二网络设备支持对序列号加密传输。The first network device determines that the second network device supports encrypted transmission of the sequence number according to the value of the predetermined identification bit in the IKE negotiation response message. 5.一种报文解密方法,其特征在于,该方法包括:5. A message decryption method, characterized in that the method comprises: 第二网络设备接收第一网络设备发送的数据报文;The second network device receives the data packet sent by the first network device; 所述第二网络设备从子密钥集合中确定出一个子密钥,所述子密钥集合包含M个子密钥,所述M个子密钥是根据原始密钥拆分得到的N个字段生成的,所述原始密钥是所述第一网络设备与所述第二网络设备预先协商确定的,M大于等于N;The second network device determines a subkey from the subkey set, the subkey set includes M subkeys, and the M subkeys are generated according to N fields obtained by splitting the original key , the original key is determined in advance by the first network device and the second network device through negotiation, and M is greater than or equal to N; 所述第二网络设备将接收到的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行解密处理,得到解密字段,其中,所述序列号中包含多个字段;The second network device decrypts the first field contained in the serial number of the received data packet and the determined subkey to obtain a decrypted field, wherein the serial number contains multiple fields ; 所述第二网络设备利用所述解密字段替换所述数据报文的序列号中的第一字段,从而得到解密后的数据报文。The second network device replaces the first field in the sequence number of the data packet with the decryption field, thereby obtaining a decrypted data packet. 6.根据权利要求5所述的方法,其特征在于,所述子密钥集合还包括每个子密钥对应的索引值,所述第二网络设备从子密钥集合中确定出一个子密钥,包括:6. The method according to claim 5, wherein the subkey set further comprises an index value corresponding to each subkey, and the second network device determines a subkey from the subkey set ,include: 所述第二网络设备将所述数据报文的序列号中包含的第二字段对M取模得到模值;The second network device obtains a modulo value by modulo M of the second field included in the serial number of the data packet; 所述第二网络设备以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。The second network device uses the modulus value as an index value to find a subkey corresponding to the index value from the subkey set. 7.根据权利要求5或6所述的方法,其特征在于,所述第二网络设备将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行解密处理,得到解密字段,包括:7. The method according to claim 5 or 6, wherein the second network device decrypts the first field contained in the serial number of the data packet and the determined subkey , to get the decrypted fields, including: 所述第二网络设备将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到解密字段,其中,所述确定出的子密钥的字节数目与所述第一字段的字节数目相同。The second network device performs an XOR operation on the first field included in the serial number of the data packet and the determined subkey to obtain a decryption field, wherein the determined subkey is The number of bytes is the same as the number of bytes of the first field. 8.根据权利要求5至6任一项所述的方法,其特征在于,所述第二网络设备从子密钥集合中确定出第一子密钥之前,还包括:8. The method according to any one of claims 5 to 6, wherein before the second network device determines the first subkey from the subkey set, the method further comprises: 所述第二网络设备接收所述第一网络设备发送的因特网密钥交换IKE协商请求报文,所述IKE协商请求报文中的预定标识位的值被设置为第一值,所述第一值指示支持对序列号加密传输;The second network device receives the Internet Key Exchange IKE negotiation request message sent by the first network device, and the value of the predetermined identification bit in the IKE negotiation request message is set to a first value, and the first The value indicates that encrypted transmission of serial numbers is supported; 如果所述第二网络设备支持对序列号加密传输,则所述第二网络设备向所述第一网络设备发送IKE协商响应报文,其中,所述IKE协商响应报文中的所述预定标识位的值被设置为所述第一值。If the second network device supports encrypted transmission of the sequence number, the second network device sends an IKE negotiation response message to the first network device, wherein the predetermined identifier in the IKE negotiation response message The value of the bit is set to the first value. 9.一种第一网络设备,其特征在于,该第一网络设备包括:通信接口、处理器以及存储器;9. A first network device, characterized in that the first network device comprises: a communication interface, a processor, and a memory; 所述处理器调用存储在所述存储器中的指令,执行以下处理:The processor invokes the instructions stored in the memory to perform the following processing: 生成一个数据报文;Generate a data message; 从子密钥集合中确定出一个子密钥,所述子密钥集合包含M个子密钥,所述M个子密钥是根据原始密钥拆分得到的N个字段生成的,所述原始密钥是所述第一网络设备与第二网络设备预先协商确定的,M大于等于N;A subkey is determined from the subkey set, the subkey set includes M subkeys, and the M subkeys are generated according to N fields obtained by splitting the original key. The key is determined by the first network device and the second network device through negotiation in advance, and M is greater than or equal to N; 将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行加密处理,得到加密字段,其中,所述序列号中包含多个字段;Encrypting the first field contained in the serial number of the data message and the determined subkey to obtain an encrypted field, wherein the serial number contains multiple fields; 利用所述加密字段替换所述数据报文的序列号中的第一字段,从而得到修改后的数据报文;Replace the first field in the sequence number of the data message with the encrypted field, thereby obtaining the modified data message; 通过所述通信接口向所述第二网络设备发送所述修改后的数据报文。Send the modified data message to the second network device through the communication interface. 10.根据权利要求9所述的网络设备,其特征在于,所述处理器具体用于:10. The network device according to claim 9, wherein the processor is specifically configured to: 将所述序列号中包含的第二字段对M取模得到模值;The second field contained in the serial number is modulo M to obtain a modulo value; 以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。Using the modulus value as an index value, the subkey corresponding to the index value is found from the subkey set. 11.根据权利要求9或10所述的网络设备,其特征在于,所述处理器具体用于:11. The network device according to claim 9 or 10, wherein the processor is specifically configured to: 将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到加密字段,其中,所述确定出的子密钥的字节数目与所述第一字段的字节数目相同。Perform an exclusive OR operation on the first field contained in the serial number of the data message and the determined sub-key to obtain an encrypted field, wherein the determined sub-key has the same number of bytes as the determined sub-key. The first field has the same number of bytes. 12.根据权利要求9至10任一项所述的网络设备,其特征在于,所述处理器还用于:12. The network device according to any one of claims 9 to 10, wherein the processor is further configured to: 通过所述通信接口向所述第二网络设备发送的因特网密钥交换IKE协商请求报文,所述IKE协商请求报文中的预定标识位的值被设置为第一值,所述第一值指示支持对序列号加密传输;In the Internet Key Exchange IKE negotiation request message sent to the second network device through the communication interface, the value of the predetermined identification bit in the IKE negotiation request message is set to a first value, and the first value Indicates support for encrypted transmission of serial numbers; 通过所述通信接口接收所述第二网络设备发送的IKE协商响应报文,所述IKE协商响应报文中的预定标识位的值被设置为所述第一值;receiving an IKE negotiation response message sent by the second network device through the communication interface, where the value of a predetermined identification bit in the IKE negotiation response message is set to the first value; 根据所述IKE协商响应报文中的预定标识位的值确定所述第二网络设备支持对序列号加密传输。It is determined according to the value of the predetermined identification bit in the IKE negotiation response message that the second network device supports encrypted transmission of the sequence number. 13.一种第二网络设备,其特征在于,该第二网络设备包括:通信接口、处理器以及存储器;13. A second network device, characterized in that the second network device comprises: a communication interface, a processor, and a memory; 所述处理器调用存储在所述存储器中的指令,执行以下处理:The processor invokes the instructions stored in the memory to perform the following processing: 通过所述通信接口接收第一网络设备发送的数据报文;receiving, through the communication interface, a data message sent by the first network device; 从子密钥集合中确定出一个子密钥,所述子密钥集合包含M个子密钥,所述M个子密钥是根据原始密钥拆分得到的N个字段生成的,所述原始密钥是所述第一网络设备与所述第二网络设备预先协商确定的,M大于等于N;A subkey is determined from the subkey set, the subkey set includes M subkeys, and the M subkeys are generated according to N fields obtained by splitting the original key. The key is pre-negotiated and determined by the first network device and the second network device, and M is greater than or equal to N; 将接收到的数据报文的序列号中包含的第一字段和所述确定出的子密钥进行解密处理,得到解密字段,其中,所述序列号中包含多个字段;Decrypt the first field contained in the serial number of the received data message and the determined subkey to obtain a decrypted field, wherein the serial number contains multiple fields; 利用所述解密字段替换所述数据报文的序列号中的第一字段,从而得到解密后的数据报文。The first field in the sequence number of the data packet is replaced with the decrypted field, so as to obtain the decrypted data packet. 14.根据权利要求13所述的网络设备,其特征在于,所述处理器具体用于:14. The network device according to claim 13, wherein the processor is specifically configured to: 将所述数据报文的序列号中包含的第二字段对M取模得到模值;The second field contained in the serial number of the data message is modulo M to obtain a modulo value; 以所述模值作为索引值,从所述子密钥集合中查找到所述索引值对应的子密钥。Using the modulus value as an index value, the subkey corresponding to the index value is found from the subkey set. 15.根据权利要求13或14所述的网络设备,其特征在于,所述处理器具体用于:15. The network device according to claim 13 or 14, wherein the processor is specifically configured to: 将所述数据报文的序列号中包含的第一字段和所述确定出的子密钥进行异或操作,得到解密字段,其中,所述确定出的子密钥的字节数目与所述第一字段的字节数目相同。Perform an XOR operation on the first field contained in the serial number of the data message and the determined subkey to obtain a decryption field, wherein the determined subkey has the same number of bytes as the determined subkey. The first field has the same number of bytes. 16.根据权利要求13至14任一项所述的网络设备,其特征在于,16. The network device according to any one of claims 13 to 14, wherein, 通过所述通信接口接收所述第一网络设备发送的因特网密钥交换IKE协商请求报文,所述IKE协商请求报文中的预定标识位的值被设置为第一值,所述第一值指示支持对序列号加密传输;An Internet Key Exchange IKE negotiation request message sent by the first network device is received through the communication interface, the value of a predetermined identification bit in the IKE negotiation request message is set to a first value, and the first value Indicates support for encrypted transmission of serial numbers; 如果支持对序列号加密传输,则通过所述通信接口向所述第一网络设备发送IKE协商响应报文,其中,所述IKE协商响应报文中的所述预定标识位的值被设置为所述第一值。If the encrypted transmission of the sequence number is supported, an IKE negotiation response message is sent to the first network device through the communication interface, wherein the value of the predetermined identification bit in the IKE negotiation response message is set to the specified value. the first value. 17.一种通信系统,其特征在于,包括执行上述权利要求9至12任一项所述的第一网络设备,以及执行上述权利要求13至16任一项所述的第二网络设备。17 . A communication system, characterized in that it comprises executing the first network device according to any one of the preceding claims 9 to 12 , and executing the second network device according to any one of the preceding claims 13 to 16 . 18 .
CN201710763841.1A 2017-08-30 2017-08-30 Message encryption and decryption method, network equipment and system Active CN109428867B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710763841.1A CN109428867B (en) 2017-08-30 2017-08-30 Message encryption and decryption method, network equipment and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710763841.1A CN109428867B (en) 2017-08-30 2017-08-30 Message encryption and decryption method, network equipment and system

Publications (2)

Publication Number Publication Date
CN109428867A CN109428867A (en) 2019-03-05
CN109428867B true CN109428867B (en) 2020-08-25

Family

ID=65502143

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710763841.1A Active CN109428867B (en) 2017-08-30 2017-08-30 Message encryption and decryption method, network equipment and system

Country Status (1)

Country Link
CN (1) CN109428867B (en)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110138750A (en) * 2019-04-23 2019-08-16 上海数据交易中心有限公司 Encryption method, apparatus and system, storage medium, the terminal of configuration file
CN110798316A (en) * 2019-09-20 2020-02-14 西安瑞思凯微电子科技有限公司 Encryption key generation method, decryption key generation method, encryption key generation program, decryption key generation program, and decryption program
CN110635908B (en) * 2019-09-29 2023-03-24 杭州尚尚签网络科技有限公司 Management method for supporting billions of keys for electronic contract
CN110730071A (en) * 2019-10-29 2020-01-24 南方电网科学研究院有限责任公司 A security access authentication method, device and equipment for power distribution communication equipment
CN111556075B (en) * 2020-05-14 2022-05-03 中国人民解放军国防科技大学 Data transmission path restoration method and system based on non-interactive key agreement
CN112134884B (en) * 2020-09-23 2022-10-14 普联技术有限公司 Message serial number updating method
CN112332940B (en) * 2020-11-06 2024-03-12 北京东土科技股份有限公司 Data transmission method based on time synchronization network and related equipment
CN112511548B (en) * 2020-12-02 2022-09-16 中电科鹏跃电子科技有限公司 Method and device for preventing replay attack
CN113810363B (en) * 2021-07-29 2023-06-20 蜂巢能源科技有限公司 Message encryption, decryption method and electronic device
CN114329104B (en) * 2021-12-23 2022-07-08 珠海市鸿瑞信息技术股份有限公司 Message encryption transmission system and method based on electric power distribution
CN116418533A (en) * 2021-12-31 2023-07-11 北京罗克维尔斯科技有限公司 Message transmission method, device and storage medium
CN114285675B (en) * 2022-03-07 2022-07-12 杭州优云科技有限公司 Message forwarding method and device
CN115567282A (en) * 2022-09-22 2023-01-03 中国建设银行股份有限公司 Message transmission method, device, equipment and computer storage medium
CN117997675B (en) * 2024-02-07 2025-05-27 奉加科技(上海)股份有限公司 Network access communication method, gateway equipment and peripheral equipment
CN118646598B (en) * 2024-08-13 2024-12-10 浙江桢数科技有限公司 Data encryption transmission method based on random key

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7298847B2 (en) * 2002-02-07 2007-11-20 Nokia Inc. Secure key distribution protocol in AAA for mobile IP
CN101262405A (en) * 2008-04-11 2008-09-10 华南理工大学 Network Processor-Based High-Speed Security Virtual Private Network Channel and Its Realization Method
CN101471784A (en) * 2007-12-29 2009-07-01 北京天融信网络安全技术有限公司 Method for implementing IPSEC resistance of replay aggression
CN102075427A (en) * 2011-01-18 2011-05-25 中兴通讯股份有限公司 Security association-based IPSec message processing method and device
CN102843235A (en) * 2012-09-06 2012-12-26 汉柏科技有限公司 Message encrypting/decrypting method
CN105071987A (en) * 2015-07-28 2015-11-18 中国工程物理研究院计算机应用研究所 Path quality analysis method of encrypted network based on flow analysis
CN106788989A (en) * 2016-11-30 2017-05-31 华为技术有限公司 A kind of method and apparatus for setting up safe encryption channel

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI227082B (en) * 2003-06-20 2005-01-21 Accton Technology Corp A synchronous system and method for processing a packet
US9237015B2 (en) * 2013-07-24 2016-01-12 Cisco Technology, Inc. Compact and efficient communication security through combining anti-replay with encryption

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7298847B2 (en) * 2002-02-07 2007-11-20 Nokia Inc. Secure key distribution protocol in AAA for mobile IP
CN101471784A (en) * 2007-12-29 2009-07-01 北京天融信网络安全技术有限公司 Method for implementing IPSEC resistance of replay aggression
CN101262405A (en) * 2008-04-11 2008-09-10 华南理工大学 Network Processor-Based High-Speed Security Virtual Private Network Channel and Its Realization Method
CN102075427A (en) * 2011-01-18 2011-05-25 中兴通讯股份有限公司 Security association-based IPSec message processing method and device
CN102843235A (en) * 2012-09-06 2012-12-26 汉柏科技有限公司 Message encrypting/decrypting method
CN105071987A (en) * 2015-07-28 2015-11-18 中国工程物理研究院计算机应用研究所 Path quality analysis method of encrypted network based on flow analysis
CN106788989A (en) * 2016-11-30 2017-05-31 华为技术有限公司 A kind of method and apparatus for setting up safe encryption channel

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
IPsec anti-replay algorithm without bit-shifting;Xiangyang Zhang et al;《IETF draft-zhang-ipsecme-anti-replay-07》;20111031;全文 *
IPSEC的抗重放原理及其实现;丛延奇;《湖南工程学院学报》;20031231;全文 *

Also Published As

Publication number Publication date
CN109428867A (en) 2019-03-05

Similar Documents

Publication Publication Date Title
CN109428867B (en) Message encryption and decryption method, network equipment and system
US11792169B2 (en) Cloud storage using encryption gateway with certificate authority identification
JP5116752B2 (en) Efficient key derivation for the security of end-to-end networks with traffic visibility
US20170012949A1 (en) Dynamic identity verification and authentication continuous, dynamic one-time-pad/one-time passwords and dynamic distributed key infrastructure for secure communications with a single key for any key-based network security controls
JP2018529271A (en) Key generation method and apparatus using double encryption
JP2017063432A (en) System and method for designing secure client-server communication protocol based on certificateless public key infrastructure
JP2018534884A (en) Client-cloud or remote server secure data or file object encryption gateway
US8745381B2 (en) Methods, systems, and computer readable media for performing encapsulating security payload (ESP) rehashing
JP2016511620A (en) Master key encryption function for transmitter and receiver pairing as a countermeasure to thwart key recovery attacks
CN101479984A (en) Dynamic distributed key system and method for identity management, authentication server, data security and protection against man-in-the-middle attacks
Petullo et al. MinimaLT: minimal-latency networking through better security
Igoe et al. AES Galois counter mode for the secure shell transport layer protocol
US10841840B2 (en) Processing packets in a computer system
JP2024545040A (en) Automatic key rolling for link encryption
CN110832806B (en) ID-Based Data Plane Security for Identity-Oriented Networks
Hall-Andersen et al. nQUIC: Noise-based QUIC packet protection
US11343089B2 (en) Cryptography system and method
Navaz et al. Security Aspects of Mobile IP
CN114039812B (en) Data transmission channel establishment method, device, computer equipment and storage medium
Rawal et al. No-sum IPsec Lite: Simplified and lightweight Internet security protocol for IoT devices
Hartl et al. Subverting counter mode encryption for hidden communication in high-security infrastructures
US12432042B2 (en) Network traffic obfuscation
CN119676000B (en) An efficient and secure communication method between IPsec branch nodes
US20250007718A1 (en) Endpoint validation security
US20250007707A1 (en) Out of band key exchange

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant