A smart lock security authentication method based on mobile terminal virtual credentials

By introducing random challenge values ​​and hash algorithms to generate dynamic tokens, and combining them with zero-knowledge proof algorithms for identity authentication, the structural security defects in smart lock security authentication are solved. This enables identity authentication to be completed without disclosing the original credential text, preventing replay attacks and ensuring both security and convenience.

CN122394811APending Publication Date: 2026-07-14DONGGUAN XINXINGXIN INTELLIGENT TECH CO
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
DONGGUAN XINXINGXIN INTELLIGENT TECH CO
Filing Date
2026-06-05
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Existing smart lock security authentication methods based on mobile terminal virtual credentials have structural security flaws, are vulnerable to attacks, and are difficult to complete identity verification without obtaining the user's original credentials, making it difficult to balance security and convenience.

Method used

A random perturbation mechanism is used to generate random challenge values. A hash algorithm and a zero-knowledge proof algorithm are combined to generate dynamic tokens and provide mathematical proofs. Identification is achieved through irreversible response digests and session binding credentials to prevent replay attacks.

Benefits of technology

It enables identity authentication without revealing the original credentials, preventing credential leakage and replay attacks, and ensuring a balance between security and convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122394811A_ABST
    Figure CN122394811A_ABST
Patent Text Reader

Abstract

The present application relates to the field of information security technology, and particularly relates to a kind of smart lock security authentication method based on mobile terminal virtual credential;Including door lock end generates non-repeated random challenge value using random disturbance mechanism;Mobile terminal utilizes HMAC algorithm to operate challenge value and credential identity key, generates dynamic token;Dynamic token is processed using hash algorithm to obtain response digest by one-way mapping;Zero-knowledge proof algorithm is used to construct mathematical proof body;Door lock end verifies proof body;Session binding credential is generated by chain check mechanism;Session isolation mechanism is used to mark consumed state and detect replay attack.The present application realizes identity authentication under zero contact condition of credential original text, effectively eliminates the possibility of replay attack, and ensures the security of credential key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of information security technology, specifically to a smart lock security authentication method based on mobile terminal virtual credentials. Background Technology

[0002] With the rapid development and widespread adoption of Internet of Things (IoT) technology, the field of smart home security access control is undergoing profound technological changes. Mobile terminals, as the core carriers of digital identity credentials, are playing an increasingly crucial role in physical access control scenarios such as door locks, turnstiles, and safes. Traditional wired mechanical keys are gradually being replaced by virtual credentials based on mobile terminals, allowing users to enter without keys via smartphones, greatly improving convenience. However, this transformation also brings serious security challenges: how to ensure the security, integrity, and unforgeability of virtual credentials in an open wireless communication environment without pre-defined trust boundaries has become a core research topic in smart lock security authentication technology.

[0003] However, existing smart lock security authentication methods based on mobile terminal virtual credentials generally suffer from structural security flaws. Most schemes require the mobile terminal to send the complete original credential text or directly deriveable key information to the lock for comparison and verification during the identity authentication process. This mechanism, overly reliant on real data transmission, makes the lock itself a high-risk node for exposing sensitive data. Attackers can easily obtain the complete content of the virtual credential by listening to radio signals, skimming communication data, or extracting credential information from the lock's memory, and then carry out copying, replay, or man-in-the-middle attacks. Furthermore, traditional schemes lack dynamic replay protection mechanisms, allowing attackers to record and replay the entire authentication process after a legitimate user has used the credential once, thus enabling unauthorized access.

[0004] More importantly, existing technologies struggle to authenticate users solely through parameter responses and mathematical relationships without accessing the original user credentials, creating a significant business conflict between security and convenience. Therefore, a smart lock security authentication method based on mobile terminal virtual credentials is desired. Summary of the Invention

[0005] The purpose of this invention is to address the aforementioned shortcomings in the prior art by providing a smart lock security authentication method based on mobile terminal virtual credentials.

[0006] The objective of this invention is achieved through the following technical solution: a smart lock security authentication method based on mobile terminal virtual credentials, comprising the following specific steps: Step 1: After receiving the proximity trigger signal from the mobile terminal, the door lock generates a non-repeating random challenge value using a random perturbation mechanism and broadcasts the challenge value to the mobile terminal in plaintext. The lifespan of the challenge value is constrained by a preset time window. If the time window is exceeded, the challenge is deemed invalid and regenerated.

[0007] Step 2: After obtaining the random challenge value, the mobile terminal retrieves the credential identity key from the local secure storage area and uses a hash-based message authentication code (HMAC) algorithm to perform joint calculation on the random challenge value and the credential identity key to obtain a dynamic token bound to this challenge. The dynamic token does not contain any reproducible information of the original credential text.

[0008] Step 3: For the dynamic token, a hash algorithm is used to perform one-way mapping to obtain a response digest. The response digest is irreversible, and no third party holding the response digest can recover the dynamic token or credential identity key from it.

[0009] Step 4: Based on the response digest, construct a mathematical proof for this challenge using a zero-knowledge proof algorithm. The proof declares to the door lock that the mobile terminal holds a valid credential, and the proof itself does not carry any fields of the original credential text or the credential identity key.

[0010] Step 5: After the door lock obtains the mathematical proof body, it verifies the mathematical relationship between the proof body and the random challenge value based on the pre-established public verification relationship. If the verification relationship is valid, it determines that the mobile terminal holds a valid credential identity.

[0011] Step 6: If the verification relationship is not established, the authentication request is deemed invalid and an alarm record is triggered.

[0012] Step 7: Based on the successful verification, the chain verification mechanism performs a hash chain binding on the credential identity identifier, random challenge value, and dynamic token digest of this authentication session to obtain the session binding credential, which serves as the sole basis for this unlocking authorization.

[0013] Step 8: After the door lock performs the unlocking action, the session isolation mechanism immediately marks the random challenge value, dynamic token and session binding credentials as consumed. If any of the above items are detected to be submitted repeatedly, it is determined to be a replay attack and the response is rejected, thereby completing the entire identity authentication process on the door lock end under the condition of zero contact with the original credentials.

[0014] Preferably, the random perturbation mechanism in step one is implemented based on a cryptographically secure random number generator, ensuring that the random challenge value generated each time has a uniform distribution characteristic within a predetermined numerical space, and that there is no repetition or correlation between two consecutive random challenge values ​​generated.

[0015] Preferably, the time window in step one is set based on the statistical evaluation value of the processing capacity and communication latency of the door lock. This time window ensures that the mobile terminal has enough time to complete the response calculation, while avoiding attackers having enough time to carry out brute-force or replay attacks.

[0016] Preferably, the local secure storage area in step two is implemented using a hardware-level security isolation mechanism. This secure storage area is independent of the general operating system of the mobile terminal. The credential identity key can only be processed within this secure storage area and cannot be directly accessed or extracted by external processes.

[0017] Preferably, the input parameters of the HMAC algorithm in step two include a random challenge value and a credential identity key. The calculation result generates a dynamic token bound to this challenge. The generation process of this dynamic token ensures that even with the same credential identity key, completely different token contents will be generated under different random challenge values.

[0018] Preferably, the hash algorithm in step three uses a standard cryptographic hash function, the output of which is collision resistant, meaning that it is impossible to find two different inputs that produce the same output digest value through computation.

[0019] Preferably, the one-way mapping process of the response digest in step three ensures that no bit information of the dynamic token can be obtained by reverse engineering from the response digest, nor can any feature information of the credential identity key be extracted from it.

[0020] Preferably, the zero-knowledge proof algorithm in step four is implemented based on a non-interactive zero-knowledge proof protocol. This protocol allows the prover to submit a mathematical proof body to the verifier. The prover can complete the proof process without online interaction, and the proof body does not reveal any actual content about the original credential or the credential identity key.

[0021] Preferably, the proposition proved by the mathematical proof in step four includes core statements such as the mobile terminal holding a valid identity key, the key being correctly combined with the random challenge value, and the response digest being generated based on the correct calculation result.

[0022] Preferably, in step five, the public verification relationship is pre-established and stored by the door lock. This verification relationship corresponds to the verification key of the zero-knowledge proof algorithm and is used to perform deterministic verification of the mathematical proof. The verification process only involves mathematical operations and does not involve any comparison operation of the original document or the document identity key.

[0023] Preferably, the mathematical operations for verifying the relationship in step five include multiple verification dimensions such as verifying the integrity of each component of the mathematical proof body, verifying the binding relationship between the random challenge value and the proof body, and verifying the logical consistency between the response digest and the proof body.

[0024] Preferably, the alarm record in step six includes the timestamp of this authentication request, the identification information of the mobile terminal, the classification of the reasons for the verification failure, etc. The door lock will store the alarm record in the local log area and can also upload it to the security management platform for subsequent analysis and processing.

[0025] Preferably, the hash chain binding process in step seven is implemented using iterative hash operation. First, the credential identity identifier is connected with the random challenge value to calculate the first hash value. Then, the first hash value is connected with the dynamic token digest to calculate the second hash value. The final hash value is used as the session binding credential.

[0026] Preferably, the session binding credential in step seven is unique and unpredictable. The generation of this credential depends on the complete context information of the current authentication session, and any attempt to forge the session binding credential will not pass the subsequent session isolation mechanism.

[0027] Preferably, the marking of the consumed state in step eight is implemented using a state table maintained internally by the door lock. This state table records all currently valid and consumed random challenge values, dynamic tokens, and session binding credentials. The update operation of the state table and the unlocking action are executed in the same transaction to ensure state consistency.

[0028] Preferably, in step eight, the replay attack detection mechanism first searches the status table to confirm whether the random challenge value, dynamic token, and session binding credentials contained in the request have been marked as consumed when it receives any authentication request at the door lock end. If they have been consumed, it immediately rejects the response and triggers an alarm record.

[0029] The beneficial effects of this invention are as follows: By introducing a random challenge value mechanism, this invention ensures that completely different challenge parameters are used in each authentication process, eliminating the possibility of credential replay attacks; by using the HMAC algorithm for dynamic token generation, the credential identity key will never leave the secure storage area of ​​the mobile terminal in plaintext under any circumstances; by using a one-way mapping process with a hash algorithm, the irreversibility of the response digest is achieved, and any third party that intercepts the response digest cannot recover the dynamic token or credential identity key from it; by using a zero-knowledge proof algorithm to construct a mathematical proof body, the mobile terminal can prove to the door lock that it holds a valid credential without exposing the original credential text, thereby completing identity authentication under zero-contact conditions of the original credential text at the door lock; by introducing a chain verification mechanism and a session isolation mechanism, this invention ensures that each unlocking authorization has a unique and non-reusable session binding credential, while effectively detecting and blocking replay attacks; this invention achieves the best balance between security and convenience while ensuring the security of virtual credentials and taking into account the convenience of user use. Attached Figure Description

[0030] The invention will be further illustrated with reference to the accompanying drawings, but the embodiments in the drawings do not constitute any limitation on the invention. For those skilled in the art, other drawings can be obtained based on the following drawings without any creative effort.

[0031] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0032] The present invention will be further described in conjunction with the following embodiments.

[0033] Example 1, by Figure 1 As can be seen, this embodiment describes a smart lock security authentication method based on mobile terminal virtual credentials in detail. The core of this method lies in using a zero-knowledge proof mechanism to authenticate the identity of the mobile terminal holding a valid credential. Throughout the authentication process, the lock does not access any reproducible information of the original credential, thus fundamentally cutting off the leakage path of sensitive data during the verification process.

[0034] In specific embodiments, the method of the present invention includes the following technical steps: generation and broadcasting of random challenge values, generation of dynamic tokens, one-way mapping of response digests, construction and verification of mathematical proofs, generation of session binding credentials, and a replay attack protection mechanism. Each technical step is described in detail below.

[0035] Technical details of step one: After receiving a proximity trigger signal from a mobile terminal, the door lock performs a random challenge value generation operation. This proximity trigger signal is generated by the near-field communication module between the mobile terminal and the door lock. When the mobile terminal enters the effective sensing range of the door lock, the near-field communication module automatically establishes a connection and sends an identity verification request to the door lock. After receiving the request, the door lock's control processor triggers the start command of the random disturbance mechanism.

[0036] The random perturbation mechanism is implemented based on a cryptographically secure random number generator. This random number generator uses a hardware-level random source to generate a true random number sequence through physical phenomena such as thermal noise, quantum effects, or electromagnetic noise, rather than a software pseudo-random number generation algorithm. Each time it is called, the random number generator outputs a unique random number within a predetermined numerical space. This numerical space is set according to cryptographic security standards and typically uses a 256-bit or 512-bit binary representation space. The random number generator ensures that the random challenge value generated each time has a uniform distribution characteristic within the numerical space, that is, the probability of any value appearing is basically the same, and there is no statistically significant correlation between two consecutive random challenge values, making it impossible to predict the content of subsequent challenge values ​​from known challenge values.

[0037] The generated random challenge value is broadcast to the mobile terminal in plaintext via the door lock's wireless communication module. This plaintext broadcasting method ensures that the mobile terminal can directly obtain the original content of the challenge value without additional decryption. The lifespan of the random challenge value is constrained by a preset time window, the length of which is determined based on a statistical evaluation of the door lock's processing power and communication latency. Specifically, the door lock records the generation timestamp when generating the random challenge value and stores this timestamp along with the random challenge value in its internal list of valid challenge values. When the mobile terminal sends a response to the door lock within the time window, the door lock verifies whether the current time is within the validity period of the time window. If the current time exceeds the time window's limit, the random challenge value is deemed invalid, any response generated based on the challenge value is rejected, and a new round of random challenge value generation is automatically triggered. The time window setting ensures that the mobile terminal has sufficient time to complete the response calculation while preventing attackers from having ample time for brute-force attacks or replay attacks.

[0038] Technical details of step two: After obtaining a random challenge value, the mobile terminal enters the dynamic token generation stage. The core operations of this stage are completed in the mobile terminal's local secure storage area. The local secure storage area is implemented using a hardware-level security isolation mechanism, which is usually manifested as a dedicated security chip or trusted execution environment inside the mobile terminal. This secure storage area is independent of the mobile terminal's general operating system. The credential identity key is stored in the encrypted storage area of ​​the secure storage area and cannot be directly accessed or extracted by the external general operating system. Any operation that attempts to read the credential identity key from the outside will be blocked by the security hardware to ensure the confidentiality of the key.

[0039] During the generation of the dynamic token, the mobile terminal's control processor first sends a key retrieval request to the secure storage area, which contains a random challenge value for this authentication session. Upon receiving the request, the secure storage area retrieves the credential identity key bound to the current user account from the encrypted storage area. This credential identity key is distributed and securely stored in advance by the authorization management system during the credential registration phase, and its generation process follows key management security standards to ensure that each mobile terminal holds a unique credential identity key.

[0040] The secure storage area uses the HMAC algorithm to perform joint operations on the random challenge value and the credential identity key. The input parameters of the HMAC algorithm include the random challenge value and the credential identity key, and the operation result generates a dynamic token bound to the current challenge. The generation process of this dynamic token has a high degree of non-determinism. Even if the same credential identity key is used to perform HMAC operations with different random challenge values, completely different token contents will be generated. This binding characteristic ensures that the dynamic token generated in each authentication session is unique and cannot be impersonated by attackers by replaying the token contents of past sessions.

[0041] After the dynamic token is generated, it is output from the secure storage area to the application processing layer of the mobile terminal. The dynamic token does not contain any reproducible information of the original credential, that is, even if the attacker obtains the contents of the dynamic token, he will not be able to extract or restore any bit information of the original credential identity key. This security feature is guaranteed by the one-way function property of the HMAC algorithm. Its forward operation can be executed efficiently, but the reverse operation is computationally infeasible.

[0042] Technical details of step three: After obtaining the dynamic token, the application processing layer of the mobile terminal performs the operation of generating a response digest. This operation uses a standard cryptographic hash function to perform one-way mapping processing on the dynamic token. The selection of the hash function follows cryptographic security standards and usually adopts secure hash algorithms such as SHA-256, SHA-384 or SHA-512. The output of these algorithms is collision resistant, that is, it is impossible to find two different inputs that produce the same output digest value through computation.

[0043] During the one-way mapping process, the complete content of the dynamic token is used as the input parameter of the hash function, and the hash value of fixed length is obtained as the response digest after the operation. This response digest has strict irreversibility. No bit information of the dynamic token can be obtained from the response digest, nor can any feature information of the credential identity key be extracted from it. Even if the attacker obtains the random challenge value and the response digest at the same time, due to the one-way nature of the hash function, the attacker still cannot deduce the specific content of the dynamic token or the credential identity key from it.

[0044] After the response summary is generated, the mobile terminal encapsulates it together with the random challenge value into an authentication response data packet, which is then sent to the door lock via the wireless communication module. The transmission of this authentication response data packet adopts a standard communication protocol to ensure the integrity and reliability of the data during transmission.

[0045] Technical details for step four: After receiving the authentication response data packet sent by the mobile terminal, the door lock extracts the random challenge value and response digest content and forwards it to the local proof verification module; this module is responsible for verifying the mathematical proof submitted by the mobile terminal.

[0046] The construction of the mathematical proof body is completed on the mobile terminal. Based on the content of the response digest, the mobile terminal uses a zero-knowledge proof algorithm to construct a mathematical proof body for this challenge. The implementation of the zero-knowledge proof algorithm is based on a non-interactive zero-knowledge proof protocol, which allows the prover to submit a mathematical proof body to the verifier, and the prover can complete the proof process without online interaction. Commonly used non-interactive zero-knowledge proof protocols include zk-SNARK, zk-STARK, Bulletproofs, etc. These protocols ensure the credibility of the proof without revealing any actual content about the original credential or the credential identity key.

[0047] The propositions proved by the mathematical proof body contain the following core statements: First, the mobile terminal holds a valid credential identity key, which matches the credential identity pre-registered by the door lock terminal; second, the credential identity key and the current random challenge value are subjected to a correct HMAC joint operation, and the result generates a dynamic token; third, the response digest is generated based on the correct dynamic token after being processed by a one-way hash algorithm. The proof of these propositions is implemented through the mathematical construction of a zero-knowledge proof protocol, and the proof body itself does not carry any field information of the credential original text or the credential identity key.

[0048] After the mathematical proof is generated, the mobile terminal encapsulates it together with the random challenge value and response digest into a complete authentication request data packet, which is then sent to the door lock for verification.

[0049] Technical details for step five: After receiving the authentication request data packet, the proof verification module of the door lock extracts the mathematical proof body and the random challenge value from it, and performs deterministic verification of the proof body according to the pre-established public verification relationship. The public verification relationship is pre-established and stored by the door lock during the system initialization phase. This verification relationship corresponds to the verification key of the zero-knowledge proof algorithm and is used to perform mathematically deterministic verification of the mathematical proof body.

[0050] The verification process involves operations across multiple verification dimensions. First, the integrity of each component of the mathematical proof is checked to ensure that the proof has not been tampered with or damaged during transmission. Second, the binding relationship between the random challenge value and the proof is verified to confirm that the random challenge value contained in the proof is consistent with the random challenge value previously broadcast by the door lock, ensuring that the proof is generated based on the challenge value of the current session, rather than a replay of past sessions. Third, the logical consistency between the response digest and the proof is verified through mathematical operations to confirm whether there is an expected mathematical association between the content proved by the response digest and the proof.

[0051] If all the above verification dimensions pass, the verification relationship is established, the door lock determines that the mobile terminal holds a valid identity certificate, and enters the unlocking authorization process; if any verification dimension fails, the verification relationship is not established, and the door lock determines that this authentication request is invalid.

[0052] Technical details for step six: When the verification relationship in step five is not valid, the door lock executes the invalid authentication request processing procedure. This procedure first determines that the authentication request is invalid and refuses to perform the unlocking action. Then, it triggers the alarm recording mechanism to record the relevant information of the authentication request in the local log area of ​​the door lock.

[0053] The alarm log contains the following information fields: the timestamp of this authentication request, which is the specific time recorded by the local clock on the door lock; the identification information of the mobile terminal, including but not limited to the device serial number of the mobile terminal, the MAC address of the communication module or the application layer user identifier; and the classification of the reasons for the verification failure, which are classified into categories such as proof integrity verification failure, random challenge value binding verification failure or response digest logical consistency verification failure, based on the specific failure link in the verification process.

[0054] After the door lock stores the alarm records in the local log area, it can choose to upload them synchronously to the security management platform for subsequent analysis and processing. The security management platform summarizes and analyzes the alarm records to identify possible attack behaviors or system anomalies, and sends alarm notifications to the administrators.

[0055] Technical details for step seven: When the verification relationship in step five is established, the door lock enters the process of generating session binding credentials; this process is based on a chain verification mechanism, which performs hash chain binding processing on multiple key data of this authentication session.

[0056] The specific implementation process of the chain verification mechanism adopts iterative hash operation. First, the door lock terminal concatenates the credential identity identifier with the random challenge value to form the first-level connection data. The credential identity identifier is a unique identifier submitted by the mobile terminal in the authentication request, which is used to associate it with the specific user account registered in the door lock terminal system. The random challenge value is the challenge value generated by the door lock terminal at the beginning of this session. After concatenating these two data items, the first hash value is calculated using a hash algorithm.

[0057] Then, the door lock connects the first hash value with the dynamic token digest to form the second level of connection data; the dynamic token digest is the response digest content extracted from the authentication response submitted by the mobile terminal; after connecting the first hash value with the dynamic token digest, the second hash value is calculated using a hash algorithm; the final second hash value serves as the session binding credential for this authentication session.

[0058] Session binding credentials are unique and unpredictable; their generation depends on the complete context information of the current authentication session, including three data items: credential identity, random challenge value, and dynamic token digest; any attempt to forge session binding credentials will fail the subsequent session isolation mechanism because the forged credentials cannot be matched with the original data items at the time of generation.

[0059] After the session binding credentials are generated, the door lock terminal uses them as the sole basis for this unlocking authorization, triggering the unlocking execution module to perform the unlocking action.

[0060] Technical details for step eight: While performing the unlocking action, the door lock initiates a session isolation mechanism. This mechanism is responsible for marking the consumption status of relevant data in this authentication session and implementing the detection and blocking functions for replay attacks.

[0061] The consumption status is marked using a status table maintained internally by the door lock. The status table records all currently valid and consumed random challenge values, dynamic tokens, and session binding credentials. After the unlocking action is completed, the door lock marks the three data items of the current session's random challenge value, dynamic token digest, and session binding credentials as consumed and updates them to the status table. The status table update operation and the unlocking action are executed in the same transaction to ensure the atomicity of state consistency. That is, successful unlocking and successful status marking must be completed simultaneously. If either operation fails, the entire transaction is rolled back.

[0062] The replay attack detection mechanism is triggered first when the door lock receives any authentication request. The mechanism searches the status table to confirm whether the random challenge value, dynamic token digest, and session binding credentials contained in the request have been marked as consumed. If any of the above data items have been marked as consumed, the request is determined to be a replay attack, the response is immediately rejected, and an alarm is triggered. If none of the data items have been marked as consumed, the request is treated as a new valid authentication request and enters the normal verification process.

[0063] Through the above mechanism, the door lock terminal can complete the entire identity authentication process under the condition of zero contact with the original credential, while effectively preventing replay attacks. Each unlocking authorization is based on a unique session binding credential, and any attempt to illegally unlock the door by replaying a past successfully authenticated session will be blocked by the session isolation mechanism.

[0064] To better illustrate the technical implementation process of the method of the present invention, a specific application example is provided below for detailed explanation.

[0065] In a typical application scenario, the user holds a smartphone that supports virtual credentials as the unlocking credential carrier; the smartphone integrates a security chip or trusted execution environment to securely store the user's credential identity key; the smart lock is installed on the door frame of the user's residence and integrates a near-field communication module, a control processor, a wireless communication module, and an actuator.

[0066] When a user approaches the smart lock with their smartphone, the near-field communication module between the smartphone and the lock automatically establishes a connection. The smartphone sends an identity request to the lock, which includes the smartphone's application-layer user identifier. Upon receiving the request, the lock's control processor triggers a random perturbation mechanism, which starts a hardware random number generator to generate a 256-bit random challenge value. This random challenge value is then broadcast to the smartphone in plaintext via the lock's near-field communication module.

[0067] After receiving a random challenge value, the smartphone application sends a key retrieval request to its internal secure storage area. After verifying the validity of the request, the secure storage area retrieves the credential identity key bound to the current user account from the encrypted storage area. Subsequently, the secure storage area uses the HMAC-SHA256 algorithm to perform joint operations on the credential identity key and the received random challenge value to generate a dynamic token. The dynamic token is 256 bits long, and its content is entirely determined by the credential identity key and the random challenge value.

[0068] After the smartphone's application processing layer obtains the dynamic token, it uses the SHA-256 hash algorithm to perform a one-way mapping process on the dynamic token, obtaining a 256-bit response digest. Subsequently, the smartphone uses a zero-knowledge proof protocol to construct a mathematical proof based on the response digest. This proof proves that the smartphone holds a valid credential identity key, that the key and the random challenge value have been correctly HMAC-operated, and that the response digest has been correctly generated based on the dynamic token.

[0069] The smartphone encapsulates the mathematical proof, random challenge value, and response digest into an authentication request data packet and sends it to the door lock via the near-field communication module. The door lock's proof verification module verifies the mathematical proof, checking its integrity, the binding relationship of the random challenge value, and the logical consistency of the response digest. After successful verification, the door lock generates a session binding credential: first, it concatenates the credential identifier with the random challenge value and calculates the SHA-256 hash value; then, it concatenates this hash value with the response digest and calculates the SHA-256 hash value again. The final hash value is used as the session binding credential.

[0070] While performing the unlocking action, the door lock marks the random challenge value, response digest, and session binding credentials as consumed and records them in the status table; if a subsequent authentication request containing the same random challenge value, response digest, or session binding credentials is received, the door lock will refuse to respond and record an alarm.

[0071] Through the above technical solution, the door lock does not touch any reproducible information of the original credential during the entire authentication process. It only verifies the validity of the credential held by the mobile terminal through the verification of the mathematical proof, effectively preventing the risk of credential leakage and replay attacks.

[0072] Example 2

[0073] In an alternative implementation, a multi-factor authentication mechanism can be adopted for application scenarios with higher security requirements. This mechanism adds an additional biometric authentication step to the basic authentication process described above. Specifically, after completing identity verification based on zero-knowledge proof, the user also needs to perform biometric verification through the fingerprint sensor or facial recognition module of their smartphone. The result of the biometric verification is logically ANDed with the result of the zero-knowledge proof verification. Only when both verifications pass will the door lock perform the unlocking action. This multi-factor authentication mechanism further enhances the security of the system. Even if an attacker manages to obtain the mobile terminal and credential information, they will still be unable to pass the biometric verification checkpoint.

[0074] In another alternative implementation, for application scenarios where computing resources are limited at the door lock end, a lightweight zero-knowledge proof protocol can be adopted. Although standard zero-knowledge proof protocols have high security, the proof generation and verification process requires a large computational overhead. For door lock end devices with limited computing resources, lightweight zero-knowledge proof protocols such as Bulletproofs can be selected. This protocol significantly reduces the computational complexity of proof verification while ensuring the zero-knowledge characteristics, enabling it to run efficiently on resource-constrained door lock end hardware.

[0075] In another alternative implementation, for scenarios requiring offline authentication, an offline verification mechanism can be adopted. This mechanism pre-synchronizes and stores relevant verification parameters of authorized users at the door lock, including the hash value of the credential identity identifier, the verification key of the zero-knowledge proof, etc. When the door lock is offline, it can still verify the mathematical proof submitted by the mobile terminal based on the locally stored verification parameters to confirm that the mobile terminal holds a valid credential. The offline verification mechanism expands the application scope of the method of the present invention, enabling it to work normally in environments where network connectivity is unavailable.

[0076] Example 3

[0077] In an alternative implementation, for scenarios employing different near-field communication technologies, the broadcasting of random challenge values ​​and the transmission of authentication response data can be achieved based on either the Bluetooth Low Energy protocol or the near-field communication protocol. The Bluetooth Low Energy protocol features low power consumption, low latency, and wide compatibility, making it suitable for near-field communication scenarios between smartphones and smart locks. The near-field communication protocol, on the other hand, offers shorter communication distances and higher security, making it suitable for lock applications with high security requirements. Different communication protocols correspond to different communication parameters and data frame formats, but the core authentication logic remains unchanged.

[0078] In another alternative implementation, for scenarios requiring support for multiple user accounts, a multi-user management mechanism can be implemented on the door lock. This mechanism maintains the registration information of multiple user accounts in the local storage of the door lock, with each account associated with a unique credential identifier and corresponding verification parameters. When a mobile terminal submits an authentication request, the door lock retrieves the corresponding verification parameters based on the credential identifier included in the request and uses these verification parameters to verify the mathematical proof. The multi-user management mechanism allows the same smart door lock to serve multiple authorized users, with each user authenticating using their own smartphone and virtual credentials.

[0079] In another alternative implementation, for scenarios requiring authorization time limits, an authorization validity period can be set during the credential registration stage. Before verifying the mathematical proof, the door lock first checks whether the current time is within the authorization validity period. If the current time exceeds the authorization time range, the authentication request is directly rejected without subsequent zero-knowledge proof verification. The authorization time limit mechanism is suitable for application scenarios that require setting access time limits, such as short-term rentals of homestays and temporary visitors to enterprises.

[0080] In another alternative implementation, for scenarios requiring authorization limit, an upper limit for authorized usage can be set during the credential registration stage; after the door lock verifies the mathematical proof, it increments the usage counter of the credential identity and compares it with the upper limit for authorized usage; if the usage limit has been reached, the unlocking action is refused; the authorization limit mechanism is suitable for shared office spaces or rental scenarios that charge per use.

[0081] Finally, 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 scope of protection of 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 modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the essence and scope of the technical solutions of the present invention.

Claims

1. A smart lock security authentication method based on mobile terminal virtual credentials, characterized in that: Includes the following steps: Step 1: After receiving the proximity trigger signal from the mobile terminal, the door lock generates a random challenge value using a random perturbation mechanism and broadcasts the random challenge value to the mobile terminal in plaintext. The lifespan of the random challenge value is constrained by a preset time window. Step 2: After obtaining the random challenge value, the mobile terminal retrieves the credential identity key from the local secure storage area, performs a joint operation on the random challenge value and the credential identity key, and obtains a dynamic token bound to this challenge. Step 3: For dynamic tokens, a hash algorithm is used for one-way mapping to obtain the response digest; Step 4: Based on the response digest, construct a mathematical proof for this challenge using a zero-knowledge proof algorithm. This mathematical proof declares to the door lock that the mobile terminal holds a valid credential. Step 5: After the door lock obtains the mathematical proof body, it verifies the mathematical relationship between the proof body and the random challenge value based on the pre-established public verification relationship. Step 6: If the verification relationship is valid, perform hash chain binding on the credential identity identifier, random challenge value, and dynamic token digest of this authentication session to obtain the session binding credentials; Step 7: After the door lock performs the unlocking action, the session isolation mechanism marks the random challenge value, dynamic token and session binding credentials as consumed. If any item is detected to be submitted repeatedly, it is judged as a replay attack and the response is rejected.

2. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The random perturbation mechanism is implemented based on a cryptographically secure random number generator, ensuring that the random challenge value generated each time has a uniform distribution characteristic within a predetermined numerical space.

3. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The time window is set based on the statistical evaluation of the processing capacity and communication latency of the door lock, ensuring that the mobile terminal has enough time to complete the response calculation, while preventing attackers from having enough time to carry out brute-force or replay attacks.

4. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The local secure storage area is implemented using a hardware-level security isolation mechanism. This secure storage area is independent of the mobile terminal's general operating system, and the credential identity key can only be processed within this secure storage area.

5. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: In step two, the HMAC algorithm is used to perform joint calculations on the random challenge value and the credential identity key. The input parameters of the HMAC algorithm include the random challenge value and the credential identity key. The calculation result generates a dynamic token bound to this challenge. The generation process of this dynamic token ensures that even the same credential identity key will produce different token content under different random challenge values.

6. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The hash algorithm uses a standard cryptographic hash function, whose output is collision resistant, meaning that it is impossible to find two different inputs that produce the same output digest value through computation.

7. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The one-way mapping process of the response digest ensures that no bit information of the dynamic token can be obtained by reverse engineering from the response digest, nor can any feature information of the credential identity key be extracted from it.

8. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The zero-knowledge proof algorithm is implemented based on a non-interactive zero-knowledge proof protocol. This protocol allows the prover to submit a mathematical proof to the verifier, and the prover can complete the proof process without online interaction. At the same time, the proof does not reveal any actual content about the original credential or the credential identity key.

9. The smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The propositions proved by the mathematical proof include the core statement that the mobile terminal holds a valid identity key, that the key is correctly coupled with the random challenge value, and that the response digest is generated based on the correct computation result.

10. A smart lock security authentication method based on mobile terminal virtual credentials according to claim 1, characterized in that: The public verification relationship is pre-established and stored by the door lock. This verification relationship corresponds to the verification key of the zero-knowledge proof algorithm and is used to perform deterministic verification of the mathematical proof. The verification process only involves mathematical operations and does not involve any comparison operation of the original document or the identity key of the document.