CN117711094A - Dynamic password generation method of intelligent door lock and related equipment - Google Patents
Dynamic password generation method of intelligent door lock and related equipment Download PDFInfo
- Publication number
- CN117711094A CN117711094A CN202311681398.5A CN202311681398A CN117711094A CN 117711094 A CN117711094 A CN 117711094A CN 202311681398 A CN202311681398 A CN 202311681398A CN 117711094 A CN117711094 A CN 117711094A
- Authority
- CN
- China
- Prior art keywords
- dynamic
- password
- dynamic password
- door lock
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000004590 computer program Methods 0.000 claims description 12
- 238000004891 communication Methods 0.000 abstract description 12
- 230000006855 networking Effects 0.000 abstract description 8
- 230000006870 function Effects 0.000 description 9
- 238000010586 diagram Methods 0.000 description 4
- 238000012545 processing Methods 0.000 description 3
- 238000013475 authorization Methods 0.000 description 1
- 230000001680 brushing effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000005336 cracking Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME 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/00—Individual registration on entry or exit
- G07C9/00174—Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
- G07C9/00817—Electronically 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
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/08—Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
- H04L9/0861—Generation of secret information including derivation or calculation of cryptographic keys or passwords
- H04L9/0872—Generation of secret information including derivation or calculation of cryptographic keys or passwords using geo-location information, e.g. location data, time, relative position or proximity to other entities
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2463/00—Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
- H04L2463/121—Timestamp
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Lock And Its Accessories (AREA)
Abstract
The application relates to the technical field of intelligent door locks, in particular to a dynamic password generation method of an intelligent door lock and related equipment. According to the method, the device and the system, the identification information and the management password are acquired, a first encryption factor is generated according to the identification information, a second encryption factor is generated according to the management password, a start time stamp, an end time stamp and the door opening times corresponding to a management user are further acquired, a dynamic password plaintext is generated according to the start time stamp, the end time stamp and the door opening times, and the dynamic password plaintext is encrypted according to the first encryption factor to obtain a dynamic password ciphertext; or encrypting the dynamic cipher text according to the second encryption factor to obtain the dynamic cipher text. The process of generating the dynamic password ciphertext does not need intelligent door lock networking communication, and after the dynamic password ciphertext is generated, a user can directly unlock by utilizing the dynamic password ciphertext, and the intelligent door lock networking communication is not needed.
Description
Technical Field
The application relates to the technical field of intelligent door locks, in particular to a dynamic password generation method of an intelligent door lock and related equipment.
Background
The intelligent door lock is widely applied to long rented apartments, short rented apartments, hosting systems of school factories, government security houses and the like as a management means of access control, and the intelligent door lock is required to have a networking communication function so as to be managed in a centralized manner.
At present, the networking communication mode of the intelligent door lock comprises a narrowband internet of things (Narrow Band Internet of Things, NB-IoT), WIFI, long Range Radio (LoRa), bluetooth and the like, the intelligent door lock is taken as an entrance of management, 100% unlocking is required to be ensured, but communication between the intelligent door lock and a cloud is impossible to ensure 100% communication connection, so that when the intelligent door lock cannot be normally connected, a user cannot remotely authorize the networking intelligent door lock to unlock through an application program connection network of a preset terminal (for example, a user mobile phone), or the user performs unlocking operation through face brushing. Therefore, when the network fails, the user cannot normally use the intelligent door lock, the network must be repaired to be used, and if the network of the network operator cannot be used, the whole door lock system cannot be used.
Disclosure of Invention
In view of the above, the application provides a dynamic password generation method of an intelligent door lock and related equipment, which can effectively avoid the influence of network instability on the intelligent door lock.
A first aspect of the present application provides a method for generating a dynamic password for an intelligent door lock, the method including:
acquiring identification information of an intelligent door lock and acquiring a prestored management password for managing a user;
generating a first encryption factor according to the identification information and generating a second encryption factor according to the management password;
acquiring a start time stamp, an end time stamp and the door opening times corresponding to the management user;
generating a dynamic password plaintext according to the starting time stamp, the ending time stamp and the door opening times;
encrypting the dynamic cipher text according to the first encryption factor to obtain a dynamic cipher text; or (b)
And encrypting the dynamic cipher text according to the second encryption factor to obtain a dynamic cipher text.
In an optional implementation manner, the encrypting the dynamic cipher text according to the first encryption factor to obtain the dynamic cipher text includes:
performing integer division and remainder operation on the dynamic password plaintext and the identification information to obtain a first integer and a first remainder;
generating a long integer according to the first integer and the first remainder;
calculating a checksum value of the management password;
performing integer division and remainder operation on the long integer and the checksum value to obtain a second integer and a second remainder;
determining target encrypted data according to the second integer and the second remainder;
performing OR operation on the target encrypted data and the first encryption factor to generate a first dynamic cipher text;
and determining the first dynamic password ciphertext as the dynamic password ciphertext.
In an optional implementation manner, the encrypting the dynamic cipher text according to the second encryption factor to obtain the dynamic cipher text includes:
performing OR operation on the target encrypted data and the second encryption factor to generate a second dynamic cipher text;
and determining the second dynamic password ciphertext as the dynamic password ciphertext.
In an alternative embodiment, said calculating the checksum of the management password comprises:
acquiring a field format corresponding to each field information in the management password, wherein the field format comprises a digital format and an English format;
when the field format corresponding to the field information is determined to be the digital format, determining the checksum value according to each piece of field information;
when the field format corresponding to the field information is determined to be the English format, converting the field information into a standard code value, and determining the checksum value according to the standard code value.
In an alternative embodiment, said determining the target encrypted data from said second integer and said second remainder comprises:
converting the second integer to a corresponding first binary value and converting the second remainder to a corresponding second binary value;
performing left shift operation on the first binary value to obtain a first target binary value, and performing left shift operation on the second binary value to obtain a second target binary value;
performing OR operation according to the first target binary number value and the second target binary number value to obtain a target binary number value;
and converting the target binary value to obtain the target encrypted data.
In an alternative embodiment, the method comprises:
when the dynamic password ciphertext input by the management user is received, decrypting the dynamic password ciphertext to obtain a target unlocking password;
verifying whether the target unlocking password is consistent with the dynamic password plaintext;
when the target unlocking password is consistent with the dynamic password plaintext, determining that the dynamic password ciphertext is effective, and allowing the management user to unlock by using the dynamic password ciphertext;
and when the target unlocking password is inconsistent with the dynamic password plaintext, determining that the dynamic password ciphertext is invalid, and not allowing the management user to unlock by using the dynamic password ciphertext.
In an optional implementation manner, the decrypting the dynamic password ciphertext to obtain the target unlocking password includes:
performing OR operation on the dynamic cipher text and the first encryption factor to generate a third integer and a third remainder;
determining a first target unlocking password according to the third integer, the third remainder and the identification information;
performing OR operation on the dynamic cipher text and the second encryption factor to generate a fourth integer and a fourth remainder;
determining a second target unlocking password according to the fourth integer, the fourth remainder and the management password;
and determining the first target unlocking password and the second target unlocking password as the target unlocking passwords.
A second aspect of the present application provides a dynamic password generating device for an intelligent door lock, the device comprising:
the first acquisition module is used for acquiring identification information of the intelligent door lock and acquiring a prestored management password of a management user;
the first generation module is used for generating a first encryption factor according to the identification information and generating a second encryption factor according to the management password;
the second acquisition module is used for acquiring a start time stamp, an end time stamp and the door opening times corresponding to the management user;
the second generation module is used for generating a dynamic password plaintext according to the starting time stamp, the ending time stamp and the door opening times;
the first encryption module is used for encrypting the dynamic cipher text according to the first encryption factor to obtain a dynamic cipher text;
and the second encryption module is used for encrypting the dynamic cipher text according to the second encryption factor to obtain the dynamic cipher text.
A third aspect of the present application provides an intelligent door lock, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements steps of a dynamic password generation method of the intelligent door lock when the computer program is executed.
A fourth aspect of the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the dynamic password generation method of an intelligent door lock described above.
In summary, according to the method and the related device for generating the dynamic password of the intelligent door lock, the identification information and the management password are acquired, the first encryption factor is generated according to the identification information, the second encryption factor is generated according to the management password, the starting time stamp, the ending time stamp and the door opening times corresponding to the management user are further acquired, the dynamic password plaintext is generated according to the starting time stamp, the ending time stamp and the door opening times, and the dynamic password plaintext is further encrypted according to the first encryption factor, so that the dynamic password ciphertext is obtained; or encrypting the dynamic cipher text according to the second encryption factor to obtain the dynamic cipher text. The process of generating the dynamic password ciphertext does not need intelligent door lock networking communication, and after the dynamic password ciphertext is generated, a user can directly unlock by utilizing the dynamic password ciphertext, and does not need intelligent door lock networking communication, so that the influence of network instability on intelligent door lock password validity period management can be effectively avoided, and meanwhile, the operation efficiency of a manager is ensured.
Drawings
Fig. 1 is a flowchart of a dynamic password generation method of an intelligent door lock according to an embodiment of the present application;
FIG. 2 is a flow chart of another method for generating dynamic passwords for intelligent door locks according to an embodiment of the disclosure;
FIG. 3 is a flow chart illustrating a method of encrypting dynamic cipher text according to an embodiment of the present application;
FIG. 4 is a flow chart of a method of decrypting dynamic cipher text shown in an embodiment of the present application;
fig. 5 is a functional block diagram of a dynamic password generating device of an intelligent door lock according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an intelligent door lock according to an embodiment of the present application.
Detailed Description
The terminology used in the following embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this application is meant to encompass any or all possible combinations of one or more of the listed items.
The terms "first," "second," and the like, are used below for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the present application, unless otherwise indicated, the meaning of "a plurality" is two or more.
Referring to fig. 1, a flowchart of a method for generating a dynamic password of an intelligent door lock according to an embodiment of the present application is shown, where the method for generating a dynamic password of an intelligent door lock includes the following steps.
S11, acquiring identification information of the intelligent door lock.
Each smart door lock has unique identification information, i.e. a unique string identifier, e.g. 10101010.
S12, generating a first encryption factor according to the identification information.
In some embodiments, the identification information may be first converted into a binary value, then the binary value is converted into a decimal value, and the decimal value is determined as the first encryption factor corresponding to the identification information. For example, assuming that the identification information is 123456, converting 123456 to a binary value may result in 11110001001000000, and further converting 11110001001000000 to a decimal value may result in 99936, i.e., 99936 is the first encryption factor generated based on the identification information.
S13, acquiring a start time stamp, an end time stamp and the opening times corresponding to the management user.
The start time stamp and the receive time stamp are time stamps, the start time stamp can be the time when the intelligent door lock is used for unlocking for the first time, and the end time stamp can be the time when the intelligent door lock is used for unlocking for the previous time. The door opening times are accumulated times of unlocking by using the intelligent door lock between the starting time stamp and the ending time stamp.
In some embodiments, the start timestamp and the end timestamp may be converted to UNIX timestamps. The Unix time stamp is the total number of seconds from the time of greenwich time 1970, 01, 00 minutes, 00 seconds (Beijing time 1970, 01, 08, 00 minutes, 00 seconds) to the time corresponding to the start time stamp and the end time stamp. Illustratively, assume that the start timestamp is 2023, 11, 30, 08:00:00, corresponding UNIX timestamp 1672070400; again assuming an end time stamp of 2023, 12, 05, 20;00:00, corresponding UNIX timestamp 1672605600.
S14, generating a dynamic password plaintext according to the starting time stamp, the ending time stamp and the door opening times.
In some embodiments, the start time stamp, the end time stamp, and the door opening times may be added to obtain a dynamic cipher text. For example, assuming that the start time stamp is 1672070400, the end time stamp is 1672605600, and the number of times of opening is 10, the dynamic cipher plaintext=start time stamp+end time stamp+number of times of opening=1672070400+1672605600+10= 3344676010.
S15, encrypting the dynamic cipher text according to the first encryption factor to obtain a dynamic cipher text.
Because the end time stamp and the opening times are changed, the generated dynamic cipher text is changed, and the dynamic cipher text is generated by encrypting the dynamic cipher text according to the first encryption factor or the second encryption factor, so that the risk of cracking the cipher is reduced, and the safety of the dynamic cipher text is improved.
Referring to fig. 3, a flowchart of a method for encrypting dynamic cipher text is shown in an embodiment of the present application, where the method for encrypting dynamic cipher text specifically includes the following steps.
And S151, performing integer division and remainder operation on the dynamic password plaintext and the identification information to obtain a first integer and a first remainder.
Integer division means that one number can be divided by another number, i.e., the remainder of one number divided by another number is 0. The remainder operation refers to that in integer division, when the dividend cannot be divised, the remaining non-divisible portion is a remainder, and the remainder has a value ranging from 0 to an integer between the divisors (excluding the divisors). The dynamic cipher plaintext is divided according to the dynamic cipher plaintext and the identification information, so that a quotient can be obtained, when the dynamic cipher plaintext is divided by the identification information, the remainder is 0, and when the dynamic cipher plaintext is divided by the identification information, the remainder can be obtained. Therefore, a quotient obtained by dividing the dynamic cipher text by the identification information is referred to as a first integer, and a remainder obtained is referred to as a first remainder.
S152, generating a long integer according to the first integer and the first remainder;
in some embodiments, the first integer and the first remainder may be sequentially arranged and combined to form a character string, and the character string formed by the combination is referred to as a long integer. For example, assume that the first integer is 331, the first remainder is 1241700, and the long integers combined are 3311241700.
S153, calculating a checksum value of the management password;
in an alternative embodiment, said calculating the checksum of the management password comprises:
acquiring a field format corresponding to each field information in the management password, wherein the field format comprises a digital format and an English format;
when the field format corresponding to the field information is determined to be the digital format, determining the checksum value according to each piece of field information;
when the field format corresponding to the field information is determined to be the English format, converting the field information into a standard code value, and determining the checksum value according to the standard code value.
Wherein, the digital format refers to that the field information existing in the management password is Arabic numerals, namely any one of numerals 0 to 9; the english format refers to any one of the 26 letters in the english alphabet.
The field format of each field information included in the management password may be a numeric format, or may be an english format, or may include both a numeric format and an english format. When the field information in the management password is in a digital format, the field information is a standard code value, and each field information is subjected to addition operation to obtain a checksum value; when the field information in the management password is in an English format, the field information is not a standard code value, the field information needs to be converted into the standard code value, and the standard code value is subjected to addition operation to obtain a checksum value. The standard code value refers to american standard code for information interchange (American Standard Code for Information Interchange, ASCII).
S154, performing integer division and remainder operation on the long integer and the checksum value to obtain a second integer and a second remainder;
according to the same embodiment of step S151, the long integer may be divided by the checksum value to obtain a second integer and a second remainder.
S155, determining target encryption data according to the second integer and the second remainder;
when the second integer and the second remainder are calculated, the target encrypted data may be further calculated from the second integer and the second remainder.
In an alternative embodiment, said determining the target encrypted data from said second integer and said second remainder comprises:
converting the second integer to a corresponding first binary value and converting the second remainder to a corresponding second binary value;
performing left shift operation on the first binary value to obtain a first target binary value, and performing left shift operation on the second binary value to obtain a second target binary value;
performing OR operation according to the first target binary number value and the second target binary number value to obtain a target binary number value;
and converting the target binary value to obtain the target encrypted data.
In some embodiments, the second integer and the second remainder are each converted to a corresponding binary value, the binary value corresponding to the second integer being referred to as the first binary value, and the binary value corresponding to the second remainder being referred to as the second binary value. When both the second integer and the second remainder are converted to corresponding binary values, the converted binary values are left shifted, wherein the left shift operation refers to shifting one position left. The binary value after the first binary value is shifted left by one position is called a first target binary value; the binary value obtained by shifting the second binary value by one position to the left is called a second target binary value, and the target binary value can be obtained by further performing OR and operation according to the first target binary value and the second target binary value. Wherein the or operation may include a bitwise or operation and a bitwise and operation. The operation logic of the bitwise OR operation is that when any bit in the corresponding bits is 1, the result is 1, and when the corresponding bits are 0, the result is 0. The logic of the bitwise AND operation is that when the corresponding bits are all 1, the result is 1, and when any bit in the corresponding bits is 0, the result is 0. Converting the target binary value may result in target encrypted data, e.g., converting the binary value into a decimal value.
And S156, performing OR operation on the target encryption data and the first encryption factor to generate the first dynamic cipher text.
According to the embodiment in step S155 or the same as the operation described above, the first dynamic cipher text may be obtained based on the target encrypted data and the first encryption factor.
S157, determining the first dynamic password ciphertext as the dynamic password ciphertext.
And when the first dynamic cipher text is obtained by calculation according to the target encryption data and the first encryption factor, the dynamic cipher text obtained by encrypting the dynamic cipher text according to the first encryption factor is obtained.
Referring to fig. 2, a flowchart of another method for generating a dynamic password of an intelligent door lock according to an embodiment of the present application is shown, where the method for generating a dynamic password of an intelligent door lock may further include the following steps.
S21, acquiring a management password of a management user stored in advance.
The user can log in through the authorization authentication of the identity information in the user management system, the user which is authenticated by the identity information by the user management system is determined as the management user, each management user needs to add a management password when the identity information is authenticated, and each management user corresponds to one management password. Wherein, the management password can be one or more combinations of Arabic numerals and English.
S22, generating a second encryption factor according to the management password.
According to the same embodiment in step S12, a second encryption factor corresponding to the management password may be determined.
S23, acquiring a start time stamp, an end time stamp and the door opening times corresponding to the management user.
S24, generating a dynamic password plaintext according to the starting time stamp, the ending time stamp and the door opening times.
S25, encrypting the dynamic cipher text according to the second encryption factor to obtain a dynamic cipher text.
According to the same embodiment in step S15, the second dynamic cipher text may be obtained by performing or and operation according to the target encrypted data and the second encryption factor, that is, the dynamic cipher text obtained by encrypting the dynamic cipher text according to the second encryption factor is obtained.
Fig. 1 and 2 are flowcharts of a dynamic password generation method of an intelligent door lock, except that fig. 1 is a flowchart of a dynamic password ciphertext generated based on a first encryption factor, and fig. 2 is a flowchart of a dynamic password ciphertext generated based on a second encryption factor.
Referring to fig. 4, a flowchart of a method for decrypting a dynamic cipher text according to an embodiment of the present application is shown, where the method for decrypting a dynamic cipher text specifically includes the following steps.
S41, when the dynamic password ciphertext input by the management user is received, decrypting the dynamic password ciphertext to obtain a target unlocking password.
Because the dynamic cipher plaintext is generated according to the start time stamp, the end time stamp and the door opening times, when the user opens the door, the end time stamp and the door opening times are correspondingly changed, so the dynamic cipher plaintext is also changed, and the dynamic cipher ciphertext is also changed.
For the intelligent door lock, since the intelligent door lock comprises a keyboard, the keyboard only has 10 numbers of 0 to 9, and when a management user inputs a dynamic password ciphertext through the keyboard of the intelligent door lock, the intelligent door lock can decrypt the input dynamic password ciphertext to judge whether the dynamic password ciphertext input by the management user is correct or not.
In an optional implementation manner, the decrypting the dynamic password ciphertext to obtain the target unlocking password includes:
performing OR operation on the dynamic cipher text and the first encryption factor to generate a third integer and a third remainder;
determining a first target unlocking password according to the third integer, the third remainder and the identification information;
performing OR operation on the dynamic cipher text and the second encryption factor to generate a fourth integer and a fourth remainder;
determining a second target unlocking password according to the fourth integer, the fourth remainder and the management password;
and determining the first target unlocking password and the second target unlocking password as the target unlocking passwords.
The dynamic cipher text generated based on the first encryption factor and the dynamic cipher text generated based on the second encryption factor are inconsistent. In some embodiments, the management user may choose to encrypt the dynamic password plaintext using the first encryption factor or encrypt the dynamic password plaintext using the second encryption factor in a user management system of a user terminal communicatively connected to the smart door lock when the smart door lock is first used. In other embodiments, the management user may not select any one of the first encryption factor or the second encryption factor to encrypt the dynamic cipher text, and the intelligent door lock may encrypt the dynamic cipher text according to the first encryption factor to generate the first dynamic cipher text, and encrypt the dynamic cipher text according to the second encryption factor to generate the second dynamic cipher text. When the management user inputs the dynamic password ciphertext, the management user can select to input the first dynamic password ciphertext or the second dynamic password ciphertext.
Because the management and management user inputs the dynamic cipher text, the intelligent door lock does not know whether the dynamic cipher text input by the user is generated based on the first encryption factor or the second encryption factor. The intelligent door lock firstly performs OR operation on the dynamic cipher text and the first encryption factor to obtain an integer of two bytes and a remainder of one byte, the integer of the two bytes is determined to be a third integer, and the remainder of the one byte is determined to be a third remainder. Because the first encryption factor is generated according to the identification information of the intelligent door lock, the first target unlocking password after the dynamic password ciphertext input by the management user is decrypted is determined according to the third integer, the third remainder and the identification information. In some embodiments, the intelligent door lock may multiply the third integer by the identification information and then add with the third remainder to obtain the first target unlocking password.
The intelligent door lock further performs OR operation on the dynamic cipher text and the second encryption factor to obtain a new integer of two bytes and a remainder of one byte, determines the obtained integer of two bytes as a fourth integer, and determines the obtained remainder of one byte as a fourth remainder. Because the second encryption factor is generated according to the management password of the management user, according to the same embodiment, the second target unlocking password after the dynamic password ciphertext input by the management user is decrypted can be determined according to the fourth integer, the fourth remainder and the management password.
S42, verifying whether the target unlocking password is consistent with the dynamic password plaintext.
Because the dynamic cipher plaintext is generated according to the start time stamp, the end time stamp and the door opening times, the dynamic cipher plaintext is not influenced by the first encryption factor and the second encryption factor. The intelligent door lock can compare the decrypted first target unlocking password with the dynamic password plaintext or compare the second target dynamic password with the dynamic password plaintext to determine whether any one of the first target unlocking password and the second target unlocking password is consistent with the dynamic password plaintext.
S43, when the target unlocking password is consistent with the dynamic password plaintext, determining that the dynamic password ciphertext is effective, and allowing the management user to unlock by using the dynamic password ciphertext.
If any one of the first target unlocking password and the second target unlocking password is consistent with the dynamic password plaintext, the dynamic password ciphertext input by the management user through the keyboard of the intelligent door lock can be determined to be effective, namely correct, and the intelligent door lock is unlocked.
S44, when the target unlocking password is inconsistent with the dynamic password plaintext, determining that the dynamic password ciphertext is invalid, and not allowing the management user to unlock by using the dynamic password ciphertext.
When all the target unlocking passwords in the first target unlocking password and the second target unlocking password are inconsistent with the dynamic password plaintext, the dynamic password ciphertext input by the management user through the keyboard of the intelligent door lock is determined to be invalid, namely incorrect, and the intelligent door lock is not opened.
Compared with the traditional intelligent door lock unlocking method, the dynamic password ciphertext generation process in the embodiment of the application does not need intelligent door lock networking communication, so that the influence of network instability on intelligent door lock password validity management can be effectively avoided, and meanwhile, the operation efficiency of a manager is guaranteed. Compared with the traditional encryption and decryption method, for example, an advanced encryption system (Advanced Encryption System, AES) or a password hash function (for example, MD5 information abstract algorithm) is adopted to encrypt the password of the intelligent door lock to obtain the unlocking password corresponding to the condition that the intelligent door lock cannot be used by a network. And AES or MD5 is an encryption unit with 16 bytes, the length of an unlocking password generated from plaintext to ciphertext is very long and exceeds 10 bits, the starting password exceeding 10 bits is difficult to memorize, the dynamic password obtained by encryption is 6 to 8 bits, and the length of the dynamic password ciphertext can meet the use requirement of the intelligent door lock industry.
Referring to fig. 5, a functional block diagram of a dynamic password generating device of an intelligent door lock according to an embodiment of the present application is shown.
In some embodiments, the dynamic password generating device 50 of the intelligent door lock may include a plurality of functional modules composed of computer program segments. The computer program of each program segment of the dynamic password generating device 50 of the intelligent door lock may be stored in a memory of the intelligent door lock and executed by at least one processor to perform (see fig. 1 and 2 for details) the functions of dynamic password generation of the intelligent door lock.
In this embodiment, the dynamic password generating device 50 of the intelligent door lock may be divided into a plurality of functional modules according to the functions performed by the dynamic password generating device. The functional module may include: a first obtaining module 501, a first generating module 502, a second obtaining module 503, a second generating module 504, a first encrypting module 505, a second encrypting module 506, a calculating module 507 and a decrypting module 508. A module as referred to in this application refers to a series of computer program segments, stored in a memory, capable of being executed by at least one processor and of performing a fixed function. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The first obtaining module 501 is configured to obtain identification information of the intelligent door lock, and obtain a management password of a management user stored in advance.
The first generating module 502 is configured to generate a first encryption factor according to the identification information, and generate a second encryption factor according to the management password.
The second obtaining module 503 is configured to obtain a start time stamp, an end time stamp, and a door opening number corresponding to the management user.
The second generating module 504 is configured to generate a dynamic password plaintext according to the start time stamp, the end time stamp and the door opening number.
The first encryption module 505 is configured to encrypt the dynamic cipher text according to the first encryption factor to obtain a dynamic cipher text.
The first encryption module 505 is further specifically configured to:
performing integer division and remainder operation on the dynamic password plaintext and the identification information to obtain a first integer and a first remainder;
generating a long integer according to the first integer and the first remainder;
calculating a checksum value of the management password;
performing integer division and remainder operation on the long integer and the checksum value to obtain a second integer and a second remainder;
determining target encrypted data according to the second integer and the second remainder;
performing OR operation on the target encrypted data and the first encryption factor to generate a first dynamic cipher text;
and determining the first dynamic password ciphertext as the dynamic password ciphertext.
The second encryption module 506 is configured to encrypt the dynamic cipher text according to the second encryption factor to obtain a dynamic cipher text.
The second encryption module 506 is further specifically configured to:
performing OR operation on the target encrypted data and the second encryption factor to generate a second dynamic cipher text;
and determining the second dynamic password ciphertext as the dynamic password ciphertext.
The calculating module 507 is configured to:
acquiring a field format corresponding to each field information in the management password, wherein the field format comprises a digital format and an English format;
when the field format corresponding to the field information is determined to be the digital format, determining the checksum value according to each piece of field information;
when the field format corresponding to the field information is determined to be the English format, converting the field information into a standard code value, and determining the checksum value according to the standard code value.
The calculating module 507 is further configured to:
converting the second integer to a corresponding first binary value and converting the second remainder to a corresponding second binary value;
performing left shift operation on the first binary value to obtain a first target binary value, and performing left shift operation on the second binary value to obtain a second target binary value;
performing OR operation according to the first target binary number value and the second target binary number value to obtain a target binary number value;
and converting the target binary value to obtain the target encrypted data.
The decryption module 508 is configured to:
when the dynamic password ciphertext input by the management user is received, decrypting the dynamic password ciphertext to obtain a target unlocking password;
verifying whether the target unlocking password is consistent with the dynamic password plaintext;
when the target unlocking password is consistent with the dynamic password plaintext, determining that the dynamic password ciphertext is effective, and allowing the management user to unlock by using the dynamic password ciphertext;
and when the target unlocking password is inconsistent with the dynamic password plaintext, determining that the dynamic password ciphertext is invalid, and not allowing the management user to unlock by using the dynamic password ciphertext.
The decryption module 508 is further specifically configured to:
performing OR operation on the dynamic cipher text and the first encryption factor to generate a third integer and a third remainder;
determining a first target unlocking password according to the third integer, the third remainder and the identification information;
performing OR operation on the dynamic cipher text and the second encryption factor to generate a fourth integer and a fourth remainder;
determining a second target unlocking password according to the fourth integer, the fourth remainder and the management password;
and determining the first target unlocking password and the second target unlocking password as the target unlocking passwords.
It should be understood that the various modifications and embodiments of the method for generating a dynamic password of an intelligent door lock provided in the foregoing embodiments are equally applicable to the device for generating a dynamic password of an intelligent door lock in this embodiment, and those skilled in the art will be aware of the implementation method of the device for generating a dynamic password of an intelligent door lock in this embodiment through the foregoing detailed description of the method for generating a dynamic password of an intelligent door lock, which is not described in detail herein for brevity of description.
Referring to fig. 6, a schematic structural diagram of an intelligent door lock according to an embodiment of the present application is shown. In the preferred embodiment of the present application, the smart door lock 6 includes a memory 61, at least one processor 62, and at least one communication bus 63.
It will be appreciated by those skilled in the art that the configuration of the smart door lock shown in fig. 6 is not limiting of the embodiments of the present application, and that the smart door lock 6 may also include more or less other hardware or software than illustrated, or a different arrangement of components.
It should be noted that the smart door lock 6 is only used as an example, and other electronic products that may be present in the present application or may be present in the future are also included in the scope of the present application and are incorporated herein by reference.
In some embodiments, the memory 61 stores a computer program that, when executed by the at least one processor 62, implements all or part of the steps in the method for generating a dynamic password for a smart door lock as described above. In some embodiments, the at least one processor 62 is a Control Unit (Control Unit) of the intelligent door lock 6, connects various components of the entire intelligent door lock 6 using various interfaces and lines, and performs various functions and processes data of the intelligent door lock 6 by running or executing programs or modules stored in the memory 61, and calling data stored in the memory 61. For example, the at least one processor 62, when executing the computer program stored in the memory, implements all or part of the steps of the method for generating a dynamic password for an intelligent door lock in the embodiments of the present application; or realize all or part of the functions of the dynamic password generating device of the intelligent door lock. The at least one processor 62 may be comprised of integrated circuits, such as a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functionality, including one or more central processing units (Central Processing Unit, CPU), microprocessors, digital processing chips, graphics processors, combinations of various control chips, and the like.
In some embodiments, the at least one communication bus 63 is arranged to enable connected communication between the memory 61 and the at least one processor 62 or the like. In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The foregoing are all preferred embodiments of the present application, and are not intended to limit the scope of the present application in any way, therefore: all equivalent changes in structure, shape and principle of this application should be covered in the protection scope of this application.
Claims (10)
1. A method for generating a dynamic password of an intelligent door lock, the method comprising:
acquiring identification information of an intelligent door lock and acquiring a prestored management password for managing a user;
generating a first encryption factor according to the identification information and generating a second encryption factor according to the management password;
acquiring a start time stamp, an end time stamp and the door opening times corresponding to the management user;
generating a dynamic password plaintext according to the starting time stamp, the ending time stamp and the door opening times;
encrypting the dynamic cipher text according to the first encryption factor to obtain a dynamic cipher text; or (b)
And encrypting the dynamic cipher text according to the second encryption factor to obtain a dynamic cipher text.
2. The method for generating a dynamic password for an intelligent door lock according to claim 1, wherein encrypting the dynamic password plaintext according to the first encryption factor to obtain a dynamic password ciphertext comprises:
performing integer division and remainder operation on the dynamic password plaintext and the identification information to obtain a first integer and a first remainder;
generating a long integer according to the first integer and the first remainder;
calculating a checksum value of the management password;
performing integer division and remainder operation on the long integer and the checksum value to obtain a second integer and a second remainder;
determining target encrypted data according to the second integer and the second remainder;
performing OR operation on the target encrypted data and the first encryption factor to generate a first dynamic cipher text;
and determining the first dynamic password ciphertext as the dynamic password ciphertext.
3. The method for generating the dynamic password of the intelligent door lock according to claim 2, wherein encrypting the dynamic password plaintext according to the second encryption factor to obtain the dynamic password ciphertext comprises:
performing OR operation on the target encrypted data and the second encryption factor to generate a second dynamic cipher text;
and determining the second dynamic password ciphertext as the dynamic password ciphertext.
4. The method for generating dynamic passwords of an intelligent door lock according to claim 2, wherein the step of calculating the check sum of the management passwords comprises:
acquiring a field format corresponding to each field information in the management password, wherein the field format comprises a digital format and an English format;
when the field format corresponding to the field information is determined to be the digital format, determining the checksum value according to each piece of field information;
when the field format corresponding to the field information is determined to be the English format, converting the field information into a standard code value, and determining the checksum value according to the standard code value.
5. The method of generating a dynamic password for an intelligent door lock according to claim 2, wherein the determining the target encrypted data according to the second integer and the second remainder comprises:
converting the second integer to a corresponding first binary value and converting the second remainder to a corresponding second binary value;
performing left shift operation on the first binary value to obtain a first target binary value, and performing left shift operation on the second binary value to obtain a second target binary value;
performing OR operation according to the first target binary number value and the second target binary number value to obtain a target binary number value;
and converting the target binary value to obtain the target encrypted data.
6. The method for generating a dynamic password for an intelligent door lock according to any one of claims 1 to 5, the method comprising:
when the dynamic password ciphertext input by the management user is received, decrypting the dynamic password ciphertext to obtain a target unlocking password;
verifying whether the target unlocking password is consistent with the dynamic password plaintext;
when the target unlocking password is consistent with the dynamic password plaintext, determining that the dynamic password ciphertext is effective, and allowing the management user to unlock by using the dynamic password ciphertext;
and when the target unlocking password is inconsistent with the dynamic password plaintext, determining that the dynamic password ciphertext is invalid, and not allowing the management user to unlock by using the dynamic password ciphertext.
7. The method for generating a dynamic password for an intelligent door lock according to claim 6, wherein decrypting the dynamic password ciphertext to obtain a target unlocking password comprises:
performing OR operation on the dynamic cipher text and the first encryption factor to generate a third integer and a third remainder;
determining a first target unlocking password according to the third integer, the third remainder and the identification information;
performing OR operation on the dynamic cipher text and the second encryption factor to generate a fourth integer and a fourth remainder;
determining a second target unlocking password according to the fourth integer, the fourth remainder and the management password;
and determining the first target unlocking password and the second target unlocking password as the target unlocking passwords.
8. A dynamic password generating device of an intelligent door lock, the device comprising:
the first acquisition module is used for acquiring identification information of the intelligent door lock and acquiring a prestored management password of a management user;
the first generation module is used for generating a first encryption factor according to the identification information and generating a second encryption factor according to the management password;
the second acquisition module is used for acquiring a start time stamp, an end time stamp and the door opening times corresponding to the management user;
the second generation module is used for generating a dynamic password plaintext according to the starting time stamp, the ending time stamp and the door opening times;
the first encryption module is used for encrypting the dynamic cipher text according to the first encryption factor to obtain a dynamic cipher text;
and the second encryption module is used for encrypting the dynamic cipher text according to the second encryption factor to obtain the dynamic cipher text.
9. A smart door lock comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method for dynamic password generation of a smart door lock according to any one of claims 1 to 7 when the computer program is executed.
10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor realizes the steps of the dynamic password generation method of an intelligent door lock according to any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311681398.5A CN117711094A (en) | 2023-12-07 | 2023-12-07 | Dynamic password generation method of intelligent door lock and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311681398.5A CN117711094A (en) | 2023-12-07 | 2023-12-07 | Dynamic password generation method of intelligent door lock and related equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117711094A true CN117711094A (en) | 2024-03-15 |
Family
ID=90156311
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311681398.5A Pending CN117711094A (en) | 2023-12-07 | 2023-12-07 | Dynamic password generation method of intelligent door lock and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117711094A (en) |
-
2023
- 2023-12-07 CN CN202311681398.5A patent/CN117711094A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108494740B (en) | Token generation and verification method, intelligent terminal and server | |
CN101076807B (en) | Method and system for verifying one-time password | |
CN110098923B (en) | Method and equipment for generating and verifying temporary password | |
Turan et al. | Recommendation for password-based key derivation | |
EP2301185B1 (en) | Format-preserving cryptographic systems | |
US5142578A (en) | Hybrid public key algorithm/data encryption algorithm key distribution method based on control vectors | |
US8605899B2 (en) | Method for providing cryptographical key pairs | |
TW201812638A (en) | Storage design method of blockchain encrypted radio frequency chip | |
US11488134B2 (en) | Format-preserving cryptographic systems | |
CA2950766C (en) | Controlling access to a resource via a computing device | |
US8195951B2 (en) | Data processing system for providing authorization keys | |
CN111586076B (en) | Remote control and telemetry information tamper-proof encryption and decryption method and system based on mixed password | |
EP2339777A2 (en) | Method of authenticating a user to use a system | |
EP4072064A1 (en) | Electronic signature system and tamper-resistant device | |
CN111739200B (en) | Fingerprint electronic lock and encryption and decryption authentication method thereof | |
CN117857060A (en) | Two-dimensional code offline verification method, system and storage medium | |
CN115208557A (en) | Data encryption method and device, electronic equipment and computer storage medium | |
Turan et al. | Sp 800-132. recommendation for password-based key derivation: Part 1: Storage applications | |
US10230532B2 (en) | Entity authentication in network | |
CN116866029B (en) | Random number encryption data transmission method, device, computer equipment and storage medium | |
CN109257381A (en) | A kind of key management method, system and electronic equipment | |
CN110298941A (en) | A kind of disposable temporary password generation method of intelligent door lock | |
CN117711094A (en) | Dynamic password generation method of intelligent door lock and related equipment | |
CN112668353A (en) | Bargun authentication method, device, equipment and storage medium | |
CN118054901B (en) | Network communication method and storage device based on key identification quick transfer |
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 |