CN114783091B - Temporary password generation method, device, equipment and storage medium - Google Patents

Temporary password generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN114783091B
CN114783091B CN202210590738.2A CN202210590738A CN114783091B CN 114783091 B CN114783091 B CN 114783091B CN 202210590738 A CN202210590738 A CN 202210590738A CN 114783091 B CN114783091 B CN 114783091B
Authority
CN
China
Prior art keywords
encryption
decryption
check
time
temporary password
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.)
Active
Application number
CN202210590738.2A
Other languages
Chinese (zh)
Other versions
CN114783091A (en
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.)
Guangdong Hutlon Technology Co Ltd
Foshan Hutlon Intelligent Technology Co Ltd
Original Assignee
Guangdong Hutlon Technology Co Ltd
Foshan Hutlon Intelligent 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 Guangdong Hutlon Technology Co Ltd, Foshan Hutlon Intelligent Technology Co Ltd filed Critical Guangdong Hutlon Technology Co Ltd
Priority to CN202210590738.2A priority Critical patent/CN114783091B/en
Publication of CN114783091A publication Critical patent/CN114783091A/en
Application granted granted Critical
Publication of CN114783091B publication Critical patent/CN114783091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0863Generation of secret information including derivation or calculation of cryptographic keys or passwords involving passwords or one-time passwords
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/08Key distribution or management, e.g. generation, sharing or updating, of cryptographic keys or passwords
    • H04L9/0861Generation of secret information including derivation or calculation of cryptographic keys or passwords
    • H04L9/0866Generation of secret information including derivation or calculation of cryptographic keys or passwords involving user or device identifiers, e.g. serial number, physical or biometrical information, DNA, hand-signature or measurable physical characteristics
    • 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
    • G07C2009/00412Electronically 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 the transmitted data signal being encrypted

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a temporary password generation method, a device, equipment and a storage medium, wherein the method and the device establish communication with a terminal through a Bluetooth module to receive encrypted content transmitted by the terminal, and can communicate with the terminal and receive the encrypted content transmitted by the terminal even when a door lock is disconnected from a network; performing first decryption processing on the first encryption processing result and performing second decryption processing on the second encryption processing result through decryption parameters, and generating a temporary password when the time-of-entry data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, so that the problem of password verification failure caused by inconsistent clock factors is solved, and an effective and available temporary password can be generated; the temporary password is transmitted to the terminal through the Bluetooth module, so that the door lock can still transmit the temporary password for a user to use under the condition of network disconnection.

Description

Temporary password generation method, device, equipment and storage medium
Technical Field
The invention relates to the field of door locks, in particular to a temporary password generation method, a temporary password generation device, temporary password generation equipment and a storage medium.
Background
The temporary password of the intelligent door lock is usually required to be directly obtained from a server, and the server directly issues the temporary password or the intelligent door lock sends the temporary password to be obtained from the server, so that in order to ensure the normal obtaining of the temporary password of the intelligent door lock, the intelligent door lock must be in a networking state and keep communication with the server through a link network such as wifi or a gateway router, and therefore when the network disconnection condition occurs, the intelligent door lock cannot obtain the temporary password, and the use of the intelligent door lock is affected.
In order to solve the above problem, researchers have proposed a different temporary cryptography technique: the password is dynamically refreshed based on the clock factor, but in order to ensure that the server and the intelligent door lock generate the same password, the technology needs to enable the server or the App end to have the same clock factor, when the local time of the intelligent door lock is inconsistent with the server time, the generated password is inconsistent, the temporary password is finally failed to be checked, and the intelligent door lock is used.
Disclosure of Invention
In view of the foregoing, it is an object of the present invention to provide a temporary password generation method, apparatus, device, and storage medium, which can generate a temporary password that is effectively usable.
The technical scheme adopted by the embodiment of the invention is as follows:
a temporary password generation method applied to a door lock, the door lock having a bluetooth module and a storage module, the storage module storing a first identification number and decryption parameters of the door lock, the method comprising:
establishing communication with a terminal through the Bluetooth module to receive encrypted content transmitted by the terminal; the encrypted content comprises a first encryption processing result and a second encryption processing result, a server responds to the check-in information input by the terminal to generate a data packet, and the data packet is subjected to first encryption processing and second encryption processing respectively to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and time data of the check-in;
performing a first decryption process on the first encryption process result and performing a second decryption process on the second encryption process result through decryption parameters; the data packet is obtained in the first decryption processing process;
and when the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, generating a temporary password and transmitting the temporary password to the terminal through the Bluetooth module.
Further, the decryption parameter includes a first authorization code, the second encryption processing result is obtained by performing first encryption on the data packet through an encryption algorithm and performing second encryption on the first encryption result through a second authorization code, and the first authorization code is the same as the second authorization code; the second decryption processing on the second encryption processing result includes:
and performing second decryption processing on the second encryption processing result through the first authorization code to obtain a second decryption processing result which is the first encryption result.
Further, the decryption parameters further comprise a private key, and the first encryption processing result is obtained by performing third encryption on the data packet through the public key; the first decryption processing on the first encryption processing result includes:
decrypting the first encryption processing result through the private key to obtain the data packet;
and carrying out fourth encryption on the data packet through the encryption algorithm to obtain a first decryption processing result.
Further, the stay time data includes server real-time, the method further comprising:
and updating the local time of the door lock through the real-time of the server.
Further, the check-in time data further comprises a check-in start time and a check-in end time; the method further comprises the steps of: before the step of generating a temporary password: determining that the local time is between the check-in start time and the check-in end time;
or alternatively, the process may be performed,
after the step of generating a temporary password: detecting the input time of the temporary password input by a user, and unlocking the door lock when the input time is between the check-in starting time and the check-in ending time.
The embodiment of the invention also provides a temporary password generation method, which comprises the following steps:
the terminal receives the incoming information input by the user and transmits the incoming information to the server;
the server generates a data packet according to the check-in information, and respectively carries out first encryption processing and second encryption processing on the data packet to obtain encrypted content and transmits the encrypted content to the terminal; the data packet comprises a second identity identification number of the door lock and time data of the check-in;
the door lock is communicated with the terminal through the Bluetooth module to receive the encrypted content, the first encryption processing result is subjected to first decryption processing through decryption parameters, the second encryption processing result is subjected to second decryption processing, and when the time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, a temporary password is generated and transmitted to the terminal through the Bluetooth module; the door lock stores the first identification number and the decryption parameter, and the data packet is obtained in the first decryption process.
Further, the performing a first encryption process and a second encryption process on the data packet respectively to obtain encrypted content includes:
the data packet is subjected to first encryption through an encryption algorithm, and the first encryption result is subjected to second encryption through a second authorization code to obtain a second encryption processing result;
performing third encryption on the data packet through a public key to obtain a first encryption processing result;
the public key and the second authorization code are stored in the server.
The embodiment of the invention also provides a temporary password generating device, which comprises:
the Bluetooth module is used for establishing communication with the terminal to receive the encrypted content transmitted by the terminal and transmitting a temporary password to the terminal; the encrypted content comprises a first encryption processing result and a second encryption processing result, a server responds to the check-in information input by the terminal to generate a data packet, and the data packet is subjected to first encryption processing and second encryption processing respectively to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and time data of the check-in;
the storage module is used for storing a first identity identification number and decryption parameters of the door lock and carrying out first decryption processing on the first encryption processing result and second decryption processing on the second encryption processing result through the decryption parameters; the data packet is obtained in the first decryption processing process; and when the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, generating a temporary password.
The embodiment of the invention also provides electronic equipment, which comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the method.
Embodiments of the present invention also provide a computer-readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by a processor to implement the method.
The beneficial effects of the invention are as follows: establishing communication with a terminal through the Bluetooth module to receive encrypted content transmitted by the terminal, wherein the encrypted content can be communicated with the terminal and received by the terminal even when a door lock is disconnected, the encrypted content comprises a first encryption processing result and a second encryption processing result, a server responds to the check-in information input by the terminal to generate a data packet, and the data packet is respectively subjected to first encryption processing and second encryption processing to obtain the encrypted content; performing a first decryption process on the first encryption processing result and performing a second decryption process on the second encryption processing result through decryption parameters, and generating a temporary password when the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, wherein the temporary password is generated in the door lock without simultaneous dynamic refreshing in a server and the door lock, the problem of password verification failure caused by inconsistent clock factors is solved, and the effective available temporary password can be generated; the temporary password is transmitted to the terminal through the Bluetooth module, so that the door lock can still transmit the temporary password for a user to use under the condition of network disconnection.
Drawings
FIG. 1 is a schematic flow chart of steps of a temporary password generation method according to the present application;
FIG. 2 is a flowchart illustrating another temporary password generation method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a detailed embodiment of a temporary password generation method according to the present application.
Detailed Description
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims and drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprise" and "have," as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments.
As shown in fig. 1, the temporary password generating method provided by the embodiment of the application can be applied to a door lock, wherein the door lock is provided with a bluetooth module and a storage module, and the storage module stores a unique first identification number and decryption parameters of the door lock. It should be noted that the storage module may be a module including a storage function, a data processing function (such as decryption and peer-to-peer function), and a local time of the door lock, where the storage module processes the content transmitted by the bluetooth module according to the stored first identity identifier and the decryption parameter and/or sends a processing result to the bluetooth module for further transmission. Optionally, the temporary password generation method includes steps S100-S300:
S100, communication is established with the terminal through the Bluetooth module so as to receive the encrypted content transmitted by the terminal.
In the embodiment of the invention, the door lock establishes communication with the terminal of the user through the Bluetooth module, so that the effective communication between the door lock and the terminal can be maintained, and the terminal of the user can also establish communication with the door lock for subsequent operation even when a WIFI or gateway router and other link networks are not available. Alternatively, the bluetooth module of the door lock may be kept in a wake-up state all the time, or the bluetooth module may be kept in a sleep state, and the user inputs a wake-up instruction to wake up the door lock and the bluetooth module, for example, the wake-up instruction may be to click a screen or a key of the door lock, etc.
Optionally, the encrypted content includes a first encryption processing result and a second encryption processing result, the server responds to the check-in information input by the terminal to generate a data packet, and the data packet is respectively subjected to the first encryption processing and the second encryption processing to obtain the encrypted content; the data packet includes a second identification number of the door lock and entry time data. Specifically, when a user needs to check in a room, logging in the terminal to connect with the server, and inputting check-in information in the terminal, wherein the check-in information comprises but is not limited to address information, room number and check-in time data; the check-in time data includes, but is not limited to, a check-in start time, a check-in end time, and a server real-time, for example, the server real-time may be a time of a current server when the user logs in the terminal to connect to the server, or a time of a current server when the user completes check-in information. The time in the residence time data is a time value, and the time value may be a time value such as a time stamp or a time.
In the embodiment of the invention, the server receives the check-in information to generate the data packet in response to the check-in information, wherein the data packet comprises, but is not limited to, a unique second identification number of the door lock and check-in time data, so that the contents included in the data packet can be the second identification number, the check-in start time, the check-in end time and the server real-time.
Optionally, the server stores encryption parameters, and after the server generates the data packet, the server performs a first encryption process and a second encryption process on the data packet by using the encryption parameters to obtain a first encryption process result and a second encryption process result, thereby forming the encrypted content. Specifically, taking the example that the encryption parameter includes the second authorization code and the public key, the server is provided with a database, the database can include an identification number library and an authorization code library, the identification number library stores unique identification numbers of the door locks corresponding to each address and room number, the authorization code library can store authorization codes of the door locks corresponding to each address and room number, therefore, the server can determine the corresponding identification number from the identification number library as the second identification number according to the address information and the room number in the check-in information, and determine the corresponding authorization code from the authorization code library as the second authorization code according to the address information and the room number in the check-in information. Specifically, the server performs first encryption on the data packet through an encryption algorithm, and performs second encryption on the first encryption result through a second authorization code, so as to obtain a second encryption processing result; and the server performs third encryption on the data packet through the public key, so that a third encryption result, namely a first encryption processing result, is obtained. Optionally, encryption algorithms include, but are not limited to, MD5, SHA1, HMAC, AES, DES, 3DES, RSA, ECC, etc., with MD5 being illustratively employed by embodiments of the present invention.
S200, performing first decryption processing on the first encryption processing result and performing second decryption processing on the second encryption processing result through the decryption parameters.
Optionally, the decryption parameter includes, but is not limited to, a first authorization code and a private key, wherein the first authorization code is identical to a second authorization code corresponding to the door lock in the server, and the private key corresponds to a public key in the server.
In the embodiment of the present invention, the step S200 of performing the second decryption process on the second encryption result through the decryption parameter specifically includes a step S211 of performing the second decryption process on the second encryption result through the first authorization code to obtain the first encryption result, i.e., the second decryption result.
In the embodiment of the present invention, the step S200 of performing the first decryption process on the first encryption result through the decryption parameter specifically includes steps S221 to S222, and the execution sequence between steps S221, S222 and S211 is arbitrary:
s221, decrypting the first encryption processing result through the private key to obtain a data packet.
Specifically, the first encryption processing result is decrypted through the private key to obtain a data packet, so that the content in the data packet, such as the second identity identification number, the check-in starting time, the check-in ending time and the server real-time, can be obtained.
S222, fourth encryption is carried out on the data packet through an encryption algorithm, and a first decryption processing result is obtained.
It should be noted that, the encryption algorithm adopted by the door lock is the same as the encryption algorithm adopted in the server, for example, MD5 is adopted in the server, and the MD5 is adopted in the door lock, and the fourth encryption is performed on the data packet by the encryption algorithm, so as to obtain a fourth encryption result, that is, a first decryption result.
S300, when the check-in time data are legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, a temporary password is generated and transmitted to the terminal through the Bluetooth module.
In the embodiment of the invention, the door lock needs to check and compare the data packet, the first decryption processing result and the second encryption processing result, so as to determine whether a temporary password needs to be generated. Specifically, checking whether the check-in time data is legal may be, for example, detecting whether a time span between the check-in start time and the check-in end time is greater than a span threshold, detecting whether a first time interval between the check-in start time and the server real-time is greater than a first interval threshold, and detecting whether a second time interval between the check-in end time and the server real-time is greater than a second interval threshold, and if at least one of the occurrence time span is greater than the span threshold, the first time interval is greater than the first interval threshold, and the second time interval is greater than the second interval threshold, then it is considered illegal, when the check-in time data is illegal, there may be a case of being illegally tampered with, and when the temporary password is not generated. It can be understood that if the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption result and the second decryption result is the same, a temporary password is generated, so that the security is improved. It should be noted that the span threshold, the first interval threshold, and the second interval threshold may be adjusted according to actual situations.
In the embodiment of the invention, after the door lock generates the temporary password, the temporary password is transmitted to the terminal of the user through the Bluetooth module, so that the temporary password of the user is obtained, and even if the door lock is in a disconnected state without a WIFI or a gateway router or other link network, the temporary password can still be generated for the user and transmitted to the terminal of the user, and the use room of the user is not influenced; and be applicable to the scene that does not set up gateway, WIFI module networking, can reduce the cost of lock.
It should be noted that, the door lock applied by the method of the embodiment of the invention can be suitable for the door lock of the room with the facilities of the price such as hotels, apartments and the like which can be reserved on the internet, and the user can select the address and the room number according to the own needs and fill in the check-in information through the terminal, so as to apply for and reserve on the line, authorize on the line to obtain the temporary password, thereby being convenient and quick without the intervention of other people, reducing the labor cost on one hand, realizing the non-contact check-in of the room on the other hand, and improving the safety.
Optionally, the temporary password generating method of the embodiment of the present invention further includes step S400, step S500, and step S600:
And S400, updating the local time of the door lock through the server real-time.
Specifically, after the data packet is obtained in the process of performing the first decryption processing on the door lock, the local time of the door lock is updated to be the real-time of the server in the data packet, so that the local time is accurate. It should be noted that, in some cases, for example, when the door lock is powered off, the local time of the door lock may be the time when the power is turned off when the power is restored, so that the local time may deviate from the actual time, and therefore, the local time of the door lock is updated by using the real-time of the server, so that the accuracy of the local time can be improved. The execution sequence of step S400 and step S300 is arbitrary, that is, step S400 may be executed before step S300, or step S400 may be executed simultaneously with step S300, or step S400 may be executed after step S300.
Wherein S500 may include step S510 or S520:
s510, before the step of generating the temporary password: the local time is determined to be between the check-in start time and the check-in end time.
Specifically, before the step of generating the temporary password, that is, while, before or after the step of determining that the check-in time data is legal, comparing the first identification number with the second identification number, and comparing the first decryption result with the second decryption result, it may be determined that the local time is between the check-in start time and the check-in end time, and then the temporary password is regenerated. For example, the temporary password is generated after the validity of the check-in time data, the identical comparison result of the first identity identification number and the second identity identification number, the identical comparison result of the first decryption processing result and the second decryption processing result, and the local time between the check-in start time and the check-in end time are simultaneously satisfied.
S520, after the step of generating the temporary password: detecting the input time of the temporary password input by the user, and unlocking the door lock when the input time is between the check-in starting time and the check-in ending time.
Specifically, after the step of generating the temporary password: according to the time of starting the check-in and the time of ending the check-in, a valid period can be obtained, when the user inputs the temporary password, the door lock detects the input time of the temporary password input by the user, when the input time is between the time of starting the check-in and the time of ending the check-in, namely, the input time is within the valid period, the door lock is opened, otherwise, the door lock is not opened, the user can be prompted to expire the temporary password, and the user needs to reserve and apply again, for example, the user can be reminded in a mode of voice, screen display words and the like.
S600, carrying out fifth encryption on the data packet through the first authorization code, and updating the first authorization code into a fifth encryption result so as to update the second authorization code into the fifth encryption result.
Optionally, the server and the door lock detect the data packet at a preset time interval, continuously detect that the check-in time data is valid, and when the check-in time data is invalid, for example, detect that the real-time of the door lock and the current real-time of the server are later than the check-in end time, at this time, the door lock performs fifth encryption on the data packet through the first authorization code, updates the first authorization code into a fifth encryption result so as to update the second authorization code into a fifth encryption result, and updates the first authorization code of the door lock and the second authorization code of the server into a fifth encryption result identical to the first authorization code, so that the first authorization code and the second authorization code in the server are dynamic authorization codes updated at a preset time interval. It should be noted that, the server may perform sixth encryption on the data packet through the second authorization code, update the second authorization code to a sixth encryption result, where the sixth encryption result and the fifth encryption result are equivalent to updating the second authorization code to the fifth encryption result, so as to encrypt and decrypt different data packets generated by different users correspondingly next time, thereby improving security. It should be noted that, in the initial state, the first authorization code and the second authorization code are initialized to the same preset value.
As shown in fig. 2, the embodiment of the present invention further provides another temporary password generation method, which includes steps S1000 to S3000:
s1000, the terminal receives the incoming information input by the user and transmits the incoming information to the server.
Optionally, the check-in information includes, but is not limited to, address information, room number, and check-in time data including, but not limited to, check-in start time, check-in end time, and server real-time.
S2000, the server generates a data packet according to the check-in information, and respectively performs first encryption processing and second encryption processing on the data packet to obtain encrypted content and transmit the encrypted content to the terminal.
It should be noted that, the content that may be included in the data packet may be the second id, the time of starting the check-in, the time of ending the check-in, and the real-time of the server.
Optionally, the server stores encryption parameters, where the encryption parameters include, but are not limited to, a second authorization code and a public key, and after the server generates the data packet, the server performs a first encryption process and a second encryption process on the data packet by using the encryption parameters to obtain a first encryption process result and a second encryption process result, so as to form the encrypted content. Specifically, the server is provided with a database, the database can comprise an identification number library and an authorization code library, the identification number library stores unique identification numbers of the door locks corresponding to the addresses and the room numbers, the authorization code library can store authorization codes of the door locks corresponding to the addresses and the room numbers, therefore, the server can determine the corresponding identification numbers from the identification number library as second identification numbers according to the address information and the room numbers in the check-in information, and determine the corresponding authorization codes from the authorization code library as second authorization codes according to the address information and the room numbers in the check-in information.
Optionally, in step S2000, the first encryption process and the second encryption process are performed on the data packet, respectively, to obtain encrypted content, which includes steps S2001-S2002:
s2001, carrying out first encryption on the data packet through an encryption algorithm, and carrying out second encryption on the first encryption result through a second authorization code to obtain a second encryption processing result.
Optionally, encryption algorithms include, but are not limited to, MD5, SHA1, HMAC, AES, DES, 3DES, RSA, ECC, etc., with MD5 being illustratively employed by embodiments of the present invention.
S2002, carrying out third encryption on the data packet through the public key to obtain a first encryption processing result.
S3000, the door lock is communicated with the terminal through the Bluetooth module to receive the encrypted content, the first encryption processing result is subjected to first decryption processing and the second encryption processing result is subjected to second decryption processing through the decryption parameters, and when the time data of the check-in is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, a temporary password is generated and transmitted to the terminal through the Bluetooth module.
It should be noted that, the local time of the door lock can be updated by the real-time of the server; before the step of generating the temporary password, the door lock can also determine that the local time is between the check-in starting time and the check-in ending time, and the temporary password is generated after the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, the comparison result of the first decryption processing result and the second decryption processing result is the same, and the local time is between the check-in starting time and the check-in ending time; or after the step of generating the temporary password, the door lock can detect the input time of the temporary password input by the user, when the input time is between the check-in starting time and the check-in ending time, the door lock is opened, otherwise, the door lock is not opened, the user can be prompted to expire the temporary password, and the user needs to reserve and apply again, for example, the user can be reminded in a mode of voice, screen display words and the like.
In the embodiment of the invention, the door lock is provided with a Bluetooth module and a storage module, wherein the storage module stores a unique first identification number of the door lock and decryption parameters, and the decryption parameters comprise, but are not limited to, a first authorization code and a private key. Specifically, the processing procedure of step S3000 may refer to S200 and S300, which are not described in detail.
As shown in fig. 3, a detailed embodiment is provided to describe the temporary password generation method according to the embodiment of the present invention in detail:
a user wakes up the door lock before the door lock, and a Bluetooth module of the door lock enters a working state;
the user is connected with the Bluetooth door lock with the Bluetooth module through a terminal (mobile terminal);
the user inputs the check-in information to check in through the mobile terminal login server, for example, the check-in information can be provided to the server (i.e. the server) in the form of a check-in order;
the server (i.e. the server side) generates a check-in order data packet (i.e. a data packet) according to the check-in order, and then encrypts the check-in order data packet through a door lock public key stored in the server to obtain data T1 (i.e. a first encryption processing result);
the server encrypts the check-in order data packet through an MD5 algorithm to obtain an MD5 value K1 (namely a first encryption result), and encrypts the K1 through a dynamic authorization code (specifically a second authorization code) to obtain data T2 (with a fixed length L, namely a second encryption processing result).
The data T1 and the data T2 form encrypted content which is transmitted from the server to the mobile terminal of the user, and the mobile terminal is transmitted to the door lock through the Bluetooth module;
the door lock intercepts data T2 with fixed length L, decrypts the T2 through a dynamic authorization code (specifically, a first authorization code) to obtain an MD5 value K0 (namely, a second decryption processing result, normally, K0=K1), decrypts the T1 through a private key to obtain an order-in data packet, and encrypts the order-in data packet through the same MD5 encryption algorithm to obtain the MD5 value K2 (namely, a first decryption processing result).
The door lock checks whether the K2 and the K0 are consistent, namely, whether the device ID is consistent or not is determined, namely, whether the comparison result of the first identity identification number and the second identity identification number is the same, whether the comparison result of the first decryption processing result and the second decryption processing result is the same or not is determined, if the comparison result of the first identity identification number and the second identity identification number is different and/or the comparison result of the first decryption processing result and the second decryption processing result is different, a prompt failure is given, and if the comparison result of the first identity identification number and the second identity identification number is the same and the result of the first decryption processing result and the second decryption processing result is the same, the process A or the process B can be executed:
Flow A: when or after the fact that K2 and K0 are consistent and the device ID is consistent is determined, whether time is legal or not, namely whether the check-in time data is legal or not and illegal prompt fails is determined, if the check-in time data is legal, the server real-time is extracted from the check-in order data packet to update the local time of the door lock, whether the server real-time/local time is located between the check-in start time and the check-in end time or not is determined according to the check-in start time and the check-in end time, if the check-in time/local time is located between the check-in start time and the check-in end time, a temporary password is generated and is transmitted to a user mobile terminal through a Bluetooth module;
flow B: directly generating a temporary password, extracting the real-time of a server from an order data packet to update the local time of a door lock, determining the effective period according to the entry start time and the entry end time when the user inputs the temporary password, detecting whether the input time of the temporary password is within the effective period to detect the validity of the temporary password, if the input time of the temporary password is within the effective period, the temporary password is valid, unlocking, otherwise prompting failure;
in addition, after the process a or the process B, the door lock and the server will detect whether the check-in end time is reached, and if the check-in end time is reached, the door lock and the server will simultaneously encrypt the check-in data packet with the dynamic authorization code by using a private algorithm (including but not limited to MD5, SHA1, HMAC, AES, DES, 3DES, RSA, ECC, etc.), and obtain the data T3 to update the dynamic authorization code. Specifically, the door lock encrypts the incoming data packet with the first authorization code using a private algorithm to update the first authorization code, and the server encrypts the incoming data packet with the second authorization code using the same private algorithm as the door lock to update the second authorization code.
The embodiment of the invention also provides a temporary password generating device, which comprises:
the Bluetooth module is used for establishing communication with the terminal to receive the encrypted content transmitted by the terminal and transmitting the temporary password to the terminal; the encrypted content comprises a first encryption processing result and a second encryption processing result, a server responds to the check-in information input by the terminal to generate a data packet, and the data packet is subjected to first encryption processing and second encryption processing respectively to obtain the encrypted content; the data packet comprises a second identity number of the door lock and time data of the check-in;
the storage module is used for storing a first identity identification number and decryption parameters of the door lock and carrying out first decryption processing on a first encryption processing result and second decryption processing on a second encryption processing result through the decryption parameters; obtaining a data packet in the first decryption process; and when the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, generating a temporary password.
The content in the method embodiment is applicable to the embodiment of the device, and the functions specifically realized by the embodiment of the device are the same as those of the method embodiment, and the obtained beneficial effects are the same as those of the method embodiment.
The embodiment of the invention also provides electronic equipment, which comprises a processor and a memory, wherein at least one instruction, at least one section of program, a code set or an instruction set is stored in the memory, and the at least one instruction, the at least one section of program, the code set or the instruction set is loaded and executed by the processor to realize the temporary password generation method of the previous embodiment. The electronic equipment of the embodiment of the invention comprises, but is not limited to, a mobile phone, a tablet personal computer, a vehicle-mounted computer, a server, a door lock and the like.
The content in the method embodiment is applicable to the embodiment of the device, and functions specifically implemented by the embodiment of the device are the same as those of the embodiment of the method, and the achieved beneficial effects are the same as those of the embodiment of the method.
The embodiment of the invention also provides a computer readable storage medium, in which at least one instruction, at least one section of program, code set or instruction set is stored, and the at least one instruction, the at least one section of program, code set or instruction set is loaded and executed by a processor to implement the temporary password generation method of the foregoing embodiment.
Embodiments of the present invention also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the temporary password generation method of the foregoing embodiment.
The terms "first," "second," "third," "fourth," and the like in the description of the application and in the above figures, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of elements is merely a logical functional division, and there may be additional divisions of actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form. The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
The above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (10)

1. A temporary password generation method, characterized in that it is applied to a door lock, the door lock has a bluetooth module and a storage module, the storage module stores a first identity identification number and a decryption parameter of the door lock, the method includes:
establishing communication with a terminal through the Bluetooth module to receive encrypted content transmitted by the terminal; the encrypted content comprises a first encryption processing result and a second encryption processing result, a server responds to the check-in information input by the terminal to generate a data packet, and the data packet is subjected to first encryption processing and second encryption processing respectively to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and time data of the check-in;
performing a first decryption process on the first encryption process result and performing a second decryption process on the second encryption process result through decryption parameters; the data packet is obtained in the first decryption processing process;
and when the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, generating a temporary password and transmitting the temporary password to the terminal through the Bluetooth module.
2. The temporary password generation method according to claim 1, wherein: the decryption parameters comprise a first authorization code, the second encryption processing result is obtained by carrying out first encryption on the data packet through an encryption algorithm and carrying out second encryption on the first encryption result through a second authorization code, and the first authorization code is identical to the second authorization code; the second decryption processing on the second encryption processing result includes:
and performing second decryption processing on the second encryption processing result through the first authorization code to obtain a second decryption processing result which is the first encryption result.
3. The temporary password generation method according to claim 2, wherein: the decryption parameters further comprise a private key, and the first encryption processing result is obtained by carrying out third encryption on the data packet through the public key; the first decryption processing on the first encryption processing result includes:
decrypting the first encryption processing result through the private key to obtain the data packet;
and carrying out fourth encryption on the data packet through the encryption algorithm to obtain a first decryption processing result.
4. A temporary password generation method according to any one of claims 1 to 3, characterized in that: the check-in time data includes server real-time, the method further comprising:
And updating the local time of the door lock through the real-time of the server.
5. The temporary password generation method according to claim 4, wherein: the check-in time data also comprises a check-in starting time and a check-in ending time; the method further comprises the steps of:
before the step of generating a temporary password: determining that the local time is between the check-in start time and the check-in end time;
or alternatively, the process may be performed,
after the step of generating a temporary password: detecting the input time of the temporary password input by a user, and unlocking the door lock when the input time is between the check-in starting time and the check-in ending time.
6. A temporary password generation method, characterized by comprising:
the terminal receives the incoming information input by the user and transmits the incoming information to the server;
the server generates a data packet according to the check-in information, and respectively carries out first encryption processing and second encryption processing on the data packet to obtain encrypted content and transmits the encrypted content to the terminal; the data packet comprises a second identity identification number of the door lock and time data of the check-in;
the door lock is communicated with the terminal through the Bluetooth module to receive the encrypted content, the first encryption processing result is subjected to first decryption processing through decryption parameters, the second encryption processing result is subjected to second decryption processing, and when the time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, a temporary password is generated and transmitted to the terminal through the Bluetooth module; the door lock stores the first identification number and the decryption parameter, and the data packet is obtained in the first decryption process.
7. The temporary password generation method according to claim 6, wherein: the first encryption processing and the second encryption processing are respectively performed on the data packet to obtain encrypted content, including:
the data packet is subjected to first encryption through an encryption algorithm, and the first encryption result is subjected to second encryption through a second authorization code to obtain a second encryption processing result;
performing third encryption on the data packet through a public key to obtain a first encryption processing result;
the public key and the second authorization code are stored in the server.
8. A temporary password generation apparatus, comprising:
the Bluetooth module is used for establishing communication with the terminal to receive the encrypted content transmitted by the terminal and transmitting a temporary password to the terminal; the encrypted content comprises a first encryption processing result and a second encryption processing result, a server responds to the check-in information input by the terminal to generate a data packet, and the data packet is subjected to first encryption processing and second encryption processing respectively to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and time data of the check-in;
the storage module is used for storing a first identity identification number and decryption parameters of the door lock and carrying out first decryption processing on the first encryption processing result and second decryption processing on the second encryption processing result through the decryption parameters; the data packet is obtained in the first decryption processing process; and when the check-in time data is legal, the comparison result of the first identity identification number and the second identity identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, generating a temporary password.
9. An electronic device comprising a processor and a memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the method of any one of claims 1-7.
10. A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set, the at least one instruction, the at least one program, the code set, or instruction set being loaded and executed by a processor to implement the method of any of claims 1-7.
CN202210590738.2A 2022-05-27 2022-05-27 Temporary password generation method, device, equipment and storage medium Active CN114783091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210590738.2A CN114783091B (en) 2022-05-27 2022-05-27 Temporary password generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210590738.2A CN114783091B (en) 2022-05-27 2022-05-27 Temporary password generation method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN114783091A CN114783091A (en) 2022-07-22
CN114783091B true CN114783091B (en) 2023-10-20

Family

ID=82409313

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210590738.2A Active CN114783091B (en) 2022-05-27 2022-05-27 Temporary password generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114783091B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204759558U (en) * 2015-07-14 2015-11-11 深圳市亲邻科技有限公司 Intelligent entrance guard , equipment and system
CN105205898A (en) * 2015-10-22 2015-12-30 深圳优方网络技术有限公司 Electronic code permission management system for intelligent lock
KR20170101156A (en) * 2016-02-26 2017-09-05 윤성호 System and method for doorlock
CN107798757A (en) * 2017-10-26 2018-03-13 厦门分享云科技有限公司 A kind of method for unlocking of intelligent door lock
CN109905235A (en) * 2017-12-08 2019-06-18 北京邮电大学 A kind of smart lock unlocking method, smart lock, terminal, server and system
WO2019134404A1 (en) * 2018-01-05 2019-07-11 深圳市欧瑞博科技有限公司 Smart door lock control method and device, and related apparatus
CN112200941A (en) * 2020-10-09 2021-01-08 广东科徕尼智能科技有限公司 Method, equipment and storage medium for generating temporary password by intelligent door lock
CN113689607A (en) * 2021-09-15 2021-11-23 深圳指芯物联技术有限公司 Intelligent door lock code scanning unlocking method and system based on application program
CN113781686A (en) * 2021-09-10 2021-12-10 青岛海信智慧生活科技股份有限公司 Verification method, generation method and device for temporary password of intelligent door lock
CN114297622A (en) * 2021-11-09 2022-04-08 四川微盾智能科技有限公司 Password authorization method and system

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN204759558U (en) * 2015-07-14 2015-11-11 深圳市亲邻科技有限公司 Intelligent entrance guard , equipment and system
CN105205898A (en) * 2015-10-22 2015-12-30 深圳优方网络技术有限公司 Electronic code permission management system for intelligent lock
KR20170101156A (en) * 2016-02-26 2017-09-05 윤성호 System and method for doorlock
CN107798757A (en) * 2017-10-26 2018-03-13 厦门分享云科技有限公司 A kind of method for unlocking of intelligent door lock
CN109905235A (en) * 2017-12-08 2019-06-18 北京邮电大学 A kind of smart lock unlocking method, smart lock, terminal, server and system
WO2019134404A1 (en) * 2018-01-05 2019-07-11 深圳市欧瑞博科技有限公司 Smart door lock control method and device, and related apparatus
CN112200941A (en) * 2020-10-09 2021-01-08 广东科徕尼智能科技有限公司 Method, equipment and storage medium for generating temporary password by intelligent door lock
CN113781686A (en) * 2021-09-10 2021-12-10 青岛海信智慧生活科技股份有限公司 Verification method, generation method and device for temporary password of intelligent door lock
CN113689607A (en) * 2021-09-15 2021-11-23 深圳指芯物联技术有限公司 Intelligent door lock code scanning unlocking method and system based on application program
CN114297622A (en) * 2021-11-09 2022-04-08 四川微盾智能科技有限公司 Password authorization method and system

Also Published As

Publication number Publication date
CN114783091A (en) 2022-07-22

Similar Documents

Publication Publication Date Title
US11070364B2 (en) Secure communication method and smart lock system based thereof
US7571489B2 (en) One time passcode system
US8930700B2 (en) Remote device secure data file storage system and method
US7681037B2 (en) Network connection system
CN1323538C (en) A dynamic identity certification method and system
CN101291228B (en) Generating, authenticating method for super code, system and device thereof
JP2005516268A (en) Method for operating a computer system
CN108605034A (en) Radio firmware updates
CN111130798B (en) Request authentication method and related equipment
US10810318B2 (en) Method for leveraging a secure telecommunication session
CN111243133A (en) Bluetooth door lock system based on dynamic password generation and matching and unlocking method
CN107221061A (en) A kind of cipher management method of smart lock
JPH08320847A (en) Password management system
KR102160656B1 (en) Login Method Using Palm Vein
CN105069920A (en) Password-dynamic-synchronization-based collection system
WO2013102152A1 (en) Secure mechanisms to enable mobile device communication with a security panel
CN110598469B (en) Information processing method, device and computer storage medium
CN112039922A (en) Encryption communication method and device
CN100592317C (en) Peripheral apparatus and method for verifying authority thereof
CN112425116A (en) Intelligent door lock wireless communication method, intelligent door lock, gateway and communication equipment
CN114783091B (en) Temporary password generation method, device, equipment and storage medium
CN109949457B (en) Intelligent door lock control method and related device
KR101451638B1 (en) Identification and theft prevention system, and method thereof
CN112530053A (en) Control method and system of intelligent lock, lock equipment, server and storage medium
CN110191090A (en) Method of calibration, device, computer equipment and the storage medium of single-sign-on

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
GR01 Patent grant
GR01 Patent grant