Encrypted data transmission method and system based on private network protocol
By using the MTI network key negotiation protocol and the XOR encryption method in the private network protocol, the information in the data packet is encrypted and hiddenly transmitted, which solves the problem of fragility of traditional encryption methods and achieves high security of data transmission and reliability.
Patent Information
- Application Number
- CN202411173606.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2024-11-12
AI Technical Summary
Traditional encrypted data transmission methods are fragile in network private protocols and are easily cracked, resulting in information leakage. It is difficult for the existing technology to effectively ensure the security and concealment of information.
Using the encrypted data transmission method based on the private network protocol, the negotiation key and session key are generated through the MTI network key negotiation protocol, the information in the data packet is encrypted with XOR operation, and the encrypted information is hidden in the TCP and IP protocols. In specific bits, information interaction is carried out in combination with the master/slave query method of the private network protocol to ensure the security of data transmission.
Effectively prevent data from being intercepted or tampered during transmission, ensure data integrity, and only allow participants with the correct key to access the data content, significantly improving the security and reliability of encrypted data transmission.
Smart Images

Figure CN118944953A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data encryption, and in particular relates to an encrypted data transmission method and system based on a private network protocol. Background Art
[0002] With the development of information globalization, all walks of life have boarded the high-speed train of the Internet, and a series of related fields (such as network technology, network security, etc.) are also changing with each passing day. A large amount of information is transmitted through the Internet, including various sensitive information. Once this information is stolen, it will cause unimaginable consequences. In order to ensure information security, network covert channels were proposed at this time. It refers to adding sensitive information to the network protocol application layer, transport layer and network layer during normal communication, thereby forming a channel for hidden information transmission.
[0003] During the communication process, communication control and status monitoring of devices is a key technology for device communication. Due to the vulnerability of network private protocols, traditional encrypted data transmission methods are easily cracked, resulting in information leakage, while network covert channels can ensure the confidentiality of information and transmit according to certain rules, making them less likely to be cracked. Summary of the invention
[0004] In view of the existing problems, the present invention provides an encrypted data transmission method and system based on a private network protocol, so as to better improve the security and reliability of communication.
[0005] In order to solve the above technical problems, the present invention provides the following technical solutions: an encrypted data transmission method based on a private network protocol, comprising the following steps:
[0006] S1. The client and the server use the MTI network key negotiation protocol to generate a negotiation key, and then randomly generate a session key. The session key is used to perform XOR operation on the information in the data packet to be sent to obtain encrypted information.
[0007] S2. XOR encrypt the session key with the negotiated key to generate an encrypted session key; combine the generated random sequence with the encrypted information and number each data packet to be sent to calculate the header checksum;
[0008] S3, fill the encrypted information into the TCP sequence number bit, fill the encrypted session key into the IP identification bit, fill the number into the TCP source port, and the client sends the data packet to be sent to the server to complete the data packet sending;
[0009] S4, the server receives the data packet from the client, calculates the TCP header checksum, and extracts the encryption information, session key and data packet number from the header of the data packet when the check result indicates that the information is complete;
[0010] S5. Decrypt the session key using the negotiated key, and decrypt the information transmitted this time using the decrypted session key;
[0011] S6. Read the data packet number, return to execute step S4, reorganize the transmission information according to the number, and obtain the correct information for transmission.
[0012] Furthermore, the information in the aforementioned data packet to be sent includes basic terminal information, service information, and alarm information.
[0013] Furthermore, the aforementioned client and server use a master / slave query method to exchange information according to a private network protocol. When the master device sends a message to any valid address in the network, the slave device with the address responds in accordance with the corresponding private protocol format.
[0014] Furthermore, in the aforementioned step S3, when the encrypted information is filled, the encrypted information is hidden in the 32-bit sequence number of the TCP protocol header, wherein the upper 16 bits are filled with a random sequence and the lower 16 bits are used for information hiding.
[0015] Furthermore, the aforementioned private network protocol data frame structure definition includes a frame header, a device type, a device subtype, a device address, a length, a parameter body, a command word, a check word, and a frame tail part;
[0016] The frame header and frame trailer are fixed characters used to mark the data packet as a data packet in the private network protocol format corresponding to the device;
[0017] Device type and device subtype are used to classify devices and can be modified through negotiation;
[0018] The device address is the specific address of the corresponding device; the length is the total number of bytes from the frame length byte to the check byte; the command word indicates the type of command, including full query and full query response, single query and single query response, setting and setting response; the check byte is the cumulative sum of all content bytes from the address to the parameter body;
[0019] The parameter body contains the parameter content of the corresponding frame.
[0020] The present invention also provides an encrypted data transmission system based on a private network protocol, comprising a client and a server; the client comprises a first link detection module, a first negotiation key module, a data encryption module, a first summation check module, and a data filling module;
[0021] The server side includes a second link detection module, a second negotiation key module, a data decryption module, a second sum verification module, and a data parsing module;
[0022] The first link detection module and the second link detection module are used to detect whether the link between the client and the server is normal or abnormal;
[0023] The first negotiation key module and the second negotiation key module are used to generate a negotiation key and a session key between the client and the server using the MTI network key negotiation protocol;
[0024] The data encryption module uses the session key to perform XOR operation encryption on the information in the data packet to be sent to obtain encrypted information; the session key is XOR encrypted with the negotiated key to generate an encrypted session key;
[0025] The first sum check module combines the generated random sequence with the encrypted information and numbers each data packet to be sent.
[0026] The data filling module is used to fill the encrypted information into the TCP sequence number bit, and at the same time fill the encrypted session key into the IP identification bit, fill the number into the TCP source port, and calculate the header checksum;
[0027] A second sum check module is used to receive a data packet from a client at the server end, calculate the TCP header checksum, and extract the encryption information, session key and data packet number from the header of the data packet when the check result indicates that the information is complete;
[0028] The data analysis module is used to negotiate the key to decrypt the session key, and use the decrypted session key to decrypt the information transmitted this time; the transmitted information is reorganized according to the number to obtain the correct information transmitted.
[0029] Furthermore, the aforementioned first link detection module is configured to perform the following actions: based on the server-side terminal device, the device status is actively pushed to the client through the network port. After receiving the data, the client judges and processes the instructions, retrieves the information stored in the corresponding measurement and control device, and returns the execution result to the client through the network port, indicating that the link has been opened. The control center displays that the device is online. If the link is disconnected or the device has an abnormality, the result of the unconnected link will be returned to the user.
[0030] Furthermore, the aforementioned second link detection module is configured to perform the following actions: based on the client sending instructions to the corresponding device on the server side through the network port, the device judges and processes the instructions after receiving the data, and after operating the corresponding measurement and control equipment or directly retrieving the information stored in the device, the execution result is correctly returned to the client via the network port, indicating that the link has been opened, and the control center displays that the device is online. If the link is blocked or the device has an abnormality, the result of the blocked link will be returned to the client via the network port.
[0031] Compared with the prior art, the beneficial technical effects of the above technical solutions adopted in the present invention are as follows: The present invention is an encrypted data transmission method based on a private network protocol, and in particular, it relates to a communication link, encryption method, decryption method, parsing method, transmission channel, monitoring process, computer equipment and storage medium that integrate a private network protocol. The private network protocol can be customized according to specific needs to adapt to different business scenarios and security requirements, and has good scalability. Designing encryption and decryption algorithms and verification modules for private protocols can effectively prevent data from being intercepted or tampered with during transmission, and ensure the integrity of the data. Data and keys are encrypted and transmitted covertly during transmission to ensure that only participants with the correct keys can access the data content, reduce the risk of sensitive information being leaked during transmission, and can effectively improve the security of encrypted data transmission. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a system composition block diagram of the present invention.
[0033] Figure 2 It is a link detection flow chart of the present invention.
[0034] Figure 3 It is a data transmission flow chart of the present invention. DETAILED DESCRIPTION
[0035] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.
[0036] Various aspects of the invention are described herein with reference to the accompanying drawings, in which many illustrative embodiments are shown. The embodiments of the invention are not limited to those described in the accompanying drawings. It should be understood that the invention is implemented by any of the various concepts and embodiments described above, as well as the concepts and embodiments described in detail below, because the concepts and embodiments disclosed in the invention are not limited to any implementation. In addition, some aspects disclosed in the invention may be used alone or in any appropriate combination with other aspects disclosed in the invention.
[0037] like Figure 1As shown, an encrypted data transmission system based on a private network protocol of the present invention includes a client and a server, wherein the client includes a first link detection module, a first negotiation key module, a data encryption module, a first sum verification module, and a data filling module; the server includes a second link detection module, a second negotiation key module, a data decryption module, a second sum verification module, and a data parsing module;
[0038] The first link detection module and the second link detection module are used to detect whether the link between the client and the server is normal or abnormal;
[0039] The first negotiation key module and the second negotiation key module are used to generate a negotiation key and a session key between the client and the server using the MTI network key negotiation protocol;
[0040] The data encryption module uses the session key to perform XOR operation encryption on the information in the data packet to be sent to obtain encrypted information; the session key is XOR encrypted with the negotiated key to generate an encrypted session key;
[0041] The first sum check module combines the generated random sequence with the encrypted information and numbers each data packet to be sent to calculate the checksum of the header;
[0042] The data filling module is used to fill the encrypted information into the TCP sequence number bit, fill the encrypted session key into the IP identification bit, and fill the number into the TCP source port.
[0043] A second sum check module is used to receive a data packet from a client at the server end, calculate the TCP header checksum, and extract the encryption information, session key and data packet number from the header of the data packet when the check result indicates that the information is complete;
[0044] The data analysis module is used to negotiate the key to decrypt the session key, and use the decrypted session key to decrypt the information transmitted this time; the transmitted information is reorganized according to the number to obtain the correct information transmitted.
[0045] The process of link detection by the first link detection module and the second link detection module is as follows: Figure 2As shown. The link transmits basic parameter information such as terminal serial number and production date, business information such as network access, network withdrawal, link establishment and dismantling, cluster SMS, and alarm information such as device offline and parameter abnormality. The first link detection module is based on the terminal device on the server side actively pushing the device status to the client through the network port. After receiving the data, the client judges and processes the instructions, retrieves the information stored in the corresponding measurement and control equipment, and returns the execution result to the client through the network port, indicating that the link has been opened and the control center displays the device online. If the link is not connected or the device is abnormal, the result of the link failure is returned to the user. The second link detection module is based on the client sending instructions to the corresponding device on the server side through the network port. After receiving the data, the device judges and processes the instructions. After operating the corresponding measurement and control equipment or directly retrieving the information stored in the equipment, the execution result is correctly returned to the client through the network port, indicating that the link has been opened and the control center displays the device online. If the link is not connected or the device is abnormal, the result of the link failure is returned to the client through the network port.
[0046] refer to Figure 3 The present invention provides an encrypted data transmission method based on a private network protocol. The method encrypts and numbers the information to be transmitted, and then hides the information in some unused or rarely used fields of the TCP protocol and the IP protocol for transmission. After receiving the data packet, the server performs verification, decryption and analysis to complete the data transmission process. Specifically, the method includes the following steps:
[0047] S1. The client and the server use the MTI network key negotiation protocol to generate a negotiation key, and then randomly generate a session key. The session key is used to perform XOR encryption on the information in the data packet to be sent to obtain encrypted information.
[0048] Among them, the information in the data packet to be sent includes basic terminal information, business information, and alarm information. The client and the server use the master / slave query method to exchange information according to the private network protocol. The master device sends a message to any valid address in the network, and the slave device with the address responds according to the corresponding private protocol format. The private network protocol data frame structure definition includes a frame header, device type, device subtype, device address, length, parameter body, command word, check word, and frame tail. The frame header and frame tail are fixed characters used to mark the data packet as a private network protocol format data packet corresponding to the device; the device type and device subtype are used for device classification and can be negotiated and modified; the device address is the specific address of the corresponding device; the length is the total number of all bytes after the frame length byte to the check byte; the command word indicates the type of command, including full query and full query response, single query and single query response, setting and setting response; the check byte is the cumulative sum of all content bytes from the address to the parameter body; the parameter body contains the parameter content of the corresponding frame.
[0049] S2. Use the negotiated key to XOR-encrypt the session key to generate an encrypted session key; combine the generated random sequence with the encrypted information and number each data packet to be sent, and calculate the checksum of the header.
[0050] S3. The sensitive data information composed of the private network protocol is encrypted with the session key and embedded into the sequence number of the TCP protocol header; at the same time, the encrypted session key is filled into the identification bit of the IP. In order to ensure the effective reorganization of the data information, it is necessary to number each data packet sent, and fill the number information into the source port bit of the TCP protocol header. Finally, the protocol header and data bits are checked and summed to ensure the integrity and accuracy of the data. The client sends the data packet to be sent to the server to complete the data packet sending. Specifically, the information is hidden in the 32-bit sequence number bit of the TCP protocol header, of which the upper 16 bits are filled with random sequences, and the lower 16 bits are used for information hiding, a random sequence number is generated, and the hidden information is encrypted with the session key, which is randomly variable.
[0051] S4, the server receives the data packet from the client, calculates the TCP header checksum, and extracts the encryption information, session key and data packet number from the header of the data packet when the check result indicates that the information is complete;
[0052] S5. Decrypt the session key using the negotiated key, and decrypt the information transmitted this time using the decrypted session key;
[0053] S6. Read the data packet number, return to execute step S4, reorganize the transmission information according to the number, and obtain the correct information for transmission.
[0054] Although the present invention has been described above with preferred embodiments, it is not intended to limit the present invention. A person skilled in the art of the present invention may make various modifications and improvements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the definition of the claims.
Claims
1. A method for transmitting encrypted data based on a private network protocol, characterized in that: The steps include: S1. The client and the server use the MTI network key negotiation protocol to generate a negotiation key, and then randomly generate a session key. The session key is used to perform XOR operation on the information in the data packet to be sent to obtain encrypted information. S2. XOR encrypt the session key with the negotiated key to generate an encrypted session key; combine the generated random sequence with the encrypted information and number each data packet to be sent to calculate the header checksum; S3, fill the encrypted information into the TCP sequence number bit, fill the encrypted session key into the IP identification bit, fill the number into the TCP source port, and the client sends the data packet to be sent to the server to complete the data packet sending; S4, the server receives the data packet from the client, calculates the TCP header checksum, and extracts the encryption information, session key and data packet number from the header of the data packet when the check result indicates that the information is complete; S5. Decrypt the session key using the negotiated key, and decrypt the information transmitted this time using the decrypted session key; S6. Read the data packet number, return to execute step S4, reorganize the transmission information according to the number, and obtain the correct information for transmission.
2. According to claim 1, a method for encrypted data transmission based on a private network protocol is characterized in that: The information in the data packet to be sent includes basic terminal information, service information, and alarm information.
3. The method for encrypted data transmission based on a private network protocol according to claim 1, characterized in that: The client and server use the master / slave query method to exchange information based on the private network protocol. When the master device sends a message to any valid address in the network, the slave device with the address will respond in accordance with the corresponding private protocol format.
4. The method for encrypted data transmission based on a private network protocol according to claim 1, characterized in that: In step S3, when the encrypted information is filled, the encrypted information is hidden in the 32-bit sequence number of the TCP protocol header, wherein the upper 16 bits are filled with a random sequence and the lower 16 bits are used for information hiding.
5. The method for encrypted data transmission based on a private network protocol according to claim 3, characterized in that: The private network protocol data frame structure definition includes frame header, device type, device subtype, device address, length, parameter body, command word, check word, and frame tail; The frame header and frame trailer are fixed characters used to mark the data packet as a data packet in the private network protocol format corresponding to the device; Device type and device subtype are used to classify devices and can be modified through negotiation; The device address is the specific address of the corresponding device; the length is the total number of bytes from the frame length byte to the check byte; The command word indicates the type of command, including full query and full query response, single query and single query response, setting and setting response, broadcast search and response, etc. The check byte is the cumulative sum or XOR sum of all the bytes from the address to the parameter body; The parameter body contains the parameter content of the corresponding frame.
6. An encrypted data transmission system based on a private network protocol, characterized in that: Including client and server; The client includes a first link detection module, a first negotiation key module, a data encryption module, a first sum verification module, and a data filling module; The server side includes a second link detection module, a second negotiation key module, a data decryption module, a second sum verification module, and a data parsing module; The first link detection module and the second link detection module are used to detect whether the link between the client and the server is normal or abnormal; The first negotiation key module and the second negotiation key module are used to generate a negotiation key and a session key between the client and the server using the MTI network key negotiation protocol; The data encryption module uses the session key to perform XOR operation encryption on the information in the data packet to be sent to obtain encrypted information; the session key is XOR encrypted with the negotiated key to generate an encrypted session key; The first sum check module combines the generated random sequence with the encrypted information and numbers each data packet to be sent. The data filling module is used to fill the encrypted information into the TCP sequence number bit, and at the same time fill the encrypted session key into the IP identification bit, fill the number into the TCP source port, and calculate the header checksum; A second sum check module is used to receive a data packet from a client at the server end, calculate the TCP header checksum, and extract the encryption information, session key and data packet number from the header of the data packet when the check result indicates that the information is complete; The data analysis module is used to negotiate the key to decrypt the session key, and use the decrypted session key to decrypt the information transmitted this time; the transmitted information is reorganized according to the number to obtain the correct information transmitted.
7. The encrypted data transmission system based on a private network protocol according to claim 6, characterized in that: The first link detection module is configured to perform the following actions: the terminal device on the server side actively pushes the device status to the client through the network port. After receiving the data, the client judges and processes the instructions, retrieves the information stored in the corresponding measurement and control device, and returns the correct execution result to the client, indicating that the link has been opened and the control center displays the device online. If the link is not connected or the device is abnormal, the result of the link being unconnected is returned to the user.
8. The encrypted data transmission system based on a private network protocol according to claim 6, characterized in that: The second link detection module is configured to perform the following actions: the client sends a command to the corresponding device on the server through the network port. After receiving the data, the device judges and processes the command, and returns the correct execution result to the client after operating the corresponding measurement and control device or directly retrieving the information stored in the device, indicating that the link has been opened and the control center displays the device online. If the link is not connected or the device is abnormal, the result of the link being not connected is returned to the client.
