The present application relates to the technical field of
industrial communication, and particularly relates to a
Modbus trusted enhancement method based on a national secret
algorithm, comprising the following steps: S1: a
client sends identity
authentication message information including a
time factor, a random number, a
client public key and a digest to a
server to complete public
key exchange, and then identity
authentication of both communication parties is performed
through transmission of a session identifier; S2: the
client sends a key negotiation message to the
server, and after receiving the
server key parameter returned by the server after successful
verification of the key negotiation message, generates a session-specific key; S3: key
verification is performed between the client and the server; S4: the client sends a
Modbus trusted message carrying a
time factor, a random number and a
Modbus command to the server after encrypting the Modbus trusted message, and the server analyzes and replies. The present application increases an identity
verification process, is used for avoiding misoperation of other PLCs in a PLC login scene, and guarantees anti-replay and
tamper resistance of the message through the
time factor, the random number and the digest.