Quantum key-based secondary authentication method and device for digital terminal of power system, and medium
By introducing a dual random number key derivation mechanism, timestamp, and puzzle mechanism into the power system, the key lifecycle management and replay attack problems between the power system terminals and the quantum security service platform are solved, and a secure and efficient secondary authentication is achieved, which is suitable for large-scale terminal access and network jitter scenarios.
Patent Information
- Application Number
- CN202511188996.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-25
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2045-08-25
AI Technical Summary
The existing secondary authentication method between power system terminals and quantum security service platforms has problems such as lack of key lifecycle management, lack of session key dynamics and forward security, susceptibility to replay attacks, and insufficient authentication efficiency and atomicity.
By pre-sharing the master key between the terminal and the platform, utilizing a key derivation mechanism involving dual random numbers, combined with a timestamp and puzzle mechanism, session authentication keys and session encryption keys are established to enhance the security and efficiency of the authentication process, and rapid re-authentication is achieved through the migration token after the session is interrupted.
It improves the communication security and stability between power system terminals and platforms, enhances the defense capabilities against replay attacks and timing attacks, reduces authentication delays, and adapts to network jitter and large-scale terminal access scenarios.
Smart Images

Figure CN120729634A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of power system security technology, and in particular to a method, device and medium for secondary authentication of a power system digital terminal based on quantum key. Background Art
[0002] Existing technology provides a two-step authentication method between power system terminals and a quantum security service platform. In this method, after a terminal initiates registration, the platform responds with a random number and a quantum key identifier. The terminal uses this identifier to retrieve a pre-shared quantum key, generate another random number, and use this quantum key to calculate two message authentication codes: one from the terminal to the platform (MACab) and the other from the platform to the terminal (MACba). The terminal then sends the MACab and MACba to the platform. The platform verifies the MACab and, if valid, sends its calculated MACba to the terminal, which then verifies the MACba, completing bidirectional authentication.
[0003] However, the above-mentioned existing technologies suffer from several technical issues: 1. Lack of key lifecycle management: This method relies on a pre-shared quantum key but fails to address mechanisms for its secure distribution, update, and revocation throughout its lifecycle. If the key is leaked during the pre-sharing phase or becomes insecure due to long-term use, the security of the entire authentication system will be seriously compromised. 2. Lack of dynamic and forward-secure session keys: Directly using a long-lived quantum key to calculate a message authentication code, once the long-lived key is leaked, all past and future authentication sessions based on this key can be compromised, lacking forward security. 3. Risk of replay attacks: Although random numbers and ciphertext are used in the authentication process, improper random number generation or management can still pose a risk of carefully crafted replay attacks in certain network attack scenarios or in systems with less stringent time synchronization requirements, especially if the key identifier and random number are intercepted by an attacker. 4. Issues with the atomicity and efficiency of the authentication process: Multiple message exchanges (e.g., four message passes) can lead to low authentication efficiency when network latency is high or when facing a large number of terminal access requests. Furthermore, the non-atomic nature of the authentication process also poses a risk of intermediate state being exploited by attackers. Summary of the Invention
[0004] In view of the above-mentioned problems, the present invention is proposed.
[0005] Therefore, the technical problem solved by the present invention is: how to solve the problems of lack of quantum key lifecycle management, lack of session key dynamics and forward security, vulnerability to replay attacks, and insufficient authentication efficiency and atomicity.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a secondary authentication method for a power system digital terminal based on quantum key, which includes: The terminal and the platform pre-share the master key; The terminal initiates a session authentication key request including a first random value to the platform; After receiving the request, the platform generates a second random value; The platform derives a session authentication key through a first key derivation function based on the master key, the first random value, and the second random value; The platform sends the second random value to the terminal; The terminal derives a session authentication key identical to that of the platform through a first key derivation function based on the master key, the first random value, and the second random value; The terminal and the platform use the session authentication key to complete the two-way authentication process.
[0007] As a preferred solution of the method for secondary authentication of a digital terminal in a power system based on quantum key according to the present invention, when the terminal initiates a session authentication key request, the request includes a first timestamp; Verifying that the first timestamp is within a preset first time window before the platform derives a session authentication key; The platform includes a second timestamp in a response sent to the terminal; The terminal verifies whether the second timestamp is within a preset second time window before deriving the session authentication key; Inputs of the first key derivation function include a first timestamp and a second timestamp.
[0008] As a preferred solution of the method for secondary authentication of a digital terminal in a power system based on quantum key according to the present invention, after the terminal and the platform complete the two-way authentication process, the terminal and the platform negotiate encryption parameters; The encryption parameter is based on the session authentication key and the negotiated third random value and the fourth random value, and a session encryption key is derived by a second key derivation function.
[0009] As a preferred solution of the quantum key-based secondary authentication method for a power system digital terminal according to the present invention, before the terminal and the platform communicate using a session encryption key, the method includes: the terminal encrypting a first known vector using the session encryption key and sending the first known vector to the platform; The platform decrypts and verifies the first known vector using the currently derived session encryption key to confirm that the terminal has correctly derived the session encryption key; The platform encrypts the second known vector using the session encryption key and sends the encrypted vector to the terminal. The endpoint decrypts and verifies the second known vector using the currently derived session encryption key to confirm that the platform has correctly derived the session encryption key.
[0010] As a preferred solution of the method for secondary authentication of a digital terminal in a power system based on quantum key according to the present invention, wherein: the terminal and the platform serve as a communication sender and a communication receiver to each other; The communication sender attaches an incrementing sending sequence number to each application data message to be sent, and uses the session encryption key to encrypt and authenticate the message with the sending sequence number attached; After the communication receiver decrypts and authenticates the received message, it verifies whether the sequence number in the message is the expected sequence number, thereby completing the detection of message loss, disorder or replay.
[0011] As a preferred solution of the method for secondary authentication of a digital terminal in a power system based on quantum key according to the present invention, wherein: the terminal and the platform perform a step of time synchronization verification when communicating using a session encryption key; The terminal records the local sending time t1 and sends the time synchronization request message containing t1 to the platform through encryption; The platform records the local time t2 when the request is received and the local time t3 when the response is ready, and encrypts the time synchronization response message containing t1, t2, and t3 and sends it to the terminal. The terminal records the local time t4 when the response is received, and calculates the clock offset between the terminal and the platform based on t1, t2, t3, and t4; Sending encrypted data to the terminal or platform also includes refreshing the session key; The terminal or platform initiates a refresh request, and both parties exchange new random values; The terminal and the platform derive a new session authentication key and a new session encryption key based on the current session authentication key and the new random value.
[0012] Before the terminal initiates a session authentication key request, it also includes a denial of service attack defense step; The platform sends a computational puzzle to the terminal, which then solves it to obtain the solution. The terminal includes the puzzle solution in the current session authentication key request; The platform verifies the validity of the puzzle solution before deriving the session authentication key.
[0013] As a preferred solution of the quantum key-based secondary authentication method for power system digital terminals described in the present invention, the method for establishing the master key is that the terminal and the platform perform an elliptic curve key exchange protocol to negotiate a shared secret; the terminal and the platform derive the master key based on the shared secret.
[0014] This preferred solution proactively generates a migration token and pre-master key after the first secure session is established, and sends them to the terminal, preserving the conditions for subsequent rapid re-authentication. Compared to the traditional method of re-initiating the entire authentication process after a session is interrupted, this mechanism ensures forward continuity of the authentication state, enabling the terminal to renegotiate session keys without having to re-acquire the master key. This reduces the platform's computational overhead and enhances system continuity under unstable communication conditions.
[0015] As a preferred solution of the quantum key-based secondary authentication method for a power system digital terminal described in the present invention, the terminal and the platform complete a two-way authentication process using a session authentication key, enter a first secure session, and the platform generates a migration token and a pre-master key, and sends both to the terminal; When the first secure session is interrupted, the terminal initiates a fast reauthentication request, which includes a migration token and a new terminal random value; After the platform verifies that the migration token is valid, it derives a new session key with the terminal based on the pre-master key and the new random value and establishes a second secure session.
[0016] In this preferred solution, if the first secure session is unexpectedly interrupted, the terminal can directly use the previously obtained migration token and pre-master key to quickly negotiate a new session key with the platform and establish a second secure session. This approach not only significantly shortens authentication latency and improves system recovery efficiency, but also better adapts to scenarios such as short-term link jitter and module reboots that are common in power terminal equipment operation.
[0017] The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and is characterized in that when the processor executes the computer program, the steps of the method for secondary authentication of a power system digital terminal based on quantum key are implemented.
[0018] The present invention provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the method for secondary authentication of a power system digital terminal based on quantum key are implemented.
[0019] The present invention's beneficial effects: By constructing an authentication mechanism that combines master key negotiation, key derivation, two-way authentication, and rapid re-authentication, the present invention effectively enhances the security and stability of communication between terminals and platforms. Compared to existing solutions that employ a single authentication process, the present invention ensures the dynamic nature of the authentication key through master key negotiation and random number interaction during the initial terminal access phase. This in turn utilizes the authentication key to perform two-way authentication, improving the reliability of identity verification.
[0020] After two-way authentication is complete, the system enters the first secure session. The platform pre-generates a migration token and pre-master key and sends them to the terminal, providing critical support for the rapid re-authentication process. If the first secure session is interrupted, the terminal can use the obtained migration token and a new random number, combined with the pre-master key, to derive a new session key, thereby quickly establishing a second secure session. This mechanism not only ensures authentication strength, but also improves the terminal's authentication recovery efficiency in scenarios such as network jitter or unplanned restarts, avoiding the resource burden and connection interruption risks associated with a full re-authentication process.
[0021] The present invention also introduces timestamp verification, serial number verification, session key refresh, two-way encrypted communication and anti-DoS processing mechanism in the process of authentication information generation and transmission, constructs a multi-dimensional protection structure, and enhances the overall system's defense capabilities against various threats such as timing attacks, replay attacks, and spoofing attacks. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0023] Figure 1 An overall flow chart of a method for secondary authentication of a digital terminal in a power system based on quantum key is provided as an embodiment of the present invention.
[0024] Figure 2 A flowchart illustrating an optional DoS defense mechanism for a quantum key-based secondary authentication method for a power system digital terminal according to an embodiment of the present invention.
[0025] Figure 3 A schematic diagram of the time synchronization verification process for encrypted communication of a power system digital terminal secondary authentication method based on quantum keys provided by one embodiment of the present invention.
[0026] Figure 4A schematic diagram of the session migration and rapid re-authentication process of a secondary authentication method for a power system digital terminal based on quantum key is provided as an embodiment of the present invention.
[0027] Figure 5 A schematic diagram of the initial key negotiation process based on elliptic curve cryptography for a secondary authentication method for a power system digital terminal based on quantum key provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0028] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, the following detailed description of the specific embodiments of the present invention is given in conjunction with the accompanying drawings. It is obvious that the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in this field without creative work should fall within the scope of protection of the present invention.
[0029] Embodiment 1 is an embodiment of the present invention, which provides a secondary authentication method for a power system digital terminal based on quantum key, including: In existing technologies, the secondary authentication method between power system terminals and quantum security service platforms can achieve identity authentication by constructing bidirectional message authentication codes (MACab and MACba) using random numbers and quantum key identifiers. However, the authentication process still has the following key issues: 1. Existing technologies rely directly on pre-shared quantum keys for authentication calculations, without a controllable session key update mechanism. Once this key is leaked during long-term operation, all sessions face information security risks.
[0030] 2. The authentication process does not introduce an independent, dynamically generated session key. Instead, it reuses a long-term key to generate a MAC. Once the long-term key is leaked, the historical communication content will also be exposed, and the system lacks forward secrecy capabilities.
[0031] 3. Although random numbers are used in authentication, no context binding mechanism or time constraint strategy is introduced to match the random numbers. If an attacker intercepts part of the communication content, they may replay the attack process by forging requests, endangering the platform response security.
[0032] 4. Existing solutions usually rely on multiple rounds of message interactions. In scenarios with large-scale concurrent terminal access or unstable networks, identity authentication failure or abnormal authentication status may easily occur due to step interruptions, affecting system stability and response efficiency.
[0033] In response to the key technical shortcomings in existing power system authentication schemes, a key derivation mechanism based on dual random number participation is designed in this embodiment to avoid the direct exposure of long-term master keys during the authentication process, fundamentally solving the security risks caused by the long-term validity of keys. At the same time, by clearly distinguishing the independent session keys generated for each authentication request, the isolation between sessions is enhanced, ensuring that even if a session key is leaked, it will not affect the security of other historical or subsequent sessions. In addition, random parameters generated by the platform and the terminal are introduced as derived inputs to strengthen the relevance of the authentication information, making it impossible to simply reuse it, thereby improving the ability to resist replay attacks. The entire authentication process compresses the message interaction rounds as much as possible while maintaining security strength. It is particularly suitable for large-scale access scenarios of power terminals and helps to improve the overall authentication processing efficiency and stability of the system.
[0034] The terminal and the platform pre-share a master key.
[0035] The terminal initiates a session authentication key request including a first random value to the platform.
[0036] After receiving the request, the platform generates a second random value.
[0037] The platform derives a session authentication key through a first key derivation function based on the master key, the first random value, and the second random value.
[0038] The platform sends the second random value to the terminal.
[0039] The terminal derives a session authentication key identical to that of the platform through a first key derivation function based on the master key, the first random value, and the second random value.
[0040] The terminal and the platform use the session authentication key to complete the two-way authentication process.
[0041] When the terminal initiates a session authentication key request, the request includes a first timestamp.
[0042] Verify whether the first timestamp is within a preset first time window before the platform derives a session authentication key.
[0043] The platform includes the second timestamp in the response sent to the terminal.
[0044] The terminal verifies whether the second timestamp is within a preset second time window before deriving the session authentication key.
[0045] An input to the first key derivation function includes a first timestamp and a second timestamp.
[0046] After the terminal and the platform complete the two-way authentication process, the terminal and the platform negotiate encryption parameters.
[0047] The encryption parameter is based on the session authentication key and the negotiated third random value and the fourth random value, and a session encryption key is derived by a second key derivation function.
[0048] Before the terminal and the platform communicate using the session encryption key, the process includes: the terminal encrypts the first known vector using the session encryption key and sends the encrypting vector to the platform.
[0049] The platform decrypts and verifies the first known vector using the currently derived session encryption key to confirm that the terminal has correctly derived the session encryption key.
[0050] The platform encrypts the second known vector using the session encryption key and sends the encrypted vector to the terminal.
[0051] The endpoint decrypts and verifies the second known vector using the currently derived session encryption key to confirm that the platform has correctly derived the session encryption key.
[0052] The terminal and the platform serve as communication senders and receivers to each other.
[0053] The communication sender attaches an incremented sending sequence number to each application data message to be sent, and uses the session encryption key to encrypt and authenticate the message attached with the sending sequence number.
[0054] After the communication receiver decrypts and authenticates the received message, it verifies whether the sequence number in the message is the expected sequence number, thereby completing the detection of message loss, disorder or replay.
[0055] The step of performing time synchronization verification when the terminal and the platform communicate using the session encryption key.
[0056] The terminal records the local sending time t1 and sends the time synchronization request message containing t1 to the platform through encrypted communication.
[0057] The platform records the local time t2 when the request is currently received and the local time t3 when the response is ready, and sends the time synchronization response message containing t1, t2, and t3 to the terminal through encrypted communication.
[0058] The terminal records the local time t4 when the response is received, and calculates the clock offset between the terminal and the platform based on t1, t2, t3, and t4.
[0059] Sending to the terminal or platform via encrypted communication also includes refreshing the session key.
[0060] The terminal or platform initiates a refresh request, and the two parties exchange new random values.
[0061] The terminal and the platform derive a new session authentication key and a new session encryption key based on the current session authentication key and the new random value.
[0062] Before the terminal initiates a session authentication key request, a denial of service attack defense step is also included.
[0063] The platform sends a computational puzzle to the terminal, and the terminal solves it to obtain the solution.
[0064] The terminal includes the puzzle solution in the current session authentication key request.
[0065] The platform verifies the validity of the puzzle solution before deriving the session authentication key.
[0066] The method for establishing the master key is that the terminal and the platform perform an elliptic curve key exchange protocol to negotiate a shared secret; the terminal and the platform derive the master key based on the shared secret.
[0067] After the terminal and the platform complete the two-way authentication process using the session authentication key, they enter the first secure session. The platform generates a migration token and a pre-master key and sends them to the terminal.
[0068] When the first secure session is interrupted, the terminal initiates a fast re-authentication request, which includes a migration token and a new terminal random value.
[0069] After the platform verifies that the migration token is valid, it derives a new session key with the terminal based on the pre-master key and the new random value and establishes a second secure session.
[0070] Example 2, reference Figures 1 to 5 In one embodiment of the present invention, a method for secondary authentication of a power system digital terminal based on quantum key is provided based on the previous embodiment, comprising: Session authentication key derivation and enhancement method based on master key.
[0071] This embodiment discloses the core steps of a method for secondary authentication of a power system digital terminal based on quantum key, especially the derivation process of the session authentication key, and combines optional timestamp verification and DoS defense mechanism. Figure 1 This method is applied between the power system terminal (hereinafter referred to as the terminal) and the quantum security service platform (hereinafter referred to as the platform), and both parties pre-share a long-term master key and a master key identifier .
[0072] The derivation process of the session authentication key specifically includes: Step S201: the terminal initiates a session authentication key request.
[0073] The terminal generates an initial random number (as the first random value) and sends a session authentication key request to the platform.
[0074] The request message can be expressed as: , in, It is a session authentication key request message sent by the terminal to the platform. REGISTER_REQ is the registration request type identifier. The master key identifier.
[0075] Step S202: The platform generates session authentication key material and responds.
[0076] After receiving the request, the platform uses the master key identifier Retrieve the corresponding long-term master key The platform generates a platform random number (as the second random value). The platform uses a key derivation function (KDF) based on 、 、 and a predefined context information (e.g., the string "AUTH_KEY_DERIVATION") to derive the session authentication key and a session key identifier The process can be expressed as: , in, Indicates a concatenation operation. KDF can be selected from functions that comply with the NIST SP800-108 standard, such as the HMAC-based extraction and expansion key derivation function (HKDF). The platform generates a random number for subsequent authentication. To ensure The platform can use 、 、 and Compute a key-derived message authentication code : , The platform will key identifier 、 、 and Sent to the terminal. The response message can be expressed as: .
[0077] in, This is the platform's response message.
[0078] Step S203: The terminal derives a session authentication key and verifies it.
[0079] After receiving the response from the platform, the terminal uses the locally stored and received And the one I generated before , using the same KDF (Key Derivation Function, KDF key derivation function) as the platform and Derive the session authentication key : , in, Derive a session authentication key for the endpoint, which then uses the long-term master key calculate , and verify Is it consistent with the received Consistent, among them, The key derivation calculated for the terminal confirms the message authentication code.
[0080] If there is a mismatch, the authentication is terminated, which may indicate Tampered with or the platform's identity is suspicious.
[0081] Step S204: Continue the original authentication process.
[0082] like Verification passed, the terminal confirms that it has established a connection with the platform (Right now ) reached an agreement. At this point, As a session identifier for subsequent authentication, As the session key. Subsequent two-way authentication steps (for example, the terminal generates a random number , calculate the message authentication code from the terminal to the platform and platform-to-terminal message authentication code etc.) will use this and Instead of using directly and .
[0083] An optional timestamp mechanism can be introduced into the above key derivation process to enhance the ability to resist replay attacks.
[0084] Step S201 ′: adding a timestamp to the terminal request.
[0085] The terminal also includes the current timestamp of the terminal in the request of step S201. (first timestamp). The request message becomes: .
[0086] Step S202': Add timestamp and checksum to the platform response.
[0087] After receiving the request, the platform first verifies freshness, for example, checking whether it is within a preset acceptable time window (relative to the current time of the platform ), that is, to judge Is it established? If invalid, the request is rejected. Valid, platform-generated random number and the platform's current timestamp (Second timestamp). Session authentication key The derivation can incorporate timestamp information into the input of the KDF: , Key Derivation Confirmation Message Authentication Code The calculation also includes timestamp information: , The platform response message becomes: , It should be further explained that the preset acceptable time window The value range of is: 1. Ideal environment: dedicated power network (such as a fiber-optic network).
[0088] In this environment, network latency is very low and stable, and clock synchronization accuracy is high. Typical values range from tens of milliseconds to hundreds of milliseconds (for example, 50ms to 500ms).
[0089] 2. Standard environment: high-quality public network (such as stable 4G / 5G network).
[0090] This is the access method used by many power IoT devices. Network latency is relatively controllable, but it is higher than that of a private network and can fluctuate. Typical values range from 1 to 5 seconds.
[0091] 3. Complex or harsh environments: Satellite communications, cross-border networks, and mobile networks with unstable signals. In these scenarios, network latency is high and extremely unstable, potentially causing delays of several seconds or even longer. Typical values range from 5 seconds to 30 seconds, or even longer.
[0092] Step S203 ′: adding timestamp verification to terminal derivation and verification.
[0093] After receiving the response, the terminal first checks freshness, for example, checking whether it is within a preset acceptable time window, i.e., the second time window (relative to the current time of the terminal) ), that is, to judge Is it true?
[0094] If the current timestamp If invalid, the authentication will be terminated.
[0095] If the current timestamp Valid, terminal use 、 、 and the timestamps of both parties , using the same KDF as the platform Terminal Computing and verify.
[0096] Step S204': The subsequent authentication includes a timestamp.
[0097] In subsequent use Authentication message (such as 、 ), the corresponding timestamp information should also be included in the calculation, for example: , , in The terminal sends The current timestamp at Sent by the platform The receiver also needs to verify the freshness of the timestamp in the corresponding message before verifying the MAC.
[0098] Optional DoS (Denial of Service) defense mechanism reference Figure 2 ,To prevent the platform from exhausting resources due to processing a large number of ,initial key derivation requests, a client puzzle mechanism can be introduced before ,the formal session authentication key request.
[0099] Step S301: The terminal initiates a preliminary registration request.
[0100] The terminal sends a lightweight preliminary registration request to the platform: , in, Hint for the master key identifier.
[0101] Step S302: The platform responds to the puzzle.
[0102] After receiving the initial request, the platform does not immediately execute Instead of doing expensive operations related to For example, to find a random number Make Before The bit is 0. (The challenge value Challenge given by the platform and a value X attempted by the terminal are concatenated together, and then the hash value of the concatenated new data is calculated.) The platform will challenge the puzzle and difficulty parameters (or a puzzle identifier pointing to a predefined puzzle ) is sent to the terminal: .
[0103] It should be further explained that the platform only sends one PID_puzzle. This method assumes that the platform and the terminal have pre-configured (or negotiated) a series of standard puzzles and each puzzle is numbered (this number is the PID_puzzle).
[0104] Step S303: The terminal solves the puzzle and initiates a complete request.
[0105] The terminal solves the puzzle and gets the solution Then, the terminal initiates a session authentication key request containing the puzzle solution (such as step S201 or S201'), and the request additionally contains (or )and .
[0106] A random value generated by the platform (server) and sent to the terminal can be considered the "stem" or "question" of a puzzle. The terminal must solve the puzzle based on this Challenge value. When the terminal sends the solution back to the platform, it must also include the original Challenge value, so that the platform can identify the puzzle to which the solution is addressed.
[0107] PID_puzzle: When the platform issues a puzzle, it can choose not to directly issue a Challenge, but instead issue a predefined puzzle ID (i.e., PID_puzzle). Therefore, when the terminal returns the answer, it also needs to tell the platform which puzzle ID it is solving.
[0108] The Solution is the "answer" to the puzzle found by the terminal through calculation. It is the specific value X that makes the calculation result of Hash(Challenge||X) meet certain conditions (such as the first k bits are 0). The terminal sends this Solution to the platform to prove that it has invested the necessary computing resources to complete the "assignment" assigned by the platform, thereby proving that it is a legitimate and sincere customer. For example: , Step S304: The platform verifies the puzzle solution and continues.
[0109] After the platform receives the request, it first quickly verifies for effectiveness.
[0110] If the solution is invalid, the platform rejects the request.
[0111] If the solution is valid, the platform will continue to perform the subsequent key derivation steps (such as step S202 or S202'). The calculation of should preferably also include puzzle-related information to enhance security: , It is to splice together the "challenge" of the puzzle and the "solution" of the puzzle, and then calculate a hash value.
[0112] The subsequent process is the same as above.
[0113] Through this embodiment, a dynamically derived session authentication key is used Replace long-term master key Direct participation in authentication improves the security of the master key. Combined with the timestamp mechanism, it enhances the ability to resist replay attacks. Combined with the puzzle mechanism, it mitigates the risk of the platform being subjected to DoS attacks.
[0114] Negotiation and confirmation of encrypted channels based on session authentication keys: Based on the "Session Authentication Key Derivation and Enhancement Method Based on Master Key", the session authentication key is described. After successful derivation and mutual authentication, how to further negotiate and derive the session encryption key? , and confirm the key to establish a secure encrypted communication channel.
[0115] Session encryption key negotiation assumes that the terminal and the platform have shared the session authentication key through the method of embodiment 1. and session identifier , and completed the identity authentication.
[0116] Step S401: The terminal initiates an encryption parameter negotiation request.
[0117] The terminal selects a set of encryption algorithm suites that it supports (for example, AES-GCM-128) and a random number used to derive the encryption key (as the third random value). The terminal uses this information together with the original message in the subsequent authentication steps (for example, the random number generated by the terminal). and the second timestamp recorded by the terminal authentication message) is sent to the platform.
[0118] For example, the message could be: , in, use Calculation, whose input should include a random number generated by the terminal to derive the encryption key and the list of cipher suites proposed by the endpoint (or hash values) to protect the integrity of these parameters: , in, is a standard hash function (such as SHA-256), Performs hash calculations on the list of cipher suites proposed to the endpoint.
[0119] Step S402: The platform selects encryption parameters and derives a session encryption key.
[0120] Platform Verification Afterwards, from Select a cryptographic algorithm suite that is supported by both parties and preferred by the platform. The platform generates a random number used to derive the encryption key (as the fourth random value).
[0121] Platform Usage (session authentication key) and (a random number generated by the platform for deriving cryptographic keys) and a context for cryptographic key derivation (e.g., "SESSION_ENCRYPTION_KEY") derives the session encryption key through a second key derivation function If the selected cipher suite is not AEAD (Authenticated Encryption with Associated Data) mode, a session integrity key may also be derived. .
[0122] , in, A context string used to derive encryption keys.
[0123] If AEAD is used (such as AES-GCM), only one key is usually derived .
[0124] Step S403: The platform responds to the encryption parameter selection.
[0125] The platform will select 、 Together with the original message in the subsequent steps of the authentication (e.g. ) are sent to the terminal together.
[0126] For example, the response message could be: , in, The encryption algorithm suite finally selected by the platform.
[0127] (Assume etc. have been transferred in the previous step or are included in calculation of ). The calculation of should also include these negotiated parameters at this time: , in, Hash calculations are performed for the cipher suite selected for the platform.
[0128] Step S404: The terminal derives a session encryption key.
[0129] Terminal Verification If the verification is successful, the terminal uses 、 (own), (received) and and Derive the same session encryption key and the session integrity key derived by the terminal side . At this time, there should be .
[0130] Session encryption keys are confirmed to ensure both parties are correctly derived and ready for use , to confirm the key.
[0131] Step S405: The terminal sends an encrypted key confirmation message.
[0132] The terminal constructs a first known vector (e.g., a fixed string), using the newly derived and selected It is encrypted and / or authenticated.
[0133] , in is the first initialization vector, is the first additional authentication data (which may contain ), For encryption actions, The session encryption key is used for this encryption operation To execute.
[0134] The ciphertext generated by the terminal (as well as and authentication tag, if separate) to the platform.
[0135] Step S406: The platform decrypts and verifies and sends an encrypted response.
[0136] The platform receives , using your own derived Decryption and / or verification is performed. If decryption / verification is successful and the recovered As expected If the two are consistent, the platform confirms that the terminal has been used correctly. The platform constructs its own second known vector , also use and It is encrypted and / or authenticated.
[0137] , The platform will Send to the terminal, is the second initialization vector, It is the second additional authentication data.
[0138] Indicates the "first known vector" recovered by the platform after decryption.
[0139] is the original, plaintext known vector.
[0140] When the platform receives After that, you will use your own key Decryption is performed. The data obtained after successful decryption is recorded in the document as The platform compares the recovered and it expected Whether they are completely consistent, to confirm whether the terminal's key and encryption operation are correct. "Here it stands for "the version decrypted / recovered by the other party".
[0141] Step S407: The terminal decrypts and verifies the key of the platform.
[0142] The terminal receives ,use Decryption and / or verification is performed. If decryption / verification is successful and the recovered As expected If the terminal confirms that the platform has been used correctly, .
[0143] At this point, both parties have successfully negotiated and confirmed the session encryption key , subsequent application data can be securely encrypted and integrity protected using this key and the selected encryption suite.
[0144] Sequence number management and time synchronization verification in encrypted communication: Based on the encrypted channel established by "Encrypted Channel Negotiation and Confirmation Based on Session Authentication Key", this article describes how to prevent message loss, disorder or replay through sequence number management, and how to use this secure channel for time synchronization verification.
[0145] Serial number management, through In an encrypted session, a sequence number is introduced for each message.
[0146] Step S501: Initialize the serial number.
[0147] The terminal and platform each initialize and send the serial number (Terminal sends), (Sent by the platform), and the expected receiving sequence number (the terminal expects to receive from the platform), (The platform expects to receive from the terminal).
[0148] in, Send serial number to the terminal, Send a serial number to the platform, The terminal expects to receive the serial number, is the expected receive sequence number.
[0149] Step S502: The sender encapsulates and sends the message.
[0150] When the sender (such as a terminal) has application data When you need to send: a. Send its current sequence number and Together they form a message .
[0151] b. Use and selected right Perform encryption and authentication to generate AAD may contain .
[0152] in, Indicates the plaintext message (Message). This is the original, unencrypted data before encryption. According to the description of step S502, M is composed of the current sending sequence number and the application data Payload to be transmitted. .
[0153] Represents the initialization vector. This is a random number that is It is used together in the encryption process. Its main purpose is to make the same M generate different ciphertexts each time it is encrypted, which is crucial to prevent attacks such as pattern analysis. The sender needs to It is sent to the recipient along with the ciphertext, because the recipient needs to use this same IV when decrypting.
[0154] (Additional Authenticated Data) This data will not be encrypted, but will be protected by the integrity of the encryption algorithm. In other words, the receiver can ensure that this data has not been tampered with during transmission. AAD may contain session This prevents an attacker from taking a message from one session and replaying it intact in another session.
[0155] c. The sender will Send to the recipient.
[0156] d. The sender Increment by 1.
[0157] Step S503: The receiver processes the message.
[0158] When the receiver (such as the platform) receives back: a. Use Decryption authentication, get If it fails, it is discarded.
[0159] It should be further explained that: It is the message recovered after decryption. This is the message that the receiver (such as the platform) receives the ciphertext and uses the key The result obtained after decryption and authentication with IV. If decryption is successful, the content of M' should be exactly the same as the original M of the sender.
[0160] Represents the send sequence number recovered from the decrypted message. This is the sequence number portion contained in M'. The receiver will and the expected receiving sequence number recorded by yourself Compare to check if messages are lost, out of order, or replayed.
[0161] b. Compare the received sequence number The expected received sequence number .like : The message sequence is correct. Processing , and Increment by 1. If : Message loss is detected. You can cache, discard, or request retransmission. If : The message is repeated or outdated. It should be discarded. When the platform sends a message to the terminal, it also follows the above steps and uses its and .
[0162] It should be further explained that: Represents the application data recovered from the decrypted message.
[0163] This is included in The application data portion of the packet. After all verifications (decryption, integrity, and sequence number) are passed, Payload is the valid data that is ultimately delivered to the upper-layer application for processing.
[0164] Time synchronization verification reference based on authenticated encryption Figure 3 , using the established encrypted channel with serial number for time synchronization verification.
[0165] Step S601: The terminal initiates a time synchronization request.
[0166] The terminal records its current local high-precision timestamp The terminal prepares the time synchronization request message ,Include This message is sent to the platform through the above-mentioned serial number management and encryption method (step S502), for example: , in, The encrypted time synchronization request (Request) ciphertext (Ciphertext), It is the initialization vector (IV) used to encrypt the time synchronization request (Request). It is additional authentication data used to encrypt time synchronization requests.
[0167] Step S602: The platform processes the request and responds.
[0168] The platform receives and decrypts the authentication , get the time synchronization response message restored after decryption and among them . (Terminal check Is it consistent with your own records? to confirm the correspondence of the responses.) The platform records the local time when it receives the message and the local time when processing is complete and the response is prepared . Platform preparation time synchronization response message ,Include , , This message is also sent back to the terminal using serial number management and encryption methods, for example: , in, Initialization vector for encrypted time synchronization response (Response).
[0169] Step S603: The terminal processes the response and calculates the deviation .
[0170] The terminal receives and decrypts the authentication ,get and among them , , . ( The "local time when the request was received" recorded by the platform The value of The "local time of ready response" recorded for the platform . The terminal records the local time when it receives the response The terminal uses four timestamps Calculating clock offset and one-way network delay : , , The terminal can be based on Verify that its time synchronization with the platform is within the allowed threshold and decide whether the local clock needs to be calibrated.
[0171] It should be further explained that: Currently, "terminals can Verify whether the time synchronization with the platform is within the allowable threshold. The allowable threshold is used to determine whether the offset θ between the two clocks is within the acceptable range.
[0172] This threshold is typically defined as the maximum tolerable clock error (MTCER) for a specific power system application. It's not a fixed standard, but rather determined by business requirements. For the "digital terminal" of this invention, the threshold needs to be determined based on its specific function. For control purposes, it might be in the tens of milliseconds; for meter reading or logging, an error of a few seconds is acceptable.
[0173] Session key refresh and fast reauthentication: how to refresh the session key during an established secure session and how to perform fast reauthentication after a session is interrupted.
[0174] Step S701: The platform prepares a refresh request.
[0175] The platform generates a new random number and the new session identifier The platform is ready to refresh the request message .
[0176] This message is encrypted using the current session key After serialization, encryption and authentication, it is sent to the terminal.
[0177] Step S702: The terminal processes the refresh request and derives a new key.
[0178] After the terminal decrypts and authenticates, and .
[0179] in, It is a new random number (Nonce) generated by the platform for this key refresh (Refresh) after the terminal decrypts and recovers it. This is the identifier of the new session (New Session) assigned by the platform and restored after decryption by the terminal.
[0180] The terminal generates its own new random number .
[0181] The terminal authenticates the key based on the current session and the new context Derive a new session authentication key and the new session encryption key .
[0182] This is the key refresh response message sent by the terminal to the platform. Is the context used to derive new authentication keys, Is the context used to derive new encryption keys.
[0183] For example: , , in, Authentication key for the new session, is the new session integrity key, A context string for deriving new encryption keys, A context string for deriving new authentication keys.
[0184] Terminal is ready to refresh response message and use the new After encryption, it is sent to the platform.
[0185] Step S703: The platform completes key refresh and confirms.
[0186] After receiving the response, the platform attempts to use its corresponding derived (expected) new Decryption. If successful, the platform confirms that the terminal has switched to the new key. The platform can choose to send a The encrypted final confirmation message.
[0187] Both parties subsequently used Communication is carried out and the serial number can be reset.
[0188] Session Migration and Fast Reauthentication Reference Figure 4 , allowing the terminal to quickly resume the session after session interruption and network switching.
[0189] Step S801: The platform generates a migration token.
[0190] In an active session (SessionA, key ), the platform generates a time-limited migration token for the terminal and an associated pre-master key .
[0191] Can be constructed as: , in, Represents an encryption function that uses a The encryption is performed using a special key, is the concatenation operator, is the expiration time, is the pre-master key B, The identifier of session A.
[0192] And comes with a .
[0193] in, is the message authentication code of the token, for The specific calculation process uses a special key , for the whole Calculate the HMAC value based on the content of the .
[0194] and It is the platform internal key.
[0195] It should be further explained that: as well as These two keys are internal to the platform, but they have different purposes. Therefore, they must be two different keys. This is an extremely important principle in cryptography called "key separation"—that is, "one key has only one purpose."
[0196] as well as These are two different secret keys managed internally by the platform. Following the best security practices of key separation, Specifically used for encryption to ensure the confidentiality of the token content; Specifically used to generate HMAC to ensure the integrity and immutability of the token. Assigning encryption, decryption, and authentication functions to different keys can prevent potential cryptographic attacks. The platform will (migrate tokens , the token's message authentication code )and The information is sent to the terminal through the secure channel of the first secure session Session A. The terminal stores the information.
[0197] Step S802: The terminal initiates a fast re-authentication request.
[0198] Session A is interrupted. After the terminal switches to another network, it initiates a fast re-authentication request to the platform: , in, For fast re-authentication requests, It is a data packet generated and encrypted by the platform. is the message authentication code used to verify the token, is a new random value generated by the terminal.
[0199] Fast Re-authentication Request. This is a message type identifier that tells the platform that this is a fast re-authentication request, not a normal initial authentication request.
[0200] Step S803: The platform verifies the token and derives a new session key.
[0201] Platform Verification and The validity of the certificate (including validity period, terminal identity, etc.).
[0202] If valid, the platform gets .
[0203] The platform generates a new platform random number and the second secure session, the new session .
[0204] Platform Usage 、 and Derive a new session authentication key and session encryption keys : , , in, It is the pre-master key B recovered after the platform decrypts the migration token. is a new random number generated by the terminal for a new session, is a new random number generated by the platform for a new session. is the key derivation function, The context string used to derive the authentication key during the re-authentication process. Context string used to derive encryption keys during the reauthentication process.
[0205] Step S804: The platform responds and completes re-authentication.
[0206] The platform uses the newly derived Calculate the message authentication code: , Response message: , in, is the identifier of session B, Message authentication code for the re-authentication process.
[0207] Step S805: The terminal derives a new session key and verifies it.
[0208] The terminal uses its stored pre-master key as well as .
[0209] Derive the authentication key of session B derived by the terminal The encryption key of session B derived from the terminal .
[0210] Terminal Computing And verify whether it is consistent with the received consistent.
[0211] If the authentication is successful, a new secure session SessionB is established, using .
[0212] Initial key negotiation based on elliptic curve public key cryptography: This embodiment provides an alternative or enhanced pre-shared master key The initial session authentication key is negotiated using Elliptic Curve Cryptography (ECC) , or for secure distribution This method can be combined with the DoS defense mechanism of Example 1. Figure 5 .
[0213] Prerequisite: The platform has a long-term ECC key pair ( ), public key Public or verifiable through a certificate. The terminal can dynamically generate a temporary ECC key pair. Is the platform's private key, is the generating point or base point.
[0214] Step S901: The terminal initiates a request including an ECC public key.
[0215] After the puzzle is verified, the terminal generates a temporary ECC key pair ( ).
[0216] in, is the temporary private key of the terminal, The temporary public key of the terminal.
[0217] The terminal's request message contains : , in, is a registration request, is the platform identifier to which the terminal wants to connect, is the terminal random number, is the terminal timestamp, It is the puzzle challenge value and solution, It is the temporary public key of the terminal.
[0218] Step S902: The platform verifies the request, generates a shared key and responds.
[0219] Platform verification puzzle solution (if puzzle mechanics are used) and effectiveness.
[0220] The platform uses its private key and the terminal's temporary public key Calculate part of the shared secret, For example (If static ECDH (Elliptic Curve Diffie-Hellman) is used).
[0221] What is being solved is not an unknown number, but a calculation process. It means that the platform uses its own private key and the public key of the terminal Perform a "point multiplication" operation on the elliptic curve to obtain a shared secret value that can only be calculated by the two communicating parties. is the intermediate shared secret.
[0222] A more common method that provides forward security is to use the Ephemeral Elliptic Curve Diffie-Hellman (ECDHE) key exchange.
[0223] The platform also generates its own temporary ECC key pair ( ).
[0224] in, It is the temporary private key of the platform. The temporary public key of the platform.
[0225] The platform uses its own temporary private key and the terminal's temporary public key Calculating the shared secret .
[0226] Platform based on (as well as , platform-generated etc.) to derive the session authentication key and session key identifier : , , in, To share a secret, is the terminal random number, is the random number of the platform, is the authentication key for the session, is the session identifier.
[0227] The platform can use its long-term private key For key negotiation parameters (such as ) to sign .
[0228] Platform response message: .
[0229] in, Is the platform's timestamp.
[0230] Step S903: The terminal calculates the shared key, verifies the signature, and derives the session key.
[0231] The terminal receives the response and verifies The terminal uses its temporary private key and the platform's temporary public key Calculating the shared secret .
[0232] due
[0233] Terminal verification signature (You need to have a trusted platform public key ).
[0234] If the signature is valid, the terminal uses Derived by the same KDF as the platform and .
[0235] The subsequent process is consistent with step S204 of the "session authentication key derivation and enhancement method based on the master key". Perform authentication and subsequent operations. If this method is used to distribute ,but It can be used as Or for encrypted transmission .
[0236] Example 3 is another embodiment of the present invention. This embodiment also provides an electronic device, which is suitable for a secondary authentication method for a power system digital terminal based on quantum key, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute computer-executable instructions to implement a secondary authentication method for a power system digital terminal based on quantum key as proposed in the above embodiment.
[0237] This embodiment also provides a storage medium having a computer program stored thereon. When the program is executed by a processor, the method for secondary authentication of a power system digital terminal based on quantum key as proposed in the above embodiment is implemented.
[0238] The storage medium proposed in this embodiment and the method for implementing a secondary authentication method for a power system digital terminal based on quantum key proposed in the above embodiment belong to the same inventive concept. Technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0239] From the above description of the embodiments, those skilled in the art will clearly understand that the present invention can be implemented using software and necessary general-purpose hardware. Of course, it can also be implemented using hardware, but in many cases the former is the preferred embodiment. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, can be embodied in the form of a software product. This software product can be stored on a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk, or optical disk, and includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute the methods of various embodiments of the present invention.
[0240] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A secondary authentication method for a power system digital terminal based on quantum key, characterized by: include, The terminal and the platform pre-share the master key; The terminal initiates a session authentication key request including a first random value to the platform; After receiving the request, the platform generates a second random value; The platform derives a session authentication key based on the master key, the first random value, and the second random value through a first key derivation function; The platform sends the second random value to the terminal; The terminal derives a session authentication key identical to that of the platform through a first key derivation function based on the master key, the first random value, and the second random value; The terminal and the platform use the session authentication key to complete the two-way authentication process.
2. The method for secondary authentication of a power system digital terminal based on quantum key according to claim 1, characterized in that: When the terminal initiates a session authentication key request, the request includes a first timestamp; Verifying that the first timestamp is within a preset first time window before the platform derives a session authentication key; The platform includes a second timestamp in the response sent to the terminal; The terminal verifies whether the second timestamp is within a preset second time window before deriving the session authentication key; Inputs of the first key derivation function include a first timestamp and a second timestamp.
3. The method for secondary authentication of a power system digital terminal based on quantum key according to claim 2, characterized in that: After the terminal and the platform complete the two-way authentication process, the terminal and the platform negotiate encryption parameters; The encryption parameter is based on the session authentication key and the negotiated third random value and the fourth random value, and a session encryption key is derived by a second key derivation function.
4. The method for secondary authentication of a power system digital terminal based on quantum key according to claim 3, characterized in that: Before the terminal and the platform communicate using the session encryption key, the method includes: the terminal encrypting the first known vector using the session encryption key and sending the first known vector to the platform; The platform decrypts and verifies the first known vector using the currently derived session encryption key to confirm that the terminal has correctly derived the session encryption key; The platform encrypts the second known vector using the session encryption key and sends the encrypted vector to the terminal. The endpoint decrypts and verifies the second known vector using the currently derived session encryption key to confirm that the platform has correctly derived the session encryption key.
5. The method for secondary authentication of a power system digital terminal based on quantum key according to claim 3, characterized in that: The terminal and the platform serve as a communication sender and a communication receiver to each other; The communication sender attaches an incrementing sending sequence number to each application data message to be sent, and uses the session encryption key to encrypt and authenticate the message with the sending sequence number attached; After the communication receiver decrypts and authenticates the received message, it verifies whether the sequence number in the message is the expected sequence number, thereby completing the detection of message loss, disorder or replay.
6. A method for secondary authentication of a power system digital terminal based on quantum key according to claim 5, characterized in that: The step of performing time synchronization verification when the terminal and the platform communicate using a session encryption key; The terminal records the local sending time t1 and sends the time synchronization request message containing t1 to the platform through encryption; The platform records the local time t2 when the request is received and the local time t3 when the response is ready, and encrypts the time synchronization response message containing t1, t2, and t3 and sends it to the terminal. The terminal records the local time t4 when the response is received, and calculates the clock offset between the terminal and the platform based on t1, t2, t3, and t4; Sending encrypted data to the terminal or platform also includes refreshing the session key; The terminal or platform initiates a refresh request, and both parties exchange new random values; The terminal and the platform derive a new session authentication key and a new session encryption key based on the current session authentication key and the new random value; Before the terminal initiates a session authentication key request, it also includes a denial of service attack defense step; The platform sends a computational puzzle to the terminal, which then solves it to obtain the solution. The terminal includes the puzzle solution in the current session authentication key request; The platform verifies the validity of the puzzle solution before deriving the session authentication key.
7. The method for secondary authentication of a power system digital terminal based on quantum key according to claim 6, characterized in that: The method for establishing the master key is that the terminal and the platform execute an elliptic curve key exchange protocol to negotiate a shared secret; the terminal and the platform derive the master key based on the shared secret.
8. The method for secondary authentication of a power system digital terminal based on quantum key according to claim 7, characterized in that: After the terminal and the platform complete a two-way authentication process using the session authentication key, they enter a first secure session. The platform generates a migration token and a pre-master key, and sends both to the terminal. When the first secure session is interrupted, the terminal initiates a fast reauthentication request, which includes a migration token and a new terminal random value; After the platform verifies that the migration token is valid, it derives a new session key with the terminal based on the pre-master key and the new random value and establishes a second secure session.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of a power system digital terminal secondary authentication method based on quantum key according to any one of claims 1 to 8 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of a power system digital terminal secondary authentication method based on quantum key according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Authentication and key negotiation method and device, and storage medium
CN114726555A
Mutual authentication method between mutual authentication devices based on session key and token, mutual authentication devices
KR1020170017455A
Service providing apparatus and method for authentication using post-quantum cryptography, and service providing system therefor
KR102662935B1
Method and system for quantum key distribution based on trusted computing
US20180109372A1
Authentication and key agreement method and system
WO2025025426A1