Pqc-based device authentication method and electronic device

CN122969800APending Publication Date: 2026-10-23SHENZHEN SHANGSHU COM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611450357.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-18
Publication Date
2026-10-23

AI Technical Summary

Technical Problem

[0003]目前,传统的身份认证方案采用经典对称密码与哈希校验机制完成可信认证,该类密码体系易遭受量子算法攻击,密码原生安全强度被大幅削弱,认证交互中的响应凭证存在被破解、伪造的风险,攻击者能够冒充合法设备实现非法接入,进而,导致设备身份认证的安全性下降

Benefits of technology

可以看出,本申请中所描述的基于PQC的设备认证方法及电子设备,一方面,采用后量子密码(PQC)完成认证交互,能够抵御量子计算攻击;另一方面,通过设置认证握手报文、目标认证报文两级校验机制,分层拦截非法接入请求,只在校验全部通过后建立两端安全通道,确保接入设备身份可信,从而有效提高了设备身份认证的安全性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122969800A_ABST
    Figure CN122969800A_ABST
Patent Text Reader

Abstract

The application discloses a PQC-based device authentication method and an electronic device, and is applied to a server of a device authentication system. The method comprises the following steps: receiving an authentication handshake message of a device end; checking the authentication handshake message to obtain a first checking result; when the first checking result comprises a checking success, generating a server random number through a first QRNG module, and acquiring a server PQC private key; generating a session challenge value according to the authentication handshake message; determining a challenge response message according to the server random number, the server PQC private key and the session challenge value; sending the challenge response message to the device end; checking a target authentication message to obtain a second checking result; and when the second checking result comprises a checking success, establishing a secure channel between the server and the device end. The application embodiment improves the security of device identity authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of device authentication technology, and in particular to a device authentication method and electronic device based on PQC. Background Technology

[0002] In IoT and distributed systems, trusted identity authentication of connector devices is the core of ensuring system access and data transmission security.

[0003] Currently, traditional identity authentication schemes use classical symmetric cryptography and hash verification mechanisms to complete trusted authentication. This type of cryptographic system is vulnerable to quantum algorithm attacks, and the original security strength of the cryptography is greatly weakened. The response credentials in the authentication interaction are at risk of being cracked or forged. Attackers can impersonate legitimate devices to achieve unauthorized access, which in turn leads to a decline in the security of device identity authentication.

[0004] Therefore, improving the security of device authentication has become an urgent problem to be solved. Summary of the Invention

[0005] This application provides a device authentication method and electronic device based on PQC, which improves the security of device identity authentication.

[0006] In a first aspect, embodiments of this application provide a device authentication method based on PQC, applied to the server side of a device authentication system, wherein the device authentication system further includes a device side, the server side includes a first QRNG module, and the method includes: Receive the authentication handshake message from the device. The authentication handshake message is verified to obtain a first verification result; When the first verification result includes verification success, a server-side random number is generated through the first QRNG module, and a preset server-side PQC private key is obtained; The session challenge value for this authentication session is generated based on the authentication handshake message; The challenge response message is determined based on the server-side random number, the server-side PQC private key, and the session challenge value; The challenge response message is sent to the device, so that the device can generate a target authentication message based on the challenge response message and send the target authentication message to the server. The target authentication message is verified to obtain a second verification result; If the second verification result includes a successful verification, a secure channel is established between the server and the device.

[0007] Secondly, embodiments of this application provide a PQC-based device authentication method applied to the device side of a device authentication system. The device authentication system further includes a server side, the server side including a first QRNG module, and the method includes: An authentication handshake message is generated and sent to the server. When the authentication handshake message is successfully verified, the server determines a challenge response message based on a server random number randomly generated by the first QRNG module, a preset server PQC private key, and a session challenge value for the current authentication session generated based on the authentication handshake message. Receive the challenge response message returned by the server in response to the authentication handshake message; The challenge response message is verified to obtain the fifth verification result; When the fifth verification result includes a successful verification, a target authentication message is generated based on the challenge response message, and the target authentication message is sent to the server so that the server can verify the target authentication message. After the target authentication message passes the verification, a secure channel is established between the server and the device.

[0008] Thirdly, embodiments of this application provide an electronic device, including: a processor, a memory, a communication interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, and the programs include instructions for performing the steps in the first or second aspects of embodiments of this application.

[0009] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program for electronic data interchange, wherein the computer program causes a computer to perform some or all of the steps described in the first or second aspect of embodiments of this application.

[0010] Fifthly, embodiments of this application provide a computer program product, wherein the computer program product includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps described in the first or second aspects of embodiments of this application. The computer program product may be a software installation package.

[0011] Implementing this application will have the following beneficial effects: As can be seen, the device authentication method and electronic device based on PQC described in this application, on the one hand, uses post-quantum cryptography (PQC) to complete the authentication interaction, which can resist quantum computing attacks; on the other hand, by setting up a two-level verification mechanism of authentication handshake message and target authentication message, illegal access requests are intercepted in layers, and a secure channel between the two ends is established only after all verifications pass, ensuring that the identity of the access device is trustworthy, thereby effectively improving the security of device identity authentication. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application or the background art, the accompanying drawings used in the embodiments of this application or the background art will be described below.

[0013] Figure 1 This is a schematic diagram of the structure of a device authentication system provided in an embodiment of this application; Figure 2 This is a flowchart of a device authentication method based on PQC provided in an embodiment of this application; Figure 3 This is a flowchart of another PQC-based device authentication method provided in the embodiments of this application; Figure 4 This is a schematic diagram of the composition of a device provided in an embodiment of this application; Figure 5 This is a schematic diagram of the composition of a TPM module provided in an embodiment of this application; Figure 6 This is a functional unit block diagram of a device authentication apparatus based on PQC provided in an embodiment of this application; Figure 7 This is a functional unit block diagram of another PQC-based device authentication device provided in this application embodiment; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0014] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0015] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.

[0016] It should be understood that the term "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this document indicates that the preceding and following related objects are in an "or" relationship. In the embodiments of this application, "multiple" refers to two or more.

[0017] In the embodiments of this application, "at least one item" or its similar expression refers to any combination of these items, including any combination of a single item or a plurality of items. "One or more" means one or more, while "multiple" means two or more. For example, "at least one item" of a, b, or c can represent the following seven cases: a, b, c; a and b; a and c; b and c; a, b, and c. Each of a, b, and c can be an element or a set containing one or more elements.

[0018] In this application, the term "connection" refers to various connection methods, such as direct connection or indirect connection, to achieve communication between devices. This application does not impose any limitations on this.

[0019] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0020] The electronic devices described in this application embodiment may include smartphones (such as Android phones, iOS phones, Windows Phones, etc.), tablet computers, PDAs, laptops, video matrices, monitoring platforms, mobile internet devices (MIDs), or wearable devices, etc. The above are merely examples and not exhaustive, and include but are not limited to the above devices.

[0021] Of course, the aforementioned electronic devices can also serve as a device authentication system, or a server-side component of a device authentication system, or a device-side component of a device authentication system.

[0022] The following describes the relevant content, concepts, meanings, technical issues, technical solutions, and beneficial effects involved in the embodiments of this application.

[0023] First, let me explain some of the technical terms or phrases used in this application: PQC: Post-Quantum Cryptography, also known as quantum-resistant cryptography, refers to a cryptographic algorithm system that can resist attacks from both classical and quantum computers. Unlike traditional public-key cryptography that relies on problems such as discrete logarithms and large number factorization, its security is built upon mathematical problems that are difficult for quantum computers to solve efficiently, such as lattice problems and hash problems, resulting in high security.

[0024] QRNG: Quantum Random Number Generator, which generates true random numbers based on the intrinsic uncertainty of quantum mechanics; compared with pseudo-random number generators, its output random numbers have the characteristics of being unpredictable, unreproducible, and high-entropy.

[0025] TPM: Trusted Platform Module, a secure cryptographic hardware module conforming to the TCG Trusted Computing Organization specifications. It possesses secure key storage, platform integrity measurement, remote credentialing (Quote), and cryptographic computation capabilities, used to build a hardware root of trust for the device, supporting trusted device identity authentication and system integrity verification.

[0026] ECDSA: Elliptic Curve Digital Signature Algorithm, a classic digital signature algorithm based on the elliptic curve discrete logarithm problem, is widely used in traditional TPM Quote signatures; however, this algorithm is easily cracked by Shor's quantum algorithm, posing a quantum security risk.

[0027] PCR metric: Platform Configuration Register metric. PCR is a dedicated internal register of TPM, supporting only one-way extended hash operations. During system startup and operation, components such as firmware, bootloader, and kernel are hashed sequentially and iteratively written to the PCR. The final accumulated hash result is the PCR metric, used to characterize the integrity of the device's operating environment, and can be reported externally via TPM Quote.

[0028] TPM Quote: Platform state proof data generated by the Trusted Platform Module (TPM) includes a summary of the current value of the specified Platform Configuration Register (PCR) and external data provided by the caller (such as the hash value of the session random number), and is digitally signed by the authentication key inside the TPM. The server can verify the signature and PCR value to confirm that the current trusted boot state of the device has not been tampered with.

[0029] ML-DSA: Module-Lattice-Based Digital Signature Algorithm, also known as a post-quantum digital signature algorithm, is a digital signature algorithm developed according to the NIST FIPS 204 standard. It is a standardized and renamed version of the CRYSTALS-Dilithium algorithm and belongs to the post-quantum cryptography (PQC) system. ML-DSA includes three sets of security parameters: ML-DSA-44, ML-DSA-65, and ML-DSA-87, adapting to different security levels and scenarios.

[0030] SHA-256 Algorithm: A 256-bit secure hash algorithm belonging to the SHA-2 family, it is a classic one-way hash algorithm that follows the FIPS 180-4 standard. It can convert input data of arbitrary length into a fixed 256-bit hash digest; it possesses one-way and collision-resistant properties and is widely used for data integrity verification in traditional cryptographic systems. However, this algorithm cannot withstand the security threats posed by Grover's algorithm in quantum computers.

[0031] SHAKE128 Scalable Output Function: A scalable output hash function (XOF) constructed based on KECCALS permutations, conforming to the NIST FIPS 204 standard SHA-3 architecture. Unlike fixed-length hash algorithms, it can output bit sequences of arbitrary length as needed; it is a post-quantum compatible hash function, resistant to quantum computing attacks.

[0032] ML-KEM Algorithm: Module-Lattice-Based Key-Encapsulation Mechanism, belonging to post-quantum cryptography (PQC). Its security is based on the module-lattice learning error problem, making it resistant to quantum computer cracking; it supports public key encapsulation and private key decapsulation, allowing communicating parties to securely negotiate and share session keys.

[0033] Please see Figure 1 , Figure 1This is a schematic diagram of the structure of a device authentication system provided in an embodiment of this application; it can be seen that the device authentication system includes: a server and a device; wherein, the server includes a first QRNG module; the device includes a second QRNG module; wherein: The server acts as the authentication management entity, responsible for receiving handshake requests from the device, generating session random numbers and session challenge values, constructing challenge response messages, verifying the target authentication messages uploaded by the device, completing device trusted authentication, and establishing a secure channel with the device after successful authentication. The server has a built-in first QRNG module, which is used to generate high-entropy server random numbers as a session freshness factor to prevent replay attacks.

[0034] On the device side, for the connector device to be connected (e.g., IoT gateway, industrial controller, etc.), an authentication handshake is initiated, the challenge response message sent by the server is received and verified, a target authentication message containing TPM Quote signature data is generated and uploaded to the server; the device side has a built-in second QRNG module, which is used to generate device-side random numbers to participate in the construction of session challenge values, ensuring the uniqueness of each authentication session.

[0035] Please see Figure 2 , Figure 2 This is a flowchart of a PQC-based device authentication method provided in an embodiment of this application; applied to a server of a device authentication system, the device authentication system also includes a device side, the server includes a first QRNG module, and the method includes: S201. Receive the authentication handshake message from the device.

[0036] In this embodiment, authentication can be initiated by the device. The device calls the second QRNG module to generate a device-side random number; obtains the device's unique identifier, a preset device-side PQC public key, and information on the first authentication mode supported by the device; encapsulates the device-side random number, device unique identifier, device-side PQC public key, and first authentication mode information into a message according to a preset communication protocol, adds a message header and a checksum, and obtains an authentication handshake message. Then, the authentication handshake message is sent to the server. The preset communication protocol can include any of the following: TCP / IP protocol, MQTT protocol, CoAP protocol, WebSocket protocol, etc., and is not limited here.

[0037] The server can continuously listen for authentication requests from the device and receive communication messages (i.e., authentication handshake messages).

[0038] S202. Verify the authentication handshake message to obtain the first verification result.

[0039] In this embodiment, the authentication handshake message is parsed according to a preset communication protocol, verifying the message header, payload length, and built-in checksum; determining whether the message format is correct and whether the checksum matches; if any item has a problem, the first verification result is determined to be verification failure; if the message format is correct and the checksum matches successfully, all fields in the authentication handshake message can be extracted to obtain the device unique identifier, device-side PQC public key, first authentication mode information, device-side random number, etc. Then, each field is verified in turn: the device unique identifier is not empty, the format of the device-side PQC public key is compliant, and the length of the device-side random number conforms to the preset specification; the first authentication mode information is verified to belong to the pre-agreed set of legal modes. If any field is invalid, the first verification result is determined to be verification failure; if all fields are compliant, the first verification result is determined to be verification success.

[0040] In some embodiments, the server may further include a trusted device identifier whitelist. After extracting the unique identifier of the device, the server searches the trusted device identifier whitelist to determine whether the unique identifier of the device exists in the whitelist. If it does not exist, the first verification result is determined to be a verification failure. If the unique identifier of the device is included in the whitelist, it indicates that the device is a pre-registered trusted device. The server further verifies whether the device's PQC public key carried in the message is consistent with the filing public key stored on the server. If they are consistent, the first verification result is determined to be a verification success; if they are inconsistent, the first verification result is determined to be a verification failure.

[0041] S203. When the first verification result includes verification success, generate a server-side random number through the first QRNG module and obtain the preset server-side PQC private key.

[0042] In this embodiment, the server can call the built-in first QRNG module to start the quantum random number generation operation and output a server random number with a specified bit length (e.g., 32 bytes) and high entropy characteristics; at the same time, it can retrieve the pre-configured server PQC private key from the server's secure storage area.

[0043] The server-side PQC private key is permanently encrypted and stored in a secure server storage area, allowing access only through authorized authentication processes and prohibiting direct external reading.

[0044] S204. Generate the session challenge value for this authentication session based on the authentication handshake message.

[0045] In some embodiments, the device includes a second QRNG module, and the authentication handshake message includes: a unique device identifier, a preset device PQC public key, first authentication mode information supported by the device, and a device random number generated by the device through the second QRNG module; generating the session challenge value for this authentication session based on the authentication handshake message includes: S11. Determine the first string based on the random number from the device and the unique identifier of the device; S12. Determine the second string based on the device-side PQC public key; S13. Obtain the second authentication mode information supported by the server; S14. Determine the target authentication mode based on the second authentication mode information and the first authentication mode information; the target authentication mode includes any one of the following: ECDSA authentication mode, PQC priority compatibility mode, and PQC authentication mode. S15. Based on the target authentication mode, perform authentication processing on the first string and the second string to obtain the session challenge value.

[0046] In this embodiment of the application, the random number on the device side is generated by the second QRNG module and has a length of 32 bytes.

[0047] In a specific embodiment, the first string can be determined based on the device-side random number Nonce_D and the device's unique identifier ID. Specifically, Nonce_D and ID can be combined according to a preset encoding rule to generate the first string. The preset encoding rule can include any of the following: sequential concatenation, bitwise XOR, post-concatenation, etc., which are not limited here.

[0048] In some embodiments, the preset encoding rule can be sequential concatenation, concatenating Nonce_D first and ID last to obtain the first string.

[0049] Next, the second string can be determined based on the device's PQC public key. Specifically, the device's PQC public key can be hashed (for example, using the SHAKE128 extensible output function) to compress the public key into a fixed-length hash value as the second string. Then, the server's second authentication mode information can be obtained. Specifically, the server can read the locally supported authentication modes from its local configuration file to obtain at least one authentication mode, i.e., the second authentication mode information. Then, the target authentication mode can be determined based on the second authentication mode information and the first authentication mode information. Specifically, the intersection of the second and first authentication mode information can be taken. If the intersection contains only one authentication mode, that authentication mode is used as the target authentication mode. If the intersection contains multiple authentication modes, the authentication mode with the best security can be selected as the target authentication mode.

[0050] It should be explained that the ECDSA authentication mode uses only classical elliptic curve cryptography, which poses a security risk under the threat of quantum computing, resulting in the lowest security level. The PQC priority compatibility mode prioritizes the use of post-quantum algorithms while retaining compatibility support for ECDSA, offering a medium security level. The PQC authentication mode uses only NIST-standardized post-quantum cryptography algorithms, fully resisting known quantum computing attacks, and thus offering the highest security level.

[0051] Finally, based on the target authentication mode, the first string and the second string can be authenticated to obtain the session challenge value. Specifically, the target authentication identifier corresponding to the target authentication mode can be determined; for example, the target authentication identifier corresponding to the ECDSA authentication mode can be 0; the target authentication identifier corresponding to the PQC priority compatibility mode can be 1; and the target authentication identifier corresponding to the PQC authentication mode can be 2. Then, the target authentication identifier, the first string, and the second string are concatenated sequentially to obtain the third string. If the target authentication mode is the ECDSA authentication mode, the third string can be hashed using a first preset hash algorithm to generate a first hash value, which is then used as the session challenge value. The first hash algorithm is a classic secure hash algorithm, such as the SHA-256 algorithm.

[0052] If the target authentication mode is PQC priority compatibility mode, the third string can be hashed using the second preset hash algorithm to generate a second hash value. Then, the second hash value and the first hash value are concatenated to obtain a composite hash value, which is used as the session challenge value. The second hash algorithm is a post-quantum secure hash algorithm, such as the SHAKE128 extensible output function.

[0053] It should be explained that in PQC-preferred compatibility mode, the server will subsequently send the composite challenge value as the session challenge value to the device. After receiving the composite challenge value, the device can choose any of the following paths to complete authentication based on its own capabilities: 1. Parse the first challenge value component and complete the signature using the ECDSA algorithm; 2. Parse the second challenge value component and complete the signature using the PQC signature algorithm; the PQC signature algorithm may include any of the following: ML-DSA, SLH-DSA, FN-DSA, etc., without limitation.

[0054] 3. Two algorithms are used simultaneously for dual signatures to provide stronger security redundancy. This mode is suitable for the PQC migration transition phase, aiming to balance security enhancement and system compatibility.

[0055] If the target authentication mode is PQC authentication mode, the third string can be hashed using the second preset hash algorithm to generate a second hash value, which can then be used as the session challenge value.

[0056] Thus, by combining device-side random numbers, unique device identifiers, and device-side PQC public keys to construct a basic string, and negotiating the target authentication mode by combining the first authentication mode information reported by the device with the server's own second authentication mode information, a session challenge value is generated based on the differentiated calculations for different modes. This not only binds device identity and session random factors, ensuring that the challenge value is different for each session to resist replay attacks, but also achieves negotiation and adaptation of cryptographic capabilities between the server and the device, is compatible with traditional ECDSA links and post-quantum cryptographic links, smoothly completes the transition of the cryptographic system, and improves the universality and quantum security resistance of the authentication system.

[0057] S205. Determine the challenge response message based on the server-side random number, the server-side PQC private key, and the session challenge value.

[0058] In some embodiments, determining the challenge response message based on the server-side random number, the server-side PQC private key, and the session challenge value includes: S21. Determine the authentication request data based on the server-side random number and the session challenge value; S22. Sign the authentication request data using the server-side PQC private key to obtain the challenge response message.

[0059] In a specific embodiment, the server-side random number and the session challenge value can be concatenated together to obtain the authentication request data; then, the authentication request data is signed using the PQC signature algorithm with the server-side PQC private key to obtain the first digital signature; the authentication request data and the first digital signature are encapsulated and combined to form a challenge response message.

[0060] In this way, by combining the server-side random number with the session challenge value to form the authentication request data, and using the server-side PQC private key to sign and generate the challenge response message, on the one hand, the message is bound to the parameters of this session, ensuring the uniqueness of the session and resisting replay attacks; on the other hand, the server-side identity endorsement is achieved by relying on the post-quantum signature, and the device can verify the authenticity and integrity of the message through the server-side PQC public key, preventing man-in-the-middle forgery and building a quantum-resistant secure session interaction link.

[0061] S206. The challenge response message is sent to the device so that the device can generate a target authentication message based on the challenge response message and send the target authentication message to the server.

[0062] In this embodiment, the server can send a challenge response message to the device. After sending, the device uses the pre-stored server PQC public key to perform signature verification, confirming whether the challenge response message was sent by the server and whether it has been tampered with during transmission. If the verification is successful, the device generates the corresponding target authentication message based on the challenge response message and sends the target authentication message to the server. If the verification fails, a failure response is returned to the server, and the authentication is terminated.

[0063] S207. Verify the target authentication message to obtain a second verification result.

[0064] In some embodiments, the target authentication message includes: TPM Quote signature data and challenge response value; the verification of the target authentication message to obtain a second verification result includes: S31. Verify the TPM Quote signature data according to the device-side PQC public key to obtain a third verification result; S32. When the third verification result includes verification success, determine the PCR metric value and proof constraint data of the device based on the TPM Quote signature data; verify the PCR metric value and proof constraint data to obtain the fourth verification result; S33. When the fourth verification result includes verification success, determine the reference response value corresponding to the session challenge value; determine whether the challenge response value is consistent with the reference response value; if consistent, determine that the second verification result includes verification success; if inconsistent, determine that the second verification result includes verification failure.

[0065] In a specific embodiment, the PQC signature verification algorithm is adopted. The device-side PQC public key is used to perform a signature verification operation on the TPM Quote signature data. If the signature verification passes, the third verification result is a successful verification; if the signature verification fails, the third verification result is a failed verification. The PQC signature verification algorithm can be the ML-DSA-65 signature verification algorithm.

[0066] If the third verification result is a verification failure, the server will directly return an error response to the device and terminate the authentication.

[0067] When the third verification result includes successful verification, the PCR metric and proof constraint data on the device side are determined based on the TPM Quote signature data. Specifically, the internal payload of the TPM Quote signature data can be parsed to extract the PCR metric and proof constraint data. Then, the PCR metric and proof constraint data can be verified to obtain the fourth verification result.

[0068] If the fourth verification result includes a verification failure, the server will directly return an error response to the device and terminate the authentication.

[0069] If the fourth verification result includes verification success, the reference response value corresponding to the session challenge value is determined. Specifically, the server can calculate and generate a reference response value locally based on the session challenge value saved in this session, according to the agreed target authentication mode calculation rules. The challenge response value carried in the target authentication message is compared with the locally calculated reference response value to determine whether the two are consistent. If they are consistent, the second verification result is determined to include verification success; if they are inconsistent, the second verification result is determined to include verification failure.

[0070] In this way, by sequentially completing TPMQuote signature verification, proof of limited data, and challenge response value comparison, the device identity, operating status, and session interaction context are verified at multiple levels; relying on PQC signature to achieve quantum-resistant identity authentication, identifying device tampering behavior through PCR metric value, and binding session challenge value to prevent replay attacks, the security of the device authentication link is comprehensively improved.

[0071] In some embodiments, the proof constraint data includes server-side random numbers and device-side random numbers; the verification of the PCR metric and the proof constraint data to obtain a fourth verification result includes: S41. Determine whether the PCR metric value exists in the preset PCR metric value set. If it exists, perform freshness verification on the server-side random number and the device-side random number to obtain the first freshness verification result. S42. When the first freshness verification result includes verification success, determine that the fourth verification result includes verification success; S43. When the first freshness verification result includes verification failure, determine that the fourth verification result includes verification failure.

[0072] In this embodiment, the preset PCR metric set can be preset in advance or defaulted to; the preset PCR metric set stores the corresponding PCR standard metric values ​​under the scenario of a registered device starting normally and not being tampered with. Each trusted device corresponds to a PCR standard metric value, which serves as the basis for determining whether the device firmware, operating system, and boot components have been tampered with.

[0073] In a specific embodiment, a search can be performed in a preset PCR metric set to determine whether the PCR metric exists in the preset PCR metric set. If it exists, the freshness of the server-side random number and the device-side random number is checked to obtain a first freshness check result. Specifically, the first generation time of the server-side random number, the second generation time of the device-side random number, and the current time of the server can be obtained. The first duration is obtained by subtracting the first generation time from the current time. At the same time, the second duration is obtained by subtracting the second generation time from the current time. If both the first duration and the second duration are less than or equal to the preset session validity duration, the first freshness check result is a successful check; otherwise, the first freshness check result is a failed check.

[0074] In some embodiments, the server-side random number and device-side random number in the proof-limited data can be compared one by one with the device-side random number and server-side random number stored in the server's current session cache. If both sets of random numbers match and the current session has not exceeded the preset session validity period (e.g., 300ms), the first freshness verification result is a successful verification; if any set of random numbers does not match, or the session has exceeded the preset session validity period, the first freshness verification result is a failed verification.

[0075] If it does not exist, it means that the device has failed to start normally or may have been tampered with. In this case, you can terminate the authentication directly.

[0076] If the first freshness verification result includes verification success, then the fourth verification result is determined to include verification success. If the first freshness check result includes a check failure, then the fourth check result is determined to include a check failure.

[0077] Thus, by comparing the PCR metric value to verify the integrity of the device startup environment, and then verifying the random number to determine the session freshness, the fourth verification result is considered successful only when both conditions are met. This not only identifies whether the device firmware and system have been tampered with, but also ensures that the TPM Quote signature data belongs to the current session, blocks historical packet replay attacks, and constructs a dual security verification mechanism of trusted device environment and session context.

[0078] S208. When the second verification result includes verification success, a secure channel is established between the server and the device.

[0079] In some embodiments, establishing a secure channel between the server and the device includes: S51. Generate a session key through the first QRNG module; S52. Encrypt the session key using the device-side PQC public key to obtain encrypted session key data; S53. The session key encryption data is sent to the device so that the device can determine the session key based on the session key encryption data; S54. Establish a secure channel between the server and the device based on the session key.

[0080] In a specific embodiment, a quantum random number can be generated by calling the first QRNG module and used as the session key. Then, the session key can be encrypted using the device-side PQC public key to obtain encrypted session key data. Specifically, a post-quantum key encapsulation algorithm (e.g., ML-KEM algorithm) is used, with the device-side PQC public key as input, to perform key encapsulation operation on the session key and output key encapsulation ciphertext, i.e., encrypted session key data. Then, the encrypted session key data is sent to the device so that the device can determine the session key based on the encrypted session key data. Specifically, the device uses its local corresponding device-side PQC private key to perform the corresponding decapsulation operation, decrypt and recover the original session key, and complete the secure key negotiation interaction.

[0081] Finally, a secure channel can be established between the server and the device based on the session key. Specifically, the server and the device use the negotiated session key as the symmetric encryption key and adopt the agreed symmetric cryptographic algorithm to encrypt and decrypt bidirectional communication data, thus constructing an encrypted secure channel. Subsequent business data is transmitted in encrypted form within this channel to ensure the confidentiality and integrity of the communication data.

[0082] In summary, the PQC-based device authentication method described in this application, on the one hand, uses post-quantum cryptography (PQC) to complete the authentication interaction, which can resist quantum computing attacks; on the other hand, by setting up a two-level verification mechanism of authentication handshake message and target authentication message, illegal access requests are intercepted in layers, and a secure channel between the two ends is established only after all verifications pass, ensuring the trustworthiness of the access device's identity, thereby effectively improving the security of device identity authentication.

[0083] Please see Figure 3 , Figure 3 This is a flowchart of another PQC-based device authentication method provided in this application embodiment, applied to the device side of a device authentication system. The device authentication system further includes a server side, which includes a first QRNG module. The method includes: S301. Generate an authentication handshake message and send the authentication handshake message to the server. When the authentication handshake message is successfully verified, the server determines a challenge response message based on a server random number randomly generated by the first QRNG module, a preset server PQC private key, and a session challenge value for this authentication session generated based on the authentication handshake message.

[0084] In a specific embodiment, the device can call the second QRNG module to generate a device-side random number; read the locally stored device unique identifier, device-side PQC public key, and information on the first authentication mode it supports; encapsulate the device unique identifier, device-side PQC public key, first authentication mode information, and device-side random number according to a preset communication protocol to obtain an authentication handshake message; after the device completes the message assembly, it sends the authentication handshake message to the server according to the preset communication protocol to start the device authentication process.

[0085] After receiving the authentication handshake message, the server first verifies it. If the verification is successful, the server generates a corresponding challenge response message based on the server's random number, server PQC private key, and session challenge value, and sends the challenge response message to the device. The specific process of generating the challenge response message has been explained above and will not be repeated here.

[0086] S302. Receive the challenge response message returned by the server in response to the authentication handshake message.

[0087] In a specific embodiment, after the device sends an authentication handshake message, it waits to receive a challenge response message from the server. This challenge response message is the response data sent by the server after completing the handshake message verification, generating a session challenge value, and signing it.

[0088] S303. Verify the challenge response message to obtain the fifth verification result.

[0089] In some embodiments, the step of verifying the challenge response message to obtain a fifth verification result includes: S61. Verify the challenge response message according to the preset server PQC public key to obtain the sixth verification result; S62. When the sixth verification result includes verification success, the freshness of the server-side random number is verified to obtain the second freshness verification result. S63. When the second freshness verification result includes verification success, determine that the fifth verification result includes verification success; S64. When the second freshness verification result includes verification failure, determine that the fifth verification result includes verification failure.

[0090] In a specific embodiment, the challenge response message is verified according to the preset server-side PQC public key to obtain the sixth verification result. Specifically, the challenge response message can be split first to obtain the authentication request data and the first digital signature. Then, the PQC signature verification algorithm is used to perform a signature verification operation on the first digital signature using the server-side PQC public key. If the signature verification passes, the sixth verification result is a successful verification; if the signature verification fails, the sixth verification result is a failed verification.

[0091] If the sixth verification result includes a verification failure, an error response is returned and the authentication is terminated.

[0092] If the sixth verification result includes a successful verification, the server-side random number in the challenge response message is extracted, and the freshness of the server-side random number is verified to obtain the second freshness verification result. Specifically, the first generation time of the server-side random number and the current time of the device can be obtained. The third duration is obtained by subtracting the first generation time from the current time of the device. If the third duration is less than or equal to the preset session validity duration, the second freshness verification result is a successful verification; otherwise, the second freshness verification result is a failed verification.

[0093] It should be explained that time synchronization mechanisms (such as gPTP / NTP) can be deployed on the device and server sides to reduce clock deviation between the two ends and alleviate the problem of misjudgment of freshness verification caused by clock inconsistency.

[0094] In some embodiments, the challenge response message may further include a session identifier. The device receives the challenge response message and parses it to obtain the session identifier, and caches the session identifier corresponding to this handshake process locally. When performing freshness verification, in addition to determining that the third duration does not exceed the preset session validity duration, the device also compares whether the session identifier extracted from the message is consistent with the locally cached session identifier. Only when the duration condition and the session identifier matching condition are both met is the second freshness verification result determined to be successful; otherwise, the verification fails.

[0095] If the second freshness verification result includes "verification successful", the fifth verification result will be determined as "verification successful". If the second freshness check result includes a check failure, the fifth check result will be determined as a check failure.

[0096] Thus, by sequentially performing post-quantum signature verification of the challenge response message and server-side random number freshness verification, the fifth verification result is determined under dual constraints. This mechanism relies on the PQC signature verification message being issued by a trusted server and not tampered with, and combines timeliness and session identifier verification to block historical message replay attacks, ensuring that the device only responds to legitimate challenge commands corresponding to the current session.

[0097] S304. When the fifth verification result includes verification success, a target authentication message is generated according to the challenge response message, and the target authentication message is sent to the server so that the server can verify the target authentication message, and after the target authentication message passes the verification, a secure channel is established between the server and the device.

[0098] In a specific embodiment, when the fifth verification result includes verification success, a target authentication message is generated based on the challenge response message, and the target authentication message is sent to the server.

[0099] After receiving the target authentication message, the server verifies the message. If the verification is successful, a secure channel is established between the server and the device. It should be noted that the process of establishing the secure channel has been described above and will not be repeated here.

[0100] In some embodiments, please refer to Figure 4 , Figure 4 This is a schematic diagram of the composition of a device terminal provided in an embodiment of this application. It can be seen that the device terminal includes a second QRNG module and a TPM module; please refer to... Figure 5 , Figure 5 This is a schematic diagram of the composition of a TPM module provided in an embodiment of this application. As can be seen, the TPM module includes a PCR register; the TPM module stores the device-side PQC private key. S71, The step of generating a target authentication message based on the challenge response message includes: S72. Determine the proof constraint data based on the server-side random number and the device-side random number; the device-side random number is generated by the second QRNG module; S73. Read the PCR measurement value from the PCR register; S74. Determine the TPM Quote data based on the evidence-limited data and the PCR metric value; S75. Sign the TPM Quote data using the device-side PQC private key to obtain TPM Quote signed data; S76. Determine the challenge response value corresponding to the challenge response message; S77. Determine the target authentication message based on the TPM Quote signature data and the challenge response value.

[0101] In a specific embodiment, the device can call the second QRNG module to generate a quantum random number, i.e., a device-side random number. Then, the server-side random number and the device-side random number are combined and encapsulated to generate QuoteData. This data embeds two random numbers from the current session, which are used to bind the current authentication session and provide a basis for subsequent server-side freshness verification. Then, the TPM module can be called to read the PCR metric value stored in the PCR register of the TPM module. This PCR metric value characterizes the current firmware and system boot link of the device, reflecting the integrity of the device's operating environment.

[0102] Next, based on the proof constraint data and PCR metric value, the TPM Quote data is determined. Specifically, the proof constraint data and PCR metric value can be encapsulated and integrated to form the TPM Quote data. Then, the TPM Quote data is signed using the device-side PQC private key to obtain the TPM Quote signed data. Specifically, the PQC signature algorithm can be used to sign the TPM Quote data using the device-side PQC private key to obtain a second digital signature. The second digital signature is then encapsulated and combined with the TPM Quote data to form the TPM Quote signed data. Furthermore, the challenge response value corresponding to the challenge response message can be determined. Specifically, the device calculates and generates the challenge response value locally based on the session challenge value and the agreed-upon target authentication mode calculation rules, which serves as the challenge response credential. Finally, the target authentication message can be determined based on the TPM Quote signature data and the challenge response value. Specifically, the TPM Quote signature data and the challenge response value can be assembled into a message to obtain the target authentication message.

[0103] In this way, by integrating session random numbers and PCR metrics into TPM Quote data and signing them with PQC private keys, and simultaneously constructing target authentication messages with challenge response values, the integrity of the device system can be verified, quantum security protection can be achieved by relying on PQC signatures, and replay attacks can be resisted by binding sessions with random numbers, thus fully constructing a trusted identity authentication link for the device.

[0104] Please see Figure 6 , Figure 6 This is a functional unit block diagram of a PQC-based device authentication apparatus provided in an embodiment of this application; applied to the server side of a device authentication system, the device authentication system also includes a device side, the server side includes a first QRNG module, and the PQC-based device authentication apparatus 700 includes: The first receiving unit 701 is used to receive the authentication handshake message from the device. The first verification unit 702 is used to verify the authentication handshake message and obtain a first verification result; The first message generation unit 703 is configured to, when the first verification result includes verification success, generate a server-side random number through the first QRNG module and obtain a preset server-side PQC private key; generate a session challenge value for this authentication session based on the authentication handshake message; and determine a challenge response message based on the server-side random number, the server-side PQC private key, and the session challenge value. The first sending unit 704 is used to send the challenge response message to the device, so that the device can generate a target authentication message based on the challenge response message and send the target authentication message to the server. The first verification unit 702 is also used to verify the target authentication message and obtain a second verification result; The first channel establishment unit 705 is used to establish a secure channel between the server and the device when the second verification result includes verification success.

[0105] It should be noted that the functions of each unit module of the PQC-based device authentication device 700 provided in this embodiment can be specifically implemented according to the methods in the above method embodiments, and will not be repeated here.

[0106] Please see Figure 7 , Figure 7 This is a functional unit block diagram of another PQC-based device authentication device provided in this application embodiment; applied to the device end of a device authentication system, the device authentication system further includes a server end, the server end includes a first QRNG module, and the PQC-based device authentication device 700 includes: The second message generation unit 801 is used to generate an authentication handshake message and send the authentication handshake message to the server so that when the authentication handshake message is successfully verified, the server determines a challenge response message based on the server random number randomly generated by the first QRNG module, the preset server PQC private key, and the session challenge value of the current authentication session generated based on the authentication handshake message. The second receiving unit 802 is used to receive the challenge response message returned by the server in response to the authentication handshake message; The second verification unit 803 is used to verify the challenge response message and obtain the fifth verification result; The second message generation unit 801 is further configured to generate a target authentication message based on the challenge response message when the fifth verification result includes verification success, and send the target authentication message to the server so that the server can verify the target authentication message, and establish a secure channel between the server and the device after the target authentication message passes verification.

[0107] It should be noted that the functions of each unit module of the PQC-based device authentication device 700 provided in this embodiment can be specifically implemented according to the methods in the above method embodiments, and will not be repeated here.

[0108] Please see Figure 8 , Figure 8This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include a processor, a memory, a communication interface, and one or more programs. The processor, memory, and communication interface can be interconnected via a bus. The one or more programs are stored in the memory and configured to be executed by the processor. In this embodiment, the one or more programs include instructions for executing other implementations described in the above method embodiments, which will not be repeated here.

[0109] The processor can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, cells, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The communication unit can be a communication interface, transceiver, transceiver circuit, etc., and the storage unit can be a memory.

[0110] The memory can be volatile or non-volatile, or a combination of both. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), used as an external cache. By way of example, but not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous DRAM (DDR SDRAM), enhanced synchronous DRAM (ESDRAM), synchronous linked DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0111] It is understood that electronic devices may include more or fewer structural elements than those shown in the above block diagram, such as power modules, physical buttons, Wi-Fi modules, speakers, Bluetooth modules, sensors, display modules, etc., without limitation.

[0112] This application also provides a computer-readable storage medium storing a computer program for electronic data interchange, which causes a computer to perform some or all of the steps of any of the methods described in the above method embodiments, wherein the computer includes an electronic device.

[0113] This application also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods described in the above method embodiments. The computer program product may be a software installation package, and the computer may include an electronic device.

[0114] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0115] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0116] In the several embodiments provided in this application, it should be understood that the disclosed apparatus can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical or other forms.

[0117] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0118] The steps of the methods or algorithms described in the embodiments of this application can be implemented in hardware or by a processor executing software instructions. The software instructions can consist of corresponding software modules, which can be stored in RAM, flash memory, ROM, EPROM, electrically erasable programmable read-only memory (EEPROM), registers, hard disk, portable hard disk, read-only optical disk (CD-ROM), or any other form of storage medium well known in the art. An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and storage medium can reside in an ASIC. Furthermore, the ASIC can reside in a terminal device or management device. Alternatively, the processor and storage medium can exist as discrete components in the terminal device or management device.

[0119] Those skilled in the art will recognize that, in one or more of the examples above, the functions described in the embodiments of this application can be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated.

[0120] The aforementioned computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media.

[0121] The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., digital video discs (DVDs)), or semiconductor media (e.g., solid-state disks (SSDs)).

[0122] The modules / units included in the various devices and products described in the above embodiments can be software modules / units, hardware modules / units, or a combination of both. For example, for devices and products applied to or integrated into a chip, all modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits. For devices and products applied to or integrated into a chip module, all modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The implementation is achieved through a software program that runs on the processor integrated within the chip module. The remaining modules / units (if any) can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into terminal equipment, each of their modules / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components within the terminal equipment. Alternatively, at least some modules / units can be implemented through a software program that runs on the processor integrated within the terminal equipment, while the remaining modules / units (if any) can be implemented using hardware methods such as circuits.

[0123] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above descriptions are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A device authentication method based on PQC, characterized in that, A server-side application for a device authentication system, the device authentication system further including a device-side application, the server-side including a first QRNG module, the device-side including a second QRNG module, the method including: The authentication handshake message is received from the device. The generation process of the authentication handshake message includes: the device calling the second QRNG module to generate a device random number; obtaining the device unique identifier, the preset device PQC public key, and the first authentication mode information supported by the device; encapsulating the device random number, the device unique identifier, the device PQC public key, and the first authentication mode information according to a preset communication protocol, adding a message header and a checksum to obtain the authentication handshake message. The authentication handshake message is verified to obtain a first verification result; When the first verification result includes verification success, a server-side random number is generated through the first QRNG module, and a preset server-side PQC private key is obtained; The session challenge value for this authentication session is generated based on the authentication handshake message; the session challenge value is obtained by authenticating the authentication handshake message based on the first authentication mode information and the second authentication mode information supported by the server. The challenge response message is determined based on the server-side random number, the server-side PQC private key, and the session challenge value; The challenge response message is sent to the device, so that the device can generate a target authentication message based on the challenge response message and send the target authentication message to the server. The target authentication message is verified to obtain a second verification result; If the second verification result includes a successful verification, a secure channel is established between the server and the device.

2. The method as described in claim 1, characterized in that, The authentication handshake message includes: the device's unique identifier, the device's PQC public key, the first authentication mode information supported by the device, and the device's random number generated by the device through the second QRNG module; The step of generating the session challenge value for this authentication session based on the authentication handshake message includes: The first string is determined based on the random number generated by the device and the unique identifier of the device; The second string is determined based on the device-side PQC public key; Obtain the second authentication mode information supported by the server; The target authentication mode is determined based on the second authentication mode information and the first authentication mode information; the target authentication mode includes any one of the following: ECDSA authentication mode, PQC priority compatibility mode, and PQC authentication mode. Based on the target authentication mode, the first string and the second string are authenticated to obtain the session challenge value.

3. The method as described in claim 2, characterized in that, The step of determining the challenge response message based on the server-side random number, the server-side PQC private key, and the session challenge value includes: The authentication request data is determined based on the server-side random number and the session challenge value; The authentication request data is signed using the server-side PQC private key to obtain the challenge response message.

4. The method as described in claim 3, characterized in that, The target authentication message includes: TPM Quote signature data and challenge response value; The step of verifying the target authentication message to obtain a second verification result includes: The TPM Quote signature data is verified using the device-side PQC public key to obtain a third verification result. When the third verification result includes successful verification, the PCR metric value and proof constraint data of the device are determined based on the TPM Quote signature data; the PCR metric value and the proof constraint data are verified to obtain the fourth verification result; When the fourth verification result includes verification success, a reference response value corresponding to the session challenge value is determined; it is determined whether the challenge response value is consistent with the reference response value; if consistent, the second verification result is determined to include verification success; if inconsistent, the second verification result is determined to include verification failure.

5. The method as described in claim 4, characterized in that, The proof-limiting data includes the server-side random number and the device-side random number; The verification of the PCR metric and the evidentiary data yields a fourth verification result, including: Determine whether the PCR metric value exists in the preset PCR metric value set. If it exists, perform a freshness check on the server-side random number and the device-side random number to obtain a first freshness check result. If the first freshness verification result includes verification success, then the fourth verification result is determined to include verification success. If the first freshness verification result includes verification failure, then the fourth verification result is determined to include verification failure.

6. The method according to any one of claims 2-5, characterized in that, Establishing a secure channel between the server and the device includes: A session key is generated using the first QRNG module; The session key is encrypted using the device's PQC public key to obtain encrypted session key data; The session key encrypted data is sent to the device so that the device can determine the session key based on the session key encrypted data; A secure channel is established between the server and the device based on the session key.

7. A device authentication method based on PQC, characterized in that, The device side of the device authentication system is applied, and the device authentication system further includes a server side, the server side including a first QRNG module, and the device side including a second QRNG module; the method includes: An authentication handshake message is generated and sent to the server. When the authentication handshake message is successfully verified, the server determines a challenge response message based on a server-side random number randomly generated by the first QRNG module, a preset server-side PQC private key, and a session challenge value for the current authentication session generated based on the authentication handshake message. The session challenge value is obtained by authenticating the authentication handshake message based on the first authentication mode information supported by the device and the second authentication mode information supported by the server. Receive the challenge response message returned by the server in response to the authentication handshake message; The challenge response message is verified to obtain the fifth verification result; When the fifth verification result includes verification success, a target authentication message is generated based on the challenge response message, and the target authentication message is sent to the server so that the server can verify the target authentication message. After the target authentication message passes the verification, a secure channel is established between the server and the device. The generation of the authentication handshake message includes: The second QRNG module is invoked to generate a device-side random number; the device's unique identifier, the preset device-side PQC public key, and the first authentication mode information supported by the device are obtained; the device-side random number, the device's unique identifier, the device-side PQC public key, and the first authentication mode information are encapsulated according to a preset communication protocol, and a message header and a checksum are added to obtain the authentication handshake message.

8. The method as described in claim 7, characterized in that, The verification of the challenge response message to obtain the fifth verification result includes: The challenge response message is verified based on the preset server-side PQC public key to obtain the sixth verification result; When the sixth verification result includes a successful verification, the freshness of the server-side random number is verified to obtain a second freshness verification result. If the second freshness verification result includes verification success, then the fifth verification result is determined to include verification success. If the second freshness verification result includes verification failure, then the fifth verification result is determined to include verification failure.

9. The method as described in claim 8, characterized in that, The device also includes a TPM module; the TPM module includes a PCR register; the TPM module stores the device's PQC private key; The step of generating the target authentication message based on the challenge response message includes: The proof-limiting data is determined based on the server-side random number and the device-side random number; the device-side random number is generated by the second QRNG module. Read the PCR metric value from the PCR register; Based on the aforementioned proof-limiting data and the aforementioned PCR metric, the TPM Quote data was determined; The TPM Quote data is signed using the device's PQC private key to obtain TPM Quote signed data; Determine the challenge response value corresponding to the challenge response message; The target authentication message is determined based on the TPM Quote signature data and the challenge response value.

10. An electronic device, characterized in that, include: Processor, memory, communication interface, and one or more programs; The one or more programs are stored in the memory and configured to be executed by the processor, the programs including instructions for performing the steps of the method as described in any one of claims 1-9.