CN114783091A - 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
CN114783091A
CN114783091A CN202210590738.2A CN202210590738A CN114783091A CN 114783091 A CN114783091 A CN 114783091A CN 202210590738 A CN202210590738 A CN 202210590738A CN 114783091 A CN114783091 A CN 114783091A
Authority
CN
China
Prior art keywords
encryption
check
processing result
temporary password
decryption
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.)
Granted
Application number
CN202210590738.2A
Other languages
Chinese (zh)
Other versions
CN114783091B (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

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00309Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys operated with bidirectional data transmission between data carrier and locks
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/00174Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys
    • G07C9/00817Electronically operated locks; Circuits therefor; Nonmechanical keys therefor, e.g. passive or active electrical keys or other data carriers without mechanical keys where the code of the lock can be programmed
    • 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 temporary password generation method is used for establishing communication with a terminal through a Bluetooth module so as to receive encrypted content transmitted by the terminal, and can be communicated with the terminal and receive the encrypted content transmitted by the terminal even when a door lock is disconnected; 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, 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, a temporary password is generated, the problem of password verification failure caused by inconsistent clock factors does not exist, 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 send 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 usually needs to be directly obtained from the server, the temporary password is directly issued by the server or the condition that the intelligent door lock sends out is obtained from the server, so that the intelligent door lock is in a networking state in order to ensure the normal obtaining of the temporary password of the intelligent door lock, the intelligent door lock is in communication with the server through a link network such as wifi or a gateway router, and therefore the temporary password cannot be obtained by the intelligent door lock when the network is disconnected, and the use of the intelligent door lock is influenced.
In order to solve the above problems, researchers have proposed a different temporary encryption 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 server or the App end needs to have the same clock factor, and when the local time of the intelligent door lock is inconsistent with the time of the server, the generated password is inconsistent, so that the verification of the temporary password is finally failed, and the intelligent door lock is also used.
Disclosure of Invention
In view of the above, in order to solve the above technical problems, the present invention aims to provide a temporary password generating method, device, apparatus and storage medium, which can generate a temporary password that is effectively usable.
The embodiment of the invention adopts the technical scheme that:
a temporary password generation method is applied to a door lock, the door lock is provided with a Bluetooth module and a storage module, the storage module stores a first identity identification number and decryption parameters of the door lock, and the method comprises the following steps:
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, 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 first encryption processing and second encryption processing to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and the check-in time data;
performing first decryption processing on the first encryption processing result and performing second decryption processing on the second encryption processing 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 performing of 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 parameter further comprises a private key, and the first encryption processing result is obtained by performing third encryption on the data packet through the public key; the performing of 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-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.
Further, the check-in time data further comprises a check-in start time and a check-in end time; the method further comprises the following steps: prior to 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,
after the step of generating a temporary password: and detecting the input time of the temporary password input by the user, and opening the door lock when the input time is between the check-in starting time and the check-in ending time.
An embodiment of the present invention further provides a method for generating a temporary password, including:
the terminal receives check-in information input by a user and transmits the check-in information to the server;
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 transmits the encrypted content to the terminal; the data packet comprises a second identity identification number of the door lock and the check-in time data;
the door lock is communicated with the terminal through a Bluetooth module to receive the encrypted content, first decryption processing is carried out on a first encryption processing result and second decryption processing is carried out on a second encryption processing result through decryption parameters, and when the check-in time data are legal, the comparison result of the first identity identification number is the same as the comparison result of the second identity identification number and the comparison result of the first decryption processing result is the same as the comparison result of the second decryption processing result, a temporary password is generated and is transmitted to the terminal through the Bluetooth module; the door lock stores the first identity identification number and the decryption parameter, and the data packet is obtained in the first decryption processing process.
Further, the performing the first encryption processing and the second encryption processing on the data packet respectively to obtain the encrypted content includes:
performing first encryption on the data packet through an encryption algorithm, and performing second encryption on a first encryption result 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.
An embodiment of the present invention further provides a temporary password generating apparatus, including:
the Bluetooth module is used for establishing communication with a terminal so as to receive 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, 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 first encryption processing and second encryption processing to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and the check-in time data;
the storage module is used for storing a first identity identification number and a decryption parameter of the door lock and is used for carrying out first decryption processing on the first encryption processing result and carrying out second decryption processing on the second encryption processing result through the decryption parameter; 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.
An embodiment of the present invention further provides an electronic device, which includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the method.
An embodiment of the present invention further provides a computer-readable storage medium, where at least one instruction, at least one program, a code set, or a set of instructions is stored in the storage medium, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the method.
The invention has the beneficial effects that: the Bluetooth module is communicated with the terminal to receive encrypted content transmitted by the terminal, the Bluetooth module can be communicated with the terminal and receive the encrypted content transmitted 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 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; the first encryption processing result is subjected to first decryption processing and the second encryption processing result is subjected to second decryption processing through decryption parameters, 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, a temporary password is generated, the temporary password is generated in the door lock without being dynamically refreshed in the server and the door lock at the same time, the problem of password verification failure caused by inconsistent clock factors does not exist, and an effective and available temporary password can be generated; and the temporary password is transmitted to the terminal through the Bluetooth module, so that the door lock can still send the temporary password for a user to use under the condition of network disconnection.
Drawings
FIG. 1 is a schematic flow chart illustrating steps of a temporary password generation method according to the present invention;
FIG. 2 is a flowchart illustrating a method for generating a temporary password according to another embodiment of the present invention;
fig. 3 is a flowchart illustrating steps of a temporary password generation method according to a detailed embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present application better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," and "fourth," etc. in the description and claims of this application and in the accompanying drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly 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 can be included in at least one embodiment of the application. The appearances of the phrase 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. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
As shown in fig. 1, the temporary password generation method provided in the embodiment of the present invention may be applied to a door lock, where the door lock has a bluetooth module and a storage module, and the storage module stores a unique first identity identifier and a decryption parameter of the door lock. It should be noted that the storage module may be a module that includes a storage function, a data processing function (e.g., decryption, comparison, etc.) and a local time of the door lock, and the storage module processes the content transmitted by the bluetooth module and/or sends the processing result to the bluetooth module for further transmission according to the stored first identity identifier and the decryption parameter. Optionally, the temporary password generation method includes steps S100 to S300:
s100, establishing communication with the terminal through the Bluetooth module 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 establish communication with the door lock to perform subsequent operation even when no link network such as WIFI or a gateway router exists. Optionally, the bluetooth module of the door lock may be kept in the call state all the time, or the bluetooth module may be kept in the 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 button of the door lock.
Optionally, the encrypted content includes a first encryption processing result and a second encryption processing result, the server generates a data packet in response to the check-in information input by the terminal, and performs the first encryption processing and the second encryption processing on the data packet respectively to obtain the encrypted content; the data packet comprises a second identification number of the door lock and the time of entry data. Specifically, when a user needs to check in a room, the user logs in the terminal to connect with the server, and check-in information is input into the terminal, wherein the check-in information comprises but is not limited to address information, a 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 a user logs in the terminal to connect to the server or a time of the current server when the user completes filling in check-in information. Each time in the attendance 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 present invention, the server receives the check-in information, and generates a data packet in response to the check-in information, where the data packet includes, but is not limited to, the unique second id number of the door lock and the check-in time data, and therefore, the content included in the data packet may be the second id number, the check-in start time, the check-in end time, and the server real-time.
Optionally, the server stores encryption parameters, and after generating the data packet, the server performs first encryption processing and second encryption processing on the data packet by using the encryption parameters, respectively, to obtain a first encryption processing result and a second encryption processing result, thereby constituting the encrypted content. Specifically, for example, the encryption parameter includes the second authorization code and the public key, the server has a database, the database may include 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, and the authorization code library stores authorization codes of the door locks corresponding to the addresses and the room numbers, so that the server may determine a corresponding identification number from the identification number library as the second identification number according to the address information and the room numbers in the check-in information, and determine a corresponding authorization code from the authorization code library as the second authorization code according to the address information and the room numbers 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 carries out third encryption on the data packet through the public key so as to obtain a third encryption result, namely a first encryption processing result. Alternatively, encryption algorithms include, but are not limited to, MD5, SHA1, HMAC, AES, DES, 3DES, RSA, and ECC, among others, with exemplary embodiments of the invention employing MD 5.
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, the first authorization code is the same as a second authorization code corresponding to the door lock in the server, and the private key corresponds to the public key in the server.
In the embodiment of the present invention, in step S200, the second decryption process is performed on the second encryption processing result through the decryption parameter, which specifically includes step S211, that is, the second decryption process is performed on the second encryption processing result through the first authorization code, and the first encryption result, that is, the second decryption processing result is obtained.
In the embodiment of the present invention, the step S200 performs the first decryption process on the first encryption processing result through the decryption parameter, which specifically includes steps S221 to S222, and the execution sequence between the steps S221, S222 and S211 is arbitrary:
s221, decrypting the first encryption processing result through the private key to obtain the data packet.
Specifically, the first encryption processing result is decrypted by the private key to obtain a data packet, so that the content in the data packet, such as the second id, the check-in start time, the check-in end time, and the server real-time, can be obtained.
S222, carrying out fourth encryption on the data packet through an encryption algorithm to obtain a first decryption processing result.
It should be noted that, the encryption algorithm used by the door lock is the same as the encryption algorithm used in the server, for example, MD5 is used in the server, the same as MD5 is used in the door lock, and the data packet is fourth encrypted by the encryption algorithm to obtain a fourth encryption result, that is, the first decryption processing result.
S300, 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.
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, whether the check-in time data is legal or not may be, for example, one of 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, where at least one of the 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 is considered to be illegal, the check-in time data is considered to be illegal, and there may be a case of being illegally tampered, and 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 identification number and the second identification number is the same, and the comparison result of the first decryption processing result and the second decryption processing result is the same, the temporary password is generated, and 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 acquired, and even if the door lock is in a disconnected state without a WIFI or gateway router or other link networks, the temporary password can be generated for the user and transmitted to the terminal of the user without influencing the use room of the user; and be applicable to the scene of not setting 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 present invention may be applicable to facilities with a room price, such as door locks of rooms of facilities like hotels, apartments and the like, which can be applied through online reservation and online application.
Optionally, the temporary password generation method according to 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 real-time of the server.
Specifically, after the data packet is obtained in the process that the door lock performs the first decryption processing, the local time of the door lock is updated to the server real-time 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 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, and 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: determining that the local time is between the check-in start time and the check-in end time.
Specifically, before, simultaneously with, before, or after the step of determining that the check-in time data is valid, comparing the first identification number with the second identification number, and comparing the first decryption processing result with the second decryption processing result, the temporary password may be generated after determining that the local time is between the check-in start time and the check-in end time. For example, the temporary password is generated after the data of the check-in time is legal, the comparison result of the first id and the second id 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 start time and the check-in end time.
S520, after the step of generating the temporary password: and detecting the input time of the temporary password input by the user, and opening 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: the method comprises the steps that a valid period can be obtained according to the time between the check-in starting time and the check-in ending time, when a user inputs a temporary password, a door lock detects 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, 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 that the temporary password is overdue, re-reservation and application are needed, and reminding can be carried out in the modes of voice, screen display characters and the like.
S600, performing fifth ciphering on the data packet through the first authorization code, and updating the first authorization code to be a fifth ciphering result so that the second authorization code is updated to be the fifth ciphering result.
Optionally, the server and the door lock detect the data packet at a preset time interval, the data of the check-in time is continuously detected to be valid, when the data of the check-in time fails, for example, when the data of the check-in time is detected to be invalid, the real-time of the door lock and the real-time of the current server are later than the check-in ending time, at this moment, the door lock performs fifth encryption on the data packet through the first authorization code, the first authorization code is updated to the fifth encryption result so that the second authorization code is updated to the fifth encryption result, while the first authorization code of the door lock is updated, the second authorization code of the server is also updated to the fifth encryption result which is the same as the first authorization code, and therefore 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, and update the second authorization code to be a sixth encryption result, and the sixth encryption result and the fifth encryption result, so that the server is equivalent to update the second authorization code to be the fifth encryption result, and is used to encrypt and decrypt different data packets correspondingly generated by different users 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, an embodiment of the present invention further provides another temporary password generation method, including steps S1000-S3000:
and S1000, the terminal receives the check-in information input by the user and transmits the check-in 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, a check-in start time, a check-in end time, and a server real time.
S2000, the server generates a data packet according to the check-in information, and performs first encryption processing and second encryption processing on the data packet respectively 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 number, the start time of the incoming call, the end time of the incoming call, 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 a data packet, the server performs first encryption processing and second encryption processing on the data packet by using the encryption parameters, respectively, to obtain a first encryption processing result and a second encryption processing result, so as to form encrypted content. Specifically, the server has a database, which may include 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 house numbers, and the authorization code library stores authorization codes of the door locks corresponding to the addresses and the house numbers, so that the server may determine a corresponding identification number from the identification number library as the second identification number according to the address information and the room numbers in the check-in information, and determine a corresponding authorization code from the authorization code library as the second authorization code according to the address information and the room numbers in the check-in information.
Optionally, the step S2000 of performing the first encryption process and the second encryption process on the data packet respectively to obtain the encrypted content includes steps S2001-S2002:
s2001, the data packet is encrypted through an encryption algorithm, and a second encryption processing result is obtained by encrypting the first encryption result through a second authorization code.
Alternatively, encryption algorithms include, but are not limited to, MD5, SHA1, HMAC, AES, DES, 3DES, RSA, ECC, and the like, with MD5 being used by exemplary embodiments of the invention.
And S2002, performing third encryption on the data packet through the public key to obtain a first encryption processing result.
S3000, the door lock communicates with the terminal through the Bluetooth module to receive encrypted content, first decryption processing is conducted on a first encryption processing result and second decryption processing is conducted on a second encryption processing result through decryption parameters, 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, the comparison result of the first decryption processing result and the second decryption processing result is the same, a temporary password is generated and is 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 when the data of the check-in time 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, the temporary password is generated; or after the step of generating the temporary password, the door lock may detect an input time when the user inputs the temporary password, and open the door lock when the input time is between the start time of the check-in and the end time of the check-in, otherwise, the door lock is not opened and the user may be prompted that the temporary password is expired, and the user needs to make a reservation and apply for the temporary password again, for example, the user may be reminded by means of voice, screen display text, and the like.
In the embodiment of the invention, the door lock is provided with a Bluetooth module and a storage module, the storage module stores a unique first identity identification number and decryption parameters of the door lock, and the decryption parameters include 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, and will not be described in detail.
As shown in fig. 3, a detailed embodiment is provided to describe the temporary password generation method in detail in the embodiment of the present invention:
a user wakes up the door lock in front of 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 (a mobile terminal);
a user logs in a server through a mobile terminal to input check-in information to check in, for example, the check-in information can be provided to the server (namely a server) in the form of a check-in order;
a server (namely a server) generates a check-in order data packet (namely a data packet) according to a 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 (namely a first encryption processing result);
the server encrypts the data packet of the check-in order by using an MD5 algorithm to obtain an MD5 value K1 (i.e., a first encryption result), and encrypts K1 by using a dynamic authorization code (specifically, a second authorization code) to obtain data T2 (having a fixed length L, i.e., a second encryption processing result).
The data T1 and T2 form encrypted content and are 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 a fixed length L, decrypts T2 by using a dynamic authorization code (specifically, a first authorization code) to obtain an MD5 value K0 (i.e., a second decryption processing result, normally, K0 is K1), decrypts T1 by using a private key to obtain a check-in order data packet, and encrypts the check-in order data packet by using the same MD5 encryption algorithm to obtain an MD5 value K2 (i.e., a first decryption processing result).
The door lock checks whether the K2 and the K0 are consistent and whether the device ID is consistent, that is, whether the comparison result of the first identification number and the second identification number is the same and whether the comparison result of the first decryption processing result and the second decryption processing result is the same are determined, if the comparison result of the first identification number and the second identification number is not the same and/or the comparison result of the first decryption processing result and the second decryption processing result is not the same, failure is prompted, and if the comparison result of the first identification number and the second 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 may be performed:
a process A: when or after K2 and K0 are determined to be consistent and the device IDs are determined to be consistent, whether the time is legal or not is determined, namely whether the check-in time data is legal or not, and illegal prompt fails;
and (B) a process B: directly generating a temporary password, extracting real-time of a server from an order data packet of check-in order to update local time of a door lock, determining a valid period according to check-in start time and check-in end time when a user inputs the temporary password, detecting whether the input time of the temporary password is within the valid period to detect the validity of the temporary password, if the input time of the temporary password is within the valid period, the temporary password is valid, unlocking the door, and otherwise, prompting failure;
in addition, after the process a or the process B, the door lock and the server may detect whether the check-in end time is reached at regular time, and if the check-in end time is reached, the door lock and the server may 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, and the like) at the same time, obtain data T3, and update the dynamic authorization code. Specifically, the door lock encrypts the data packet to be checked in by using a first authorization code through a private algorithm to update the first authorization code, and the server encrypts the data packet to be checked in by using a second authorization code through the same private algorithm as the door lock to update the second authorization code.
An embodiment of the present invention further provides a temporary password generating apparatus, including:
the Bluetooth module is used for establishing communication with the terminal so as 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, 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 first encryption processing and second encryption processing to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and the check-in time data;
the storage module is used for storing the first identity identification number and the decryption parameter of the door lock and is used for carrying out first decryption processing on the first encryption processing result and carrying out second decryption processing on the second encryption processing result through the decryption parameter; obtaining a data packet in the first decryption processing process; and when the check-in time data is legal, the comparison results of the first identity identification number and the second identity identification number are the same, and the comparison results of the first decryption processing result and the second decryption processing result are the same, generating a temporary password.
The contents in the method embodiments are all applicable to the device embodiments, the functions specifically implemented by the device embodiments are the same as those in the method embodiments, and the beneficial effects achieved by the device embodiments are also the same as those achieved by the method embodiments.
The embodiment of the present invention further provides an electronic device, where the electronic device includes a processor and a memory, where the memory stores at least one instruction, at least one program, a code set, or an instruction set, and the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the temporary password generation method of the foregoing embodiment. The electronic device of the embodiment of the invention includes, but is not limited to, a mobile phone, a tablet computer, a vehicle-mounted computer, a server, a door lock and the like.
The contents in the above method embodiments are all applicable to the present apparatus embodiment, the functions specifically implemented by the present apparatus embodiment are the same as those in the above method embodiments, and the beneficial effects achieved by the present apparatus embodiment are also the same as those achieved by the above method embodiments.
An embodiment of the present invention further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions 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 executes the temporary password generation method of the foregoing embodiment.
The terms "first," "second," "third," "fourth," and the like (if any) in the description of the present application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or 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" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. 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 in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is only a logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment. In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (10)

1. A temporary password generation method is applied to a door lock, the door lock is provided with a Bluetooth module and a storage module, the storage module stores a first identity identification number and decryption parameters of the door lock, and the method comprises the following steps:
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, 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 first encryption processing and second encryption processing to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and the check-in time data;
performing first decryption processing on the first encryption processing result and performing second decryption processing on the second encryption processing 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 parameter comprises 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.
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 performing third encryption on the data packet through the public key; the performing of 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 performing 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, wherein: the dwell 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 further comprises a check-in starting time and a check-in ending time; the method further comprises the following steps:
prior to 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,
after the step of generating a temporary password: and detecting the input time of the temporary password input by the user, and opening 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, comprising:
the terminal receives check-in information input by a user and transmits the check-in information to the server;
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 transmits the encrypted content to the terminal; the data packet comprises a second identity identification number of the door lock and the check-in time data;
the door lock is communicated with the terminal through a Bluetooth module to receive the encrypted content, first decryption processing is carried out on a first encryption processing result and second decryption processing is carried out on a second encryption processing result through decryption parameters, and when the check-in time data are legal, the comparison result of the first identity identification number is the same as the comparison result of the second identity identification number and the comparison result of the first decryption processing result is the same as the comparison result of the second decryption processing result, a temporary password is generated and is transmitted to the terminal through the Bluetooth module; the door lock stores the first identity identification number and the decryption parameter, and the data packet is obtained in the first decryption processing process.
7. The temporary password generation method according to claim 6, wherein: the respectively performing a first encryption process and a second encryption process on the data packet to obtain encrypted content includes:
performing first encryption on the data packet through an encryption algorithm, and performing second encryption on a first encryption result 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 a terminal so as to receive 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, 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 first encryption processing and second encryption processing to obtain the encrypted content; the data packet comprises a second identity identification number of the door lock and the check-in time data;
the storage module is used for storing a first identity identification number and a decryption parameter of the door lock and is used for performing first decryption processing on the first encryption processing result and performing second decryption processing on the second encryption processing result through the decryption parameter; obtaining the data packet 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, the 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 according to any one of claims 1-7.
10. 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, which is loaded and executed by a processor to implement the method according to any one of claims 1 to 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 true CN114783091A (en) 2022-07-22
CN114783091B 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
CN114783091B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
US11070364B2 (en) Secure communication method and smart lock system based thereof
US11335144B2 (en) Method for unlocking intelligent lock, mobile terminal, intelligent lock and server
US9836906B2 (en) Time synchronization
CN109272606B (en) Intelligent lock supervision equipment and method based on block chain and storage medium
CN1323538C (en) A dynamic identity certification method and system
CN110162936A (en) A kind of use authorization method of software content
US9467293B1 (en) Generating authentication codes associated with devices
Simplicio et al. SecourHealth: a delay-tolerant security framework for mobile health data collection
CN101853533B (en) Password setting method and device used for building gate control system
CN105118127A (en) Visiting system and control method thereof
CN110138744A (en) Replace method, apparatus, system, computer equipment and the storage medium of communicating number
CN103095457A (en) Login and verification method for application program
CN111130798B (en) Request authentication method and related equipment
CN112187931A (en) Session management method, device, computer equipment and storage medium
CN106411830A (en) Method for preventing access data from being tampered and mobile terminal
CN108605034A (en) Radio firmware updates
US20210351920A1 (en) Secure communication method and smart lock system based thereof
US20030156721A1 (en) Method and system for encryption and authentication
KR20080087917A (en) System for certify one-time password, system for issue a seed, and method for generating one-time password
US20130173913A1 (en) Secure mechanisms to enable mobile device communication with a security panel
CN109951294B (en) Information updating management method in electronic label system and related equipment
CN111444496A (en) Application control method, device, equipment and storage medium
CN110598469A (en) Information processing method and device and computer storage medium
CN100592317C (en) Peripheral apparatus and method for verifying authority thereof
CN112530053B (en) Control method and system of intelligent lock, lock equipment, server and storage medium

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