Disclosure of Invention
The invention aims to provide an encryption communication method of a split type intelligent lock and the split type intelligent lock, which can effectively improve the communication safety of the split type intelligent lock.
In order to achieve the purpose, the invention adopts the following technical scheme:
an encryption communication method of a split type intelligent lock is realized by a back panel and a password input device, wherein the same encryption random number is stored in the back panel and the password input device in advance, and the encryption communication method comprises the following steps:
s10, the password input device acquires an input key of a user;
s20, the password input device generates a first random number component, and encrypts the first random number component and the input key according to an encrypted random number to obtain first encrypted information;
s30, the password input device sends the first encryption information to the rear panel;
s40, the rear panel receives and decrypts the first encrypted information, obtains the first random number component and the input key, and judges whether to execute unlocking operation according to the input key;
s50, generating a second random number component by the rear panel, and combining the first random number component and the second random number component by the rear panel to form a new random number;
s60, the rear panel encrypts the new random number according to the encrypted random number to obtain second encryption information, and the new random number is used as the encrypted random number in the next encryption;
s70, the rear panel sends the second encrypted information to the password input device;
and S80, the password input device receives and decrypts the second encryption information, acquires the new random number, and makes the new random number as the encryption random number in the next encryption.
Optionally, before the password input device obtains the input key of the user, the method further includes a binding step, where the binding step is implemented by a binding code generation device, the back panel, and the password input device, and the binding step specifically includes:
s01, the binding code generating device generates a first binding random number and transmits the first binding random number to the rear panel through a set encryption communication channel;
s02, after receiving the first binding random number, the rear panel establishes wireless communication connection with the password input device;
s03, the password input device acquires the first binding random number input by a user, generates a second binding random number, encrypts the second binding random number according to the first binding random number to obtain a first key, and sends the first key to the rear panel;
s04, the back panel decrypts the first key to obtain the second binding random number, and the back panel generates a third binding random number; the back panel combines the second binding random number and the third binding random number to form the encrypted random number and stores the encrypted random number;
s05, the rear panel encrypts the encrypted random number according to the first binding random number to obtain a second key, and sends the second key to the password input device;
and S06, the password input device decrypts the second secret key, the encrypted random number is obtained and stored, and the rear panel is bound with the password input device.
Optionally, the step of: the rear panel receives and decrypts the first encrypted information, obtains the first random number component and the input key, and judges whether to execute unlocking operation according to the input key, wherein the key comprises:
s41, the rear panel receives and decrypts the first encrypted information;
s42, acquiring an input key, and judging whether the input key is matched with a preset unlocking key;
s43, if yes, unlocking operation is executed;
and S44, if not, not executing the unlocking operation.
Optionally, the back panel stores preset MAC address information in advance;
the password input device receives and decrypts the second encrypted information, acquires the new random number, and after the new random number is used as the encrypted random number in the next encryption, the password input device further comprises the following authentication steps:
s91, the password input device encrypts MAC address information of the password input device according to the encrypted random number and sends the encrypted MAC address information of the password input device to the rear panel;
s92, the rear panel judges whether the set MAC address information is consistent with the MAC address information of the password input device or not;
s93, if yes, allowing the password input device and the rear panel to keep wireless communication connection;
and S94, if not, disconnecting the wireless communication connection between the password input device and the rear panel.
Optionally, the wireless communication connection between the rear panel and the password input device is a bluetooth connection;
the password input device receives and decrypts the second encrypted information, acquires the new random number, and after making the new random number serve as an encrypted random number for the next encryption, the password input device further includes the following steps:
s95, after the password input device does not receive the trigger signal within the first set time length, automatically reducing the Bluetooth connection interval from the first set interval to a second set interval;
and S96, after receiving the trigger signal, the password input device calls back the Bluetooth connection interval from the second setting interval to the first setting interval.
Optionally, the first random number component has a byte length equal to the byte length of the second random number component.
A split type intelligent lock comprises a password input device and a rear panel, wherein the password input device is provided with a first encryption and decryption module and a first signal transceiving module, the rear panel is provided with a second encryption and decryption module and a second signal transceiving module, the password input device is further provided with a numeric keyboard, and the password input device and the rear panel execute the encryption communication method of the split type intelligent lock.
Optionally, the password input device and the rear panel are respectively arranged on two opposite sides of the door body.
Optionally, the split type intelligent lock further comprises a lock cylinder, the rear panel is detachably connected with the lock cylinder, and the rear panel is provided with a driving device for driving the lock cylinder to unlock or lock.
Compared with the prior art, the invention has the following beneficial effects:
in the embodiment of the invention, the rear panel and the password input device both pre-store encrypted random numbers, the password input device generates a first random number component in each unlocking communication process, the first random number component is used as a part of first encrypted information and transmitted to the rear panel, the rear panel generates a second random number component when receiving the first encrypted information, the rear panel forms the first random number component and the second random number component into a new random number, and the encrypted random numbers of the rear panel and the password input device are reset into the new random number when each communication is finished, so that the encrypted random numbers of each communication between the rear panel and the password input device are different, and the communication safety of the split intelligent lock is greatly improved.
Detailed Description
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "upper", "lower", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. It should be noted that when one component is referred to as being "connected" to another component, it can be directly connected to the other component or intervening components may also be present.
The technical scheme of the invention is further explained by the specific implementation mode in combination with the attached drawings.
Example one
An encryption communication method of a split type intelligent lock is realized by a back panel and a password input device, wherein the same encryption random number is stored in the back panel and the password input device in advance, and the encryption communication method comprises the following steps:
s10, the password input device acquires an input key of a user;
s20, the password input device generates a first random number component, and encrypts the first random number component and the input key according to the encrypted random number to obtain first encrypted information;
s30, the password input device sends the first encrypted information to the rear panel;
s40, the rear panel receives and decrypts the first encrypted information, obtains a first random number component and an input key, and judges whether to execute unlocking operation according to the input key;
s50, generating a second random number component by the rear panel, and combining the first random number component and the second random number component by the rear panel to form a new random number;
s60, encrypting the new random number by the rear panel according to the encrypted random number to obtain second encryption information, and enabling the new random number to serve as the encrypted random number in the next encryption;
s70, the rear panel sends the second encrypted information to the password input device;
s80, the password input device receives and decrypts the second encrypted information, obtains a new random number, and enables the new random number to serve as the encrypted random number in the next encryption.
Specifically, in each unlocking process, the password input device 2 generates a first random number component, the rear panel generates a second random number component, a new random number formed by combining the first random number component and the second random number component replaces the encrypted random number of the last time, and the new random number is used as the encrypted random number of the next unlocking. Therefore, in the unlocking process at each time, the encryption random numbers of the input keys for encrypting the users are different, the unlocking communication safety of the split intelligent lock is greatly improved, and replay attack can be effectively defended.
In this embodiment, before the password input apparatus obtains the input key of the user, the method further includes a binding step, where the binding step is implemented by the binding code generating apparatus, the back panel, and the password input apparatus, and the binding step specifically includes:
s01, generating a first binding random number by a binding code generating device, and transmitting the first binding random number to a rear panel through a set encryption communication channel;
s02, after receiving the first binding random number, the rear panel establishes wireless communication connection with a password input device;
s03, the password input device acquires a first binding random number input by a user, generates a second binding random number, encrypts the second binding random number according to the first binding random number to obtain a first key, and sends the first key to the rear panel;
s04, the back panel decrypts the first key to obtain a second binding random number, and the back panel generates a third binding random number; the rear panel combines the second binding random number and the third binding random number to form an encryption random number and stores the encryption random number;
s05, the rear panel encrypts and encrypts the random number according to the first binding random number to obtain a second key, and sends the second key to the password input device;
and S06, the password input device decrypts the second secret key, obtains and stores the encrypted random number, and the rear panel is bound with the password input device.
Specifically, the binding code generating device may be a mobile terminal, such as a mobile phone, an electronic watch, or a tablet computer. The mobile terminal is provided with an APP for generating a first binding random number, and the user obtains the first binding random number by using the APP. It should be clear that through the above binding step, both the password input device and the back panel hold encrypted random numbers, so that the back panel can unlock the first key smoothly.
In this embodiment, the receiving and decrypting of the first encrypted information by the back panel, obtaining the first random number component and the input key, and determining whether to execute the unlocking operation according to the input key includes:
s41, the rear panel receives and decrypts the first encrypted information;
s42, acquiring an input key, and judging whether the input key is matched with a preset unlocking key;
s43, if yes, unlocking operation is executed;
and S44, if not, the unlocking operation is not executed.
In this embodiment, the back panel stores preset MAC address information in advance; the password input device receives and decrypts the second encrypted information, acquires a new random number, and after the new random number is used as the encrypted random number in the next encryption, the password input device further comprises the following authentication steps:
s91, the password input device encrypts MAC address information of the password input device according to the encrypted random number and sends the encrypted MAC address information of the password input device to the rear panel;
s92, judging whether the set MAC address information is consistent with the MAC address information of the password input device or not by the rear panel;
s93, if yes, allowing the password input device to be in wireless communication connection with the rear panel;
and S94, if not, disconnecting the wireless communication connection between the password input device and the rear panel.
It should be clear that, after the last unlocking communication process, if the communication connection between the password input device and the rear panel is accidentally disconnected, the above-mentioned authentication step needs to be performed before the next unlocking communication. In this embodiment, the security of the split type intelligent lock can be further improved by comparing whether the set MAC address information is consistent with the MAC address information of the password input device.
In this embodiment, the wireless communication connection between the rear panel and the password input device is a bluetooth connection;
the password input device receives and decrypts the second encrypted information, acquires a new random number, and after making the new random number serve as an encrypted random number for the next encryption, further comprising the steps of:
s95, after the password input device does not receive the trigger signal within the first set time length, automatically reducing the Bluetooth connection interval from the first set interval to a second set interval;
and S96, the password input device receives the trigger signal and then calls back the Bluetooth connection interval from the second set interval to the first set interval.
It should be known that, after the binding relation is established between the password input device and the rear panel, the connection is always kept, and when the password input device is triggered, the Bluetooth connection interval of the split type intelligent lock is shorter, so that the requirement of quickly responding to the input information of the user can be met. In this embodiment, the first setting interval is set to 1 second, and the second setting interval is set to 0.1 second, and when password input device 2 does not detect trigger signal in the first setting time span, its bluetooth connection interval is revised from 0.1 second to 1 second to effectively reduce the consumption when split type intelligence lock awaits the opportune moment. In particular, the trigger signal referred to herein is a key signal of the password input device or a signal detectable by other password input devices. In addition, the password input device may be a keypad having encryption and decryption functions. The first set length of time may be set to 10 minutes or other set length of time.
In this embodiment, the byte length of the first random number component is equal to the byte length of the second random number component. In addition, the combination mode of the first random number component and the second random number component is sequential combination, namely the byte length of the first random number component is set to be 8 bytes, the byte length of the second random number component is also set to be 8 bytes, and a new random number with 16 bytes is formed after combination.
Example two
The split intelligent lock comprises a password input device and a rear panel, wherein the password input device is provided with a first encryption and decryption module and a first signal transceiving module, the rear panel is provided with a second encryption and decryption module and a second signal transceiving module, the password input device is further provided with a numeric keyboard, and the password input device and the rear panel are used for executing the encryption communication method of the split intelligent lock according to the first embodiment.
The password input device and the back panel are respectively arranged at two opposite sides of the door body.
The split intelligent lock further comprises a lock cylinder, the rear panel is detachably connected with the lock cylinder, and the rear panel is provided with a driving device for driving the lock cylinder to unlock or lock. It should be clear that when a user replaces a normal mechanical lock with a smart lock, the user generally replaces the entire mechanical lock with the smart lock directly. However, because the front panel volume of intelligence lock is great, need additionally drill on the door body for the intelligence lock with mechanical lock replacement, it is inconvenient to install, and needs extra installation cost, directly falls the whole replacement of mechanical lock and can increase user's replacement cost. Therefore, the rear panel is detachably connected with the lock cylinder, when a user replaces a common mechanical lock with an intelligent lock, the user only needs to replace the rear panel of the common mechanical lock with the rear panel in the embodiment, the rear panel is connected with the lock cylinder in a driving mode, the password input device is arranged on the outer side of the door body, the common mechanical lock can be modified into the intelligent lock, and the cost for replacing the mechanical lock with the intelligent lock is lower.
It should be noted that the back panel should meet certain criteria so that the back panel can fit more mechanical locks for the user. In particular, the structure of the rear panel may be a structure of a rear panel conforming to the lock standard of the united states, or a structure of a rear panel conforming to the lock standard of other countries.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention 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 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 of the embodiments of the present invention.