CN112381976A - One-time password verification method for electronic lock - Google Patents

One-time password verification method for electronic lock Download PDF

Info

Publication number
CN112381976A
CN112381976A CN202011283136.XA CN202011283136A CN112381976A CN 112381976 A CN112381976 A CN 112381976A CN 202011283136 A CN202011283136 A CN 202011283136A CN 112381976 A CN112381976 A CN 112381976A
Authority
CN
China
Prior art keywords
module
password
time password
time
counting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011283136.XA
Other languages
Chinese (zh)
Inventor
沈哲明
黄智�
杨友喜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ningbo Jiuchan Internet Of Things Technology Co ltd
Original Assignee
Ningbo Jiuchan Internet Of Things Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ningbo Jiuchan Internet Of Things Technology Co ltd filed Critical Ningbo Jiuchan Internet Of Things Technology Co ltd
Priority to CN202011283136.XA priority Critical patent/CN112381976A/en
Publication of CN112381976A publication Critical patent/CN112381976A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00817Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Lock And Its Accessories (AREA)

Abstract

The invention discloses a one-time password verification method of an electronic lock, which comprises a time module, a password input module and a processor, wherein the processor is internally provided with a one-time password generation module, a one-time password verification module, a locking counting module and a counting module, and comprises the following steps: the one-time password generating module generates a one-time password, the processor locks the counting module after receiving an input password and enters a counting mode, when the one-time password verification module compares the input password with the one-time password and finds that the input password cannot be compared with the one-time password, the counting module counts the number of unmatched numbers in the two passwords and compares the unmatched numbers with a threshold, if the number is larger than the threshold, unlocking fails, if the number is smaller than the threshold, the password is prompted to be input again, meanwhile, the counting module is locked for counting, the counted number is compared with a preset value, and if the counted number is larger than the preset value, unlocking fails. The invention improves the security of the lock and increases the fault-tolerant rate of the lock.

Description

One-time password verification method for electronic lock
Technical Field
The invention relates to the field of electronic locks, in particular to a one-time password verification method of an electronic lock.
Background
With the progress of science and technology, electronic locks have been widely used. The electronic lock in the market generally has a working mode that an administrator sets a group of digital passwords on the lock, and then in a lock closing state, the administrator can pass authority authentication and execute unlocking by inputting preset password numbers. The traditional electronic lock has the risk of leakage due to the fixed password value, and meanwhile, the risk of manually cracking the password violently exists. In the prior art, in order to increase the security of an electronic lock, a disposable password verification mode is selected for part of electronic locks, but the password in the disposable password verification mode can be used only once, namely the password needs to be regenerated after being used once, or an accurate password needs to be input in a short time, but old people or people with blurred vision have the problem of eyesight, and when the password is input, so that the disposable password of the electronic lock is updated too frequently, or the input process is too slow, so that the password is not input yet, the disposable password is replaced by the electronic lock, and the situation that the electronic lock can be unlocked only by inputting the password for many times occurs, which is very unfriendly for the old people or people with blurred vision, and wastes time.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a one-time password verification method for an electronic lock, which is used for solving the problem that the fault tolerance rate of the one-time password in the existing electronic lock is too low, so that the inconvenience is brought to the old or the people with blurred vision.
The invention is realized by the following technical scheme.
A one-time password verification method of an electronic lock comprises a time module, a password input module and a processor, wherein a one-time password generation module, a one-time password verification module, a locking counting module and a counting module are arranged in the processor, the one-time password verification module controls a driving module, and the method comprises the following steps: A) the one-time password generating module generates a one-time password according to the time information provided by the time module; B) after the processor receives the first digit transmitted by the password input module, the locking counting module enables the one-time password generating module to be in a locking state and enters a counting mode; C) the one-time password verification module compares the input password with the password generated by the one-time password generation module, if the input password is successfully compared with the password generated by the one-time password generation module, the step D is executed, and if the comparison is not successful, the step E is executed; D) driving to unlock, and unlocking by the locking counting module; E) the counting module counts the number of unmatched numbers on each digit in the input password and the password generated by the one-time password generating module, and if the counted number value is larger than a preset value, the step G is executed; if the counted number is smaller than the preset value, executing the step F; F) prompting to re-input the password, counting by the locking counting module, comparing a value obtained by counting with a threshold value, executing the step C if the value of the locking counting module is smaller than the threshold value, and executing the step G if the value of the locking counting module is larger than the threshold value; G) and if the unlocking fails, an alarm is given, and the locking counting module unlocks.
Preferably, the one-time password generation module comprises a counter T and a storage module, and the working process is as follows: generating a 4-byte system key ID with the time module and the processor; the system key ID and the counter T are used as dispersion factors, DES encryption is used for generating 8-byte ciphertext, the first 4 bytes are rolling codes A, and the second 4 bytes are encrypted ciphertext A; the 8-byte ciphertext is stored in a storage module, and the counter T extracts the 8-byte ciphertext and recombines the 8-byte ciphertext with the counter T to generate a group of 9-digit digital passwords.
Preferably, the one-time password verification module comprises a comparison module and a reverse reasoning module, and the working steps are as follows: inputting a password, reversely reasoning through the reverse reasoning module to obtain a rolling code B and an encrypted ciphertext B, judging whether the rolling code B is larger than the rolling code A or not by the comparing module, and executing the step E if the rolling code B is not larger than the rolling code A; if yes, whether the encrypted ciphertext B is consistent with the encrypted ciphertext A or not is judged.
Preferably, the generation formula of the system key ID is system key ID = current timestamp + processor.
Preferably, the 8-byte cipher text and the counter T are recombined in such a way that the first 4 bytes are rolling code a, the last 4 bytes are encrypted cipher text a, a random number between 0 and 9 is inserted at the end, the random number is an integer, the random number is changed into 4 digits according to a binary system, the 4 digits are all 0 or 1, the rolling code a and the encrypted cipher text a are sequentially extracted according to the 4 digits, when the digit is 0, two bytes of the rolling code a are respectively extracted according to a sequence from left to right and sequentially delayed to form 8 digital ciphers, and then the random number is added at the end to form a 9-digit cipher.
Preferably, in the step E, the preset value may be set according to an actual situation of the user.
Preferably, the threshold in step F can be set by the user according to the user's needs.
Compared with the prior art: after the processor receives a first number, the locking counting module locks the one-time password generating module and enters a counting mode, so that the password cannot be updated within the times set by a user, the fault tolerance rate of the electronic lock is increased, the situation that the one-time password generating module needs to generate a new password or the password is input every time the password is input by mistake is effectively avoided, the one-time password generating module is convenient for people to operate when the security is increased, and the use experience of the user is better.
Drawings
FIG. 1 is a flow chart of the present invention.
Fig. 2 is a schematic structural diagram of the present invention.
Detailed Description
The invention is further described with reference to the following drawings and detailed description.
A one-time password verification method of an electronic lock comprises a time module, a password input module and a processor, wherein a one-time password generation module, a one-time password verification module, a locking counting module and a counting module are arranged in the processor, the one-time password verification module controls a driving module, and the method comprises the following steps: A) the one-time password generating module generates a one-time password according to the time information provided by the time module; B) after the processor receives an input password, the locking counting module enables the one-time password generating module to be in a locking state and enters a counting mode; C) the one-time password verification module compares the input password with the password generated by the one-time password generation module, if the input password is successfully compared with the password generated by the one-time password generation module, the step D is executed, and if the comparison is not successful, the step E is executed; D) driving to unlock, and unlocking by the locking counting module; E) the counting module counts the number of unmatched numbers on each digit in the input password and the password generated by the one-time password generating module, and if the counted number value is larger than a preset value, the step G is executed; if the counted number is smaller than the preset value, executing the step F; F) prompting to re-input the password, counting by the locking counting module, comparing a value obtained by counting with a threshold value, executing the step C if the value of the locking counting module is smaller than the threshold value, and executing the step G if the value of the locking counting module is larger than the threshold value; G) and if the unlocking fails, an alarm is given, and the locking counting module unlocks.
The one-time password generation module generates a system key ID by using the time information provided by the time module and the processor, and the specific generation formula is that the system key ID is the current timestamp plus the processor. For example, the time module and the processor form a system key ID of 1234, and then the system key ID and the counter T are used as a dispersion factor to encrypt with DES to generate 8 bytes of ciphertext, where the first 4 bytes are rolling code a, and the last 4 bytes are encrypted ciphertext a, so that the rolling code a is 1234 and the encrypted ciphertext a is 5678.
The processor randomly inserts a random number 5, 5 with a binary number of 0101, the first bit of the binary number is 0, the first two bits are 1, 5, the second bit is 1, so the next two bits are 2, 3, the third bit is 0, the next two bits are 4, 6, so the last two bits are 7, 8, so the 8-bit code is 15234678, plus the random number 5, and the final 9-bit code is 152346785.
Assuming that the binary number of the random number 8, 8 is 1000, the first bit of the binary number is 1, the first two bits are 1, 2, then the second is 0, so the next two bits are 3, 5, then the third bit is 1, then the next two bits are 4, 6, so the last two bits are 7, 8, so the 8-bit password is 12354678, plus the random number 8, and the last 9-bit password is 123546788.
Assuming that the binary number of the random number 3, 8 is 0011, the first bit of the binary number is 0, the first two bits are 1, 5, then the second is 0, so the next two bits are 2, 6, then the third bit is 1, then the next two bits are 3, 4, so the last two bits are 7, 8, so the 8-bit password is 15263478, plus the random number 3, and the last 9-bit password is 152634783.
After the processor receives the password input by the password input module, the locking counting module in the processor firstly locks the one-time password generating module, so that the one-time password generating module cannot generate a new one-time password, and the locking counting module enters a counting mode. When entering the counting mode, the value of the locking counting module is 0, the value of the locking counting module is added with 1 every time the processor receives the password, and the value is compared with the preset value, if the value of the locking counting module is larger than the preset value, the unlocking is failed, and the locking of the one-time password generation module is released.
Inputting a 9-digit password through a password input module, carrying out reverse reasoning on the 9-digit password through a reverse reasoning module to obtain a rolling code B and an encrypted ciphertext B, judging whether the rolling code B is larger than the rolling code A, and if not, executing the step E; if yes, judging whether the encrypted ciphertext B is consistent with the encrypted ciphertext A, if yes, executing the step D, and if not, executing the step E.
And the counting module counts the number of unmatched input passwords and the one-time passwords when the one-time password verification module compares the input passwords with the one-time passwords, compares the counted number with a threshold value, fails to unlock if the counted number is larger than the threshold value, and executes the step F if the counted number is smaller than the threshold value.
The preset value and the threshold value can be set according to the requirements of a user, the preset value and the threshold value are constants of times, and the user can set the numerical value.
The technical principle of the present invention is described above in connection with specific embodiments. The description is made for the purpose of illustrating the principles of the invention and should not be construed in any way as limiting the scope of the invention. Based on the explanations herein, those skilled in the art will be able to conceive of other embodiments of the present invention without inventive effort, which would fall within the scope of the present invention.

Claims (7)

1. A one-time password verification method of an electronic lock is characterized by comprising a time module, a password input module and a processor, wherein a one-time password generation module, a one-time password verification module, a locking counting module and a counting module are arranged in the processor, the one-time password verification module controls a driving module, and the method comprises the following steps: A) the one-time password generating module generates a one-time password according to the time information provided by the time module; B) after the processor receives the first digit transmitted by the password input module, the locking counting module enables the one-time password generating module to be in a locking state and enters a counting mode; C) the one-time password verification module compares the input password with the password generated by the one-time password generation module, if the input password is successfully compared with the password generated by the one-time password generation module, the step D is executed, and if the comparison is not successful, the step E is executed; D) driving to unlock, and unlocking by the locking counting module; E) the counting module counts the number of unmatched numbers on each digit in the input password and the password generated by the one-time password generating module, and if the counted number value is larger than a preset value, the step G is executed; if the counted number is smaller than the preset value, executing the step F; F) prompting to re-input the password, counting by the locking counting module, comparing a value obtained by counting with a threshold value, executing the step C if the value of the locking counting module is smaller than the threshold value, and executing the step G if the value of the locking counting module is larger than the threshold value; G) and if the unlocking fails, an alarm is given, and the locking counting module unlocks.
2. The one-time password authentication method of the electronic lock as claimed in claim 1, wherein the one-time password generation module comprises a counter T and a storage module, and the working process is as follows: generating a 4-byte system key ID with the time module and the processor; the system key ID and the counter T are used as dispersion factors, DES encryption is used for generating 8-byte ciphertext, the first 4 bytes are rolling codes A, and the second 4 bytes are encrypted ciphertext A; the 8-byte ciphertext is stored in a storage module, and the counter T extracts the 8-byte ciphertext and recombines the 8-byte ciphertext with the counter T to generate a group of 9-digit digital passwords.
3. The one-time password authentication method of the electronic lock as claimed in claim 1, wherein the one-time password verification module comprises a comparison module and a reverse reasoning module, and the working steps are as follows: inputting a password, reversely reasoning through the reverse reasoning module to obtain a rolling code B and an encrypted ciphertext B, judging whether the rolling code B is larger than the rolling code A or not by the comparing module, and executing the step E if the rolling code B is not larger than the rolling code A; if yes, whether the encrypted ciphertext B is consistent with the encrypted ciphertext A or not is judged.
4. The one-time password authentication method of an electronic lock according to claim 2, wherein the generation formula of the system key ID is system key ID = current timestamp + processor.
5. The one-time password authentication method of an electronic lock according to claim 2, wherein the 8-byte ciphertext is recombined with the counter T in such a way that the first 4 bytes are rolling codes a, the last 4 bytes are encryption ciphertext a, a random number between 0 and 9 is inserted at the end, the random number is an integer, the random number is changed into 4 numbers according to a binary system, the 4 numbers are all 0 or 1, the rolling codes a and the encryption ciphertext a are sequentially extracted according to the 4 numbers, when the number is 0, the two bytes of the rolling codes a are respectively extracted according to the sequence from left to right and sequentially delayed to form 8 digital passwords, and then the random number is added at the end to form 9 digital passwords.
6. The one-time password authentication method for an electronic lock according to claim 1, wherein in step E, the preset value can be set according to the actual situation of the user.
7. The one-time password authentication method for electronic locks according to claim 1, wherein the threshold in step F can be set by the user.
CN202011283136.XA 2020-11-17 2020-11-17 One-time password verification method for electronic lock Pending CN112381976A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011283136.XA CN112381976A (en) 2020-11-17 2020-11-17 One-time password verification method for electronic lock

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011283136.XA CN112381976A (en) 2020-11-17 2020-11-17 One-time password verification method for electronic lock

Publications (1)

Publication Number Publication Date
CN112381976A true CN112381976A (en) 2021-02-19

Family

ID=74585703

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011283136.XA Pending CN112381976A (en) 2020-11-17 2020-11-17 One-time password verification method for electronic lock

Country Status (1)

Country Link
CN (1) CN112381976A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239340A (en) * 2021-05-28 2021-08-10 上海栖格网络科技有限公司 Matching instrument and matching method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593380A (en) * 2008-05-28 2009-12-02 北京飞天诚信科技有限公司 A kind of gate control system and authentication method that generates and verify based on dynamic password
CN103218865A (en) * 2013-04-17 2013-07-24 孙添平 Dynamic electronic coded lock system and authentication method thereof
CN106780895A (en) * 2016-12-23 2017-05-31 余仁植 Method for unlocking coded lock, locking method, coded lock, systems approach and system
CN107403486A (en) * 2017-06-28 2017-11-28 宁波久婵物联科技有限公司 A kind of disposal password verification method of electronic lock
CN107659568A (en) * 2017-09-28 2018-02-02 郑州云海信息技术有限公司 A kind of storage medium and control method of password locking, device and equipment
KR101841145B1 (en) * 2017-12-01 2018-05-04 (주)트라이앵글랩 Door control system using Time-based One Time Password in smart device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101593380A (en) * 2008-05-28 2009-12-02 北京飞天诚信科技有限公司 A kind of gate control system and authentication method that generates and verify based on dynamic password
CN103218865A (en) * 2013-04-17 2013-07-24 孙添平 Dynamic electronic coded lock system and authentication method thereof
CN106780895A (en) * 2016-12-23 2017-05-31 余仁植 Method for unlocking coded lock, locking method, coded lock, systems approach and system
CN107403486A (en) * 2017-06-28 2017-11-28 宁波久婵物联科技有限公司 A kind of disposal password verification method of electronic lock
CN107659568A (en) * 2017-09-28 2018-02-02 郑州云海信息技术有限公司 A kind of storage medium and control method of password locking, device and equipment
KR101841145B1 (en) * 2017-12-01 2018-05-04 (주)트라이앵글랩 Door control system using Time-based One Time Password in smart device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113239340A (en) * 2021-05-28 2021-08-10 上海栖格网络科技有限公司 Matching instrument and matching method thereof
CN113239340B (en) * 2021-05-28 2024-04-12 上海栖格网络科技有限公司 Matched instrument and matching method thereof

Similar Documents

Publication Publication Date Title
Zheng et al. Cryptographic key generation from biometric data using lattice mapping
CN109741500A (en) A kind of setting of the temporary password of smart lock and its verification method
CN102611556B (en) Working method of dynamic token
Chandran et al. Privacy amplification with asymptotically optimal entropy loss
US11979500B2 (en) Data format-preserving encryption, tokenization, and access control for vaultless systems and methods
ITRM950199A1 (en) ANTI-THEFT DEVICE FOR VEHICLES WITH ELECTRONIC CODING OF THE USE AUTHORIZATION.
WO2005083610A1 (en) Token authentication system and method
WO2000051244A1 (en) A fuzzy commitment scheme
EP1472816A2 (en) Access system utilizing multiple factor identification and authentication
Kim et al. One-factor cancellable biometrics based on indexing-first-order hashing for fingerprint authentication
CN115100762B (en) Safe unlocking method for generating 12-bit true random dynamic password
CN116318671A (en) Offline password generation and verification method
CN114758433A (en) Cloud-based dynamic password generation method and system and intelligent lock
Kanade et al. Application of biometrics to obtain high entropy cryptographic keys
CN112381976A (en) One-time password verification method for electronic lock
Al-Saggaf Secure Method for Combining Cryptography with Iris Biometrics.
CN107403486A (en) A kind of disposal password verification method of electronic lock
CN110298941A (en) A kind of disposable temporary password generation method of intelligent door lock
CN113963468B (en) Unlocking code generation method and device
KR100986980B1 (en) Biometric authentication method, client and server
CN110111103B (en) Password resetting method and system for digital currency wallet
Tuyls et al. Privacy protecting biometric authentication systems: an overview
EP4127947A1 (en) Management system and method for user authentication on password based systems
CN111859427A (en) Multi-stage encrypted data storage method and system for preventing database collision and readable medium
CN117424748B (en) Unlocking system for gun safety management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20210219