Intelligent door lock safety communication method and device, electronic equipment and medium
By generating and encrypting a one-time symmetric key in the smart door lock, the security risks of existing smart door locks in key management are solved, and the secure communication and security improvement of smart door locks are achieved.
Patent Information
- Application Number
- CN202411590769.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-02-18
AI Technical Summary
Existing smart door locks have security risks in encryption key management. The door lock firmware is easily decompiled and deciphered, resulting in key leakage, which in turn affects the security of smart door locks.
A single-time symmetric key is randomly generated through the smart door lock, and the key is encrypted using the preset platform public key and sent to the user. The user side uploads the encrypted key to the cloud platform. The cloud platform uses the platform private key to decrypt and verify the key, and returns it to the user side as a session key for encrypted communication.
It realizes secure communication of smart door locks, prevents key leakage and sends false door opening instructions, and improves the security of smart door locks.
Smart Images

Figure CN119479112A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a smart door lock security communication method, device, electronic equipment and medium. Background Art
[0002] Smart door locks generally use unlocking methods such as mobile phone user terminal unlocking, fingerprint unlocking, and password unlocking. Among them, mobile phone user terminal unlocking includes door lock network unlocking and Bluetooth near-field communication unlocking. Network unlocking requires the door lock to establish a connection with the cloud platform, and the cloud platform sends instructions to unlock. In the Bluetooth near-field communication door unlocking scenario, the door lock does not need to be connected to the Internet. The unlocking instruction can be sent to the door lock through Bluetooth communication between the mobile phone user terminal and the door lock.
[0003] In the prior art, many smart door locks on the market pre-write encryption keys in the door lock firmware when they leave the factory, or negotiate session keys through the private key preset in the door lock firmware and the platform. The door lock firmware is easily decompiled and cracked, resulting in the leakage of the door lock private key or encryption key. At the same time, because the cloud platform needs to send a key list to the manufacturer, there is also a risk of list leakage. After deciphering the door lock algorithm and key, you can open a door lock that does not belong to you by sending a false door opening command, thus affecting the security of the smart door lock. Summary of the invention
[0004] The purpose of the present invention is to solve one of the technical problems existing in the prior art to at least a certain extent.
[0005] To this end, an object of an embodiment of the present invention is to provide a smart door lock security communication method, which improves the security of the smart door lock.
[0006] Another object of an embodiment of the present invention is to provide a smart door lock security communication device.
[0007] In order to achieve the above technical objectives, the technical solutions adopted by the embodiments of the present invention include:
[0008] On the one hand, an embodiment of the present invention provides a smart door lock security communication method, comprising the following steps:
[0009] In response to a near field communication request from a user terminal, a one-time symmetric key is randomly generated by the smart door lock, the one-time symmetric key is encrypted using a preset platform public key to obtain a first encrypted value, and the door lock serial number of the smart door lock is encrypted using the one-time symmetric key to obtain a second encrypted value, and the first encrypted value and the second encrypted value are sent to the user terminal;
[0010] Uploading the first encrypted value and the second encrypted value to the cloud platform through the user terminal;
[0011] The cloud platform uses a preset platform private key to decrypt the first encrypted value to obtain the one-time symmetric key, and uses the one-time symmetric key to decrypt the second encrypted value to obtain the door lock serial number, and then verifies whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number;
[0012] When the user terminal is an authorized user terminal of the smart door lock, the one-time symmetric key is returned to the user terminal through the cloud platform, so that the user terminal and the smart door lock use the one-time symmetric key as a session key for encrypted communication.
[0013] Furthermore, in one embodiment of the present invention, the user terminal and the smart door lock perform encrypted communication through the following steps:
[0014] Generate a user command message through the user terminal, and generate a corresponding message sequence number, and then use the one-time symmetric key to encrypt the user command message and the message sequence number to obtain an encrypted user message;
[0015] Decrypting the encrypted user message by the smart door lock using the one-time symmetric key to obtain the user command message and the corresponding message sequence number, and verifying whether the message sequence number has appeared in this encrypted communication;
[0016] When the message sequence number has not appeared in the current encrypted communication, respond to the first user message and store the message sequence number;
[0017] When the message sequence number has appeared in the current encrypted communication, do not respond to the first user message;
[0018] Among them, when the user command message is generated for the first time in this encrypted communication, the corresponding message serial number is randomly generated. When the user command message is not generated for the first time in this encrypted communication, the message serial number generated last time is added by 1 to obtain the message serial number corresponding to the current user command message.
[0019] Furthermore, in one embodiment of the present invention, the smart door lock secure communication method further includes the following steps:
[0020] When the user terminal and the smart door lock end the encrypted communication, the one-time symmetric key stored in the user terminal is cleared, and the one-time symmetric key and the message sequence number stored in the smart door lock are cleared.
[0021] Further, in one embodiment of the present invention, the use of the one-time symmetric key to encrypt the door lock serial number of the smart door lock to obtain a second encrypted value specifically includes:
[0022] Sign the door lock serial number using the device private key of the smart door lock to obtain a first signature value;
[0023] The door lock serial number and the first signature value are encrypted using the one-time symmetric key to obtain the second encrypted value.
[0024] Further, in one embodiment of the present invention, the decrypting the second encrypted value using the one-time symmetric key to obtain the door lock serial number specifically includes:
[0025] Decrypt the second encrypted value using the one-time symmetric key to obtain a target sequence number and a target signature value;
[0026] According to the target serial number, the corresponding door lock public key is obtained by querying the door lock public key mapping table pre-entered in the cloud platform, and the target signature value is verified by the door lock public key;
[0027] When the signature verification is successful, it is determined that the target serial number is the door lock serial number.
[0028] Further, in one embodiment of the present invention, the verifying whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number specifically includes:
[0029] According to the door lock serial number, query the door lock authorization mapping table pre-entered in the cloud platform to obtain the corresponding authorized user list;
[0030] The user identity information of the user terminal is obtained, and whether the user terminal is an authorized user terminal of the smart door lock is verified according to the user identity information and the authorized user list.
[0031] Furthermore, in one embodiment of the present invention, the smart door lock secure communication method further comprises the following steps:
[0032] Requesting a secure communication connection from the cloud platform through the user terminal, and authenticating the user terminal through the cloud platform;
[0033] When the identity authentication is passed, a secure transmission channel between the user terminal and the cloud platform is established;
[0034] The secure transmission channel is used by the user terminal to upload the first encrypted value and the second encrypted value to the cloud platform, and is also used by the cloud platform to return the one-time symmetric key to the user terminal.
[0035] On the other hand, an embodiment of the present invention provides a smart door lock security communication device, including:
[0036] An encryption value generation module, for responding to a near field communication request from a user terminal, randomly generating a one-time symmetric key through a smart door lock, encrypting the one-time symmetric key using a preset platform public key to obtain a first encryption value, and encrypting the door lock serial number of the smart door lock using the one-time symmetric key to obtain a second encryption value, and then sending the first encryption value and the second encryption value to the user terminal;
[0037] An encrypted value uploading module, used for uploading the first encrypted value and the second encrypted value to the cloud platform through the user terminal;
[0038] An authorization verification module, used to decrypt the first encrypted value using a preset platform private key through the cloud platform to obtain the one-time symmetric key, and use the one-time symmetric key to decrypt the second encrypted value to obtain the door lock serial number, and then verify whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number;
[0039] The key return module is used to return the one-time symmetric key to the user terminal through the cloud platform when the user terminal is an authorized user terminal of the smart door lock, so that the user terminal and the smart door lock use the one-time symmetric key as a session key for encrypted communication.
[0040] On the other hand, an embodiment of the present invention provides an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the smart door lock security communication method as described above is realized.
[0041] On the other hand, an embodiment of the present invention also provides a storage medium, which is a computer-readable storage medium used for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the smart door lock security communication method as described above.
[0042] The advantages and beneficial effects of the present invention will be partly given in the following description, partly become apparent from the following description, or be understood through the practice of the present invention:
[0043] In an embodiment of the present invention, in response to a near-field communication request from a user terminal, a one-time symmetric key is randomly generated through a smart door lock, the one-time symmetric key is encryptingly used a preset platform public key to obtain a first encryption value, and the door lock serial number of the smart door lock is encrypted using the one-time symmetric key to obtain a second encryption value, and then the first encryption value and the second encryption value are sent to the user terminal, and the first encryption value and the second encryption value are uploaded to a cloud platform through the user terminal, and the first encryption value is decrypted through the cloud platform using a preset platform private key to obtain the one-time symmetric key, and the second encryption value is decrypted using the one-time symmetric key to obtain the door lock serial number, and then whether the user terminal is an authorized user terminal of the smart door lock is verified according to the door lock serial number. When the user terminal is an authorized user terminal of the smart door lock, the one-time symmetric key is returned to the user terminal through the cloud platform, so that the user terminal and the smart door lock use the one-time symmetric key as a session key for encrypted communication. When the smart door lock and the user terminal perform near-field communication, the embodiment of the present invention uses the platform private key to encrypt the one-time symmetric key generated by the smart door lock, and then uploads it to the cloud platform through the user terminal. The cloud platform uses the platform public key to decrypt the one-time symmetric key and returns it to the user terminal, so that the user terminal and the smart door lock use the one-time symmetric key to perform encrypted communication, thereby enabling the smart door lock to authenticate the authenticity of the door opening instruction, preventing the user terminal from being counterfeited and sending a false door opening instruction to the door lock to open the smart door lock that is not owned by the user, thereby improving the security of the smart door lock. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solution in the embodiments of the present invention, the following introduction is made to the drawings required for use in the embodiments of the present invention. It should be understood that the drawings introduced below are only for the convenience of clearly describing some embodiments of the technical solution of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flowchart of a secure communication method for a smart door lock provided by an embodiment of the present invention;
[0046] Figure 2 A flowchart of a step of encrypted communication between a user terminal and a smart door lock provided by an embodiment of the present invention;
[0047] Figure 3 Another flow chart of steps for encrypted communication between a user terminal and a smart door lock provided in an embodiment of the present invention;
[0048] Figure 4 A step flow chart of step S101 provided in an embodiment of the present invention;
[0049] Figure 5A step flow chart of step S103 provided in an embodiment of the present invention;
[0050] Figure 6 Another step flow chart of step S103 provided in an embodiment of the present invention;
[0051] Figure 7 Another step flow chart of the smart door lock security communication method provided by an embodiment of the present invention;
[0052] Figure 8 A schematic diagram of the structure of a smart door lock security communication device provided by an embodiment of the present invention;
[0053] Fig. 9 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention;
[0054] Fig.10 A schematic diagram of the structure of a storage medium provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0055] Embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limitations on the present application. It should be noted that, although the functional module division is performed in the system schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in a different order from the module division in the system schematic diagram or the flow chart. For the step numbers in the following embodiments, they are only set for the convenience of explanation, and the order between the steps is not limited in any way. The execution order of each step in the embodiment can be adaptively adjusted according to the understanding of those skilled in the art.
[0056] In the description of the present invention, the meaning of "a plurality" is two or more. If there is a description of the first or the second, it is only for the purpose of distinguishing the technical features, and it cannot be understood as indicating or implying the relative importance or implicitly indicating the number of the indicated technical features or implicitly indicating the order of the indicated technical features. In addition, unless otherwise defined, all technical and scientific terms used in this document have the same meaning as those commonly understood by technicians in the technical field of this application. The terms used in this document are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0057] The smart door lock security communication method provided in the embodiment of the present application can be applied to the terminal, can also be applied to the server side, and can also be software running in the terminal or the server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a set-top box, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the smart door lock security communication method, etc., but is not limited to the above forms.
[0058] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0059] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0060] like Figure 1 FIG. 1 is a flow chart showing a method for secure communication of a smart door lock according to an embodiment of the present invention. Figure 1 The embodiment of the present invention provides a smart door lock security communication method, which specifically includes the following steps:
[0061] S101, in response to a near field communication request from a user terminal, randomly generating a one-time symmetric key through the smart door lock, encrypting the one-time symmetric key using a preset platform public key to obtain a first encrypted value, and encrypting the door lock serial number of the smart door lock using the one-time symmetric key to obtain a second encrypted value, and then sending the first encrypted value and the second encrypted value to the user terminal;
[0062] S102, uploading the first encrypted value and the second encrypted value to the cloud platform through the user terminal;
[0063] S103, using a preset platform private key to decrypt the first encrypted value through the cloud platform to obtain a one-time symmetric key, and using the one-time symmetric key to decrypt the second encrypted value to obtain a door lock serial number, and then verifying whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number;
[0064] S104: When the user terminal is an authorized user terminal of the smart door lock, the one-time symmetric key is returned to the user terminal through the cloud platform, so that the user terminal and the smart door lock use the one-time symmetric key as a session key for encrypted communication.
[0065] In the embodiment of the present invention, the smart door lock needs to write the platform public key in the door lock factory firmware (the algorithm can adopt RSA, ECC, or asymmetric algorithms such as national secret SM2, national secret SM9, etc.), and the platform private key corresponding to the platform public key is only stored uniquely inside the cloud platform and not transmitted externally. The cloud platform pre-stores a list of authorized users corresponding to each door lock serial number. If the smart door lock supports built-in device private keys, the cloud platform also stores a mapping relationship table between the door lock serial number and the device public key. HTTPS, SMS authentication, operator 4G / 5G network authentication and other means are used between the legitimate user terminal and the cloud platform to ensure that only legitimate user terminals can connect to the cloud platform.
[0066] In the description of the embodiments of the present invention, the private key specifically refers to the asymmetric encryption private key, and the public key refers to the public key in asymmetric encryption. The asymmetric key consists of a pair of public and private keys, which are cryptographically related to each other. The public key can be distributed to anyone, while the private key must be securely protected and can only be used by trusted persons.
[0067] When the smart door lock and the user terminal perform near-field communication, the embodiment of the present invention uses the platform private key to encrypt the one-time symmetric key generated by the smart door lock, and then uploads it to the cloud platform through the user terminal. The cloud platform uses the platform public key to decrypt the one-time symmetric key and returns it to the user terminal, so that the user terminal and the smart door lock use the one-time symmetric key to perform encrypted communication, thereby enabling the smart door lock to authenticate the authenticity of the door opening instruction, preventing the user terminal from being counterfeited and sending a false door opening instruction to the door lock to open the smart door lock that is not owned by the user, thereby improving the security of the smart door lock.
[0068] like Figure 2 The figure is a flowchart of a step of encrypted communication between a user terminal and a smart door lock provided by an embodiment of the present invention, referring to Figure 2 As an optional implementation, the user terminal and the smart door lock perform encrypted communication through the following steps:
[0069] S201, generating a user command message through a user terminal, and generating a corresponding message sequence number, and then encrypting the user command message and the message sequence number using a one-time symmetric key to obtain an encrypted user message;
[0070] S202, decrypt the encrypted user message using a one-time symmetric key through the smart door lock, obtain the user command message and the corresponding message sequence number, and verify whether the message sequence number has appeared in this encrypted communication;
[0071] S203, when the message sequence number has not appeared in the current encrypted communication, respond to the first user message and store the message sequence number;
[0072] S204, when the message sequence number has appeared in the current encrypted communication, do not respond to the first user message;
[0073] Among them, when the user command message is generated for the first time in this encrypted communication, the corresponding message sequence number is randomly generated. When the user command message is not generated for the first time in this encrypted communication, the message sequence number generated last time is added by 1 to obtain the message sequence number corresponding to the current user command message.
[0074] like Figure 3 FIG. 1 is another flow chart of steps for encrypted communication between a user terminal and a smart door lock provided by an embodiment of the present invention, referring to FIG. Figure 3 As an optional implementation, the smart door lock security communication method further includes the following steps:
[0075] S205. When the user terminal and the smart door lock end the encrypted communication, the one-time symmetric key stored in the user terminal is cleared, and the one-time symmetric key and message sequence number stored in the smart door lock are cleared.
[0076] Specifically, the embodiment of the present invention is compatible with smart door locks that cannot have built-in device private keys. For smart door locks that do not support built-in device private keys or do not enable device private keys, the complete process of secure communication between the user terminal and the smart door lock is as follows:
[0077] 1. The user requests communication from the door lock via Bluetooth near-field communication, and the door lock generates a random one-time symmetric key.
[0078] 2. The door lock encrypts the random one-time symmetric key using the platform's public key.
[0079] 3. The door lock uses a random one-time symmetric key to encrypt the door lock serial number.
[0080] 4. The door lock transmits the above two encrypted values to the user end.
[0081] 5. The user end transparently transmits the received message to the platform.
[0082] 6. The platform uses the platform private key to decrypt to obtain a one-time symmetric key, and uses the obtained one-time symmetric key to decrypt to obtain the door lock serial number.
[0083] 7. The platform verifies that the user is the legal owner of the door lock through the door lock serial number and user login information.
[0084] 8. The platform authenticates the identity and transmits data between the platform and the user through https. The platform sends the decrypted one-time symmetric key and door lock serial number to the user through the https encrypted channel.
[0085] 9. The user uses the received one-time symmetric key as the session key to encrypt communication with the door lock and adds a random number to the ciphertext.
[0086] 10. After receiving the ciphertext, the door lock uses the one-time symmetric key generated by the door lock to decrypt it, obtain the instruction and random number, execute the instruction and store the random number in a set.
[0087] 11. At the same time, in each subsequent message communication between the user end and the door lock after this connection, the random number will be increased by 1. After decryption at the door lock end, it will be determined whether the random number has appeared in this connection. If it has not appeared, the unlocking command will be executed. If it has appeared, the execution will be refused.
[0088] 12. After completing this Bluetooth communication and disconnecting Bluetooth, clear the one-time symmetric key and the stored random number set.
[0089] like Figure 4 FIG. 1 is a flowchart of step S101 provided in an embodiment of the present invention, referring to FIG. Figure 4 As an optional implementation, the door lock serial number of the smart door lock is encrypted using a one-time symmetric key to obtain a second encrypted value, which specifically includes:
[0090] S1011. Use the device private key of the smart door lock to sign the door lock serial number to obtain a first signature value;
[0091] S1012. Use a one-time symmetric key to encrypt the door lock serial number and the first signature value to obtain a second encrypted value.
[0092] like Figure 5 FIG. 1 is a flow chart of step S103 provided in an embodiment of the present invention, referring to FIG. Figure 5 As an optional implementation, the second encrypted value is decrypted using a one-time symmetric key to obtain the door lock serial number, which specifically includes:
[0093] S1031. Decrypt the second encrypted value using a one-time symmetric key to obtain a target sequence number and a target signature value;
[0094] S1032, query the door lock public key mapping table pre-entered in the cloud platform according to the target serial number to obtain the corresponding door lock public key, and verify the target signature value through the door lock public key;
[0095] S1033. When the signature verification succeeds, the target serial number is determined to be the door lock serial number.
[0096] Specifically, for a smart door lock that supports a built-in device private key and has the device private key enabled, the complete process of secure communication between the user terminal and the smart door lock is as follows:
[0097] 1. For door locks with private keys, the door lock manufacturer enters the corresponding list of door lock serial number and door lock public key on the centralized authentication platform before leaving the factory.
[0098] 2. The user requests communication from the door lock via Bluetooth near-field communication, and the door lock generates a random one-time symmetric key.
[0099] 3. The door lock signs the serial number using the device private key in the firmware.
[0100] 4. The door lock encrypts the random one-time symmetric key using the platform's public key.
[0101] 5. The door lock uses a random one-time symmetric key to encrypt the door lock serial number and the above signature value.
[0102] 6. The door lock transmits the above two encrypted values to the user end.
[0103] 7. The user end transparently transmits the received message to the platform.
[0104] 8. The platform uses the platform private key to decrypt to obtain a one-time symmetric key, and uses the obtained one-time symmetric key to decrypt to obtain the door lock serial number and the signature value of the serial number.
[0105] 9. The platform uses the door lock serial number to find the device backup public key based on the pre-entered door lock public key and serial number correspondence, and verifies the above signature value to verify the legitimacy of the door lock.
[0106] 10. The platform verifies that the user is the legal owner of the door lock through the user's login information.
[0107] 11. The platform authenticates the identity and transmits data between the platform and the user through https. The platform sends the decrypted one-time symmetric key and door lock serial number to the user through the https encrypted channel.
[0108] 12. The user uses the received one-time symmetric key as the session key to encrypt communication with the door lock and adds a random number to the ciphertext.
[0109] 13. After receiving the ciphertext, the door lock uses the one-time symmetric key generated by the door lock to decrypt it, obtain the instruction and random number, execute the instruction and store the random number in a set.
[0110] 14. At the same time, in each subsequent message communication between the user end and the door lock after this connection, the random number will be increased by 1. After decryption at the door lock end, it will be determined whether the random number has appeared in this connection. If it has not appeared, the unlocking command will be executed. If it has appeared, the execution will be refused.
[0111] 15. After completing this Bluetooth communication and disconnecting Bluetooth, clear the one-time symmetric key and the stored random number set.
[0112] It can be recognized that in the embodiment of the present invention, the asymmetric encryption method with high computing power requirements only encrypts the value of the random symmetric key, while the serial number and signature value are calculated and encrypted using a method with low computing power requirements such as symmetric key encryption. The embodiment of the present invention creatively uses the platform public key to encrypt the random symmetric key to be transmitted, and then uses the symmetric key to encrypt other fields. For the middle attacker, because the middle attacker does not have the platform private key, he cannot decrypt the first encrypted field to obtain the random symmetric key, and cannot decrypt the second ciphertext. After receiving the two ciphertexts, the platform can use the first ciphertext to decrypt the random symmetric key, and then use the decrypted random symmetric key to decrypt other information. While ensuring the security of the random symmetric key, the length of the field content encrypted by the asymmetric key with high computing power requirements is reduced. For smart door lock devices with low computing power and sensitive to power consumption, it can significantly reduce power consumption and computing time.
[0113] It should be noted that the door lock needs to encrypt and transmit information to the user end and the centralized authentication platform for the door lock to verify the identity of the user end / platform and perform subsequent encrypted transmission (i.e., random symmetric key, signature value of random symmetric key, door lock serial number). If all this information is encrypted and sent using the public key of the centralized authentication platform, the purpose of security authentication can be achieved. However, asymmetric algorithms such as RSA and SM2 require much more computing power than symmetric algorithms such as AES and SM4. For devices such as door locks that have low computing power, are sensitive to power consumption and need to rely on batteries, excessive asymmetric encryption content will lead to long computing time and high power consumption. Therefore, the asymmetric encryption performed at the door lock end in the embodiment of the present invention only performs asymmetric encryption on the random symmetric key part. The random symmetric key is creatively used to encrypt the door lock serial number and signature value at the same time. Because, for an attacker in the middle, it is impossible to obtain the key by only obtaining the ciphertext, so a random symmetric key that needs to be kept confidential can be used to encrypt part of the information, and only the random symmetric key itself is encrypted with the platform public key for the door lock to verify the platform identity in the subsequent steps, which greatly reduces the asymmetric encryption length of the door lock, and reduces power consumption and computing time.
[0114] like Figure 6 FIG. 1 is another step flow chart of step S103 provided in an embodiment of the present invention, referring to FIG. Figure 6 As an optional implementation, verifying whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number specifically includes:
[0115] S1034, querying the door lock authorization mapping table pre-entered in the cloud platform according to the door lock serial number to obtain the corresponding authorized user list;
[0116] S1035. Obtain the user identity information of the user terminal, and verify whether the user terminal is an authorized user terminal of the smart door lock based on the user identity information and the authorized user list.
[0117] Specifically, when the user terminal is bound to the smart door lock, an authorized user list is generated based on the door lock serial number and user identity information, and the authorized user list is stored on the cloud platform. After the cloud platform decrypts the encrypted data sent by the user terminal to obtain the door lock serial number, it can verify whether the user terminal is authorized based on the authorized user list and user identity information, thereby improving the security of the smart door lock.
[0118] like Figure 7 FIG. 1 is another flow chart of the steps of the smart door lock security communication method provided by an embodiment of the present invention, referring to FIG. Figure 7 As an optional implementation, the smart door lock security communication method further includes the following steps:
[0119] S301, requesting a secure communication connection from the cloud platform through the user terminal, and authenticating the user terminal through the cloud platform;
[0120] S302, when the identity authentication is passed, a secure transmission channel between the user terminal and the cloud platform is established;
[0121] Among them, the secure transmission channel is used by the user end to upload the first encryption value and the second encryption value to the cloud platform, and is also used by the cloud platform to return the one-time symmetric key to the user end.
[0122] Specifically, identity authentication is carried out between the user terminal and the cloud platform using means such as https, SMS authentication, and operator 4G / 5G network authentication to ensure that only legitimate user terminals can connect to the cloud platform. After the identity authentication is passed, a secure transmission channel is established between the user terminal and the cloud platform. This secure transmission channel is used for data interaction between the user terminal and the cloud platform.
[0123] The above is a description of the method steps of the embodiment of the present invention. It can be recognized that in the embodiment of the present invention, when the smart door lock and the user end perform near-field communication, the one-time symmetric key generated by the smart door lock is encrypted using the platform private key and then uploaded to the cloud platform through the user end, and the one-time symmetric key is decrypted using the platform public key on the cloud platform and returned to the user end, so that the user end and the smart door lock use the one-time symmetric key for encrypted communication, thereby realizing the authentication of the authenticity of the door opening command by the smart door lock, preventing the user end from being counterfeited and sending a false door opening command to the door lock to open the smart door lock that is not owned by the user, thereby improving the security of the smart door lock.
[0124] like Figure 8 FIG. 1 is a schematic diagram of the structure of a smart door lock security communication device provided by an embodiment of the present invention, referring to FIG. Figure 8 , an embodiment of the present invention provides a smart door lock security communication device, comprising:
[0125] An encryption value generation module, for responding to a near field communication request from a user terminal, randomly generating a one-time symmetric key through a smart door lock, encrypting the one-time symmetric key using a preset platform public key to obtain a first encryption value, and encrypting a door lock serial number of the smart door lock using the one-time symmetric key to obtain a second encryption value, and then sending the first encryption value and the second encryption value to the user terminal;
[0126] An encrypted value uploading module, used to upload the first encrypted value and the second encrypted value to the cloud platform through the user terminal;
[0127] An authorization verification module is used to decrypt the first encrypted value using a preset platform private key through the cloud platform to obtain a one-time symmetric key, and use the one-time symmetric key to decrypt the second encrypted value to obtain a door lock serial number, and then verify whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number;
[0128] The key return module is used to return the one-time symmetric key to the user terminal through the cloud platform when the user terminal is an authorized user terminal of the smart door lock, so that the user terminal and the smart door lock use the one-time symmetric key as the session key for encrypted communication.
[0129] The contents of the above method embodiments are all applicable to the present device embodiments. The functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0130] The embodiment of the present invention also provides an electronic device, which includes: a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned smart door lock security communication method. The electronic device can be any smart terminal including a tablet computer, a car computer, etc.
[0131] like Fig. 9 FIG. 1 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention, referring to FIG. Fig. 9 , an embodiment of the present invention provides an electronic device, including:
[0132] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present invention;
[0133] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the smart door lock security communication method of the embodiment of the present invention;
[0134] Input / output interface 903, used to implement information input and output;
[0135] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0136] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0137] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0138] like Fig.10 FIG. 1 is a schematic diagram of a storage medium according to an embodiment of the present invention. Fig.10 An embodiment of the present invention further provides a storage medium, which is a computer-readable storage medium used for computer-readable storage. The storage medium stores one or more programs 1001, and one or more programs 1001 can be executed by one or more processors to implement the above-mentioned smart door lock security communication method.
[0139] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0140] The embodiment of the present invention also discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device can read the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes Figure 1 The method shown.
[0141] In some selectable embodiments, the function / operation mentioned in the block diagram may not occur in the order mentioned in the operation diagram. For example, depending on the function / operation involved, the two boxes shown in succession can actually be executed substantially simultaneously or the above-mentioned boxes can sometimes be executed in reverse order. In addition, the embodiment presented and described in the flow chart of the present invention is provided by way of example, for the purpose of providing a more comprehensive understanding of technology. The disclosed method is not limited to the operation and logic flow presented herein. Selectable embodiments are expected, wherein the order of various operations is changed and the sub-operation of a part for which is described as a larger operation is performed independently.
[0142] In addition, although the present invention is described in the context of functional modules, it should be understood that, unless otherwise specified to the contrary, one or more of the above-mentioned functions and / or features can be integrated into a single physical device and / or software module, or one or more functions and / or features can be implemented in a separate physical device or software module. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary for understanding the present invention. More specifically, in view of the properties, functions and internal relationships of the various functional modules in the device disclosed herein, the actual implementation of the module will be understood within the conventional skills of the engineer. Therefore, those skilled in the art can implement the present invention set forth in the claims without excessive experimentation using ordinary techniques. It is also understood that the specific concepts disclosed are merely illustrative and are not intended to limit the scope of the present invention, which is determined by the full scope of the appended claims and their equivalents.
[0143] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the above methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0144] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0145] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the above-mentioned program is printed, since the above-mentioned program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or processing in other suitable ways as necessary, and then stored in a computer memory.
[0146] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0147] In the above description of this specification, the description with reference to the terms "one embodiment / example", "another embodiment / example" or "certain embodiments / examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0148] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
[0149] The above is a specific description of the preferred implementation of the present invention, but the present invention is not limited to the above embodiments. Those skilled in the art may make various equivalent modifications or substitutions without violating the spirit of the present invention. These equivalent modifications or substitutions are all included in the scope defined by the claims of this application.
Claims
1. A smart door lock security communication method, characterized in that: The following steps are involved: In response to a near field communication request from a user terminal, a one-time symmetric key is randomly generated by the smart door lock, the one-time symmetric key is encrypted using a preset platform public key to obtain a first encrypted value, and the door lock serial number of the smart door lock is encrypted using the one-time symmetric key to obtain a second encrypted value, and the first encrypted value and the second encrypted value are sent to the user terminal; Uploading the first encrypted value and the second encrypted value to the cloud platform through the user terminal; The cloud platform uses a preset platform private key to decrypt the first encrypted value to obtain the one-time symmetric key, and uses the one-time symmetric key to decrypt the second encrypted value to obtain the door lock serial number, and then verifies whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number; When the user terminal is an authorized user terminal of the smart door lock, the one-time symmetric key is returned to the user terminal through the cloud platform, so that the user terminal and the smart door lock use the one-time symmetric key as a session key for encrypted communication.
2. A smart door lock security communication method according to claim 1, characterized in that: The user terminal and the smart door lock perform encrypted communication through the following steps: Generate a user command message through the user terminal, and generate a corresponding message sequence number, and then use the one-time symmetric key to encrypt the user command message and the message sequence number to obtain an encrypted user message; Decrypting the encrypted user message by the smart door lock using the one-time symmetric key to obtain the user command message and the corresponding message sequence number, and verifying whether the message sequence number has appeared in this encrypted communication; When the message sequence number has not appeared in the current encrypted communication, respond to the first user message and store the message sequence number; When the message sequence number has appeared in the current encrypted communication, do not respond to the first user message; Among them, when the user command message is generated for the first time in this encrypted communication, the corresponding message serial number is randomly generated. When the user command message is not generated for the first time in this encrypted communication, the message serial number generated last time is added by 1 to obtain the message serial number corresponding to the current user command message.
3. A smart door lock security communication method according to claim 2, characterized in that: The smart door lock secure communication method also includes the following steps: When the user terminal and the smart door lock end the encrypted communication, the one-time symmetric key stored in the user terminal is cleared, and the one-time symmetric key and the message sequence number stored in the smart door lock are cleared.
4. A smart door lock security communication method according to claim 1, characterized in that: The step of using the one-time symmetric key to encrypt the door lock serial number of the smart door lock to obtain a second encrypted value specifically includes: Sign the door lock serial number using the device private key of the smart door lock to obtain a first signature value; The door lock serial number and the first signature value are encrypted using the one-time symmetric key to obtain the second encrypted value.
5. A smart door lock security communication method according to claim 4, characterized in that: The step of using the one-time symmetric key to decrypt the second encrypted value to obtain the door lock serial number specifically includes: Decrypt the second encrypted value using the one-time symmetric key to obtain a target sequence number and a target signature value; According to the target serial number, the corresponding door lock public key is obtained by querying the door lock public key mapping table pre-entered in the cloud platform, and the target signature value is verified by the door lock public key; When the signature verification is successful, it is determined that the target serial number is the door lock serial number.
6. A smart door lock security communication method according to claim 1, characterized in that: The step of verifying whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number specifically includes: According to the door lock serial number, query the door lock authorization mapping table pre-entered in the cloud platform to obtain the corresponding authorized user list; The user identity information of the user terminal is obtained, and whether the user terminal is an authorized user terminal of the smart door lock is verified according to the user identity information and the authorized user list.
7. A smart door lock security communication method according to any one of claims 1 to 6, characterized in that: The smart door lock security communication method also includes the following steps: Requesting a secure communication connection from the cloud platform through the user terminal, and authenticating the user terminal through the cloud platform; When the identity authentication is passed, a secure transmission channel between the user terminal and the cloud platform is established; The secure transmission channel is used by the user terminal to upload the first encrypted value and the second encrypted value to the cloud platform, and is also used by the cloud platform to return the one-time symmetric key to the user terminal.
8. A smart door lock security communication device, characterized in that: include: An encryption value generation module, for responding to a near field communication request from a user terminal, randomly generating a one-time symmetric key through a smart door lock, encrypting the one-time symmetric key using a preset platform public key to obtain a first encryption value, and encrypting the door lock serial number of the smart door lock using the one-time symmetric key to obtain a second encryption value, and then sending the first encryption value and the second encryption value to the user terminal; An encrypted value uploading module, used for uploading the first encrypted value and the second encrypted value to the cloud platform through the user terminal; An authorization verification module, used to decrypt the first encrypted value using a preset platform private key through the cloud platform to obtain the one-time symmetric key, and use the one-time symmetric key to decrypt the second encrypted value to obtain the door lock serial number, and then verify whether the user terminal is an authorized user terminal of the smart door lock according to the door lock serial number; The key return module is used to return the one-time symmetric key to the user terminal through the cloud platform when the user terminal is an authorized user terminal of the smart door lock, so that the user terminal and the smart door lock use the one-time symmetric key as a session key for encrypted communication.
9. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the smart door lock security communication method as described in any one of claims 1 to 7 are realized.
10. A storage medium, the storage medium being a computer-readable storage medium, used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the smart door lock security communication method as described in any one of claims 1 to 7.