Power plant equipment single packet authentication method and system based on KKS coding
By integrating KKS coded information in single-pack authentication and using the national secret algorithm to encrypt and sign, the problem of insufficient authentication efficiency and security in smart power plants is solved, which significantly improves the resistance to forged attacks and improves the authentication efficiency.
Patent Information
- Application Number
- CN202411576960.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing single-pack certification scheme fails to fully integrate the physical characteristics and equipment information of the terminal in smart power plants, resulting in a high risk of forgery attacks and insufficient certification efficiency and security.
The single-package authentication method based on KKS encoding is adopted to integrate the KKS encoding information of the terminal device into the authentication request, and the data packets are encrypted and signed using the national secret algorithms SM4 and SM2 to build a more secure, reliable and efficient authentication framework.
By integrating KKS coded information, the traceability of authentication requests is significantly improved, the resistance to forged attacks is enhanced, network delay is reduced, authentication efficiency is improved, and authentication security and reliability are improved.
Smart Images

Figure CN119496641A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a single-package authentication method and system for power plant equipment based on KKS coding, and belongs to the field of network security of smart power plants. Background Art
[0002] In modern smart power plants, faced with a large number of diverse devices, ensuring the security and efficiency of data transmission has become a major challenge. Traditional authentication methods involve complex handshake protocols and multi-packet exchanges, which not only increase the complexity of data transmission, but also bring additional security risks. To solve this problem, Single Packet Authentication (SPA) has emerged as a lightweight and secure device authentication mechanism.
[0003] Single packet authentication is a secure and lightweight device authentication mechanism. SPA is a client-server architecture consisting of a firewall, SPA client, and SPA server. The firewall is located on the SPA server and is in the default-drop state. In this state, the firewall discards all received data packets, which can protect the network from attacks such as port scanning and brute force cracking. The SPA client is responsible for sending the authorization packet, which sends the client's information to the controller in an encrypted manner to verify the legitimacy of the user. The SPA server hides behind the firewall and hides its own services. If it is necessary to access the hidden service, the SPA server will temporarily reconfigure the firewall after receiving the authorization packet sent by the SPA client to allow communication between the SPA client and the required service. The limitations of the existing SPA solution are mainly reflected in the failure to fully integrate the physical characteristics of the terminal with the device information, which leaves an opportunity for forgery attacks. Attackers may illegally obtain access rights by imitating or tampering with the request data packet, thereby posing a serious threat to the network security of the power plant. The number of power plant equipment is huge and the types are diverse. How to effectively combine the identity identification of power plant equipment with the SAP authentication process to ensure the security and efficiency of power plant terminal equipment authentication is an important issue currently faced.
[0004] In the smart power plant environment, KKS coding is widely used in equipment. KKS (Kraftwerk-Kennzeichen System, the German abbreviation of power plant identification system) is a widely used power plant equipment coding system in the world. Through the combination of letters and numbers, it can uniquely identify the equipment and systems in the power plant. However, the current KKS coding is mainly used for identification in equipment management and information systems, and has not yet been directly combined with the network security certification of terminal equipment.
[0005] Therefore, a single packet authentication method for power plant equipment based on KKS coding is proposed, which aims to utilize the uniqueness and standardization of KKS coding and combine it with SPA (Single Packet Authentication) technology to achieve fast and secure authentication of power plant equipment, which has important practical application value. Summary of the invention
[0006] The present invention provides a single-packet authentication method and system for power plant equipment based on KKS coding. By integrating terminal KKS coding and single-packet authentication (SPA) technology, the KKS code and other authentication information of the equipment to be connected to the network in the smart power plant are encrypted, and a more secure, reliable and efficient authentication and authorization framework is constructed, providing a new solution for terminal authentication of smart power plants.
[0007] In order to solve the above technical problems, the technical solutions adopted by the present invention are as follows:
[0008] A single package authentication method for power plant equipment based on KKS coding, comprising:
[0009] The key generation center generates the session key SessionKey for communication between the terminal device and the server through the national secret algorithm SM4, and sends this key securely to the terminal device and the server; at the same time, the key generation center uses the SM2 algorithm to generate the public and private key pair (PK, SK) of the terminal device, makes the public key PK public, and sends the private key SK secretly to the terminal device;
[0010] The knocking packet sending module of the client stores the username, password, IP address, kks code and other information into the knocking packet, generates a valid knocking packet, and sends it to the knocking verification module of the server. The knocking monitoring module detects and monitors whether the SPA knocking fails. If it fails, the knocking packet needs to be resent. Before sending the knocking packet, the knocking packet sending module uses the key to encrypt a single data packet, signs the single data packet with the private key, and then sends the encrypted information and the signed information to the server as an authentication request. The specific process is as follows:
[0011] After the terminal device generates the information in the above data packet, it uses the key SessionKey sent to it by the key generation center to encrypt a single data packet, as follows:
[0012] C=E(SP,SessionKey)
[0013] Among them, C is the ciphertext after single packet data is encrypted, E is the encryption algorithm in SM4, SP is a single data packet, and SessionKey is the encryption key;
[0014] The terminal device uses the message digest algorithm SM3 to calculate the digest of a single data packet, as follows:
[0015] HM=H(SP)
[0016] Among them, HM is the message digest value, H is the digest algorithm in SM3, SP is a single data packet, and the terminal device uses its own private key SK to sign the single packet information and digest value, as follows:
[0017] Q=Sign(SP,HM,SK)
[0018] Among them, Q is the generated signature, Sign is the signature algorithm in SM2, SP is a single data packet, HM is the summary value of the message, and SK is the private key of the terminal device. After calculating the above information, the terminal sends its own identity information, single packet information, summary information, signature information and timestamp in ciphertext to the server as an authentication request;
[0019] The traffic monitoring module on the server side reads the data packet from the UDP listening knock port and parses the data packet; the knock verification module authenticates the data packet according to the following steps:
[0020] Step 1: Verify the correctness of the data packet signature information, as follows:
[0021] Verify(Q,SP,HM,PK)=1 / 0
[0022] Where Verify is the signature verification algorithm in SM2, Q is the signature information, SP is the single packet information, HM is the summary information, and PK is the public key of the terminal device. If the verification is successful, the verification algorithm outputs 1, indicating that the signature information of the terminal device is legal; otherwise, it outputs 0, indicating that the signature information of the terminal device is illegal, and the terminal device is denied access;
[0023] Step 2: Decrypt the data packet:
[0024] SP=D(SessionKey,C)
[0025] Among them, SP is the unencrypted single data packet information, D is the decryption algorithm in SM4, SessionKey is the decryption key of SM4, and C is the ciphertext:
[0026] Step 3: Verify the client's message digest, which is consistent with the message digest sent by the terminal device;
[0027] HM*=H(SP)
[0028] Among them, HM * is the message digest value calculated by the server, H is the message digest algorithm of SM3, SP is the single packet information, and the server can verify whether HM is equal to HM *, in order to determine whether the single packet information sent by the terminal is complete;
[0029] Step 4: Verify the information of the SPA data packet. If the authentication is successful, access is allowed; otherwise, access is denied and no information needs to be returned to the client.
[0030] The firewall module of the client mainly sets all ports that need to be protected to the default access-prohibited state, and releases data packets that pass the knocking verification module; the anomaly analysis module analyzes abnormal behavior based on the verification results and access results, and records logs.
[0031] In order to balance adaptability and efficiency, the knock monitoring module sets a timeout for each SPA knock request. If no valid response is received within this time, the knock is considered to have failed. The set timeout should take into account the network conditions within the power plant, so that knock failures can be detected in a timely manner while allowing normal network delays.
[0032] In order to improve security, the knocking package sending module of the above client stores information such as random number, username and password, timestamp, IP address, kks code and summary into the knocking package to generate a valid knocking package.
[0033] A single-package authentication system for power plant equipment based on KKS coding, comprising: a key generation center, a client and a server;
[0034] The key generation center is responsible for managing and distributing keys, and uses the national secret algorithm to generate corresponding keys for the client and the server. The key generation center generates the session key SessionKey for communication between the terminal device and the server through the national secret algorithm SM4, and sends this key securely to the terminal device and the server. At the same time, the key generation center uses the SM2 algorithm to generate the public and private key pair (PK, SK) of the terminal device, makes the public key PK public, and sends the private key SK secretly to the terminal device.
[0035] The client includes a port knock monitoring module and a knock packet sending module; the knock monitoring module is responsible for detecting and monitoring whether the SPA knock fails. If it fails, the knock packet needs to be resent; the knock packet sending module is mainly responsible for generating a valid knock packet, storing information such as the username, password, IP address, and kks code in the knock packet, encrypting a single data packet with a key before sending it, signing a single data packet with a private key, and then sending the encrypted information and signature information to the server as an authentication request. The specific process is as follows:
[0036] After the terminal device generates the information in the above data packet, it uses the key SessionKey sent to it by the key generation center to encrypt a single data packet, as follows:
[0037] C=E(SP,SessionKey)
[0038] Among them, C is the ciphertext after single packet data is encrypted, E is the encryption algorithm in SM4, SP is a single data packet, and SessionKey is the encryption key;
[0039] The terminal device uses the message digest algorithm SM3 to calculate the digest of a single data packet, as follows:
[0040] HM=H(SP)
[0041] Among them, HM is the message digest value, H is the digest algorithm in SM3, SP is a single data packet, and the terminal device uses its own private key SK to sign the single packet information and digest value, as follows:
[0042] Q=Sign(SP,HM,SK)
[0043] Among them, Q is the generated signature, Sign is the signature algorithm in SM2, SP is a single data packet, HM is the summary value of the message, and SK is the private key of the terminal device. After calculating the above information, the terminal sends its own identity information, single packet information, summary information, signature information and timestamp in ciphertext to the server as an authentication request;
[0044] The server includes a traffic monitoring module, a knock verification module, a firewall module, and an anomaly analysis module;
[0045] The traffic monitoring module reads data packets from the UDP listening port and parses the data packets;
[0046] The knock verification module is mainly responsible for: a. Verifying the format validity of the SPA package, if it is invalid, it will be discarded; b. Integrity detection, if tampering is found, it will be discarded; c. Anti-replay and anti-forgery detection; After receiving the authentication information of the terminal device, the knock verification module verifies the identity information and device information of the terminal device. If the verification passes, the public key of the terminal device is used to verify the correctness of the signature information, as follows:
[0047] Verify(Q,SP,HM,PK)=1 / 0
[0048] Where Verify is the signature verification algorithm in SM2, Q is the signature information, SP is the single packet information, HM is the summary information, and PK is the public key of the terminal device. If the verification is successful, the verification algorithm outputs 1, indicating that the signature information of the terminal device is legal; otherwise, it outputs 0, indicating that the signature information of the terminal device is illegal, and the terminal device is denied access;
[0049] The server decrypts the ciphertext using the key SessionKey, as follows:
[0050] SP=D(SessionKey,C)
[0051] Among them, SP is the unencrypted single data packet information, D is the decryption algorithm in SM4, SessionKey is the decryption key of SM4, and C is the ciphertext;
[0052] After decryption is completed, the server uses the message digest algorithm in SM3 to calculate whether the single packet information is complete, as follows:
[0053] HM*=H(SP)
[0054] Among them, HM * is the message digest value calculated by the server, H is the message digest algorithm of SM3, and SP is the single packet information; the server can verify whether HM is equal to HM * , in order to determine whether the single packet information sent by the terminal is complete;
[0055] Finally, the server verifies the single packet information sent by the terminal device, including whether the terminal user name is legal, whether the IP address meets the firewall configuration policy, whether the device KKS code is in the database, etc. If the authentication is successful, access is allowed; otherwise, access is denied, and no information needs to be returned to the client, which can effectively prevent attackers from further collecting information.
[0056] The firewall module mainly sets all ports that need to be protected to the default access-prohibited state and releases data packets that pass the knocking verification module; the anomaly analysis module analyzes abnormal behavior based on the verification results and access results, and records logs.
[0057] This invention proposes a single-packet authentication and authorization scheme combined with terminal KKS coding for terminal authentication in smart power plant scenarios. The KKS coding information of the device itself is added to the previous authentication information, ensuring that the source of each authentication request can be traced, significantly improving the ability to resist forgery attacks. At the same time, the national secret algorithm is used to encrypt the single data packet sent by the client.
[0058] The present invention aims at terminal authentication in the smart power plant scenario, and constructs a more secure, reliable and efficient authentication framework to address the limitations of the existing SPA solution, especially the insufficient defense against counterfeit attacks. By integrating the KKS encoding information of the terminal device into the authentication request, the traceability of the authentication request is ensured, and the resistance to counterfeit attacks is enhanced. By utilizing the efficient characteristics of SPA technology, the authentication process is completed with only a single data packet, which reduces network delays and improves authentication efficiency.
[0059] In order to balance efficiency and adaptability, the client's knocking monitoring module will set a timeout for each SPA knocking request. If no valid response is received within this time, the knocking is considered to have failed. The set timeout should take into account the network conditions within the power plant, so that knocking failures can be detected in a timely manner while allowing normal network delays.
[0060] To improve security, the knock packet generated by the client's knock packet sending module is a SPA data packet, which contains fields such as random number, username and password, timestamp, IP address, KKS code and summary. Among them, the random number can ensure that each SPA message is unique, the username is the client's username, the timestamp can record the time when the data packet is sent, the IP address can help the server verify the location of the entity that initiates the authentication request, and help prevent access attempts from unknown or unauthorized network locations. The KKS code is the unique identifier of the device, which can ensure the traceability of the authentication request and enhance resistance to forgery attacks. The summary allows the server to determine whether the single packet information has been tampered with.
[0061] The most original SPA data packet fields include random number, user name, timestamp, fwknop version, message type, message field and summary. Among them, the random number can ensure that each SPA message is unique. The user name is the user name of the client. The timestamp can record the time when the data packet is sent. The fwknop version field indicates the version number of fwknop while retaining backward compatibility with old versions of the software. The message type identifies the type of the SPA data packet, such as "request access", "authorized access", etc. The message field is used to describe the message content in detail, and the summary is used to verify the integrity of the message after decryption.
[0062] In order to deal with replay attacks and forgery attacks, the present invention adds additional fields to the original data packet to implement multi-factor authentication to increase the security of authentication:
[0063] (1) IP address: The source IP address can help the recipient verify the location of the entity initiating the authentication request, which helps prevent access attempts from unknown or unauthorized network locations;
[0064] (2) KKS coding of equipment: The KKS coding of thermal power plants is compiled and implemented based on GB / T50549 "Power Plant Identification System Coding Standard", which is divided into three types: process-related identification, installation point identification and location identification, ensuring that each device has a unique digital identity. In the past, KKS coding was used in equipment maintenance and repair. Due to its accuracy and uniqueness, it can also be used in network authentication, which can effectively distinguish legitimate equipment from potential counterfeiters, ensuring that only authorized devices can access the network, thereby significantly reducing the risk of counterfeit attacks. In addition, it can also prevent the SPA knock-on amplification vulnerability caused by IP authentication;
[0065] In addition, in order to improve efficiency, this method removes some unnecessary fields in the standard SPA data packet, including the fwknop version, message type, etc., because in the smart power plant scenario, the data packets sent by the client are all requesting services, and this method does not limit the system used to fwknop.
[0066] The traffic monitoring module of the above server uses libpcap to read data packets from the UDP listening port. libpcap (Packet Capture Library) is a network data packet capture library under the Unix / Linux platform. It is an API interface for user-level packet capture independent of the system, providing a portable framework for underlying network monitoring. After receiving the data packet, it is necessary to parse the content of the data packet and extract the authentication information therein to verify the legitimacy of the data packet.
[0067] The above-mentioned firewall module mainly sets all ports that need to be protected to a default access-prohibited state. All clients must be authenticated before they can communicate with the server, otherwise any data packets accessing these ports will be automatically intercepted and rejected. Configuring the firewall to the "Default-Drop" state can fundamentally reduce the network exposure, making it difficult for attackers to discover open ports by guessing or scanning, thereby greatly reducing the risk of network attacks. In addition, the firewall is also responsible for releasing data packets that pass the knock verification module, allowing them to communicate with the server. The firewall also supports the function of timing the expiration of access policies. Legitimate access requests will automatically expire after a preset period of time unless they are authenticated and authorized again. This mechanism helps prevent abuse of permissions and long-term undetected latent attacks, ensuring that network protection is always maintained in the best state.
[0068] The technologies not mentioned in the present invention are all referred to the prior art.
[0069] This invention proposes a new authentication and authorization scheme combining KKS encoding and single packet authentication (SPA) technology for terminal authentication in smart power plant scenarios, and builds a more secure, reliable and efficient authentication framework to address the limitations of existing SPA schemes, especially the insufficient defense capability against counterfeit attacks. The beneficial effects produced include:
[0070] Efficiency: The adoption of a single-packet authentication mechanism means that the authentication process between the terminal and the server only requires one data exchange to complete, greatly shortening the authentication time and reducing network latency.
[0071] Authentication security: By combining KKS coding, the present invention can use the unique identifier of the device to create a unique authentication information for each terminal. KKS coding not only provides the physical location and function information of the device, but also ensures that the source of each authentication request can be traced, significantly improving the ability to resist counterfeit attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 It is a schematic diagram of the single package authentication method of power plant equipment based on KKS coding of the present invention.
[0073] Figure 2 It is a schematic diagram of the SPA data packet of the present invention.
[0074] Figure 3 This is a flow chart of server authentication of the present invention. DETAILED DESCRIPTION
[0075] In order to better understand the present invention, the content of the present invention is further explained below in conjunction with the embodiments, but the content of the present invention is not limited to the following embodiments.
[0076] The present invention proposes a single-packet authentication and authorization scheme combined with terminal KKS coding for terminal authentication in smart power plant scenarios, aiming to build a more secure, reliable and efficient authentication framework to address the limitations of existing SPA schemes, especially the insufficient defense against counterfeit attacks. By integrating the KKS coding information of the terminal device into the authentication request, the traceability of the authentication request is ensured and the resistance to counterfeit attacks is enhanced. By utilizing the efficient characteristics of SPA technology, the authentication process is completed with only a single data packet, reducing network delays and improving authentication efficiency. At the same time, the national secret algorithm is used to encrypt the single data packet sent by the client.
[0077] Example 1
[0078] Figure 1 This is a schematic diagram of the KKS-encoded single-package authentication system for power plant equipment described in the present invention, which mainly includes a client, a server and a key generation center.
[0079] The client includes a port knock monitoring module and a knock packet sending module. The knock monitoring module is responsible for detecting and monitoring whether the SPA knock fails. If it fails, the knock packet needs to be resent. The knock monitoring module sets a timeout for each SPA knock request. If no valid response is received within this time, it is considered that the knock fails. The knock packet sending module is mainly responsible for generating a valid knock packet, storing the username, password, kks code and other information in the knock packet, encrypting a single data packet with a key before sending it, signing a single data packet with a private key, and then sending the encrypted information and signature information to the server as an authentication request. The specific process is:
[0080] After the terminal device generates the information in the above data packet, it uses the key SessionKey sent to it by the key generation center to encrypt a single data packet, as follows:
[0081] C=E(SP,SessionKey)
[0082] Among them, C is the ciphertext after single packet data is encrypted, E is the encryption algorithm in SM4, SP is a single data packet, and SessionKey is the encryption key;
[0083] The terminal device uses the message digest algorithm SM3 to calculate the digest of a single data packet, as follows:
[0084] HM=H(SP)
[0085] Among them, HM is the message digest value, H is the digest algorithm in SM3, SP is a single data packet, and the terminal device uses its own private key SK to sign the single packet information and digest value, as follows:
[0086] Q=Sign(SP,HM,SK)
[0087] Among them, Q is the generated signature, Sign is the signature algorithm in SM2, SP is a single data packet, HM is the summary value of the message, and SK is the private key of the terminal device. After calculating the above information, the terminal sends its own identity information, single packet information, summary information, signature information and timestamp in ciphertext to the server as an authentication request;
[0088] The server includes a traffic monitoring module, a knock verification module, a firewall module, and an anomaly analysis module. The traffic monitoring module uses libpcap to read data packets from the UDP listening knock port and parse the data packets. The knock verification module is mainly responsible for 1. Verifying the format validity of the SPA package, and discarding it if it is invalid. 2. Integrity detection, discarding if tampering is found. 3. Anti-replay and anti-counterfeiting detection. The firewall module mainly sets all ports that need to be protected to the default prohibited access state, and releases data packets that pass the knock verification module. The firewall also supports the function of timing the expiration of access policies. Legitimate access requests will automatically expire after a preset time period unless they are authenticated and authorized again. The anomaly analysis module analyzes abnormal behavior based on the verification results and access results, and records logs.
[0089] The key generation center is responsible for managing and distributing keys. The key generation center uses the national secret algorithm to generate corresponding keys for the client and the server. The key generation center uses the national secret algorithm SM4 to generate the session key SessionKey for communication between the terminal device and the server, and securely sends this key to the terminal device and the server; at the same time, the key generation center uses the SM2 algorithm to generate the public and private key pair (PK, SK) of the terminal device, and makes the public key PK public, and the private key SK is sent secretly to the terminal device;
[0090] Figure 2 This is a schematic diagram of the SPA data packet described in the present invention. It contains fields such as random number, username and password, timestamp, IP address, KKS code, summary, etc. Among them, the random number can ensure that each SPA message is unique, the username is the username of the client, the timestamp can record the time when the data packet is sent, and the IP address can help the server verify the location of the entity that initiated the authentication request. It helps to prevent access attempts from unknown or unauthorized network locations. The KKS code is a unique identifier for the device, which can ensure the traceability of the authentication request and enhance resistance to forgery attacks. The summary information allows the server to determine whether the single packet information has been tampered with.
[0091] Figure 3 The following is a flow chart for server authentication. The server is first initialized and then the firewall is set to the default access-denied state. After receiving the SPA data packet sent by the client, the zero-trust gateway verifies the signature result of the SPA data packet, decrypts the SPA data packet, verifies the message digest of the SPA data packet, and verifies the specific content of the SPA data packet. If the above information is successfully verified, a temporary access credential is generated for the client, allowing access to service resources.
[0092] Step 1: Verify the correctness of the SPA data packet signature information, as follows:
[0093] Verify(Q,SP,HM,PK)=1 / 0
[0094] Among them, Verify is the signature verification algorithm in SM2, Q is the signature information, SP is the single package information, HM is the summary information, and PK is the public key of the terminal device. If the verification is successful, this verification algorithm outputs 1, indicating that the signature information of the terminal device is legal; otherwise, it outputs 0, indicating that the signature information of the terminal device is illegal, and the terminal device is denied access.
[0095] Step 2: Decrypt the SPA data packet.
[0096] SP=D(SessionKey,C)
[0097] Among them, SP is the unencrypted single data packet information, D is the decryption algorithm in SM4, SessionKey is the decryption key of SM4, and C is the ciphertext.
[0098] Step 3: Verify the client's message digest. This message digest value is consistent with the message digest value sent by the terminal device.
[0099] HM*=H(SP)
[0100] Among them, HM * is the message digest value calculated by the server, H is the message digest algorithm of SM3, and SP is the single packet information. The server can verify whether HM is equal to HM * , in order to determine whether the single packet information sent by the terminal is complete.
[0101] Step 4: Verify the information in the SPA data packet.
[0102] Example 2
[0103] A single package authentication method for power plant equipment based on KKS coding, characterized by comprising:
[0104] The key generation center generates the session key SessionKey for communication between the terminal device and the server through the national secret algorithm SM4, and sends this key securely to the terminal device and the server; at the same time, the key generation center uses the SM2 algorithm to generate the public and private key pair (PK, SK) of the terminal device, makes the public key PK public, and sends the private key SK secretly to the terminal device;
[0105] The knocking packet sending module of the client stores the random number, username and password, timestamp, IP address, kks code and summary into the knocking packet, generates a valid knocking packet, and sends it to the knocking verification module of the server. The knocking monitoring module is used to detect and monitor whether the SPA knocking fails. If it fails, the knocking packet needs to be resent. The knocking monitoring module sets a timeout for each SPA knocking request. If no valid response is received within this time, it is considered that the knocking fails. Before sending the knocking packet, the knocking packet sending module uses the key to encrypt a single data packet, signs the single data packet with the private key, and then sends the encrypted information and the signed information to the server as an authentication request. The specific process is as follows:
[0106] After the terminal device generates the information in the above data packet, it uses the key SessionKey sent to it by the key generation center to encrypt a single data packet, as follows:
[0107] C=E(SP,SessionKey)
[0108] Among them, C is the ciphertext after single packet data is encrypted, E is the encryption algorithm in SM4, SP is a single data packet, and SessionKey is the encryption key;
[0109] The terminal device uses the message digest algorithm SM3 to calculate the digest of a single data packet, as follows:
[0110] HM=H(SP)
[0111] Among them, HM is the message digest value, H is the digest algorithm in SM3, SP is a single data packet, and the terminal device uses its own private key SK to sign the single packet information and digest value, as follows:
[0112] Q=Sign(SP,HM,SK)
[0113] Among them, Q is the generated signature, Sign is the signature algorithm in SM2, SP is a single data packet, HM is the summary value of the message, and SK is the private key of the terminal device. After calculating the above information, the terminal sends its own identity information, single packet information, summary information, signature information and timestamp in ciphertext to the server as an authentication request;
[0114] The traffic monitoring module on the server uses libpcap to read data packets from the UDP listening knock port and parse the data packets; the knock verification module authenticates the data packets according to the following steps:
[0115] Step 1: Verify the correctness of the data packet signature information, as follows:
[0116] Verify(Q,SP,HM,PK)=1 / 0
[0117] Where Verify is the signature verification algorithm in SM2, Q is the signature information, SP is the single packet information, HM is the summary information, and PK is the public key of the terminal device. If the verification is successful, the verification algorithm outputs 1, indicating that the signature information of the terminal device is legal; otherwise, it outputs 0, indicating that the signature information of the terminal device is illegal, and the terminal device is denied access;
[0118] Step 2: Decrypt the data packet:
[0119] SP=D(SessionKey,C)
[0120] Among them, SP is the unencrypted single data packet information, D is the decryption algorithm in SM4, SessionKey is the decryption key of SM4, and C is the ciphertext:
[0121] Step 3: Verify the client's message digest, which is consistent with the message digest sent by the terminal device;
[0122] HM*=H(SP)
[0123] Among them, HM * is the message digest value calculated by the server, H is the message digest algorithm of SM3, SP is the single packet information, and the server can verify whether HM is equal to HM * , in order to determine whether the single packet information sent by the terminal is complete;
[0124] Step 4: Verify the information of the SPA data packet. If the authentication is successful, access is allowed; otherwise, access is denied and no information needs to be returned to the client.
[0125] The client's firewall module mainly sets all ports that need to be protected to the default access-prohibited state, and allows data packets that pass the knocking verification module to pass. The firewall also supports the function of timing the expiration of access policies. Legitimate access requests will automatically expire after a preset time period unless they are authenticated and authorized again; the anomaly analysis module analyzes abnormal behavior based on the verification results and access results, and records logs.
[0126] In summary, the present invention proposes a single-packet authentication and authorization scheme combined with terminal KKS coding for terminal authentication in smart power plant scenarios. By integrating the KKS coding information of the terminal device into the authentication request, the traceability of the authentication request is ensured and the resistance to counterfeit attacks is enhanced. By utilizing the efficient characteristics of SPA technology, the authentication process is completed with only a single data packet, which reduces network latency and improves authentication efficiency. At the same time, the single data packet sent by the client is encrypted using the national secret algorithm, which is safe and reliable.
Claims
1. A single package authentication method for power plant equipment based on KKS coding, characterized by: include: The key generation center generates the session key for communication between the terminal device and the server through the national secret algorithm SM4, and sends this key securely to the terminal device and the server; at the same time, the key generation center uses the SM2 algorithm to generate the public and private key pair (PK, SK) of the terminal device, makes the public key PK public, and sends the private key SK secretly to the terminal device; The terminal knocking packet sending module stores the username, password, IP address and kks code in the knocking package, generates a valid knocking package, and sends it to the knocking verification module on the server side. The knocking monitoring module detects and monitors whether the SPA knocking fails. If it fails, the knocking package needs to be resent. Before sending the knocking package, the knocking packet sending module uses the key to encrypt a single data packet, signs the single data packet with the private key, and then sends the encrypted information and the signed information to the server side as an authentication request. The specific process is as follows: After generating the information in the above data packet, the terminal device uses the key SessionKey sent to it by the key generation center to encrypt a single data packet, as follows: C=E(SP,SessionKey) Among them, C is the ciphertext after single packet data is encrypted, E is the encryption algorithm in SM4, SP is a single data packet, and SessionKey is the encryption key; The terminal device uses the message digest algorithm SM3 to calculate the digest of a single data packet, as follows: HM=H(SP) Among them, HM is the message digest value, H is the digest algorithm in SM3, SP is a single data packet, and the terminal device uses its own private key SK to sign the single packet information and digest value, as follows: Q=Sign(SP,HM,SK) Among them, Q is the generated signature, Sign is the signature algorithm in SM2, SP is a single data packet, HM is the summary value of the message, and SK is the private key of the terminal device. After calculating the above information, the terminal sends its own identity information, single packet information, summary information, signature information and timestamp in ciphertext to the server as an authentication request; The traffic monitoring module on the server side reads the data packet from the UDP listening knock port and parses the data packet; the knock verification module authenticates the data packet according to the following steps: Step 1: Verify the correctness of the data packet signature information, as follows: Verify(Q,SP,HM,PK)=1 / 0 Where Verify is the signature verification algorithm in SM2, Q is the signature information, SP is the single packet information, HM is the summary information, and PK is the public key of the terminal device. If the verification is successful, the verification algorithm outputs 1, indicating that the signature information of the terminal device is legal; otherwise, it outputs 0, indicating that the signature information of the terminal device is illegal, and the terminal device is denied access; Step 2: Decrypt the data packet: SP=D(SessionKey,C) Among them, SP is the unencrypted single data packet information, D is the decryption algorithm in SM4, SessionKey is the decryption key of SM4, and C is the ciphertext: Step 3: Verify the client's message digest. This message digest value is consistent with the message digest value sent by the terminal device. HM*=H(SP) Among them, HM * is the message digest value calculated by the server, H is the message digest algorithm of SM3, SP is the single packet information, and the server verifies whether HM is equal to HM * , in order to determine whether the single packet information sent by the terminal is complete; Step 4: Verify the information of the SPA data packet. If the authentication is successful, access is allowed; otherwise, access is denied and no information needs to be returned to the client. The client's firewall module sets all ports that need to be protected to the default access-prohibited state and allows data packets that pass the knock verification module to pass; the anomaly analysis module analyzes abnormal behavior based on the verification results and access results and records logs.
2. The method for single package authentication of power plant equipment based on KKS coding according to claim 1 is characterized in that: The knock monitoring module sets a timeout for each SPA knock request. If no valid response is received within this time, the knock is considered to have failed.
3. The single package authentication method for power plant equipment based on KKS coding according to claim 1 or 2, characterized in that: The terminal knocking package sending module stores the random number, username and password, timestamp, IP address, kks code and summary into the knocking package to generate a valid knocking package.
4. A single package authentication system for power plant equipment based on KKS coding, characterized by: include: Includes key generation center, client and server; The key generation center is responsible for managing and distributing keys, and using the national encryption algorithm to generate corresponding keys for the client and server; The key generation center generates the session key SessionKey for communication between the terminal device and the server through the national secret algorithm SM4, and sends this key securely to the terminal device and the server; at the same time, the key generation center uses the SM2 algorithm to generate the public and private key pair (PK, SK) of the terminal device, makes the public key PK public, and sends the private key SK secretly to the terminal device; The client includes a port knock monitoring module and a knock packet sending module; the knock monitoring module is responsible for detecting and monitoring whether the SPA knock fails. If it fails, the knock packet needs to be resent; the knock packet sending module is responsible for generating a valid knock packet, storing the username, password, IP address and kks code in the knock packet, encrypting a single data packet with a key before sending it, signing a single data packet with a private key, and then sending the encrypted information and signature information to the server as an authentication request. The specific process is as follows: After the terminal device generates the information in the above data packet, it uses the key SessionKey sent to it by the key generation center to encrypt a single data packet, as follows: C=E(SP,SessionKey) Among them, C is the ciphertext after single packet data is encrypted, E is the encryption algorithm in SM4, SP is a single data packet, and SessionKey is the encryption key; The terminal device uses the message digest algorithm SM3 to calculate the digest of a single data packet, as follows: HM=H(SP) Among them, HM is the message digest value, H is the digest algorithm in SM3, SP is a single data packet, and the terminal device uses its own private key SK to sign the single packet information and digest value, as follows: Q=Sign(SP,HM,SK) Among them, Q is the generated signature, Sign is the signature algorithm in SM2, SP is a single data packet, HM is the summary value of the message, and SK is the private key of the terminal device. After calculating the above information, the terminal sends its own identity information, single packet information, summary information, signature information and timestamp in ciphertext to the server as an authentication request; The server includes traffic monitoring module, knock verification module, firewall module and anomaly analysis module; The traffic monitoring module reads data packets from the UDP listening port and parses the data packets; The knock verification module is responsible for: a. Verifying the format validity of the SPA package, and discarding it if it is invalid; b. Integrity detection, and discarding it if tampering is found; c. Anti-replay and anti-forgery detection; After receiving the authentication information of the terminal device, the knock verification module verifies the identity information and device information of the terminal device. If the verification passes, the public key of the terminal device is used to verify the correctness of the signature information, as follows: Verify(Q,SP,HM,PK)=1 / 0 Where Verify is the signature verification algorithm in SM2, Q is the signature information, SP is the single packet information, HM is the summary information, and PK is the public key of the terminal device. If the verification is successful, the verification algorithm outputs 1, indicating that the signature information of the terminal device is legal; otherwise, it outputs 0, indicating that the signature information of the terminal device is illegal, and the terminal device is denied access; The server decrypts the ciphertext using the key SessionKey, as follows: SP=D(SessionKey,C) Among them, SP is the unencrypted single data packet information, D is the decryption algorithm in SM4, SessionKey is the decryption key of SM4, and C is the ciphertext; After decryption is completed, the server uses the message digest algorithm in SM3 to calculate whether the single packet information is complete, as follows: HM*=H(SP) Among them, HM * is the message digest value calculated by the server, H is the message digest algorithm of SM3, and SP is the single packet information; the server verifies whether HM is equal to HM * , in order to determine whether the single packet information sent by the terminal is complete; Finally, the server verifies the single packet information sent by the terminal device, including whether the terminal user name is legal, whether the IP address meets the firewall configuration policy, and whether the device KKS code is in the database. If the authentication is successful, access is allowed; otherwise, access is denied, and no information needs to be returned to the client to prevent attackers from further collecting information. The firewall module sets all ports that need to be protected to the default access-prohibited state and allows data packets that pass the knock verification module to pass; the anomaly analysis module analyzes abnormal behavior based on the verification results and access results, and records logs.
5. The power plant equipment single package authentication system based on KKS coding according to claim 4 is characterized in that: The knock monitoring module of the client sets a timeout for each SPA knock request. If no valid response is received within this time, the knock is considered to have failed.
6. The power plant equipment single package authentication system based on KKS coding according to claim 4 or 5, characterized in that: The knock packet generated by the knock packet sending module of the client is a SPA data packet, which contains a random number, username and password, timestamp, IP address, KKS code and summary; among them, the random number ensures that each SPA message is unique, the username is the username of the client, the timestamp records the time when the data packet is sent, and the IP address helps the server to verify the location of the entity that initiates the authentication request and prevent access attempts from unknown or unauthorized network locations. The KKS code is the unique identifier of the device, ensuring the traceability of the authentication request and enhancing resistance to forgery attacks. The summary allows the server to determine whether the single packet information has been tampered with.
7. The power plant equipment single package authentication system based on KKS coding according to claim 4 or 5, characterized in that: The traffic monitoring module on the server uses libpcap to read data packets from the UDP listening port. After receiving the data packets, it parses the contents of the data packets and extracts the authentication information to verify the legitimacy of the data packets.
8. The KKS-coded power plant equipment single package authentication system according to claim 4 or 5, characterized in that: The firewall also supports the function of timing the expiration of access policies. Legitimate access requests will automatically become invalid after a preset period of time unless they are authenticated and authorized again.
Citation Information
Patent Citations
Resource access control method based on zero-trust single packet authentication and authorization
CN114553568A
Equipment ledger data coding method and system with KKS (Kernel Kernel System) as core for framework
CN115935418A