Protocol message packaging method and device, equipment and storage medium
By encrypting the message content and authentication password information of the protocol message, the security risks caused by the transmission of civilized messages in the existing technology are solved, and the secure transmission of protocol messages is realized, and network security is improved.
Patent Information
- Application Number
- CN202510138239.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-08
- Publication Date
- 2025-05-13
AI Technical Summary
The protocol packets of existing switches are transmitted in plain text, which has the risk of being cracked and tampered with, affecting network security.
The message content of the protocol message is encrypted by the preset key, a first encrypted data segment is generated, and the first preset digest is encrypted, and a second encrypted data segment is generated. The message header, the second encrypted data segment and the first encrypted data segment are spliced to form a combined message, and encapsulated it to form a target protocol message.
It effectively avoids attackers intercepting and tampering with protocol messages, reduces network security risks, and ensures the security of data interaction.
Smart Images

Figure CN119995980A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of protocol message encapsulation, and in particular to a protocol message encapsulation method, device, equipment and storage medium. Background Art
[0002] Most of the existing switch protocol messages are transmitted in plain text. The authentication password information of the protocol message is transmitted in plain text or encrypted by MD5 (Message-Digest Algorithm 5).
[0003] Regardless of whether the authentication password information is transmitted in plain text or in a form encrypted by MD5, the message content of the protocol message is still transmitted in plain text.
[0004] The message content of the protocol message is transmitted in plain text, which makes the protocol message at risk of being cracked. Attackers can easily intercept and tamper with the protocol message and send it to the receiving device, or forge the protocol message to attack the receiving device, affecting network security. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a protocol message encapsulation method, device, equipment and storage medium to solve the above-mentioned problems, realize the encrypted transmission of the message content and authentication password information of the protocol message, and reduce the risk of the protocol message being cracked.
[0006] In a first aspect, an embodiment of the present application provides a protocol message encapsulation method, which is applied to a sending device, and the method includes: The sending device encrypts the message content of the protocol message by using a preset key to obtain a first encrypted data segment; The sending device encrypts the first preset digest by using the preset key to obtain a second encrypted data segment; The sending device generates a message header of the protocol message; The sending device sequentially concatenates the message header, the second encrypted data segment, and the first encrypted data segment to obtain a combined message; The sending device encapsulates the combined message to obtain a target protocol message.
[0007] Preferably, the protocol message is an IP message, and the step of the sending device generating a message header of the protocol message includes: The sending device splices the Ethernet header and the IP header of the protocol message to obtain a message header.
[0008] Preferably, the protocol message is a non-IP message; The step of generating a message header of the protocol message by the sending device includes: The sending device generates a message header according to the Ethernet header of the protocol message.
[0009] The protocol message encapsulation method provided by the present application brings the following beneficial effects: The present application provides a protocol message encapsulation method, in which a sending device encrypts the message content of a protocol message by using a preset key to obtain a first encrypted data segment, and encrypts a first preset summary by using a preset key to obtain a second encrypted data segment. When the method performs protocol message interaction between a sending device and a receiving device, it can effectively prevent an attacker from intercepting and tampering with the protocol message of the sending device, or forging the protocol message sent by the switch, and attacking the receiving device, thereby affecting network security.
[0010] In a second aspect, an embodiment of the present application provides another protocol message encapsulation method, which is applied to a receiving device, and the method includes: The receiving device obtains the target protocol message sent by the sending device; The receiving device parses the target protocol message to obtain a message header, a first encrypted data segment, and a second encrypted data segment; The receiving device decrypts the second encrypted data segment using a preset key to obtain a second preset summary; The receiving device compares the first preset summary with the second preset summary to obtain a comparison result; If the comparison result indicates that the first preset digest and the second preset digest are the same, the receiving device decrypts the first encrypted data segment using the preset key to obtain the message content of the target protocol message.
[0011] Preferably, the method further comprises: If the comparison result indicates that the first preset digest and the second preset digest are different, the receiving device discards the marked data segment, the first encrypted data segment, and the second encrypted data segment.
[0012] Preferably, the method further comprises: The receiving device marks the target protocol message as an illegal message.
[0013] Another protocol message encapsulation method provided by the present application brings the following beneficial effects: The present application provides another protocol message encapsulation method, in which a first preset digest and a second preset digest are compared by a receiving device to obtain a comparison result. If the comparison result indicates that the first preset digest and the second preset digest are the same, the receiving device decrypts the first encrypted data segment by a preset key to obtain the message content of the target protocol message. If the comparison result indicates that the first preset digest and the second preset digest are different, the receiving device discards the marked data segment, the first encrypted data segment and the second encrypted data segment. This method prevents the target protocol message stolen or tampered with by an attacker during the transmission process from attacking the receiving device, thereby causing serious damage to the receiving device, improves the accuracy of the receiving device's transmission of the target protocol message, and ensures the security of the data interaction of the receiving device.
[0014] In a third aspect, the present application also provides a protocol message encapsulation device, the device comprising: A sending device, used to encrypt the message content of the protocol message by using a preset key to obtain a first encrypted data segment; The sending device is further used to encrypt the first preset digest by using a preset key to obtain a second encrypted data segment; generate a message header of the protocol message; sequentially concatenate the message header, the second encrypted data segment and the first encrypted data segment to obtain a combined message; and encapsulate the combined message to obtain a target protocol message; A receiving device, used to obtain a target protocol message sent by a sending device; The receiving device is also used to parse the target protocol message to obtain a message header, a first encrypted data segment and a second encrypted data segment; decrypt the second encrypted data segment using a preset key to obtain a second preset summary; compare the first preset summary and the second preset summary to obtain a comparison result; if the comparison result indicates that the first preset summary and the second preset summary are the same, decrypt the first encrypted data segment using the preset key to obtain the message content of the target protocol message.
[0015] The protocol message encapsulation device provided in the embodiment of the present application has the same technical features as the protocol message encapsulation method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0016] In a fourth aspect, the present application provides a computing device, including a memory and a processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.
[0017] In a fifth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.
[0018] In a sixth aspect, the present application provides a computer program product, wherein the computer program product comprises one or more computer instructions, and when the computer instructions are executed by a computer, the computer executes the method as described in any one of the first aspects.
[0019] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application are realized and obtained by the structures particularly pointed out in the description and the drawings.
[0020] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0022] Figure 1 A schematic diagram of a protocol message encapsulation method flow provided in an embodiment of the present application; Figure 2 A schematic diagram of a flow chart of another protocol message encapsulation method provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a protocol message encapsulation device provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0024] To facilitate understanding of this embodiment, the embodiments of the present application are described in detail below.
[0025] The embodiment of the present application provides a protocol message encapsulation method, which is applied to a sending device. Figure 1 A schematic diagram of a protocol message encapsulation method provided in an embodiment of the present application. The method comprises the following steps: S101, a sending device encrypts the message content of a protocol message using a preset key to obtain a first encrypted data segment.
[0026] Specifically, the encryption method of the message content of the above protocol message is AES (Advanced Encryption Standard) encryption, which is a symmetric encryption algorithm. The specific process is as follows: (i) Replace each byte of the message content with a first preset byte to obtain replaced message content.
[0027] (ii) Convert the replacement message content to obtain a replacement message content matrix.
[0028] (iii) Circularly shift each row of the replacement message content matrix to the left to obtain a first replacement message content matrix.
[0029] (iv) Performing a linear transformation on each column of the first replacement message content matrix to obtain a second replacement message content matrix.
[0030] (V) Processing a preset key through a key expansion algorithm to obtain a target key; wherein the preset key is set by a staff member through a command line, or is a default key set by a sending device.
[0031] (vi) performing an XOR operation on the target key and the second replacement message content matrix to obtain a first encrypted data segment.
[0032] Such a setting can disrupt the order of the protocol messages, increase the complexity of the protocol messages, and achieve protection of sensitive information in the protocol messages.
[0033] S102: The sending device encrypts the first preset digest using a preset key to obtain a second encrypted data segment.
[0034] Specifically, in order for the subsequent receiving device to accurately distinguish whether the protocol message is encrypted, it is necessary to add a first preset digest before the message content. The first preset digest is a plain text obtained by the staff through the configuration instruction. In order to improve the confidentiality of the plain text, it is necessary to encrypt the plain text through AES encryption. The specific process is as follows: (i) Replace each byte of the first preset digest with the second preset byte to obtain a replaced digest.
[0035] (ii) Transform the replacement summary to obtain the replacement summary matrix.
[0036] (iii) Circularly left-shift each row of the replacement summary matrix to obtain the first replacement summary matrix.
[0037] (iv) Perform a linear transformation on each column of the first replacement summary matrix to obtain a second replacement summary matrix.
[0038] (V) Processing a preset key through a key expansion algorithm to obtain a target key; wherein the preset key is set by a staff member through a command line, or is a default key set by a sending device.
[0039] (vi) performing an XOR operation on the target key and the second replacement digest matrix to obtain a second encrypted data segment.
[0040] Such a setting can further enhance the complexity of the protocol message, better hide the location of the message content, and thus achieve the protection of sensitive information in the protocol message.
[0041] S103: The sending device generates a message header of the protocol message.
[0042] Specifically, the message header includes the destination address and source address of the protocol message, so that the sending device can accurately send the protocol message to the receiving device corresponding to the destination address, and the receiving device can accurately receive the protocol message sent by the sending device corresponding to the source address.
[0043] S104, the sending device sequentially concatenates the message header, the second encrypted data segment, and the first encrypted data segment to obtain a combined message.
[0044] Specifically, in order to further obfuscate the position of the message content in the protocol message, the encrypted first preset digest (second encrypted data segment) needs to be inserted between the message header and the first encrypted data segment. The sequential splicing is to ensure that the order of the message header, the second encrypted data segment, and the first encrypted data segment matches the parsing order of the receiving device. It should be noted that the sending device needs to determine the splicing order of the message header, the second encrypted data segment, and the first encrypted data segment according to the preset transmission protocol.
[0045] S105, the sending device encapsulates the combined message to obtain a target protocol message.
[0046] Specifically, the sending device completes encapsulation by modulating the combined message to ensure the integrity and confidentiality of the combined message, so that the combined message can adapt to different network environments and receiving devices, and provide a reliable transmission environment for the combined message.
[0047] The embodiment of the present application provides a protocol message encapsulation method, in which the sending device encrypts the message content of the protocol message by a preset key to obtain a first encrypted data segment, and encrypts the first preset summary by a preset key to obtain a second encrypted data segment. The encryption process in the method uses AES encryption, and AES encryption has undergone strict security analysis and testing, and can effectively resist a variety of known cryptographic attacks, such as differential attacks, linear attacks, and brute force attacks. Compared with the prior art, in which the message content of the protocol message is sent in the form of plain text, the message content of the protocol message in this method is transmitted in the form of ciphertext, and the encrypted first preset summary (second encrypted data segment) is inserted into the message header and the encrypted message content (the first encrypted data segment) to confuse the position of the message content in the protocol message. The encryption of the first preset summary is to prevent the attacker from parsing the first preset summary and exposing the position of the message content in the protocol message. When the method performs protocol message interaction between the sending device and the receiving device, it can effectively prevent the attacker from intercepting and tampering with the protocol message of the sending device, or forging the protocol message sent by the switch, and attacking the receiving device, thereby affecting the network security. In addition, using AES encryption in the process of encrypting the message content and the first preset summary can speed up the encryption speed, which is suitable for the case where the amount of data of the message content of the protocol message to be protected or the preset key is long. The method can achieve unified processing of the encryption methods of all transmission protocols between the sending device and the receiving device, reducing the difficulty of network deployment.
[0048] The following describes how the sending device generates a message header of a protocol message. The protocol message is an IP message, and the sending device concatenates the Ethernet header and IP header of the protocol message to obtain the message header; the protocol message is a non-IP message, and the sending device generates the message header based on the Ethernet header of the protocol message.
[0049] Specifically, when the destination address in the message header of the above protocol message includes both a MAC address and an IP address, the protocol message is an IP message. When encapsulating the above combined message, the sending device needs to first splice the Ethernet header and the IP header of the protocol message to ensure that the destination address remains intact; When the destination address in the message header of the above protocol message only includes the MAC address, the protocol message is a non-IP message. When the sending device encapsulates the above combined message, it only needs to generate the message header according to the Ethernet header of the protocol message; among them, the IP address (IP header) in the message header of the IP message occupies 20 bytes, and the MAC address (Ethernet header) occupies 14 bytes.
[0050] In this method, the sending device implements different processing methods for the message headers of different protocol messages. The sending device can generate a corresponding message header according to the type of specific protocol message, thereby improving the flexibility of message header generation, supporting multiple different types of protocol messages, and further adapting to different transmission environments to improve transmission efficiency.
[0051] The present application embodiment provides another protocol message encapsulation method, which is applied to a receiving device, such as Figure 2 As shown, Figure 2 A flowchart of another protocol message encapsulation method provided in an embodiment of the present application. The method comprises the following steps: S201: A receiving device obtains a target protocol message sent by a sending device.
[0052] Specifically, in a network transmission environment, the receiving device obtains the target protocol message sent by the sending device to prepare for subsequent parsing of the target protocol message.
[0053] S202: The receiving device parses the target protocol message to obtain a message header, a first encrypted data segment, and a second encrypted data segment.
[0054] Specifically, since the target protocol message has been encapsulated (modulated), the receiving device needs to demodulate the target protocol message after obtaining it, and convert the target protocol message into a form recognizable by the receiving device, that is, divide the target protocol message into a message header, a first encrypted data segment, and a second encrypted data segment. The receiving device identifies the divided message header and confirms the source address of the target protocol message.
[0055] S203: The receiving device decrypts the second encrypted data segment using a preset key to obtain a second preset summary.
[0056] Specifically, the preset key used by the receiving device to decrypt the second encrypted data segment needs to be consistent with the preset key used by the sending device to encrypt the first preset summary, and the decryption process of the second encrypted data is the inverse process of AES encryption.
[0057] S204, the receiving device determines whether the first preset digest and the second preset digest are the same, if so, executes step S205, if not, executes step S206.
[0058] Specifically, the receiving device determines whether the acquired target protocol message comes from the sending device and whether the acquired target protocol message is stolen, tampered with or lost by comparing the second preset digest obtained by decryption with the first preset digest before encryption by the sending device.
[0059] S205: The receiving device decrypts the first encrypted data segment using a preset key to obtain the message content of the target protocol message.
[0060] Specifically, if the first preset digest is the same as the second preset digest, it means that the target protocol message obtained by the receiving device is the target protocol message sent by the sending device, and has not been stolen, tampered with or lost during the transmission process. The target protocol message is safe and legal. At this time, the target protocol message is further decrypted, that is, the first encrypted data segment is decrypted by the preset key.
[0061] S206: The receiving device discards the marked data segment, the first encrypted data segment, and the second encrypted data segment.
[0062] Specifically, if the first preset digest is different from the second preset digest, it means that the target protocol message obtained by the receiving device is not the target protocol message sent by the sending device or is stolen, tampered with or lost during the transmission process. The target protocol message is unsafe and illegal. At this time, the first encrypted data segment and the second encrypted data segment in the target protocol message are discarded.
[0063] Another protocol message encapsulation method provided by an embodiment of the present application, in which a first preset digest and a second preset digest are compared by a receiving device to obtain a comparison result, if the comparison result indicates that the first preset digest and the second preset digest are the same, the receiving device decrypts the first encrypted data segment by a preset key to obtain the message content of the target protocol message, if the comparison result indicates that the first preset digest and the second preset digest are different, the receiving device discards the marked data segment, the first encrypted data segment and the second encrypted data segment. This method prevents the target protocol message stolen or tampered with by an attacker during the transmission process from attacking the receiving device, thereby causing serious damage to the receiving device, improves the accuracy of the receiving device's transmission of the target protocol message, and ensures the security of the data interaction of the receiving device.
[0064] In one implementation, the receiving device marks the target protocol message as an illegal message.
[0065] Specifically, since the first preset digest is different from the second preset digest, it means that the target protocol message obtained by the receiving device is not the target protocol message sent by the sending device or is stolen, tampered with or lost during the transmission process. The target protocol message is unsafe and illegal. At this time, the receiving device marks the target protocol message as an illegal message and stores it in the log, so that the staff can analyze the illegal message records in the log and the security vulnerabilities of the receiving device, thereby providing guidance for the maintenance and upgrade of the receiving device.
[0066] In this method, the receiving device marks the target protocol message as an illegal message. The staff can adjust and optimize the defense strategy of the receiving device based on the illegal message information in the log to improve the receiving device's ability to resist similar attacks. This method helps to build a more secure and reliable data interaction environment.
[0067] Based on the above method embodiment, the present application embodiment also provides a protocol message encapsulation device, such as Figure 3 As shown, Figure 3 A schematic diagram of the structure of a protocol message encapsulation device provided in an embodiment of the present application. The device includes: a sending device 30 and a receiving device 31. The functions of each device are as follows: The sending device 30 is used to encrypt the message content of the protocol message by using a preset key to obtain a first encrypted data segment; The sending device 30 is further used to encrypt the first preset digest by using a preset key to obtain a second encrypted data segment; generate a message header of the protocol message; sequentially concatenate the message header, the second encrypted data segment and the first encrypted data segment to obtain a combined message; encapsulate the combined message to obtain a target protocol message; The receiving device 31 is used to obtain the target protocol message sent by the sending device; The receiving device 31 is also used to parse the target protocol message to obtain a message header, a first encrypted data segment and a second encrypted data segment; decrypt the second encrypted data segment using a preset key to obtain a second preset summary; compare the first preset summary and the second preset summary to obtain a comparison result; if the comparison result indicates that the first preset summary and the second preset summary are the same, decrypt the first encrypted data segment using the preset key to obtain the message content of the target protocol message.
[0068] Preferably, the protocol message is an IP message; the sending device 30 is specifically used to splice the Ethernet header and the IP header of the protocol message to obtain a message header.
[0069] Preferably, the protocol message is a non-IP message; the sending device 30 is specifically configured to generate a message header according to an Ethernet header of the protocol message.
[0070] Preferably, the receiving device 31 is further configured to discard the marked data segment, the first encrypted data segment, and the second encrypted data segment if the comparison result indicates that the first preset digest and the second preset digest are different.
[0071] Preferably, the receiving device 31 is further configured to mark the target protocol message as an illegal message.
[0072] The protocol message encapsulation device provided in the embodiment of the present application has the same technical features as the protocol message encapsulation method provided in the above embodiment, so it can also solve the same technical problems and achieve the same technical effects.
[0073] The present application also provides a computing device. Figure 4 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and the computing device 400 includes a bus 401, a processor 402, a communication interface 403 and a memory 404. The processor 402, the memory 404 and the communication interface 403 communicate with each other through the bus 401.
[0074] The bus 401 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0075] The processor 402 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0076] The communication interface 403 is used for communicating with the outside. The memory 404 may include a volatile memory, such as a random access memory (RAM). The memory 404 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid state drive (SSD).
[0077] The memory 404 stores executable codes, and the processor 402 executes the executable codes to perform the aforementioned protocol message encapsulation method.
[0078] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned protocol message encapsulation method.
[0079] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0080] The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0081] When the computer program product is executed by a computer, the computer executes any of the aforementioned protocol message encapsulation methods. The computer program product may be a software installation package, and when any of the aforementioned protocol message encapsulation methods is required, the computer program product may be downloaded and executed on a computer.
[0082] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0083] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.
Claims
1. A protocol message encapsulation method, characterized in that: Applied to a sending device, the method comprises: The sending device encrypts the message content of the protocol message by using a preset key to obtain a first encrypted data segment; The sending device encrypts the first preset digest by using the preset key to obtain a second encrypted data segment; The sending device generates a message header of the protocol message; The sending device sequentially concatenates the message header, the second encrypted data segment, and the first encrypted data segment to obtain a combined message; The sending device encapsulates the combined message to obtain a target protocol message.
2. The protocol message encapsulation method according to claim 1, characterized in that: The protocol message is an IP message, and the step of the sending device generating a message header of the protocol message includes: The sending device splices the Ethernet header and the IP header of the protocol message to obtain a message header.
3. The protocol message encapsulation method according to claim 1, characterized in that: The protocol message is a non-IP message; The step of generating a message header of the protocol message by the sending device includes: The sending device generates a message header according to the Ethernet header of the protocol message.
4. A protocol message encapsulation method, characterized in that: Applied to a receiving device, the method comprises: The receiving device obtains the target protocol message sent by the sending device; The receiving device parses the target protocol message to obtain a message header, a first encrypted data segment, and a second encrypted data segment; The receiving device decrypts the second encrypted data segment using a preset key to obtain a second preset summary; The receiving device compares the first preset summary with the second preset summary to obtain a comparison result; If the comparison result indicates that the first preset digest and the second preset digest are the same, the receiving device decrypts the first encrypted data segment using the preset key to obtain the message content of the target protocol message.
5. The protocol message encapsulation method according to claim 4, characterized in that: The method further comprises: If the comparison result indicates that the first preset digest and the second preset digest are different, the receiving device discards the marked data segment, the first encrypted data segment, and the second encrypted data segment.
6. The protocol message encapsulation method according to claim 5, characterized in that: The method further comprises: The receiving device marks the target protocol message as an illegal message.
7. A protocol message encapsulation device, characterized in that: The device comprises: A sending device, used to encrypt the message content of the protocol message by using a preset key to obtain a first encrypted data segment; The sending device is further configured to encrypt the first preset digest by using the preset key to obtain a second encrypted data segment; generate a message header of the protocol message; sequentially concatenate the message header, the second encrypted data segment and the first encrypted data segment to obtain a combined message; and encapsulate the combined message to obtain a target protocol message; A receiving device, used to obtain a target protocol message sent by a sending device; The receiving device is also used to parse the target protocol message to obtain a message header, a first encrypted data segment and a second encrypted data segment; decrypt the second encrypted data segment using a preset key to obtain a second preset summary; compare the first preset summary and the second preset summary to obtain a comparison result; if the comparison result indicates that the first preset summary and the second preset summary are the same, decrypt the first encrypted data segment using the preset key to obtain the message content of the target protocol message.
8. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as claimed in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.
10. A computer program product, characterized in that The computer program product comprises one or more computer instructions. When the computer instructions are executed by a computer, the computer performs the method according to any one of claims 1 to 6.