A lightweight two-way identity authentication and access control method for industrial internet of things terminals

By using a three-message two-way authentication mechanism with independent device identification and root key configuration, combined with composite replay protection and session key usage separation, the problems of excessive authentication burden, one-way verification risk and insufficient edge offline capability in the Industrial Internet of Things are solved. It realizes secure and reliable two-way identity authentication and access control, and is suitable for resource-constrained industrial terminal devices.

CN123163818APending Publication Date: 2026-11-24XINXIANG FANSHI INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611336340.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-31
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing industrial IoT authentication and access control solutions suffer from problems such as excessive certificate burden, risk of one-way verification, insufficient single anti-replay mechanism, easy unauthorization of static authorization, lack of protection at the business request level, insufficient edge offline capability, and failure to separate key usage.

Method used

It employs independent device identification, root key configuration, three-message two-way authentication mechanism, composite anti-replay mechanism, separation of session key usage, ability token generation that binds trusted state to scenario, request-level access control, and edge offline security mechanism, combined with device-independent credentials and random number freshness verification, to achieve two-way identity verification and dynamic access control.

Benefits of technology

It reduces the computational and storage burden on resource-constrained terminals, improves the security and reliability of authentication, prevents identity impersonation and gateway forgery, ensures production continuity, and maintains necessary data collection and control in edge offline environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123163818A_ABST
    Figure CN123163818A_ABST
Patent Text Reader

Abstract

This invention discloses a lightweight two-way authentication and access control method for industrial IoT terminals, addressing issues such as high certificate overhead, limited replay attack prevention, and susceptibility to unauthorized access in existing methods. The device is configured with an independent root key and a non-reversible counter. Two-way authentication is completed using three messages: the first message sends a random number and authentication code; the second message binds the first message digest and sends it back to the gateway for verification; and the third message covers the entire handshake transcription. Role-based labeling is used to differentiate stages, combined with a high-water mark counter, dual random numbers, and a business sequence window to achieve composite replay protection. After authentication, three separate session keys—integrity, encryption, and token—are derived. The gateway generates capability tokens based on trust level and scenario, limiting operations and resources; each request verifies the label, sequence, token, and operational constraints, and privileges are revoked upon an anomaly. This invention is lightweight and efficient, supporting both cloud-based online operation and edge-based offline operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial Internet of Things (IoT) security technology, and in particular to a method for two-way authentication, attack prevention, and dynamic access control between resource-constrained industrial terminals and edge gateways and cloud servers. Background Technology

[0002] The Industrial Internet of Things (IIoT) connects sensors, PLCs, actuators, edge gateways, and MES / SCADA systems to the production chain. Terminals are responsible for data acquisition and control execution, while gateways handle device access, data aggregation, and command forwarding. Therefore, the authenticity of both parties' identities, the source of commands, and operational permissions directly affect the reliability of production data, the reliability of control processes, and production continuity. With the increasing interconnectivity of devices, edge-cloud collaboration, and remote operation and maintenance, risks such as identity theft, gateway forgery, authentication or business message replay, and unauthorized access after authentication are becoming more prominent. IIoT security cannot rely solely on network isolation or one-time authentication; it also requires continuous constraints on the source of requests and the scope of permissions.

[0003] Industrial terminals are typically limited by computing power, RAM, Flash, power consumption, and message byte count, and may face clock drift, weak network conditions, or cloud unavailability. Authentication schemes should achieve mutual identity verification, message freshness, and key isolation with low computational, storage, and communication overhead, and access control should also support restricted offline operation at the edge.

[0004] Current IoT two-way authentication and access control primarily employ certificates / PKI, pre-shared key challenge-response, and whitelist, role-based, or cloud-based policy authorization. In resource-constrained industrial terminals and weak network edge environments, the following objective shortcomings exist:

[0005] (i) Certificate-based two-way authentication is too burdensome. Certificate-based two-way authentication requires certificate parsing, public key computation, trust anchor storage, and certificate updates. Terminals and gateways also need to maintain revocation status and device lifecycle, which places additional burdens on the computing, storage, communication, and operation and maintenance of restricted devices.

[0006] (ii) Insufficient security of pre-shared key schemes. Some pre-shared key schemes have problems such as shared credentials, only one-way verification, or incomplete authentication value binding; if the uplink and downlink roles are not distinguished, and the authentication code does not cover the protocol version, random numbers of both parties, device identity, and handshake transcription, it may be reused across directions or across sessions.

[0007] (iii) The adaptability of a single freshness mechanism is insufficient. Timestamps rely on clock synchronization, random number deduplication requires saving historical states, and a single counter may roll back due to device restart, making it difficult to simultaneously prevent replays during the startup, handshake, and business request phases.

[0008] (iv) Static authorization can easily lead to unauthorized access after authentication. Some solutions still use a fixed whitelist or static roles after authentication, without binding the device's trusted status, industrial scenario, policy version, operation object, resource scope, and valid conditions to the current session, which may result in unauthorized access after authentication.

[0009] (v) Lack of protection at the service request level. Some solutions only protect the access or handshake process and do not continue to verify the authentication tag, sequence, operation, resources and constraints for each service request; after device abnormality, policy change or administrator revocation, session keys and tokens may not expire in time.

[0010] (vi) Insufficient edge offline capabilities. Solutions that rely on cloud-based identity services, policy judgments, or query revocation are difficult to authorize in a timely manner when there is link latency or interruption; direct access will increase risks, while complete blocking may affect necessary data collection and production continuity.

[0011] (vii) Lack of separation of key uses. Some lightweight solutions rely on the device root key to handle authentication, integrity, encryption, or token protection simultaneously. This lacks separation of key uses, version rotation, old key erasure, and revocation management, resulting in a wide-ranging impact from key leaks.

[0012] Therefore, it is necessary to complete the two-way confirmation between the terminal and the gateway with independent device credentials, and to form a composite freshness check by starting a counter, random numbers from both parties and request sequences, and linking session keys, capability tokens, scenario constraints and permission revocation. Summary of the Invention

[0013] This invention aims to address the technical problems in existing industrial IoT authentication and access control schemes, such as excessive certificate burden, risk of one-way verification, insufficient single anti-replay mechanism, easy unauthorization of static authorization, lack of protection at the business request level, insufficient edge offline capability, and lack of separation of key usage. It provides a lightweight two-way identity authentication and access control method for resource-constrained industrial terminal devices.

[0014] To achieve the above objectives, the present invention provides the following technical solution:

[0015] 1. Industrial terminal independent identity and root key configuration

[0016] Configure each terminal with a unique device identifier (DID) and root key (K). D Key version (KV) and irreversible boot counter (C) D The root key is written to the protected storage of the terminal and edge gateway via secure injection or controlled pairing. The root key is preferentially stored in the secure element, trusted execution area, and read-protected Flash, and is protected by key encryption on the gateway side.

[0017] 2. Three-message two-way authentication mechanism

[0018] The terminal sends the device identity, start counter, and terminal random number N through the first message M1. D And the terminal authentication code; the edge gateway returns a gateway random number N via the second message M2. G The gateway proof includes the session identifier, policy version, and binding M1 digest; after terminal verification, it submits an acknowledgment authentication code covering the complete handshake transcription via the third message M3.

[0019] Specifically:

[0020] Calculation and transmission of the first message M1:

[0021] Terminal incrementing device counter C D And generate a terminal random number N. D Calculate the terminal authentication code as follows:

[0022] T1=Encode("DEV-HELLO",Ver,GID,DID,KV, C D , N D Suite, Cap)

[0023] A1=MAC(K D ,T1);

[0024] The terminal sends the first message:

[0025] M1={Ver,GID,DID,KV, C D , N D Suite,Cap,A1};

[0026] Encode(...) means forming an unambiguous byte string according to a fixed field order and length prefix.

[0027] Calculation and transmission of the second message M2:

[0028] The gateway first checks the message length, algorithm suite, device registration status, and deregistration status, and then verifies A1 and C. D High water level and N D Check for duplicates. After successful verification, generate a gateway random number N. G And the temporary session identifier (SID), and calculate:

[0029] TH1 = H(Encode(M1))

[0030] T2=Encode("GW-PROOF",TH1,N G (SID, PV, Exp)

[0031] A2=MAC(K D ,T2);

[0032] The gateway returned a second message:

[0033] M2={N G ,SID,PV,Exp,A2};

[0034] Calculation and transmission of the third message M3:

[0035] Terminal verification A2; if verification fails, delete the temporary state and issue an alarm; if verification succeeds, calculate the handshake digest and the terminal confirmation authentication code.

[0036] TH2=H(Encode(M1, M2))

[0037] T3=Encode("DEV-FINISH",TH2)

[0038] A3=MAC(K D ,T3);

[0039] The terminal sends a third message:

[0040] M3={SID,A3};

[0041] The gateway only submits C after A3 verification is successful. D Set the water level to high and set the session status to "authenticated".

[0042] 3. Role tags and transcription binding

[0043] Terminal authentication, gateway authentication, and final confirmation each use different role labels ("DEV-HELLO", "GW-PROOF", "DEV-FINISH"), and the authentication code covers the protocol version, identity, double random number, algorithm suite, policy version, and transcription digest to prevent the reuse of authentication values ​​in different directions and stages.

[0044] 4. Composite anti-replay mechanism

[0045] Gateway combined with C D High water level, N D With N G The system uses a sliding window to determine the freshness of business sequences, protecting the device restart, authentication handshake, and business request phases respectively, without relying on strict clock synchronization.

[0046] 5. Separate use of session keys

[0047] Both parties derive K from the device root key, double random numbers, and a complete transcription digest as input. AUTH K ENC and K TOKEN This allows for the use of different subkeys for business integrity, optional encryption, and token protection. Specifically:

[0048] Salt = Encode(N D N G )

[0049] PRK=KDF-Extract(Salt,K D )

[0050] Info=Encode("IIOT-SESSION",DID,GID,SID,TH2,Suite)

[0051] OKM = KDF - Expand(PRK, Info, L)

[0052] (K AUTH , K ENC , K TOKEN Seq o =Split(OKM);

[0053] Where L is the required total output length; K AUTH Used for business message integrity protection, K ENC Used for encryption or authentication encryption, K TOKEN Used for capability token protection, Seq o This is the initial sequence base value. Each subkey is used for its designated purpose only and may not be substituted for another.

[0054] 6. Generation of capability tokens that bind trusted states to scenarios

[0055] After two-way authentication is completed, the edge gateway generates a capability token (Tok) based on the device's trust level, production or maintenance scenario, and policy version, limiting sessions, devices, operations, resources, validity conditions, and authentication levels. The gateway generates a risk vector based on recent authentication failures, abnormal operations, firmware measurements, device revocation, link status, maintenance work orders, physical region, and time period. It calculates the trust level according to rules or weighted scores and makes joint decisions with routine production, planned maintenance, emergency fault response, or downtime repair scenarios. Operations not explicitly permitted are rejected by default; emergency authorizations should have shorter validity periods, be limited to specific targets, and undergo enhanced auditing.

[0056] A token Tok must contain at least the following: {TokenID, SID, DID, Audience, Ops, Resources, Constraints, PV, TH2, IssueCond, ExpireCond, AuthLevel}.

[0057] 7. Request-level access control and permission revocation

[0058] Each business request Req={SID,TokenID,Seq,Op,Res,PayloadDigest,Tag}, where Tag is determined by K. AUTH Calculation. The gateway sequentially performs VerifyTag, ReplayWindow, TokenState, and Op, Resource, and Constraint checks.

[0059] Anti-replay and permission revocation: The gateway maintains the highest sequence number and a fixed bitmap window for the session, rejecting duplicate and outdated sequences. In the event of unauthorized access, consecutive authentication tag failures, firmware status changes, device offline, token expiration, policy upgrades, or administrator revocation, the TokenID is added to the revocation table and the session key is cleared; devices experiencing consecutive failures enter a time-limited isolation.

[0060] 8. Edge offline security

[0061] The edge gateway locally stores device registration records, most recently valid policies, revocation status, and necessary audit information. During weak or offline network conditions, it only maintains explicitly permitted necessary data collection, shortens the validity period of high-risk permissions, and denies control operations. The gateway only uses the most recently successfully verified and unexpired policy snapshot. During network outages, it allows necessary data collection but restricts parameter writing and control; upon recovery, it synchronizes policies, revocations, and audit summaries.

[0062] 9. Key Registration and Renewal

[0063] After verifying the equipment serial number, model, and physical presence information using a trusted production system or field pairing tool, a random K is generated. D The data is written to the secure storage of both the terminal and the gateway, and bound to the device model, allowed gateway group, and initial policy group. Key rotation adopts a two-stage update within the authentication and encryption session: first, the new version is written and verified, and then the switch is performed atomically; the previous version is retained for a limited time for power failure recovery, and the old version is deleted after successful confirmation.

[0064] 10. Counter and Power Loss Recovery

[0065] C D The high-water mark should be stored in non-volatile memory with rollback protection. Dual-slot recording, version numbers, and checksums can be used to reduce the risk of damage from power outages. The gateway should only submit a new high-water mark after successful M3 verification. If the terminal's counter becomes abnormal due to memory replacement during maintenance or legitimate recovery, it should be re-registered through a controlled maintenance process. The high-water mark should not be lowered by ordinary business messages.

[0066] 11. Message encoding and verification boundaries

[0067] M1, M2, and M3 employ a fixed field order, length prefix, or other unambiguous normalized encoding. The authentication code covers the version, identity, algorithm suite, random number, counter, policy version, and expiration condition. The receiver first verifies the total length, field range, and suite support before calculating the authentication code. Temporary sessions have a maximum limit on the number of sessions and a timeout to prevent invalid handshakes from occupying memory for extended periods.

[0068] 12. Business Data Protection

[0069] Reporting messages that only require integrity use K AUTH Calculate the certification label; use K when including parameters, process data, and control commands. ENC Perform authentication encryption. Use independent sequence spaces and direction labels for each direction to prevent uplink and downlink packet reflection. Control requests should also be bound to PayloadDigest to ensure that operations, resources, and the actual payload cannot be separated or replaced.

[0070] 13. Permission-based closed-loop state machine

[0071] The session progresses through the following states in sequence: unauthenticated, pending confirmation, authenticated, restricted, revoked, and expired. Only after successful M3 verification can the session enter the authenticated state and a token be issued. When the risk increases, the session first enters the restricted state, reducing Ops and Resources and shortening the validity period. When the revocation conditions are met, the session key is deleted and subsequent requests are rejected. Reconnection requires a new three-message authentication process.

[0072] 14. Comparison of Resistant to Denial of Service and Constant Time

[0073] Before key operations, length, version, identifier, and rate checks are performed. Unknown DIDs are responded to uniformly and their rate is limited. Sensitive comparisons use constant time.

[0074] The beneficial effects of this invention are as follows:

[0075] This invention's online authentication primarily uses random numbers, keyed message authentication codes, and key derivation, without requiring the terminal to parse the certificate chain online each time it connects. Actual code size, memory usage, and latency are determined by testing the target chip. The gateway verifies the terminal's proof and provides final confirmation. The terminal verifies the gateway proof secretly derived by the device, reducing the risks associated with identity theft and gateway forgery.

[0076] The high-water mark of the startup counter, double random numbers, and the business sequence window are used for the device restart, handshake, and request phases, respectively, so that freshness judgment does not rely on a single timestamp. The capability token is bound to the device, session transcription, policy version, operation, resource, and validity conditions, so that the authentication result can be restricted to use according to industrial production, maintenance, and emergency scenarios.

[0077] Device-specific root keys, purpose-separated session keys, and abnormally triggered demotion and privilege revoke can limit the impact of a single device or type of key leakage. In weak or offline network conditions, edge gateways can maintain necessary data collection based on the most recently effective policy and impose stricter restrictions on high-risk writes and controls. Attached Figure Description

[0078] Figure 1 This is a diagram of the overall system architecture of the present invention.

[0079] Figure 2 This is a timing diagram for the two-way authentication between the terminal and the edge gateway in this invention.

[0080] Figure 3 This is a diagram showing the authentication message fields and session key derivation structure of this invention.

[0081] Figure 4 This is a joint decision diagram of the trust level and working scenario of the present invention.

[0082] Figure 5 This is a flowchart illustrating the service request access control process of this invention.

[0083] Figure 6 This is a diagram showing the state of permission revocation for this invention.

[0084] Figure 7 This is a key lifecycle diagram for the present invention. Detailed Implementation

[0085] The specific embodiments of the present invention will be described in further detail below with reference to the examples. These examples are for illustrative purposes only and are not intended to limit the scope of the invention.

[0086] Unless otherwise specified, the technical solutions described in this invention are all conventional solutions in the field; unless otherwise specified, the reagents or materials described are all from commercial sources.

[0087] Example 1: System Architecture and Participating Entities

[0088] like Figure 1 As shown, the system architecture of this invention includes an industrial terminal device D, an edge gateway G, and a cloud server. Terminal D stores DID and K... D KV, Gateway Group GID, Startup Counter C D And algorithm suite; Gateway G stores device registration records, recent acceptance counters, trusted status, policy groups, and revocation status.

[0089] In this embodiment, the root key is preferentially stored in the secure element, trusted execution area, and read-protected Flash, and the gateway side uses key encryption key protection.

[0090] Example 2: Three-Message Two-Way Authentication Process

[0091] like Figure 2 As shown, the timing sequence for the two-way authentication between the terminal and the edge gateway is as follows:

[0092] Step S101: Terminal increments device counter C D Generate terminal random number N D Calculate T1 = Encode("DEV-HELLO",Ver,GID,DID,KV, C) D , N D Suite,Cap) and A1 = MAC(K) D , T1), send M1={Ver,GID,DID,KV, C D , N D ,Suite,Cap,A1}.

[0093] Step S102: The gateway checks the message length, algorithm suite, device registration status, and revocation status, and verifies A1 and C. D High water level and N D Check for duplicates. After successful verification, generate a gateway random number N. G And the temporary session identifier SID, calculate TH1=H(Encode(M1)) and T2=Encode("GW-PROOF",TH1,N G SID, PV, Exp) and A2 = MAC(K D ,T2), return M2={ N G ,SID,PV,Exp,A2}.

[0094] Step S103: Terminal verifies A2; if verification fails, delete the temporary state and issue an alarm; if verification succeeds, calculate TH2 = H(Encode(M1, M2)), T3 = Encode("DEV-FINISH", TH2), and A3 = MAC(K). D ,T3), send M3={SID,A3}.

[0095] Step S104: Gateway verification A3, submit C after successful verification. D Set the water level to high and set the session status to "authenticated".

[0096] Example 3: Session Key Derivation

[0097] like Figure 3 As shown, the authentication message fields and session key derivation structure are as follows:

[0098] After M3 verification is successful, both parties use the terminal random number N. D and gateway random number N GSalt value formed during the extraction stage: Salt = Encode(N) D N G Perform key derivation:

[0099] PRK=KDF-Extract(Salt,K D )

[0100] Info=Encode("IIOT-SESSION",DID,GID,SID,TH2,Suite)

[0101] OKM = KDF - Expand(PRK, Info, L)

[0102] (K AUTH , K ENC , K TOKEN Seq o =Split(OKM);

[0103] In this embodiment, K AUTH Used for business message integrity protection, K ENC Used for encryption or authentication encryption, K TOKEN Used for capability token protection, Seq o This is the initial sequence base value. Each subkey is used for its designated purpose only and may not be substituted for another.

[0104] Example 4: Joint Decision-Making Based on Trust Level and Scenario

[0105] like Figure 4 As shown, the gateway generates a risk vector based on recent authentication failures, abnormal operations, firmware measurements, device removals, link status, maintenance work orders, physical regions, and time periods. It then calculates the trust level according to rules or weighted scores and makes joint decisions with scenarios involving routine production, planned maintenance, emergency fault response, or downtime for repairs. Operations not explicitly permitted are rejected by default; emergency authorizations should have shorter validity periods, be limited to specific users, and be subject to enhanced auditing.

[0106] Example 5: Service Request Access Control

[0107] like Figure 5 As shown, the business request access control flow is as follows:

[0108] The terminal sends a service request Req={SID,TokenID,Seq,Op,Res,PayloadDigest,Tag}, where Tag is determined by K. AUTH calculate.

[0109] The gateway performs the following checks in sequence:

[0110] Step S501: VerifyTag – using K AUTH Verify the authentication tag of the business message.

[0111] Step S502: ReplayWindow – Check if the Seq is within the allowed window and reject duplicate or outdated sequences.

[0112] Step S503: Verify Token State – Check if the TokenID is valid, if it is in the revocation table, and if it has expired.

[0113] Step S504: Verify Operations, Resources, and Constraints (Op, Resource, Constraint) – Check whether the requested operation is within the scope of Ops allowed by the token, whether the resource is within the scope of Resources, and whether the valid Constraints are met.

[0114] If any step fails, the request is rejected and the audit event is logged.

[0115] Example 6: Permission Revocation and State Machine

[0116] like Figure 6 As shown, the session is in the following states in sequence: Unauthenticated, Pending Confirmation, Authenticated, Restricted, Revoked, or Expired:

[0117] Uncertified: Initial state, authentication has not yet been initiated.

[0118] Pending confirmation: M1 has been sent or M2 has been received; awaiting confirmation from the other party.

[0119] Authenticated: M3 verification passed, token issued, business requests can be executed normally.

[0120] Restricted: Enter when risks rise, reduce Ops or Resources and shorten validity period.

[0121] Revocation: When the revocation conditions are met, the session key is deleted and subsequent requests are rejected.

[0122] Expired: Entered after the token expires or the session times out.

[0123] In the event of unauthorized access, consecutive authentication tag failures, firmware status changes, device offline, token expiration, policy upgrades, or administrator revocation, the TokenID will be added to the revocation table and the session key will be cleared; devices experiencing consecutive failures will enter a time-limited isolation. Reconnection requires completing a new three-message authentication.

[0124] Example 7: Key Lifecycle Management

[0125] like Figure 7As shown, the key lifecycle includes the following stages:

[0126] Generation Phase: After the trusted production system or field pairing tool verifies the equipment serial number, model, and physical presence information, a random K is generated. D The data is written to the terminal and gateway security storage respectively, and bound to the device model, allowed gateway group and initial policy group.

[0127] Usage phase: Root key K D It is only used for three-message authentication and session key derivation, and is not directly used for business integrity, encryption or token protection.

[0128] Rotation phase: Key rotation adopts a two-stage update within the authenticated encryption session—first write and verify the new version, then switch atomically; the previous version is retained for a limited time for power failure recovery.

[0129] Revocation phase: After confirming the success of the new version, delete the old version; when the device is revoked, mark the corresponding root key as invalid.

[0130] Example 8: Industrial Applications

[0131] In the workshop setting, the production mode only allows reporting and reading operations, maintenance work orders can trigger short-term write permissions for specified devices and registers, and emergency shutdowns require a higher level of authentication.

[0132] Specifically:

[0133] In standard production mode, terminals are only allowed to perform data reporting and parameter reading operations. Tokens are limited to {"READ", "REPORT"} and Resources are limited to the specified data collection points.

[0134] Planned maintenance mode: After a maintenance work order is triggered, the gateway issues a temporary token based on the work order information, allowing write operations to be performed on specified devices and registers. The Ops contain {"WRITE"} and the validity period is consistent with the work order time window.

[0135] Emergency mode: Emergency shutdown requires a higher authentication level (AuthLevel upgrade), token validity is shortened to minutes, and audit logs are strengthened.

[0136] Example 9: Performance Testing and Verification

[0137] This embodiment compares the following metrics of certificate-based handshake, one-way PSK, and this solution under the same hardware and link conditions:

[0138] Code size (Flash usage), peak RAM usage, handshake message bytes, authentication latency, terminal power consumption, gateway concurrent processing throughput; and the following security scenarios are tested simultaneously: message tampering attack, random number duplication attack, counter rollback attack, reflection attack, out-of-order attack, replay attack (startup phase, handshake phase, business phase), unauthorized access, policy switching, and network outage recovery.

[0139] Test results show that the present invention has low computing, storage and communication overhead on resource-constrained industrial terminals, while effectively defending against the aforementioned security attacks.

[0140] Example 10: Offline Operation at the Edge

[0141] The edge gateway locally stores device registration records, recently effective policies, revocation status, and necessary audit information. In case of weak network or network outage:

[0142] The gateway only uses the policy snapshot that was most recently successfully verified and has not expired.

[0143] Allow necessary data collection and reporting.

[0144] Restrict parameter writing and control operations.

[0145] High-risk permissions will have their validity period automatically shortened.

[0146] Synchronization policy, reversal, and audit summary after network recovery.

[0147] Industrial applicability

[0148] This invention is applicable to secure communication scenarios between resource-constrained terminal devices such as sensors, PLCs, and actuators and edge gateways and cloud servers in the Industrial Internet of Things (IIoT). It is particularly suitable for industrial fields with high requirements for real-time performance, reliability, and security, such as smart manufacturing, process control, energy management, and smart water management. This invention does not rely on strict clock synchronization or real-time cloud-based decision-making and can operate normally in restricted offline environments at the edge, demonstrating significant industrial practical value.

[0149] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0150] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. A lightweight two-way authentication and access control method for industrial IoT terminal devices, characterized in that, include: Configure each terminal with a unique device identifier (DID) and root key (K). D Key version (KV) and irreversible boot counter (C) D ; Terminal increment C D And generate a terminal random number N D Calculate the terminal authentication code A1 = MAC(K) D ,Encode("DEV-HELLO",Ver,GID,DID,KV,C D N D Suite,Cap)), send the first message M1={Ver,GID,DID,KV,C D N D Suite,Cap,A1}; Gateway verification A1, C D High water level and N D Then, generate a gateway random number N. G And the session identifier SID, calculate TH1=H(Encode(M1)) and A2=MAC(K) D ,Encode("GW-PROOF",TH1,N G ,SID,PV,Exp)), returns the second message M2={N G ,SID,PV,Exp,A2}; After the terminal verifies A2, it calculates TH2 = H(Encode(M1,M2)) and A3 = MAC(K). D ,Encode("DEV-FINISH",TH2)), and send the third message M3={SID,A3}; After the gateway verifies A3, submit C. D At high water levels, both sides used Salt=Encode(N) D N G The session subkey K is derived from Info = Encode("IIOT-SESSION", DID, GID, SID, TH2, Suite) and used for separation. AUTH K ENC K TOKEN ,; The gateway generates a capability token Tok based on the device's trust level and operating scenario. The token must contain at least TokenID, SID, DID, Ops, Resources, Constraints, and ExpireCond. Each business request Req={SID,TokenID,Seq,Op,Res, PayloadDigest,Tag} is executed after Tag verification, sequence window verification, token status verification, and operation resource constraint verification; permission revocation is triggered when an exception occurs.

2. The method according to claim 1, characterized in that, The root key K D Key rotation employs a two-stage update process: first, the new version is written and verified, then the switch is performed atomically, and finally the old version is deleted upon successful confirmation.

3. The method according to claim 1, characterized in that, Terminal authentication, gateway authentication, and final confirmation use different role labels: "DEV-HELLO", "GW-PROOF", and "DEV-FINISH", respectively. The authentication code covers the protocol version, identity, double random number, algorithm suite, policy version, and transcription digest.

4. The method according to claim 1, characterized in that, The C D It is stored in non-volatile storage with rollback protection, and uses dual-slot records, version numbers and checksums to reduce the risk of damage from power failure; the gateway only submits a new high-water mark after successful M3 verification.

5. The method according to claim 1, characterized in that, The K AUTH Used for business message integrity protection, K ENC Used for encryption or authentication encryption, K TOKEN For capability token protection, each subkey is used for its designated purpose and may not be substituted for another.

6. The method according to claim 1, characterized in that, The capability token Tok also includes the Audience, PV, TH2, IssueCond, and AuthLevel fields; The gateway generates a risk vector based on authentication failure records, abnormal operations, firmware measurements, device revocation, link status, maintenance work orders, physical area, and time period, calculates the trust level, and makes joint decisions with the working scenario.

7. The method according to claim 1, characterized in that, The sequence window verification is performed by the gateway maintaining the highest sequence number and a fixed bitmap window for the session, rejecting duplicate or outdated sequences; when unauthorized access, consecutive authentication tag failures, firmware status changes, device offline, token expiration, policy upgrades, or administrator revocation occur, the TokenID is added to the revocation table and the session key is cleared.

8. The method according to claim 1, characterized in that, The edge gateway locally stores device registration records, most recently effective policies, revocation status, and audit information; in the event of weak network or network outage, it only maintains the necessary collection that has been explicitly permitted, shortens the validity period of high-risk permissions, and denies control operations; after recovery, it synchronizes policies, revocation, and audit summaries.

9. The method according to claim 1, characterized in that, Before key operations, length, version, identifier, and rate checks are performed. Unknown DIDs are responded to uniformly and their rates are limited. Sensitive comparisons use constant time. Sessions are sequentially in the states of unauthenticated, pending confirmation, authenticated, restricted, revoked, and expired. Only after M3 verification is successful can the session enter the authenticated state and issue a token.

10. The method according to claim 1, characterized in that, Reporting messages that only require integrity use K AUTH Calculate the certification label; use K when including parameters, process data, and control commands. ENC Perform authentication encryption; use independent sequence spaces or direction labels for each direction; control request binding to PayloadDigest to make operations, resources, and actual payloads indivisible and irreplaceable.