Door lock device based on TOTP algorithm
By using a smart door lock device based on the TOTP algorithm, a unique offline password is generated and privacy protection is enhanced, solving the usability and security issues of smart door locks in offline mode and achieving a highly secure and convenient unlocking experience.
Patent Information
- Application Number
- CN202420612702.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Utility models(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-28
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2034-03-28
AI Technical Summary
Existing smart locks have limited functionality when the network is unstable or offline, and password management poses security risks, especially in public rental housing management or visitor mode, where users cannot unlock the door normally, and the risk of password leakage is high.
The door lock device, which adopts the TOTP algorithm, generates and verifies a unique offline password by integrating a password input module, a storage module, a time calibration module, and a communication module into the lock body. It uses an NB-IoT module to maintain time synchronization, enhances availability in offline mode, and protects privacy through a shielding component.
It reduces the risk of password leakage, ensures that each unlock password is unique, improves availability and security in offline mode, enhances the flexibility and privacy protection of password management, and meets the security and ease of use requirements of modern smart home systems.
Smart Images

Figure CN223728271U_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The utility model relates to intelligent door lock technical field especially a door lock device based on TOTP algorithm. BACKGROUND
[0002] In the prior art, with the rapid development of information technology, smart home systems have become an important part of modern families, and the security and convenience of smart door locks, as the first line of defense for home security, have received widespread attention. Traditional door locks rely on physical keys, while smart door locks provide unlocking functions through various methods such as passwords, fingerprints, RFID cards, etc., greatly improving user convenience. However, these smart door lock systems usually rely on continuous network connections for remote control and monitoring. In the case of unstable or completely offline networks, the functionality of smart door locks may be limited, resulting in users being unable to unlock normally, especially in public rental housing management or visitor mode, where this problem is particularly prominent.
[0003] In addition, smart door locks also have certain security risks in password management. For example, password leaks, unauthorized access, and password cracking occur from time to time, which pose a threat to users' property security. Therefore, how to improve the usability of smart door locks in offline state while ensuring the security of passwords has become a technical problem that needs to be solved in this field. SUMMARY
[0004] To solve the above problems, the utility model provides a kind of door lock device based on TOTP algorithm, password does not exist in door lock end by network in advance, reduce the risk of password leakage.
[0005] To achieve the above purpose, the utility model provides a kind of door lock device based on TOTP algorithm in one aspect, including lock body, the interactive panel of being set to the surface of lock body and the circuit board in the inside of lock body, the circuit board is integrated with:
[0006] Password input module, configured on user interactive panel, for receiving the password input by user;
[0007] Storage module, for storing the unique serial number of door lock and the device key prewritten in door lock;
[0008] Time calibration module, for calibrating door lock time based on RTC function;
[0009] Communication module, for data interaction with cloud service platform, to receive offline password randomly generated by TOTP algorithm according to door lock serial number, current timestamp and device key by cloud service platform;
[0010] A password verification module is configured to verify the correctness and timeliness of the offline password based on the TOTP algorithm after the user inputs the password, and to unlock the door lock when the verification is passed.
[0011] To enhance privacy protection, a shielding component is arranged on the interaction panel and used to shield part of the password input module when the user inputs the password.
[0012] Further, the shielding component includes a shielding plate and a surrounding plate integrated with the interaction panel; the surrounding plate is designed in a U-shaped structure with an opening facing and surrounding the periphery of the password input module; the shielding plate is connected with the surrounding plate through magnetic elements or sliding rails, and the shielding plate is arranged in parallel with the interaction panel.
[0013] A method for generating offline password of door lock based on TOTP algorithm, using the door lock device based on TOTP algorithm in the above-mentioned scheme, comprising the following steps:
[0014] S101. The user submits a password application request to the cloud service platform through a mobile device or a computer terminal;
[0015] S102. After receiving the request, the cloud service platform sets the valid time length of the offline password according to the parameters specified by the user;
[0016] S103. The cloud service platform combines the unique serial number of the door lock, the current timestamp, and the device key, and uses the TOTP algorithm to calculate an offline password with a configurable length;
[0017] S104. The cloud service platform sends the generated offline password to the user;
[0018] S105. The user inputs the received offline password in the password input module of the door lock;
[0019] S106. The password verification module inside the door lock device verifies the correctness and timeliness of the input password using the TOTP algorithm;
[0020] S107. If the input offline password is confirmed to be correct and within the set valid time in the verification, the door lock device performs the unlocking operation.
[0021] To enhance security, when the door lock device first connects to the cloud service platform, the cloud service platform automatically records the initial login time, unique serial number, and pre-stored device key information of the door lock device.
[0022] To ensure password security, the algorithm formula of the TOTP algorithm is:
[0023] TOTP(K,X) = HMAC-SHA-1(K,(T-T0) / X) (1)
[0024] password=TRUNCATE(TOTP(K,X),L) (2)
[0025] In formula (1), HMAC-SHA-1 is a signature algorithm; K is a device key shared by the door lock end and the cloud service platform, and the serial number is consistent with the device key; T is a current timestamp, and T0 is an initial login timestamp when first connecting with the cloud service platform; and X is a valid time length for generating a password; in formula (2), L is a password length, and TRUNCATE is a function for truncating the length of the output value of the TOTP algorithm according to the length L.
[0026] The door lock device based on the TOTP algorithm designed in the utility model has a password generated without pre-existing in the door lock end through a network, so that the risk of password leakage is significantly reduced, and since the password generation is strictly based on the unique serial number and the real-time timestamp of the door lock, the password generated each time the door is unlocked is unique, ensuring extremely high security; in addition, the user can customize the valid time length of the password according to specific conditions, which not only improves the flexibility of password management, but also effectively prevents the abuse and long-time exposure of the password for invalid use, further enhances the security protection capability of the door lock, and meets the dual requirements of security and ease of use of the modern smart home system. BRIEF DESCRIPTION OF DRAWINGS
[0027] Figure 1 is a structure perspective view of the door lock device in the utility model;
[0028] Figure 2 is a plane structure schematic view of the door lock device in the utility model;
[0029] Figure 3 is an implementation interaction schematic view of the door lock device in the utility model;
[0030] Figure 4 is a flow chart of the use method of the door lock offline password generation of the TOTP algorithm in the utility model;
[0031] Figure 5 is a cloud service platform offline password generation process in the utility model. DETAILED DESCRIPTION
[0032] The preferred embodiments of the utility model are described below in combination with the drawings, and it should be understood that the preferred embodiments described herein are only used to illustrate and explain the utility model, and are not used to limit the utility model.
[0033] Embodiment 1.
[0034] As Figure 1 and Figure 2As shown, the embodiment provides a door lock device based on TOTP algorithm, which includes a lock body 10, an interactive panel arranged on the surface of the lock body 10, and a circuit board located inside the lock body 10, wherein the circuit board is integrated with:
[0035] a password input module 30 arranged on the user interactive panel, configured to receive the password input by the user;
[0036] a storage module 40 configured to store the unique serial number of the door lock and the device key pre-written into the door lock;
[0037] a time calibration module 50 configured to calibrate the time of the door lock based on the RTC function;
[0038] a communication module 60 configured to interact with the cloud service platform to receive the offline password randomly generated by the cloud service platform based on the door lock serial number, the current timestamp and the device key through the TOTP algorithm;
[0039] a password verification module 70 configured to verify the correctness and timeliness of the offline password based on the TOTP algorithm after the user inputs the password, and unlock the door lock when the verification is passed.
[0040] In the embodiment, the door lock device needs to calibrate its time based on the RTC function before factory inspection, to ensure that the built-in time calibration module 50 is consistent with the time of the cloud service platform (generally a server) or the error is controlled within a certain range, which helps the door lock to maintain the accuracy of the time in the offline or power-off state. Then when the door lock device first establishes a connection with the cloud service platform (i.e. first activated after installation), the cloud service platform is configured to automatically record the initial login time, unique serial number and pre-stored device key information of the door lock, which will be used for subsequent password generation and verification process.
[0041] Specifically, as Figure 3As shown, under normal network conditions, the lock body 10 keeps data interaction with the cloud service platform through the communication module 60, ensuring time synchronization, so as to avoid possible password generation error caused by time error. In the case of unstable network or offline, the user can initiate a password generation request to the cloud service platform through a mobile device or a computer terminal, provide identity information and required password validity duration, and the cloud service platform generates an offline password with specified validity duration according to the information (serial number, first login timestamp and device key) obtained when the lock device is connected for the first time and applies TOTP algorithm, and then sends the password to the user. In this embodiment, the communication module 60 adopts an NB module which supports NB-IoT (Narrowband Internet of Things) communication technology to connect to the network provided by a mobile network operator. Such connection can remain stable even in an environment with weak network signal, and the NB-IoT module is generally low in cost, which helps to reduce the cost of the entire smart lock system.
[0042] The user inputs the received offline password in the password input module 30 on the interactive panel of the lock body 10, and the password verification module 70 receives the input password, uses the serial number and device key in the storage module 40 and the calibrated RTC time provided by the time calibration module 50, and calculates an expected password value based on the TOTP algorithm. If the user input password is consistent with the expected password value and the password is within the validity duration, the lock body 10 will perform an unlocking operation to allow the user to enter smoothly.
[0043] In this way, by adopting the TOTP algorithm, the password generated by the lock device in this embodiment changes with the passage of time, ensuring that each password input is unique, and the generated password does not exist in the lock end in advance through the network, which greatly reduces the risk of password cracking. Even in the case of network interruption, the user can still use the offline password generated in advance by the cloud service platform to unlock, ensuring the availability of the lock.
[0044] In some embodiments, as Figure 1 shown, in order to enhance privacy protection, a shielding component 20 is arranged on the interactive panel, which is used to shield part of the password input module 30 when the user inputs the password. In this embodiment, the shielding component 20 can be a physical board, a flip cover structure, or a shielding curtain that can slide, which can effectively prevent onlookers or potential camera devices from peeping the password, greatly enhancing the privacy of the user when inputting the password.
[0045] Specifically, as Figure 1 and Figure 2As shown, the shielding assembly 20 includes a shielding plate 21 and a surrounding plate 22 integrated with the interactive panel; the surrounding plate 22 is designed as a U-shaped structure, the opening of which is arranged towards and around the periphery of the password input module 30; the shielding plate 21 is connected with the surrounding plate 22 through magnetic attraction or sliding rail, and the shielding plate 21 is arranged in parallel with the interactive panel. In this way, by using the physical barrier formed by the surrounding plate 22, when the user needs to input the password, the shielding plate 21 is moved into the U-shaped structure formed by the surrounding plate 22 through magnetic attraction or along the sliding rail, covering the password input module 30, to provide a private input space for the user, which protects the privacy of the user and does not affect the normal use of the door lock, and provides a safe and convenient unlocking experience.
[0046] On the other hand, as Figure 4 As shown, the present embodiment also provides a method for generating offline password of door lock based on TOTP algorithm, using the door lock device based on TOTP algorithm described in the above scheme, including the following steps:
[0047] S101. The user submits a password application request to the cloud service platform through a mobile device or a computer terminal; the request contains the user's identity verification information and the desired effective duration of the offline password.
[0048] S102. After receiving the request, the cloud service platform sets the effective duration of the offline password according to the parameters specified by the user;
[0049] S103. The cloud service platform combines the unique serial number of the door lock, the current timestamp and the device key, and uses the TOTP algorithm to calculate an offline password with a configurable length;
[0050] S104. The cloud service platform sends the generated offline password to the user;
[0051] Figure 5 A specific implementation flowchart of steps S102-S104 is shown, which is exemplary: after the cloud service platform receives the password application request from the user, it first verifies whether the user initiating the request has legal access rights, such as checking the status of the user's account, verifying the user's identity information, etc. If the user is determined to be illegal or has insufficient rights, the system will prompt the user with the corresponding information and terminate the process.
[0052] Then check whether the effective duration of the password requested by the user is within the pre-set reasonable range, for example, the system may not allow an effective duration of more than 24 hours, if the duration does not meet the requirements, the system will prompt the user that the application duration does not meet the requirements, and terminate the process or guide the user to resubmit a suitable duration.
[0053] Then the cloud service platform will check whether there is a corresponding door lock login record in the database according to the door lock serial number or identification in the user request. If the door lock does not exist, it may be due to a wrong serial number or the door lock is not registered. The system will prompt the user that the door lock does not exist and terminate the process or require the user to provide the correct door lock information. In this embodiment, when the door lock device first connects with the cloud service platform, the cloud service platform automatically records the initial login time, unique serial number and pre-stored device key information of the door lock device to help the cloud service platform verify whether there is a corresponding door lock in the database.
[0054] Further, the system will prompt the user that the password length is incorrect and terminate the process or guide the user to re-enter a password with a length that meets the requirements if the length of the password requested by the user does not meet the set security standard.
[0055] Once the above verifications are passed, the system will generate an offline password according to the unique serial number of the door lock, the current timestamp and the pre-stored device key using the TOTP algorithm. This password will have a valid time length specified by the user and is randomly generated, ensuring that each generated password is unique.
[0056] Specifically, the algorithm formula of the TOTP algorithm is:
[0057] TOTP(K, X) = HMAC-SHA-1(K, (T-T0) / X) (1)
[0058] password = TRUNCATE(TOTP(K, X), L) (2)
[0059] In formula (1), HMAC-SHA-1 is a signature algorithm; K is the device key shared by the door lock end and the cloud service platform, and the serial number is consistent with the device key; T is the current timestamp, T0 is the initial login timestamp when first connecting with the cloud service platform; X is the valid time length for generating the password; In formula (2), L is the password length, and TRUNCATE is a function that truncates the length of the output value of the TOTP algorithm according to the length L. In this embodiment, the serial number is usually a unique identifier, and when it is consistent with the device key, it can ensure that each door lock has a unique key, which increases the difficulty for crackers to try to copy or simulate the key.
[0060] S105. The user inputs the received offline password in the password input module 30 of the door lock;
[0061] S106. The password verification module 70 inside the door lock device verifies the correctness and timeliness of the input password by using the TOTP algorithm; that is, the password verification module 70 uses the TOTP algorithm to calculate an expected password value using the current time stamp (T), the door lock serial number and the device key (K), and the calculation process includes the application of the HMAC-SHA-1 hash function and the TRUNCATE function to generate a password value of the same length as the user input password.
[0062] S107. If the input offline password is confirmed to be correct and within the set valid time limit in the verification, the door lock device performs an unlocking operation.
[0063] The door lock device based on the TOTP algorithm designed by the utility model generates a password that does not exist in the door lock end in advance through the network, thereby significantly reducing the risk of password leakage, and since the password generation is strictly based on the unique serial number of the door lock and the real-time time stamp, the password generated each time the door is unlocked is unique, ensuring extremely high security, in addition, the user can customize the valid time length of the password according to the specific situation, which not only improves the flexibility of password management, but also effectively prevents the abuse and long-term exposure of the password, further enhances the security protection capability of the door lock, and meets the dual requirements of security and ease of use of the modern smart home system.
[0064] In the description of the utility model, it needs to be explained that the terms "vertical", "upper", "lower", "horizontal" and the like indicate the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the utility model and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be constructed and operated in a specific orientation, therefore, it cannot be understood as a limitation on the utility model.
[0065] In the description of the utility model, it also needs to be explained that unless otherwise explicitly specified and limited, the terms "set", "install", "connect", "connect" should be understood broadly, for example, it can be fixedly connected, or it can be detachably connected, or integrally connected; it can be mechanically connected, or it can be electrically connected; it can be directly connected, or it can be indirectly connected through an intermediate medium, or it can be the communication inside two elements. For ordinary skilled persons in the art, the specific meaning of the above terms in the utility model can be understood according to the specific situation.
[0066] Finally, it should be noted that: the above only for the preferred embodiments of the present application, and is not intended to limit the present application, although the foregoing embodiments of the present application has been described in detail, for the skilled in the art, it still can be modified, or for the equivalent replacement of part of the technical features of the technical solutions recorded in the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application, shall be included within the scope of the present application.
Claims
1. A TOTP algorithm-based door lock device, comprising a lock body, an interaction panel arranged on the surface of the lock body, and a circuit board located inside the lock body, characterized in that, The circuit board is integrated with a password input module configured on a user interaction panel and used for receiving a password input by a user, a storage module used for storing a unique serial number of the door lock and a device key pre-written into the door lock, a time calibration module used for calibrating a door lock time based on an RTC function, a communication module used for interacting with a cloud service platform to receive an offline password randomly generated by the cloud service platform according to the door lock serial number, a current time stamp and the device key through a TOTP algorithm, and a password verification module used for verifying the correctness and timeliness of the offline password based on the TOTP algorithm after the user inputs the password, and unlocking the door lock when the verification is passed. The interaction panel is provided with a shielding assembly used for shielding part of the password input module when the user inputs the password. The shielding assembly comprises a shielding plate and a surrounding plate assembled with the interaction panel as a whole; the surrounding plate is designed as a U-shaped structure, and the opening of the U-shaped structure is arranged towards and surrounds the periphery of the password input module; the shielding plate is connected with the surrounding plate through a magnetic attraction element or a sliding rail, and the shielding plate is arranged in parallel with the interaction panel.
Citation Information
Cited By
Door lock device based on TOTP algorithm and offline password generation and use method
CN118247871A