Substation communication protocol analysis method, system, equipment and medium
By exchanging keys in the smart substation automation system and using quantum key generation, the problem of decryption and analysis of encrypted communication data is solved, effective decryption and security assurance of communication data between substation equipment are achieved, and the risk of external attacks is reduced.
Patent Information
- Application Number
- CN202411203767.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In smart substation automation systems, existing technologies are difficult to decrypt and analyze encrypted communication data, resulting in complex analysis and debugging during the R&D and testing stages, and unable to effectively ensure data security.
By exchanging preset keys between the message parsing end and the client, using the first key to parse the request message and the second key to parse the response message, and using quantum key generation and distribution to ensure the security of the key. Unpredictability and non-replicability, increasing resistance to quantum computer attacks.
It achieves effective decryption and analysis of communication data between substation equipment, improves the security of data encryption, ensures the overall security of the system and the confidentiality of communication content, and reduces the risk of external attacks.
Smart Images

Figure CN118713939A
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication security technology, and in particular to a substation communication protocol parsing method, system, device and medium. Background Art
[0002] In the power industry, smart substation automation systems use Ethernet to achieve interconnection and communication between devices. However, this network architecture faces the risk of illegal network intrusion, posing a serious threat to data security. With the expansion of the scale of secondary equipment networks and the improvement of automation levels, ensuring data security has become particularly critical.
[0003] Although encrypted communication is an effective means to ensure data security, conventional message decryption software can only parse plaintext messages and cannot process encrypted messages, which makes it complicated to analyze and debug encrypted traffic during the R&D and testing stages. Therefore, the current urgent problem to be solved is how to effectively decrypt and analyze the communication data between substation equipment. Summary of the invention
[0004] The present application provides a substation communication protocol parsing method, system, device and medium, which solves the technical problem of how to effectively decrypt and analyze communication data between substation equipment, and achieves the technical effect of effectively decrypting and analyzing communication data.
[0005] In order to achieve the above objectives, the main technical solutions adopted in this application include: In a first aspect, an embodiment of the present application provides a substation communication protocol parsing method, which is applied to a message parsing end, comprising: Acquire, according to a preset IP address, a request message sent by a client to a server for requesting to establish communication with the server, and a response message sent by the server to the client for agreeing to establish communication; Receiving a first key and a second key sent by the client; wherein the first key is generated by the client, and the second key is generated by the server; The request message is parsed using the first key, and the response message is parsed using the second key.
[0006] The present embodiment provides a substation communication protocol parsing method, which captures messages of a specific IP address through a preset IP address, including request messages and response messages, which are encrypted by specific keys to ensure security during transmission. The request message can be decrypted using the received first key, and the content in the request message can be accurately extracted and analyzed, and the response message can be decrypted using the received second key, and the content in the response message can be accurately extracted and analyzed, providing detailed information for the testing and development stages, which helps to check the security and integrity of the message.
[0007] Optionally, before receiving the first key and the second key sent by the client, the method further includes: In the case where the server and the client are located in the same server, the client uses a preset calling instruction to establish a link connection with the client.
[0008] This embodiment enables the client and the message parser to communicate quickly through preset call instructions (such as function calls, API interfaces or command line parameters) without complex network settings. This method has lower latency and higher bandwidth utilization than network transmission. In addition, since the message parser and the client communicate on the same server, data transmission through the network is avoided, thereby reducing the risk of external attacks.
[0009] Optionally, before receiving the first key and the second key sent by the client, the method further includes: In the case where the server is different from the client, receiving a connection request sent by the client for establishing a TCP connection; Returning a response to the connection request to the client; In response to the client receiving the response, a link connection is established with the client.
[0010] The TCP connection establishment process between the client and the message parser in this embodiment follows the classic three-way handshake protocol, which ensures that a reliable, two-way communication connection is established between the client and the message parser, and can ensure data integrity and transmission reliability.
[0011] In a second aspect, an embodiment of the present application provides a substation communication protocol parsing method, which is applied to a client, including: Handshake with the server to obtain the target cipher suite and target TLS protocol; Receiving an initial quantum key sent by a quantum key management machine, and randomly generating a first key according to the target cipher suite and the target TLS protocol; Sending a request message to the server for requesting to establish communication with the server; Receiving a response message sent by the server end agreeing to establish communication, the response message at least including the server end receiving the initial quantum key and randomly generating a second key according to the target cipher suite and the target TLS protocol; The first key and the second key are sent to a message parsing end, so that the message parsing end uses the first key to parse the request message and uses the second key to parse the response message.
[0012] The present embodiment provides a substation communication protocol parsing method, which ensures the unpredictability and non-replicability of the key through quantum key generation and distribution, and greatly enhances the ability to resist quantum computer attacks. The key used in each communication is randomly generated, which prevents the key from being stolen or reused, and improves the security of data encryption. The request message and the response message are encrypted and decrypted using the first key and the second key, ensuring the confidentiality of the communication content between the client and the server. With the support of the message parsing end, necessary analysis and security detection can be performed on the encrypted communication, thereby ensuring the overall security of the system.
[0013] Optionally, before sending the first key and the second key to the message parsing end, the method further includes: In the case where the message parsing terminal and the message parsing terminal are located in the same server, a preset calling instruction is sent to the message parsing terminal to establish a link connection with the message parsing terminal.
[0014] This embodiment enables the client and the message parser to communicate quickly through preset call instructions (such as function calls, API interfaces or command line parameters) without complex network settings. This method has lower latency and higher bandwidth utilization than network transmission. In addition, since the message parser and the client communicate on the same server, data transmission through the network is avoided, thereby reducing the risk of external attacks.
[0015] Optionally, before receiving the first key and the second key sent by the client, the method further includes: In the case where the server and the message parsing terminal are located on different servers, sending a connection request for establishing a TCP connection to the message parsing terminal; Receive a response to the connection request returned by the message parsing end, and establish a link connection with the message parsing end.
[0016] The TCP connection establishment process between the client and the message parser in this embodiment follows the classic three-way handshake protocol, which ensures that a reliable, two-way communication connection is established between the client and the message parser, and can ensure data integrity and transmission reliability.
[0017] In a third aspect, an embodiment of the present application provides a substation communication protocol parsing system, which is applied to a message parsing terminal, including: A message acquisition module, used to acquire, according to a preset source IP address, a request message sent by a client to a server for requesting to establish communication with the server, and a response message sent by the server to the client for agreeing to establish communication; A key receiving module, used for receiving a first key and a second key sent by the client; wherein the first key is generated by the client, and the second key is generated by the server; A message parsing module is used to parse the request message using the first key, and to parse the response message using the second key.
[0018] The present embodiment provides a substation communication protocol parsing system, which captures messages of a specific IP address through a preset IP address, including request messages and response messages, which are encrypted by specific keys to ensure security during transmission. The request message can be decrypted using the received first key, and the content in the request message can be accurately extracted and analyzed, and the response message can be decrypted using the received second key, and the content in the response message can be accurately extracted and analyzed, providing detailed information for the testing and development stages, which helps to check the security and integrity of the message.
[0019] Optionally, before receiving the key module, the method further includes: In the case where the server and the client are located in the same server, the client uses a preset calling instruction to establish a link connection with the client.
[0020] This embodiment enables the client and the message parser to communicate quickly through preset call instructions (such as function calls, API interfaces or command line parameters) without complex network settings. This method has lower latency and higher bandwidth utilization than network transmission. In addition, since the message parser and the client communicate on the same server, data transmission through the network is avoided, thereby reducing the risk of external attacks.
[0021] Optionally, before receiving the key module, the method further includes: In the case where the server is different from the client, receiving a connection request sent by the client for establishing a TCP connection; Returning a response to the connection request to the client; In response to the client receiving the response, a link connection is established with the client.
[0022] The TCP connection establishment process between the client and the message parser in this embodiment follows the classic three-way handshake protocol, which ensures that a reliable, two-way communication connection is established between the client and the message parser, and can ensure data integrity and transmission reliability.
[0023] In a fourth aspect, an embodiment of the present application provides a substation communication protocol parsing system, which is applied to a client and includes: The handshake module is used to shake hands with the server to obtain the target cipher suite and target TLS protocol; A key generation module, configured to receive an initial quantum key sent by a quantum key management machine, and randomly generate a first key according to the target cipher suite and the target TLS protocol; A request message sending module, used to send a request message to the server for requesting to establish communication with the server; A response message receiving module, configured to receive a response message sent by the server end agreeing to establish communication, wherein the response message at least includes the server end receiving the initial quantum key and randomly generating a second key according to the target cipher suite and the target TLS protocol; The key sending module is used to send the first key and the second key to the message parsing end, so that the message parsing end uses the first key to parse the request message and uses the second key to parse the response message.
[0024] The present embodiment provides a substation communication protocol parsing system, which ensures the unpredictability and non-replicability of the key through quantum key generation and distribution, and greatly enhances the ability to resist quantum computer attacks. The key used in each communication is randomly generated, which prevents the key from being stolen or reused, and improves the security of data encryption. The request message and the response message are encrypted and decrypted using the first key and the second key, ensuring the confidentiality of the communication content between the client and the server. With the support of the message parsing end, necessary analysis and security detection can be performed on the encrypted communication, thereby ensuring the overall security of the system.
[0025] Optionally, before sending the key module, the method further includes: In the case where the message parsing terminal and the message parsing terminal are located in the same server, a preset calling instruction is sent to the message parsing terminal to establish a link connection with the message parsing terminal.
[0026] This embodiment enables the client and the message parser to communicate quickly through preset call instructions (such as function calls, API interfaces or command line parameters) without complex network settings. This method has lower latency and higher bandwidth utilization than network transmission. In addition, since the message parser and the client communicate on the same server, data transmission through the network is avoided, thereby reducing the risk of external attacks.
[0027] Optionally, before sending the key module, the method further includes: In the case where the server and the message parsing terminal are located on different servers, sending a connection request for establishing a TCP connection to the message parsing terminal; Receive a response to the connection request returned by the message parsing end, and establish a link connection with the message parsing end.
[0028] The TCP connection establishment process between the client and the message parser in this embodiment follows the classic three-way handshake protocol, which ensures that a reliable, two-way communication connection is established between the client and the message parser, and can ensure data integrity and transmission reliability.
[0029] In a fifth aspect, an embodiment of the present application provides a computer device, including: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the above-mentioned substation communication protocol parsing method by executing the computer instructions.
[0030] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer instructions are stored, and the computer instructions are used to enable a computer to execute the substation communication protocol parsing method described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] 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.
[0032] Figure 1 A flowchart of a substation communication protocol parsing method provided in an embodiment of the present application; Figure 2 A flowchart before step S13 provided in an embodiment of the present application; Figure 3Another flowchart before step S13 provided in an embodiment of the present application; Figure 4 A flowchart of another substation communication protocol parsing method provided in an embodiment of the present application; Figure 5 A flowchart before step S29 provided in an embodiment of the present application; Figure 6 Another flowchart before step S29 provided for an embodiment of the present application; Figure 7 A block diagram of a substation communication protocol parsing system provided in an embodiment of the present application; Figure 8 A block diagram of another substation communication protocol parsing system provided in an embodiment of the present application; Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0033] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0034] In the power industry, the core of the smart substation automation system is to achieve interconnection and communication of equipment within the substation through Ethernet. This architecture supports real-time data exchange and system automation operations. For example, various sensors, controllers, and monitoring devices in the substation are connected through Ethernet to share data in real time to optimize the operation of the power system. With the expansion of the substation equipment network scale and the improvement of the automation level, ensuring data security has become a vital task. Network expansion brings more communication nodes, and each node may become a potential target of attack.
[0035] Current encrypted communications are an effective means of protecting data security. By encrypting data, the confidentiality and integrity of data during transmission can be ensured. Even if the data is intercepted, its content cannot be read without the correct decryption key. Although encryption provides data protection, analyzing and debugging encrypted traffic becomes a challenge during the R&D and testing phases. Conventional message decryption software can usually only process plaintext messages and cannot parse encrypted data.
[0036] Therefore, in smart substation automation systems, it is crucial to solve the problem of encrypted traffic analysis to ensure that effective measures are taken subsequently to enhance data security.
[0037] According to an embodiment of the present application, an embodiment of a substation communication protocol parsing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0038] In this embodiment, a substation communication protocol parsing method is provided, which is applied to a message parsing end. Figure 1 A flowchart of a substation communication protocol parsing method provided in an embodiment of the present application, such as Figure 1 As shown, the process includes the following steps: Step S11, obtaining, according to a preset IP address, a request message sent by the client to the server for requesting to establish communication with the server, and a response message sent by the server to the client for agreeing to establish communication.
[0039] Specifically, in order to ensure the security of communication data, both the request message and the response message are pre-encrypted data. To obtain these encrypted message data, you can configure a network packet capture tool (such as Wireshark) on the message parsing end and set filtering rules to capture messages with specific IP addresses. Usually, the request message includes the source IP address (client IP) and the destination IP address (server IP), and the response message includes the source IP address (server IP) and the destination IP address (client IP). Here, you can set filtering rules, such as a specific source IP address or destination IP address, to capture the communication messages between the client and the server. For example, use the filtering expressions (ip.src==<client IP address>or ip.src==<server IP address>) and (ip.dst==<client IP address>or ip.dst==<server IP address>) to capture all packets whose source IP address is the client IP address or the server IP address, and filter all packets whose destination IP address is the server IP address or the client IP address. That is, the source IP of the packet must be the client IP address or the server IP address, and the destination IP must also be the client IP address or the server IP address.
[0040] Step S13, receiving a first key and a second key sent by the client; wherein the first key is generated by the client, and the second key is generated by the server.
[0041] Specifically, the client and the server generate the target cipher suite and TLS protocol through handshake, and send the initial quantum key in combination with the quantum key management machine to enhance security. The client and the server each determine a key derivation function according to the target cipher suite and TLS protocol. The key derivation function is used to generate the key actually used for encrypted communication from the initial quantum key. The client uses its key derivation function to process the initial quantum key and generate a first key for the client to encrypt the request message sent to the server. The server uses its key derivation function to process the initial quantum key and generate a second key for the server to encrypt the response message sent to the client. The client sends the first key and the request message to the server through a secure channel, and the server receives the first key and sends the second key and the response message to the client. Once the client and the server both have each other's keys (the first key and the second key), the client can use the second key to decrypt the response message to obtain the plaintext information, and the server can use the first key to decrypt the request message to obtain the plaintext information. At this time, the client will have both the first key and the second key. The message parsing end receives the first key and the second key sent by the client, and can parse the request message and response message captured subsequently, providing a basis for analysis in the R&D and testing stages.
[0042] Step S15: parse the request message using the first key, and parse the response message using the second key.
[0043] Specifically, the message parser uses the first key generated by the client to decrypt the encrypted request message in order to view and analyze the content of the request message. The encrypted response message is decrypted using the second key generated by the server to view and analyze the content of the response message. After decryption, the message parser analyzes the structure of the message and extracts necessary information, such as HTTP request method, URI, protocol version, status code, response header and body, etc. This allows testers to perform security checks on the decrypted message, such as checking for malicious code, cross-site scripting (XSS) and other security threats.
[0044] The present embodiment provides a substation communication protocol parsing method, which captures messages of a specific IP address through a preset IP address, including request messages and response messages, which are encrypted by specific keys to ensure security during transmission. The request message can be decrypted using the received first key, and the content in the request message can be accurately extracted and analyzed, and the response message can be decrypted using the received second key, and the content in the response message can be accurately extracted and analyzed, providing detailed information for the testing and development stages, which helps to check the security and integrity of the message.
[0045] Figure 2A flowchart before step S13 is provided for an embodiment of the present application, and the process may include the following steps: Step S1211, when the server and the client are located in the same server, receiving a preset calling instruction from the client to establish a link connection with the client.
[0046] Specifically, when the message parser and the client are located on the same server, a link connection can be established through the IPC mechanism. Define and configure preset call instructions, which may be function calls, API interfaces, command line parameters or other forms of identifiers, for communication between the client and the message parser. The client initializes the communication process according to the preset call instructions, involving steps such as loading configuration and initializing the communication interface. The message parser is ready to receive calls from the client, involving listening to a specific port, path or identifier. The client sends a connection request to the message parser using the preset call instructions. The message parser receives the request and establishes a link connection. If necessary, you can also directly use command line call instructions (such as cmd) to establish a connection with the client. For example, the client requests a connection by calling api_connect("localhost", 1234), and the message parser listens to port 1234 and accepts the request. After the link connection is successfully established, the two parties can exchange data.
[0047] It should be noted that the data transmission between the message parser and the client uses a custom private protocol with a length of 256 bytes. This protocol defines a set of communication rules that are completely different from the conventional communication protocol, including the start character, end character, data length, and checksum. For example, in the custom protocol, the start character is not a standard message start mark, but a specific, opaque byte sequence. Similar to the start character, the end character is a specific, custom byte sequence. The field specifies the length of the payload, which is used to inform the receiver of the amount of data to be parsed. The checksum is used to ensure the integrity of the data during transmission. The checksum is generated based on a random algorithm, such as CRC or hash function, to detect whether the message has been tampered with. The client and the message parser need to jointly comply with the custom private protocol to define how to encode the data into a 256-byte format and how to decode it to extract information. For example, assume that the structure of the custom protocol is as follows: start character (8 bytes), data length (4 bytes), payload (up to 240 bytes, determined by the data length field), checksum (8 bytes), end character (8 bytes). During data transmission, the client encapsulates the data into the above structure, calculates the checksum, and sends the entire 256-byte message. After receiving the message, the message parser checks the checksum to verify the integrity of the data, and then extracts the payload based on the data length field. This custom protocol design increases the security of the protocol because only the two parties who know the details of the protocol can correctly parse the message.
[0048] and Figure 1 Compared with the embodiment shown in the figure, this embodiment enables the client and the message parser to quickly communicate through preset calling instructions (such as function calls, API interfaces or command line parameters) without complicated network settings. This method has lower latency and higher bandwidth utilization than network transmission. In addition, since the message parser and the client communicate on the same server, data transmission through the network is avoided, thereby reducing the risk of external attacks.
[0049] Figure 3 Another flowchart before step S13 provided in an embodiment of the present application may include the following steps: Step S1221: When the server is different from the client, a connection request for establishing a TCP connection sent by the client is received.
[0050] Step S1223: Return a response to the connection request to the client.
[0051] Step S1225: In response to the client receiving the response, establishing a link connection with the client.
[0052] Specifically, the client configures the IP address and port number of the server (the server where the message parser is located). The client randomly generates an initial sequence number (ISN), sets the SYN flag to 1, and sends it to the message parser, indicating that it wants to establish a connection. The message parser receives the SYN message sent by the client. After receiving the connection request, the message parser agrees to establish a connection, sets the ACK flag to 1, and sets the confirmation number (ACK number) to the client's ISN plus 1. The message parser also generates its own ISN and sends a SYN-ACK message to the client. The client receives the SYN-ACK message from the message parser. The client sets the ACK flag to 1, sets the sequence number (SEQ number) to the received ACK number, and sends an ACK message to the message parser. After the message parser receives the ACK message from the client, the three-way handshake process is completed, and the TCP connection is successfully established. The client and the message parser can start data transmission.
[0053] It should be noted that the data transmission between the message parser and the client in step S1221 to step S1225 uses a custom private protocol with a length of 256 bytes. The protocol defines a set of communication rules that are completely different from conventional communication protocols, including a start character, an end character, a data length, and a check code. For example, in the custom protocol, the start character is not a standard message start mark, but a specific, opaque byte sequence. Similar to the start character, the end character is a specific, custom byte sequence. The field specifies the length of the payload, which is used to inform the receiving end of the amount of data to be parsed. The check code is used to ensure the integrity of the data during transmission. The check code is generated based on a random algorithm, such as CRC or a hash function, to detect whether the message has been tampered with. The client and the message parser need to jointly comply with the custom private protocol to define how to encode the data into a 256-byte format and how to decode it to extract information. For example, assume that the structure of the custom protocol is as follows: start character (8 bytes), data length (4 bytes), payload (up to 240 bytes, determined by the data length field), check code (8 bytes), end character (8 bytes). During data transmission, the client encapsulates the data into the above structure, calculates the checksum, and sends the entire 256-byte message. After receiving the message, the message parser checks the checksum to verify the integrity of the data, and then extracts the payload based on the data length field. This custom protocol design increases the security of the protocol because only the two parties who know the details of the protocol can correctly parse the message.
[0054] and Figure 1Compared with the embodiment shown, the TCP connection establishment process between the client and the message parser in this embodiment follows the classic three-way handshake protocol. This ensures that a reliable, two-way communication connection is established between the client and the message parser, which can ensure the integrity of the data and the reliability of the transmission.
[0055] In this embodiment, a substation communication protocol parsing method is provided, which is applied to a client. Figure 4 A flowchart of another substation communication protocol parsing method provided in an embodiment of the present application, such as Figure 4 As shown, the process includes the following steps: Step S21, handshake with the server to obtain the target cipher suite and target TLS protocol.
[0056] Specifically, the client and the server perform a handshake and send a ClientHello message to the server. The message includes the TLS protocol supported by the client, a list of cipher suites, a random number (for subsequent key generation), and other parameters such as compression methods and extension fields. After receiving the ClientHello message, the server selects a target TLS protocol and target cipher suite that they both support, and sends this information back to the client via a ServerHello message.
[0057] Step S23, receiving an initial quantum key sent by a quantum key management machine, and randomly generating a first key according to the target cipher suite and the target TLS protocol.
[0058] Specifically, the quantum key management machine sends the initial quantum keys to the client according to a preset period. These keys are generated by a quantum random number generator and are unpredictable and non-replicable. The client uses these initial quantum keys as a basis, combined with the requirements of the target cipher suite and the target TLS protocol, to generate a new first key through a key derivation function for the subsequent communication encryption process. The introduction of quantum keys provides a higher level of security for the TLS protocol. Since the generation and distribution process of quantum keys is based on physical principles, it can resist the potential threats of quantum computers and realize key exchanges that cannot be eavesdropped in theory. In addition, the randomness of quantum keys ensures that the keys for each communication are unique, thereby enhancing the security of data transmission.
[0059] Step S25: Send a request message to the server to request to establish communication with the server.
[0060] Specifically, the client determines the communication protocol to be used, such as TCP / IP, TLS / SSL, etc. Then constructs a request message, including the IP address and port number of the target server. The request message is encrypted using a first key, and the first key and the encrypted request message are sent to the server, so that the server can decrypt the request message using the received first key.
[0061] Step S27, receiving a response message sent by the server agreeing to establish communication, wherein the response message at least includes the server receiving the initial quantum key and a second key randomly generated according to the target cipher suite and the target TLS protocol.
[0062] Specifically, the quantum key management machine sends the initial quantum key to the server according to a preset period. These keys are generated by a quantum random number generator and are unpredictable and non-replicable. The server uses these initial quantum keys as a basis, combined with the requirements of the target cipher suite and the TLS protocol, to generate a new second key through a key derivation function for the subsequent communication encryption process. The introduction of quantum keys provides a higher level of security for the TLS protocol. Since the generation and distribution process of quantum keys is based on physical principles, it can resist the potential threat of quantum computers and realize key exchanges that cannot be eavesdropped on in theory. In addition, the randomness of quantum keys ensures that the key for each communication is unique, thereby enhancing the security of data transmission. The server constructs a response message, which at least includes confirmation information for the client request, and encrypts the response message using the second key, and sends the second key and the encrypted response message to the client, so that the client can decrypt the response message using the received second key.
[0063] Step S29: Send the first key and the second key to the message parsing end, so that the message parsing end uses the first key to parse the request message, and uses the second key to parse the response message.
[0064] Specifically, the client sends the first key and the second key to the message parsing end, so that the message parsing end can decrypt and parse the encrypted messages exchanged between the client and the server, so that the tester can perform necessary analysis and recording, thereby performing effective network monitoring, data analysis and security testing.
[0065] The present embodiment provides a substation communication protocol parsing method, which ensures the unpredictability and non-replicability of the key through quantum key generation and distribution, and greatly enhances the ability to resist quantum computer attacks. The key used in each communication is randomly generated, which prevents the key from being stolen or reused, and improves the security of data encryption. The request message and the response message are encrypted and decrypted using the first key and the second key, ensuring the confidentiality of the communication content between the client and the server. With the support of the message parsing end, necessary analysis and security detection can be performed on the encrypted communication, thereby ensuring the overall security of the system.
[0066] Figure 5 A flowchart before step S29 is provided for an embodiment of the present application, and the process may include the following steps: Step S2911, when the message parsing terminal and the message parsing terminal are located in the same server, a preset calling instruction is sent to the message parsing terminal to establish a link connection with the message parsing terminal.
[0067] Specifically, when the client and the message parser are located on the same server, a link connection can be established through the IPC mechanism. Define and configure preset call instructions, which may be function calls, API interfaces, command line parameters or other forms of identifiers, for communication between the client and the message parser. The client initializes the communication process according to the preset call instructions, involving steps such as loading configuration and initializing the communication interface. The message parser is ready to receive calls from the client, involving listening to a specific port, path or identifier. The client sends a connection request to the message parser using the preset call instructions. The message parser receives the request and establishes a link connection. If necessary, you can also directly use command line call instructions (such as cmd) to establish a connection with the client. For example, the client requests a connection by calling api_connect("localhost", 1234), the message parser listens to port 1234 and accepts the request, and after the link connection is successfully established, the two parties can exchange data.
[0068] It should be noted that the data transmission between the message parser and the client uses a custom private protocol with a length of 256 bytes. This protocol defines a set of communication rules that are completely different from the conventional communication protocol, including the start character, end character, data length, and checksum. For example, in the custom protocol, the start character is not a standard message start mark, but a specific, opaque byte sequence. Similar to the start character, the end character is a specific, custom byte sequence. The field specifies the length of the payload, which is used to inform the receiver of the amount of data to be parsed. The checksum is used to ensure the integrity of the data during transmission. The checksum is generated based on a random algorithm, such as CRC or hash function, to detect whether the message has been tampered with. The client and the message parser need to jointly comply with the custom private protocol to define how to encode the data into a 256-byte format and how to decode it to extract information. For example, assume that the structure of the custom protocol is as follows: start character (8 bytes), data length (4 bytes), payload (up to 240 bytes, determined by the data length field), checksum (8 bytes), end character (8 bytes). During data transmission, the client encapsulates the data into the above structure, calculates the checksum, and sends the entire 256-byte message. After receiving the message, the message parser checks the checksum to verify the integrity of the data, and then extracts the payload based on the data length field. This custom protocol design increases the security of the protocol because only the two parties who know the details of the protocol can correctly parse the message.
[0069] and Figure 4 Compared with the embodiment shown in the figure, this embodiment enables the client and the message parser to quickly communicate through preset calling instructions (such as function calls, API interfaces or command line parameters) without complicated network settings. This method has lower latency and higher bandwidth utilization than network transmission. In addition, since the message parser and the client communicate on the same server, data transmission through the network is avoided, thereby reducing the risk of external attacks.
[0070] Figure 6 Another flowchart before step S29 provided in an embodiment of the present application may include the following steps: Step S2921: When the server and the message parsing end are located on different servers, a connection request for establishing a TCP connection is sent to the message parsing end.
[0071] Step S2923: Receive a response to the connection request returned by the message parsing end, and establish a link connection with the message parsing end.
[0072] Specifically, the client configures the IP address and port number of the server (the server where the message parser is located). The client randomly generates an initial sequence number (ISN), sets the SYN flag to 1, and sends it to the message parser, indicating that it wants to establish a connection. The message parser receives the SYN message sent by the client. After receiving the connection request, the message parser agrees to establish a connection, sets the ACK flag to 1, and sets the confirmation number (ACK number) to the client's ISN plus 1. The message parser also generates its own ISN and sends a SYN-ACK message to the client. The client receives the SYN-ACK message from the message parser. The client sets the ACK flag to 1, sets the sequence number (SEQ number) to the received ACK number, and sends an ACK message to the message parser. After the message parser receives the ACK message from the client, the three-way handshake process is completed, and the TCP connection is successfully established. The client and the message parser can start data transmission.
[0073] It should be noted that the data transmission between the message parser and the client in step S2921 to step S2923 uses a custom private protocol with a length of 256 bytes. The protocol defines a set of communication rules that are completely different from conventional communication protocols, including a start character, an end character, a data length, and a checksum. For example, in the custom protocol, the start character is not a standard message start mark, but a specific, opaque byte sequence. Similar to the start character, the end character is a specific, custom byte sequence. The field specifies the length of the payload, which is used to inform the receiving end of the amount of data to be parsed. The checksum is used to ensure the integrity of the data during transmission. The checksum is generated based on a random algorithm, such as CRC or a hash function, to detect whether the message has been tampered with. The client and the message parser need to jointly comply with the custom private protocol to define how to encode the data into a 256-byte format and how to decode it to extract information. For example, assume that the structure of the custom protocol is as follows: start character (8 bytes), data length (4 bytes), payload (up to 240 bytes, determined by the data length field), checksum (8 bytes), and end character (8 bytes). During data transmission, the client encapsulates the data into the above structure, calculates the checksum, and sends the entire 256-byte message. After receiving the message, the message parser checks the checksum to verify the integrity of the data, and then extracts the payload based on the data length field. This custom protocol design increases the security of the protocol because only the two parties who know the details of the protocol can correctly parse the message.
[0074] and Figure 4Compared with the embodiment shown, the TCP connection establishment process between the client and the message parser in this embodiment follows the classic three-way handshake protocol. This ensures that a reliable, two-way communication connection is established between the client and the message parser, which can ensure the integrity of the data and the reliability of the transmission.
[0075] In some embodiments, a clock synchronization device is also included, and the clock synchronization device performs time synchronization for the client, server and quantum key management machine through a network method or a B code method.
[0076] Specifically, network-based time synchronization usually relies on protocols such as NTP (Network Time Protocol), which can synchronize the clocks between the client, server, and quantum key management machine, and provide high-precision time correction, with an accuracy of less than 1 millisecond in a LAN network and tens of milliseconds in a WAN network. The B code method, especially the IRIG-B code, is a time code consisting of continuous data frames, each of which contains information about seconds, minutes, hours, days, and years, and can provide time information from years to nanoseconds. The working principle of the IRIG-B code is based on the continuous transmission of periodic time frames, each of which marks the beginning of a new one-second cycle and contains complete time information. Through the clock synchronization device, the clock synchronization of the entire client, server, and quantum key management machine can be ensured, reducing the security risks caused by time inconsistency and enhancing the security and reliability of the entire communication network.
[0077] Accordingly, please refer to Figure 7 A block diagram of a substation communication protocol parsing system provided in an embodiment of the present application, which is applied to a message parsing end, includes: The message acquisition module 101 is used to acquire, according to a preset source IP address, a request message sent by a client to a server for requesting to establish communication with the server, and a response message sent by the server to the client for agreeing to establish communication.
[0078] The key receiving module 103 is used to receive a first key and a second key sent by the client; wherein the first key is generated by the client, and the second key is generated by the server.
[0079] The message parsing module 105 is used to parse the request message using the first key, and to parse the response message using the second key.
[0080] In some embodiments, before receiving the key module 103, the method further includes: In the case where the server and the client are located in the same server, the client uses a preset calling instruction to establish a link connection with the client.
[0081] In some embodiments, before receiving the key module 103, the method further includes: In the case where the server is different from the client, receiving a connection request sent by the client for establishing a TCP connection; Returning a response to the connection request to the client; In response to the client receiving the response, a link connection is established with the client.
[0082] Accordingly, please refer to Figure 8 A block diagram of another substation communication protocol parsing system provided in an embodiment of the present application, applied to a client, the system comprising: The handshake module 201 is used to perform a handshake with the server to obtain a target cipher suite and a target TLS protocol.
[0083] The key generation module 203 is used to receive the initial quantum key sent by the quantum key management machine, and randomly generate a first key according to the target cipher suite and the target TLS protocol.
[0084] The request message sending module 205 is used to send a request message to the server for requesting to establish communication with the server.
[0085] The response message receiving module 207 is used to receive a response message sent by the server agreeing to establish communication, wherein the response message at least includes the server receiving the initial quantum key and a second key randomly generated according to the target cipher suite and the target TLS protocol.
[0086] The key sending module 209 is used to send the first key and the second key to the message parsing end, so that the message parsing end uses the first key to parse the request message and uses the second key to parse the response message.
[0087] In some embodiments, before sending the key module 209, the method further includes: In the case where the message parsing terminal and the message parsing terminal are located in the same server, a preset calling instruction is sent to the message parsing terminal to establish a link connection with the message parsing terminal.
[0088] In some embodiments, before sending the key module 209, the method further includes: In the case where the server and the message parsing terminal are located on different servers, sending a connection request for establishing a TCP connection to the message parsing terminal; Receive a response to the connection request returned by the message parsing end, and establish a link connection with the message parsing end.
[0089] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0090] In this embodiment, a substation communication protocol parsing system is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0091] See also Fig. 9 , Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0092] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0093] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0094] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0095] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0096] The computer device further comprises a communication interface 30 for the computer device to communicate with other devices or a communication network.
[0097] The embodiment of the present application also provides a computer-readable storage medium. The above method according to the embodiment of the present application can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0098] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0099] For the convenience of description, the above system is described by dividing the functions into various modules. Of course, when implementing the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0100] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods and systems. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0101] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0102] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0103] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0104] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0105] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0106] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
[0107] Although the embodiments of the present application have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present application, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A method for analyzing substation communication protocol, It is characterized in that Applied to the message parsing end, including: Acquire, according to a preset IP address, a request message sent by a client to a server for requesting to establish communication with the server, and a response message sent by the server to the client for agreeing to establish communication; Receiving a first key and a second key sent by the client; wherein the first key is generated by the client, and the second key is generated by the server; The request message is parsed using the first key, and the response message is parsed using the second key.
2. The method according to claim 1, It is characterized in that Before receiving the first key and the second key sent by the client, the method further includes: In the case where the server and the client are located in the same server, the client uses a preset calling instruction to establish a link connection with the client.
3. The method according to claim 1, It is characterized in that Before receiving the first key and the second key sent by the client, the method further includes: In the case where the server is different from the client, receiving a connection request sent by the client for establishing a TCP connection; Returning a response to the connection request to the client; In response to the client receiving the response, a link connection is established with the client.
4. A method for analyzing substation communication protocol, It is characterized in that Applied to the client, including: Handshake with the server to obtain the target cipher suite and target TLS protocol; Receiving an initial quantum key sent by a quantum key management machine, and randomly generating a first key according to the target cipher suite and the target TLS protocol; Sending a request message to the server for requesting to establish communication with the server; Receiving a response message sent by the server end agreeing to establish communication, the response message at least including the server end receiving the initial quantum key and randomly generating a second key according to the target cipher suite and the target TLS protocol; The first key and the second key are sent to a message parsing end, so that the message parsing end uses the first key to parse the request message and uses the second key to parse the response message.
5. The method according to claim 4, It is characterized in that Before sending the first key and the second key to the message parsing end, the method further includes: In the case where the message parsing terminal and the message parsing terminal are located in the same server, a preset calling instruction is sent to the message parsing terminal to establish a link connection with the message parsing terminal.
6. The method according to claim 4, It is characterized in that Before receiving the first key and the second key sent by the client, the method further includes: In the case where the server and the message parsing terminal are located on different servers, sending a connection request for establishing a TCP connection to the message parsing terminal; Receive a response to the connection request returned by the message parsing end, and establish a link connection with the message parsing end.
7. A substation communication protocol analysis system, It is characterized in that Applied to the message parsing end, including: A message acquisition module, used to acquire, according to a preset source IP address, a request message sent by a client to a server for requesting to establish communication with the server, and a response message sent by the server to the client for agreeing to establish communication; A key receiving module, used for receiving a first key and a second key sent by the client; wherein the first key is generated by the client, and the second key is generated by the server; A message parsing module is used to parse the request message using the first key, and to parse the response message using the second key.
8. A substation communication protocol analysis system, It is characterized in that Applied to the client, including: The handshake module is used to shake hands with the server to obtain the target cipher suite and target TLS protocol; A key generation module, configured to receive an initial quantum key sent by a quantum key management machine, and randomly generate a first key according to the target cipher suite and the target TLS protocol; A request message sending module, used to send a request message to the server for requesting to establish communication with the server; A response message receiving module, configured to receive a response message sent by the server end agreeing to establish communication, wherein the response message at least includes the server end receiving the initial quantum key and randomly generating a second key according to the target cipher suite and the target TLS protocol; The key sending module is used to send the first key and the second key to the message parsing end, so that the message parsing end uses the first key to parse the request message and uses the second key to parse the response message.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the substation communication protocol parsing method according to any one of claims 1 to 3 or claims 4 to 6 by executing the computer instructions.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the substation communication protocol parsing method according to any one of claims 1 to 3 or claims 4 to 6.
Citation Information
Patent Citations
Transformer substation quantum communication model, quantum secret key distribution center and model achieving method
CN102983965A
Ciphertext data auditing method and system based on HTTPS, and related apparatus
CN108965307A
Method and device for monitoring and analyzing encrypted traffic in real time
CN114050935A
TLS protocol negotiation method and device, and medium
CN115174267A
Traffic collection and blocking method, system and device and storage medium
CN115514583A
