Method for enhancing security of modbus protocol in multicast communication scenario

By introducing a session key and message authentication code exchange mechanism into the Modbus protocol and optimizing the Modbus bus message format, the identity authentication and key management problems of the Modbus protocol in multicast communication scenarios are solved, realizing efficient and secure data transmission and fast identity authentication, and improving the overall security and reliability of industrial control systems.

CN120301603BActive Publication Date: 2026-07-14XIDIAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XIDIAN UNIV
Filing Date
2025-04-21
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

The Modbus protocol lacks authentication and key management mechanisms in the field of industrial automation, which leads to insecure data transmission, vulnerability to attacks, high computational overhead on low-power devices, low authentication efficiency, and complex key management.

Method used

In multicast communication scenarios, rapid and unified identity authentication and key negotiation are achieved through session key calculation and message authentication code exchange between master and slave nodes. Pre-set keys and session keys are used for encrypted transmission, and the Modbus bus message format is optimized to support multi-node authentication.

Benefits of technology

It improves authentication efficiency, reduces latency, lowers computational and storage overhead, ensures the confidentiality and integrity of data transmission, and enhances system security and reliability, making it suitable for large industrial networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120301603B_ABST
    Figure CN120301603B_ABST
Patent Text Reader

Abstract

The application discloses a multicast communication scene Modbus protocol security enhancement method, comprising: when the master node initiates an identity authentication request, the master node calculates a first message authentication code of a first random number according to a session key; wherein the session key is obtained according to random numbers generated in advance by the master node and the slave node; the encrypted session key and the first message authentication code are broadcasted to each slave node; the slave node decrypts the encrypted session key, and calculates a second message authentication code of the first random number according to the obtained session key; when the message authentication codes are the same, the identity of the master node is authenticated; the slave node calculates a third message authentication code of a second random number by using the session key, and sends the third message authentication code to the master node; the master node calculates a fourth message authentication code of each second random number by using the session key; when the message authentication codes are the same, the identity of the corresponding slave node is authenticated. The application improves the identity authentication efficiency, and improves the security and reliability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of network security, specifically relating to a method for enhancing the security of the Modbus protocol in multicast communication scenarios. Background Technology

[0002] The Modbus protocol is a widely used communication standard in industrial automation, primarily used to connect sensors, actuators, and other devices. It supports serial communication and Ethernet-based communication (Modbus TCP / IP). Its applications span manufacturing, smart grids, building automation, water treatment, and other fields, enabling data exchange and remote control between devices. Characterized by its openness, simplicity, and reliability, the Modbus protocol is easy to implement and integrate, making it suitable for industrial systems of all sizes. Due to its low cost, good compatibility, and efficient data transmission capabilities, Modbus holds a significant position in global industrial control systems. However, its simple design results in a lack of necessary security mechanisms, leading to security vulnerabilities such as data eavesdropping and device information alteration in practical applications.

[0003] While the Modbus protocol is widely used in industrial automation, it suffers from significant security flaws. First, the basic Modbus protocol lacks fundamental security mechanisms and cannot authenticate communication devices, allowing unauthorized devices to easily access the network and increasing potential attack risks. Second, the Modbus protocol lacks key management and key negotiation mechanisms; when encryption or integrity verification is required, the protocol itself cannot provide the necessary key support, making data protection measures difficult to implement. Furthermore, the basic Modbus protocol itself does not support data encryption, making transmitted data vulnerable to interception and theft, failing to ensure data confidentiality. Statistics show that over 60% of industrial network attacks exploit protocol vulnerabilities for data theft and device control. These security deficiencies make Modbus particularly vulnerable to modern cyber threats. Therefore, despite Modbus's excellent performance in connecting devices and transmitting data, its security shortcomings urgently need to be addressed by adding security layers or upgrading the protocol to ensure the overall security of industrial control systems. Summary of the Invention

[0004] To address the aforementioned problems in the existing technology, this invention provides a method for enhancing the security of the Modbus protocol in multicast communication scenarios.

[0005] The technical problem to be solved by this invention is achieved through the following technical solution:

[0006] In a first aspect, the present invention provides a method for enhancing the security of the Modbus protocol in a multicast communication scenario, the method comprising:

[0007] When the master node initiates an authentication request, the master node calculates a first message authentication code based on a first random number using the session key; wherein, the session key is obtained based on random numbers pre-generated by the master node and the slave node;

[0008] The encrypted session key and the first message authentication code are broadcast to each of the slave nodes;

[0009] The slave node decrypts the encrypted session key to obtain the session key, and calculates the second message authentication code of the first random number based on the session key;

[0010] When the second message authentication code is the same as the first message authentication code, the slave node authenticates the identity of the master node;

[0011] The slave node uses the session key to calculate the third message authentication code of the second random number and sends it to the master node;

[0012] The master node uses the session key to calculate the fourth message authentication code for each of the second random numbers;

[0013] When the third message authentication code and the fourth message authentication code are the same, the master node authenticates the identity of the corresponding slave node.

[0014] Optionally, before the master node calculates the first message authentication code based on the session key, the method further includes:

[0015] The master node uses a preset key to encrypt the first random number and the identifier of the host address corresponding to the master node, and broadcasts the encrypted first ciphertext to the slave node.

[0016] The slave node decrypts the received first ciphertext to obtain the first random number and the identifier of the host address corresponding to the master node.

[0017] Optionally, after the slave node decrypts the received first ciphertext to obtain the first ciphertext and the identifier of the host address corresponding to the master node, the method further includes:

[0018] The slave node uses the preset key to encrypt the second random number and the identifier of the slave address corresponding to the slave node, and sends the encrypted second ciphertext to the master node;

[0019] The master node receives the second ciphertext sent by each of the slave nodes and calculates the session key based on the second ciphertext sent by each of the slave nodes;

[0020] The session key is encrypted using the preset key to obtain the encrypted session key.

[0021] Optionally, the first ciphertext obtained by encryption is represented as follows:

[0022] C g =F enc (K pre,l ,R g ||MID);

[0023] Among them, C g This represents the first ciphertext, F. enc (·) denotes the function used for encryption operations, K pre,l R represents the preset key. g The first random number is represented by MID, which represents the identifier of the host address corresponding to the master node.

[0024] Optionally, the decryption process of the second ciphertext is represented as follows:

[0025] R i ||SID i =F dec (K pre,l C i );

[0026] Among them, R i SID represents the second random number of the i-th slave node. i F is an identifier representing the slave address corresponding to the i-th slave node. dec (·) represents the function used for decryption operations, C i This represents the second ciphertext of the i-th slave node.

[0027] Optionally, the session key is represented as follows:

[0028] K sess,l =KDF(R) g ||R1||R2||…||R i ||…||R n );

[0029] Among them, K sess,l Let KDF(·) represent the session key, and R be the key derivation function. g R represents the first random number. i Let represent the second random number of the i-th slave node, and n be the number of slave nodes.

[0030] Optionally, the first message authentication code is represented as follows:

[0031] AUTH g =F mac(K sess,l ,R g );

[0032] Among them, AUTH g This represents the first message authentication code, F. mac (·) represents a one-way function used to generate message authentication codes.

[0033] Optionally, the second message authentication code is represented as follows:

[0034] XAUTH g =F mac (K sess,l ,R g );

[0035] Among them, XAUTH g This indicates the second message authentication code.

[0036] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:

[0037] This invention supports rapid, unified identity authentication across multiple nodes, effectively addressing the low authentication efficiency of the Modbus protocol in multi-device environments. It enables rapid authentication of multiple nodes in large industrial networks, ensuring real-time performance and stability during data transmission, reducing latency caused by authentication, and meeting the high-efficiency communication requirements of industrial control systems. Simultaneously, this invention implements a multi-node key negotiation mechanism through pre-set keys and session keys, compensating for the lack of key management and negotiation mechanisms in the Modbus protocol. By dynamically negotiating and managing encryption keys among communicating nodes, it achieves encrypted data transmission and integrity verification, ensuring the confidentiality and tamper-proof capabilities of transmitted data. This not only prevents data interception and theft but also enhances the system's ability to resist various network attacks. Furthermore, the security solution proposed in this invention does not involve modification of the Modbus standard protocol; it enhances the protocol's security within the constraints of the Modbus standard, meaning the proposed solution conforms to the relevant Modbus standards. This effectively solves the security shortcomings of the Modbus protocol and significantly improves the overall security and reliability of industrial control systems.

[0038] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of a Modbus TCP packet format provided in an embodiment of the present invention;

[0040] Figure 2 This is a schematic diagram of a Modbus RTU / ASCII message format provided in an embodiment of the present invention;

[0041] Figure 3 This is a flowchart of a method for enhancing the security of the Modbus protocol in a multicast communication scenario, provided by an embodiment of the present invention. Detailed Implementation

[0042] To facilitate understanding of the present invention, a brief description of the prior art and the inventive concept of the present invention will be provided first.

[0043] Some cutting-edge research attempts to apply blockchain technology to Modbus identity authentication. By recording device identity and authentication information in a decentralized ledger, it enhances the system's tamper resistance and transparency, achieving unforgeable and traceable device identities. One scholar proposed a "Secure Communication Method and System Based on National Cryptographic Algorithms and Improved Modbus TCP Protocol," which primarily enhances Modbus protocol security through four cryptographic security mechanisms. First, the host and multiple slave devices share an SM2 public-private key pair for integrity verification and identity authentication during subsequent key negotiation. Second, during identity authentication and key negotiation, random numbers are generated and signed using the SM2 algorithm to achieve device authentication, ensure message integrity, and effectively prevent unauthorized devices from accessing the network. Third, after verifying the identities of both parties, the host generates a symmetric session key for the SM4 algorithm, encrypts it using the slave's public key and the SM2 algorithm, signs it with the host's private key, and sends it to the slave. Upon receiving the key, the slave verifies the signature and decrypts it to obtain the session key. Finally, the SM4 cryptographic algorithm is used to encrypt and decrypt the transmitted data using the agreed-upon symmetric session key, ensuring the confidentiality and integrity of the data during transmission.

[0044] However, this solution has the following drawbacks:

[0045] 1. High overhead, difficult to implement on low-power devices. This solution employs the SM2 asymmetric key algorithm, which, while improving security, also introduces significant computational and storage overhead. The complex computational requirements of the SM2 algorithm may exceed the processing capabilities and resource limitations of low-power devices such as RTUs (Remote Terminal Units) and PLCs (Programmable Logic Controllers) in existing Modbus protocol applications. These devices typically have limited processor performance and memory, making it impossible to efficiently execute complex encryption operations, leading to decreased system response speed. Furthermore, the high overhead may increase device power consumption, shorten battery life, or increase heat dissipation requirements, further impacting the long-term stability and reliability of the system. Therefore, although the solution improves security, its practical application on low-power devices is limited, making it difficult to meet the needs of widespread deployment.

[0046] 2. Authentication between individual nodes impacts efficiency. In a network architecture with a master and multiple slaves, this scheme requires each slave to authenticate with the master individually. This one-to-one authentication mechanism is manageable when the number of devices is small, but in real-world industrial environments, a large number of slave devices typically connect to the network simultaneously. Each slave needs to complete the authentication process independently, which not only increases communication overhead during authentication but also significantly reduces the overall system's authentication efficiency. In a network with only single-node authentication, when n nodes connect, these nodes need to perform n*(n-1) interactions after mutual authentication, while in a multi-node group broadcast authentication scheme, only n interactions are often required. In high-density device networks, the master needs to handle a large number of concurrent authentication requests, which may lead to authentication delays, affecting the system's real-time performance and response speed. This is a serious performance bottleneck for industrial applications that require rapid data exchange and instant control, potentially limiting the application of this scheme in large-scale industrial systems.

[0047] 3. Key Management Challenges. Because the host needs to authenticate each slave individually and negotiate an independent symmetric session key for each master-slave pair, the entire system generates a large number of key pairs. This complexity in key management becomes particularly pronounced as the number of devices increases. In a network of n nodes, if symmetric keys and single-node mutual authentication are used, each node needs to maintain 2*(n-1) keys, including (n-1) pre-shared keys and (n-1) session keys, leading to significant storage overhead. In multi-node group broadcast authentication, each node only needs to maintain one pre-shared key and one session key. First, securely distributing and storing these keys becomes a challenge, especially in distributed and dynamically changing industrial environments. Second, over time, key updates and revocations require efficient management mechanisms; otherwise, the risk of key leakage or misuse increases. Furthermore, key lifecycle management (such as key generation, distribution, updating, and destruction) requires strict processes and controls, increasing system maintenance costs and management complexity. In large-scale deployments, the complexity of key management not only affects system security but may also lead to management oversights and errors, thereby threatening the security and stability of the entire industrial control system.

[0048] Therefore, this invention proposes a method for enhancing the security of the Modbus protocol in multicast communication scenarios to solve this technical problem.

[0049] In this invention, by utilizing the Modbus bus message format, slave nodes participating in industrial control network data transmission complete node identity registration for industrial control network security communication control with the assistance of the master node. The specific scheme is as follows:

[0050] The master node represents the device that initiates a Modbus transaction. It broadcasts requests to slave nodes and waits for responses. The master node has the ability to communicate with multiple slave nodes and can request different types of data from each slave node. Slave nodes are devices that wait for Modbus slave node requests. Once a request is received, the slave node processes the request and sends a response back to the master node. Slave nodes do not initiate communication; they only respond to requests from the master node. The node address is used to identify the device's address information; during communication, it indicates the sending address and the target receiving address of the message. The node address is represented by 1 byte (8 bits), consisting of a domain ID (3 bits) and a node ID (5 bits).

[0051] (1) The encoding length is 8 bits. The first 3 bits represent the domain (which can be a single slave node or a group of multiple slave nodes), and the last 5 bits represent the node sequence number.

[0052] (2) Use hexadecimal representation, such as 0x41-010 00001, which represents the slave node with ID 00001 in the 010 domain;

[0053] (3) The master node is a special node and can be identified by a special node address. The specific rules are domain ID (3 bits) and all 0 (5 bits).

[0054] During system initialization and registration, any slave node wishing to join needs to obtain legitimate identity information and relevant verification data to gain communication permissions. When a new node wants to join the network, it needs to connect to the console via a physical secure channel. The console first verifies the device's legitimacy, then generates a unique address identifier for the node based on its information, along with a pre-shared key between the master and slave nodes, and sends this information to the master and slave nodes in the network, respectively. Upon receiving this information, the master node records it into an identity information database for unified storage and management. Subsequently, when the master node needs to communicate with slave nodes, it only communicates with slave nodes possessing legitimate identity information; other nodes are defined as malicious nodes.

[0055] Based on the current Modbus bus message format standard, this invention further customizes the function code field of the Modbus bus message, and describes the functions according to different protocols:

[0056] Figure 1 This is a schematic diagram of a Modbus TCP packet format provided in an embodiment of the present invention, as shown below. Figure 1As shown, in the Modbus TCP protocol, a data frame consists of three parts: the Modbus Application Protocol Header (MBAP), the Protocol Data Unit (PDU), and a checksum. The MBAP is the message header, 7 bytes long, and consists of a transaction identifier, a protocol identifier, a length, and a unit identifier. The PDU consists of a function code and a data field; the function code is 1 byte long, and the data field has a variable length. The checksum is responsible for verifying the data in the message and is 2 bytes long. Its specific format is shown in Table 1.

[0057] Table 1

[0058]

[0059] The new message format, after customizing the function codes, can meet all system requirements, as detailed below:

[0060] 1) Transaction Identifier field, 2 bytes in length, indicates the sequence number of the message. Each transaction identifier initiated by the master device should be unique to distinguish different requests.

[0061] 2) Protocol Identifier field, which is 2 bytes long, indicates the protocol to which the message belongs. In the Modbus TCP protocol, this field is generally 0x00 00, which refers to the Modbus TCP protocol.

[0062] 3) Length field, which is 2 bytes long, indicates how many bytes (including data fields) are left in the message after this field.

[0063] 4) Unit Identifier field, 1 byte in length, represents the node address of the receiving slave node of the message, including a 3-bit field ID and a 5-bit node ID.

[0064] The PDU consists of two parts: function code and data. The function code, consisting of one byte, indicates the operation type of the message, such as reading a save register, writing to a single register, or writing to multiple registers. To implement functions such as data hierarchical protection and integrity protection, based on the feature of reserving customizable function codes in the standard, this invention has customized the functions of unused function codes, as shown in Table 2:

[0065] Table 2

[0066]

[0067] The Modbus RTU protocol and the Modbus ASCII protocol are essentially the same, with the main differences being in checksums, start fields, and data representation. Therefore, this invention will not discuss the two schemes separately, but will refer to them collectively as the Modbus RTU / ASCII protocol. Figure 2 This is a schematic diagram of a Modbus RTU / ASCII message format provided in an embodiment of the present invention, as shown below. Figure 2 As shown, in the Modbus RTU / ASCII protocol, the message format mainly consists of four parts: device address, function code, data, and checksum. The device address and function code fields are both 1 byte long. The device address field is similar to the unit identifier field in the Modbus TCP protocol, and the custom part of the function code field is the same as in the Modbus TCP protocol. The data field has a variable length. In Modbus RTU, the checksum is a CRC checksum, which is 2 bytes long; in Modbus ASCII, the checksum is an LRC checksum, also 2 bytes long.

[0068] Figure 3 This is a flowchart of a method for enhancing the security of the Modbus protocol in a multicast communication scenario, provided by an embodiment of the present invention. Figure 3 As shown, the method may include the following steps:

[0069] S101. When the master node initiates an authentication request, the master node calculates the first message authentication code of the first random number based on the session key; wherein, the session key is obtained based on the random number pre-generated by the master node and the slave node.

[0070] Understandably, the first message authentication code is represented as follows:

[0071] AUTH g =F mac (K sess,l ,R g );

[0072] Among them, AUTH g Indicates the first message authentication code, F mac (·) denotes a one-way function used to generate message authentication codes, K sess,l Represents the session key, R g This represents the first random number.

[0073] S102. Broadcast the encrypted session key and the first message authentication code to each slave node.

[0074] It is understandable that when the master node and the slave node communicate, they do so by putting the data to be sent into the data field of the Modbus message data frame and then broadcasting it to other slave nodes.

[0075] S103. The slave node decrypts the encrypted session key to obtain the session key, and calculates the second message authentication code based on the first random number of the session key.

[0076] Understandably, the second message authentication code is represented as follows:

[0077] XAUTH g =F mac (K sess,l ,R g );

[0078] Among them, XAUTH g This indicates the second message authentication code.

[0079] S104. When the second message authentication code is the same as the first message authentication code, the slave node authenticates the identity of the master node.

[0080] Understandably, when the second message authentication code is different from the first message authentication code, the slave node will not authenticate the master node's identity.

[0081] S105. The slave node uses the session key to calculate the third message authentication code of the second random number and sends it to the master node.

[0082] Understandably, when the slave node communicates with the master node, the data to be sent is placed in the data field of the Modbus message data frame and then broadcast to the master node.

[0083] The third-party authentication code can be represented as follows:

[0084] AUTH i =F mac (K sess,l ,R i );

[0085] Among them, AUTH i R represents the third message authentication code of the i-th slave node. i This represents the second random number for the i-th slave node.

[0086] S106. The master node uses the session key to calculate the fourth message authentication code for each of the second random numbers.

[0087] It is understandable that the fourth message authentication code can be represented as follows:

[0088] XAUTH i =F mac (K sess,l ,R i );

[0089] S107. When the third message authentication code and the fourth message authentication code are the same, the master node authenticates the identity of the corresponding slave node.

[0090] It is understood that the above steps are the authentication process on the Modbus TCP protocol side. The process on the Modbus RTU / ASCII side can refer to the above process and will not be repeated here.

[0091] Optionally, prior to S101, the method may further include:

[0092] The master node uses a preset key to encrypt the first random number and the identifier of the host address corresponding to the master node, and broadcasts the encrypted first ciphertext to the slave node.

[0093] The slave node decrypts the received first ciphertext to obtain the first random number and the identifier of the host address corresponding to the master node.

[0094] It is understandable that when the master node sets the function code to 0x6D (decimal 109), it indicates an authentication request. After receiving the first ciphertext, the slave node first checks and parses the function code. If the function code is set to 109, it means that the master node has initiated an authentication request.

[0095] The first ciphertext obtained after encryption is represented as follows:

[0096] C g =F enc (K pre,l ,R g ||MID);

[0097] Among them, C g This represents the first ciphertext, F. enc (·) denotes the function used for encryption operations, K pre,l Indicates the preset key, R g The first random number is represented by MID, which represents the identifier of the host address corresponding to the master node.

[0098] The process of decrypting the first ciphertext can be represented as follows:

[0099] R g ||MID=F dec (K pre,l C g );

[0100] Among them, F dec (·) represents the function used for decryption operations.

[0101] Optionally, after the slave node decrypts the received first ciphertext to obtain the first random number and the identifier of the host address corresponding to the master node, the method may further include:

[0102] The slave node uses a preset key to encrypt the second random number and the identifier of the slave address corresponding to the slave node, and sends the encrypted second ciphertext to the master node;

[0103] The master node receives the second ciphertext sent by each slave node and calculates the session key based on the second ciphertext sent by each slave node;

[0104] The session key is encrypted using a preset key to obtain the encrypted session key.

[0105] Understandably, the second ciphertext can be represented as follows:

[0106] C i =F enc (K pre,l ,R i ||SID i );

[0107] The decryption process for the second ciphertext is as follows:

[0108] R i ||SID i =F dec (K pre,l C i );

[0109] Among them, R i SID represents the second random number of the i-th slave node. i F is an identifier representing the slave address corresponding to the i-th slave node. dec (·) represents the function used for decryption operations, C i This represents the second ciphertext of the i-th slave node.

[0110] The session key is represented as follows:

[0111] K sess,l =KDF(R) g ||R1||R2||…||R i ||…||R n );

[0112] Among them, K sess,l Represents the session key, KDF(·) is the key derivation function, and R g R represents the first random number. i Let represent the second random number of the i-th slave node, and n be the number of slave nodes.

[0113] The encryption of the session key can be represented as follows:

[0114] C k =F enc (Kpre,l ,K sess,l ).

[0115] Understandably, this invention enables rapid simultaneous authentication of multiple slave nodes in scenarios with one master node and multiple slave nodes, increasing authentication efficiency. It is specifically designed for industrial environments where one master node connects to multiple slave nodes, significantly improving the efficiency of the identity authentication process by authenticating multiple slave nodes simultaneously. In large industrial networks, a large number of slave devices typically need to access and authenticate simultaneously. Traditional one-to-one authentication methods are not only time-consuming but can also lead to system response delays. In networks with only single-node authentication, when n nodes access the network, a total of n*(n-1) interactions are required after mutual authentication. In contrast, multi-node group broadcast authentication schemes often require only n interactions. This invention achieves rapid batch authentication through parallel processing and an optimized authentication process, significantly reducing the time and resource consumption required for authentication. This efficient authentication mechanism not only improves the system's real-time performance and response speed but also ensures stability and reliability in high-density device environments, meeting the stringent requirements of industrial control systems for efficient communication and instant data exchange, thereby optimizing overall network performance and user experience. Furthermore, multi-node group broadcast authentication can reduce the storage overhead of node key management. For example, in a network of n nodes, if symmetric keys and single-node mutual authentication mechanisms are used, each node in the network needs to maintain 2*(n-1) keys, including (n-1) pre-shared keys and (n-1) session keys, which will result in significant storage overhead. However, in multi-node group broadcast authentication, each node only needs to maintain one pre-shared key and one session key.

[0116] This invention supports rapid, unified identity authentication across multiple nodes, effectively addressing the low authentication efficiency of the Modbus protocol in multi-device environments. It enables rapid authentication of multiple nodes in large industrial networks, ensuring real-time performance and stability during data transmission, reducing latency caused by authentication, and meeting the high-efficiency communication requirements of industrial control systems. Simultaneously, this invention implements a multi-node key negotiation mechanism through pre-set keys and session keys, compensating for the lack of key management and negotiation mechanisms in the Modbus protocol. By dynamically negotiating and managing encryption keys among communicating nodes, it achieves encrypted data transmission and integrity verification, ensuring the confidentiality and tamper-proof capabilities of transmitted data. This not only prevents data interception and theft but also enhances the system's ability to resist various network attacks. Furthermore, the security solution proposed in this invention does not involve modification of the Modbus standard protocol; it enhances the protocol's security within the constraints of the Modbus standard, meaning the proposed solution conforms to the relevant Modbus standards. This effectively solves the security shortcomings of the Modbus protocol and significantly improves the overall security and reliability of industrial control systems.

[0117] It should be noted that the terms "first," "second," etc., are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the invention.

[0118] Although the invention has been described herein in conjunction with various embodiments, those skilled in the art will understand and implement other variations of the disclosed embodiments by reviewing the accompanying drawings and the disclosure in carrying out the claimed invention. In the description of the invention, the word "comprising" does not exclude other components or steps, "a" or "an" does not exclude a plurality, and "a plurality" means two or more, unless otherwise explicitly specified. Furthermore, while different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce good results.

[0119] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A method for enhancing the security of the Modbus protocol in a multicast communication scenario, characterized in that, The method includes: When the master node initiates an authentication request, the master node calculates a first message authentication code based on a first random number using the session key; wherein, the session key is obtained based on random numbers pre-generated by the master node and the slave node; The encrypted session key and the first message authentication code are broadcast to each slave node via Modbus message; wherein, unused function codes in the function codes of the Modbus message are customized, and the function codes include indicating group identity authentication and key negotiation. The slave node decrypts the encrypted session key to obtain the session key, and calculates the second message authentication code of the first random number based on the session key; When the second message authentication code is the same as the first message authentication code, the slave node authenticates the identity of the master node; The slave node uses the session key to calculate the third message authentication code of the second random number and sends it to the master node; The master node uses the session key to calculate the fourth message authentication code for each of the second random numbers; When the third message authentication code and the fourth message authentication code are the same, the master node authenticates the identity of the corresponding slave node.

2. The Modbus protocol security enhancement method in multicast communication scenarios according to claim 1, characterized in that, Before the master node calculates the first message authentication code based on the session key using the first random number, the method further includes: The master node uses a preset key to encrypt the first random number and the identifier of the host address corresponding to the master node, and broadcasts the encrypted first ciphertext to the slave node. The slave node decrypts the received first ciphertext to obtain the first random number and the identifier of the host address corresponding to the master node.

3. The Modbus protocol security enhancement method in multicast communication scenarios according to claim 2, characterized in that, After the slave node decrypts the received first ciphertext to obtain the first ciphertext and the identifier of the host address corresponding to the master node, the method further includes: The slave node uses the preset key to encrypt the second random number and the identifier of the slave address corresponding to the slave node, and sends the encrypted second ciphertext to the master node; The master node receives the second ciphertext sent by each of the slave nodes and calculates the session key based on the second ciphertext sent by each of the slave nodes; The session key is encrypted using the preset key to obtain the encrypted session key.

4. The Modbus protocol security enhancement method in a multicast communication scenario according to claim 3, characterized in that, The first ciphertext obtained by encryption is represented as follows: ; in, This indicates the first ciphertext. This represents the function used for encryption operations. This refers to the preset key. Represents the first random number. An identifier representing the host address corresponding to the master node.

5. The Modbus protocol security enhancement method in a multicast communication scenario according to claim 4, characterized in that, The decryption process for the second ciphertext is as follows: ; in, Indicates the first The second random number from the node, Indicates the first The identifier of the slave address corresponding to each slave node. This represents the function used for decryption operations. Indicates the first The second ciphertext of the node.

6. The Modbus protocol security enhancement method in a multicast communication scenario according to claim 5, characterized in that, The session key is represented as follows: ; in, This refers to the session key. Derived function for key. Represents the first random number. Indicates the first The second random number from the node, This represents the number of slave nodes.

7. The Modbus protocol security enhancement method in a multicast communication scenario according to claim 6, characterized in that, The first message authentication code is represented as follows: ; in, This indicates the authentication code for the first message. This represents a one-way function used to generate message authentication codes.

8. The Modbus protocol security enhancement method in a multicast communication scenario according to claim 6, characterized in that, The second message authentication code is represented as follows: ; in, This indicates the second message authentication code.

Citation Information

Patent Citations

  • Intranet lightweight node identity authentication and hierarchical encryption and decryption method and system

    CN118337371A

  • Modbus protocol security enhancement method and system in unicast communication scene

    CN120342628A