CPU card security algorithm and system for smart door locks
By encrypting the CPU card in the smart door lock and saving the key factor, combined with the random number encryption comparison mechanism, the problem of low security of the CPU card is solved, and the uniqueness and high security of the smart door lock are achieved. Prevent copying and illegal use.
Patent Information
- Application Number
- CN202311567057.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-22
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-11-22
AI Technical Summary
The CPU card in existing smart door locks has low security and is easily copied and added to different door locks, resulting in insufficient interoperability.
The host computer encrypts the parameter information of the CPU card and the product information of the smart door lock, generates a key factor, and saves it in the folder of the CPU card. When the smart door lock detects the CPU card, it generates a random number for encryption. The key factor is compared with the ciphertext to determine whether to unlock, ensuring the security of the CPU card.
It improves the security of the CPU card, prevents it from being added to any door lock, reduces interoperability, increases the security against copying, and ensures the uniqueness and high security performance of the CPU card.
Smart Images

Figure CN117612280B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of smart door locks, and in particular to a CPU card security algorithm and system applied to smart door locks. Background Art
[0002] At present, the chip cards supported by smart door locks on the market usually include IC cards, CPU cards and T5577 cards. Among them, most IC cards are MI cards, and M1 cards are easy to crack and copy with current technology, and their security is relatively poor. The security performance of ordinary CPU cards is higher than that of MI cards, but before the CPU card is encrypted, it can be added and used on different smart door locks, which is easy to be copied and not safe enough. Summary of the invention
[0003] The main technical problem solved by the embodiments of the present application is to provide a CPU card security algorithm and system for smart door locks, which can improve the security of CPU cards, prevent them from being added and used on any door locks, reduce interoperability, and increase anti-copying security.
[0004] In the first aspect, the embodiments of the present application provide a CPU card security algorithm applied to a smart door lock, including:
[0005] The host computer splices the parameter information of the CPU card and the product information of the smart door lock into data information according to the custom string rule;
[0006] The host computer encrypts the data information to obtain a key factor, and saves the key factor in a folder of the CPU card;
[0007] When the smart door lock detects the CPU card, it generates a first random number and sends the first random number to the CPU card;
[0008] The smart door lock obtains the key factor from the folder;
[0009] The smart door lock encrypts the first random number using the key factor to generate a first ciphertext;
[0010] The CPU card encrypts the first random number using the key factor to generate a second ciphertext;
[0011] The smart door lock compares the first ciphertext with the second ciphertext to determine whether to unlock the door.
[0012] In some embodiments, before the host computer splices the parameter information of the CPU card and the product information of the smart door lock into data information according to the custom string rule, the method further includes:
[0013] The host computer creates a folder for storing the key factor in the root directory of the CPU card based on the read and write permissions of the CPU card.
[0014] In some embodiments, the method further comprises:
[0015] The host computer obtains a second random number, and encrypts the second random number to generate a first key;
[0016] The host computer uses the first key to obtain the read and write permissions of the CPU card;
[0017] The host computer creates a folder for storing the key factor in the root directory of the CPU card based on the read and write permissions of the CPU card, including:
[0018] The host computer deletes all files under the root directory of the CPU card based on the read and write permissions, thereby creating the folder for storing the key factor.
[0019] In some embodiments, after creating the folder for storing the key factor, the method further comprises:
[0020] The first key is stored in the folder.
[0021] In some embodiments, the method further comprises:
[0022] The host computer sends an activation instruction to the CPU card to obtain parameter information of the CPU card.
[0023] In some embodiments, when the smart door lock detects the CPU card, it generates a first random number, including:
[0024] When the smart door lock detects that the CPU card is approaching, the smart door lock obtains parameter information of the CPU card;
[0025] The smart door lock determines whether the parameter information of the CPU card is consistent with the pre-stored card information;
[0026] If the parameter information of the CPU card is consistent with the pre-stored card information, the smart door lock generates a first random number.
[0027] In some embodiments, the method further comprises:
[0028] If the parameter information of the CPU card is inconsistent with the pre-stored card information, the smart door lock stops unlocking.
[0029] In some embodiments, the smart door lock compares the first ciphertext with the second ciphertext to determine whether to unlock the door, including:
[0030] If the first ciphertext is consistent with the second ciphertext, the smart door lock determines to unlock;
[0031] If the first ciphertext is inconsistent with the second ciphertext, the smart door lock determines not to unlock the door.
[0032] In a second aspect, an embodiment of the present application provides a CPU card security system for a smart door lock, comprising a host computer, a CPU card and a smart door lock, wherein the host computer is communicatively connected to the CPU card, or the CPU card is communicatively connected to the smart door lock.
[0033] Different from the prior art, the embodiments of the present application provide a CPU card security algorithm and system for smart door locks. Before the CPU card is added to the smart door lock, the host computer encrypts the CPU card, obtains the key factor and saves it in the folder of the CPU card, which can improve the security of the CPU card, prevent it from being added and used on any door lock, reduce interoperability, and increase anti-copying security. When using the CPU card to unlock, the smart door lock generates a random number. The smart door lock and the CPU card generate a ciphertext by encrypting the random number, and compare the two ciphertexts to determine whether to unlock. When unlocking, the key factor written previously is used for re-encryption, and the CPU card is safer. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0035] Figure 1 A schematic diagram of a CPU card security system applied to a smart door lock according to an embodiment of the present application;
[0036] Figure 2 This is a flow chart of the CPU card security algorithm applied to the smart door lock according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] The present application is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements can also be made without departing from the concept of the present application. These all belong to the protection scope of the present application.
[0038] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0039] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. In addition, the words "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.
[0040] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.
[0041] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.
[0042] See also Figure 1 , is a schematic diagram of an embodiment of a CPU card security system applied to a smart door lock of the present application. The CPU card security system 100 applied to a smart door lock includes a host computer 10, a CPU card 20 and a smart door lock 30. The host computer 10 is communicatively connected to the CPU card 20, or the CPU card 20 is communicatively connected to the smart door lock 30.
[0043] When the host computer 10 is connected to the CPU card 20 for communication, the host computer 10 converts the USB to TTL serial port, the USB end is connected to the host computer 10, and the TTL serial port end is connected to the CUT100 card reader, and the CUT100 card reader communicates with the CPU card 20 through electrical signals.
[0044] The host computer 10 is used to encrypt the parameter information of the CPU card 20 and the product information of the smart door lock 30 to obtain the key factor to prevent the CPU card 20 from being copied.
[0045] After the key factor is stored in the folder of the CPU card 20 , the CPU card 20 can be connected to the smart door lock 30 via wireless communication.
[0046] When the smart door lock 30 detects that the CPU card 20 is approaching, the smart door lock 30 and the CPU card 20 are encrypted separately. When the smart door lock 30 is paired with the CPU card 20, the CPU card 20 can unlock the smart door lock 30.
[0047] This application embodiment provides a CPU card security algorithm for smart door locks. Figure 2 The method includes the following steps S201 to S207.
[0048] S201: The host computer splices the parameter information of the CPU card and the product information of the smart door lock into data information according to the custom string rule.
[0049] The custom string rule is the rule used by the host computer to encrypt the CPU card. First, the host computer converts the USB to TTL serial port, connects the USB end to the host computer, and connects the TTL serial port end to the CUT100 card reader to establish a physical connection between the host computer and the CPU card.
[0050] Then, the host computer sends an activation instruction to the CPU card, the CPU card returns parameter information, and the host computer obtains the parameter information of the CPU card, wherein the parameter information may be the card number of the CPU card.
[0051] Next, the host computer selects ISO14443-4 as the communication protocol between the serial port and the CPU card. The CUT100 card reader communicates with the CPU card through electrical signals, thereby establishing a communication connection between the host computer and the CPU card.
[0052] After establishing the communication connection, the host computer needs to obtain the read and write permissions of the CPU card in order to create a folder in the root directory of the CPU card to save the key factor. Therefore, in some implementation methods, the method further includes:
[0053] The host computer creates a folder for storing the key factor in the root directory of the CPU card based on the read and write permissions of the CPU card.
[0054] Specifically, in order to obtain the read and write permissions of the CPU card, in some implementation modes, the method further includes:
[0055] The host computer obtains a second random number, and encrypts the second random number to generate a first key;
[0056] The host computer uses the first key to obtain the read and write permissions of the CPU card;
[0057] The host computer creates a folder for storing the key factor in the root directory of the CPU card based on the read and write permissions of the CPU card, including:
[0058] The host computer deletes all files under the root directory of the CPU card based on the read and write permissions, thereby creating the folder for storing the key factor.
[0059] Specifically, when obtaining the read and write permissions of the CPU card, the host computer first issues an instruction to obtain an 8-byte random number as the second random number, and then uses DES (Data Encryption Standard) symmetric encryption to encrypt the second random number to generate a first key. The host computer uses the first key to obtain the read and write permissions of the CPU card.
[0060] When the host computer uses the first key to obtain the read and write permissions of the CPU card, external authentication of the CPU card is performed to obtain the read and write permissions of the CPU card.
[0061] After the host computer obtains the read and write permissions of the CPU card, the host computer deletes all files in the root directory of the CPU card, so that a folder for storing key factors can be created. The folder is represented by an ID of 0x00.
[0062] Deleting all files in the root directory of the CPU card is to recreate a new folder.
[0063] In some embodiments, after creating the folder for storing the key factor, the method further includes:
[0064] The first key is stored in the folder.
[0065] The first key is the password set by the host computer for the CPU card. When the host computer needs to read the authority of the CPU card again, it needs to compare the first key to obtain the read and write authority of the CPU card.
[0066] After creating a folder (0x00) for storing the key factor, the host computer splices the parameter information of the CPU card and the product information of the smart door lock into data information according to the custom string rule.
[0067] The product information of the smart door lock may be the abbreviation of the product.
[0068] When the upper computer is splicing data information, it can use the company abbreviation of the smart door lock, such as the 8 letters of "abcdefgh", convert the 8 letters into hexadecimal to get 8 bytes, the product information of the smart door lock is represented by "a1", and "a1" is converted into hexadecimal to get 3 bytes, the parameter information of the CPU card is the card number of the CPU card, which is 4 bytes, and the above 8 bytes, 3 bytes, and 4 bytes are spliced into data information.
[0069] S202: The host computer encrypts the data information to obtain a key factor, and saves the key factor in a folder of the CPU card.
[0070] The host computer can use the AES128 symmetric encryption algorithm to encrypt the data information, obtain the key factor, and save the key factor in the folder (0x00) of the CPU card to complete the internal authentication of the CPU card.
[0071] Since the CPU card is internally authenticated, the security of the CPU card can be improved to prevent it from being copied and prevent any door lock from adding and using the CPU card.
[0072] S203: When the smart door lock detects the CPU card, it generates a first random number and sends the first random number to the CPU card.
[0073] In some implementations, step S203 may include:
[0074] When the smart door lock detects that the CPU card is approaching, the smart door lock obtains parameter information of the CPU card;
[0075] The smart door lock determines whether the parameter information of the CPU card is consistent with the pre-stored card information;
[0076] If the parameter information of the CPU card is consistent with the pre-stored card information, the smart door lock generates a first random number.
[0077] Specifically, when the smart door lock detects that the CPU card is approaching, it first obtains the parameter information of the CPU card, which is the card number of the card. Then, by comparing the card number with the card number pre-stored in the smart door lock, the smart door lock can determine whether the parameter information of the CPU card is consistent with the pre-stored card information, thereby determining whether the card number is added to the smart door lock. If it is determined that the card number is added to the smart door lock, it is determined that the parameter information of the CPU card is consistent with the pre-stored card information, so that the smart door lock generates a first random number.
[0078] On the contrary, if it is determined that the card number is not added to the smart door lock, it can be determined that the parameter information of the CPU card is inconsistent with the pre-stored card information, then the smart door lock stops unlocking, and the smart door lock will not send the first random number to the CPU card.
[0079] S204: The smart door lock obtains the key factor from the folder;
[0080] S205: The smart door lock encrypts the first random number using the key factor to generate a first ciphertext;
[0081] S206: The CPU card encrypts the first random number using the key factor to generate a second ciphertext;
[0082] S207: The smart door lock compares the first ciphertext with the second ciphertext to determine whether to unlock the door.
[0083] Specifically, after the smart door lock determines that the card number of the CPU card is added to the smart door lock, it obtains the key factor in the folder. Then, the smart door lock and the CPU card respectively use the key factor to encrypt the first random number. The smart door lock generates a first ciphertext, and the CPU card generates a second ciphertext. The first ciphertext and the second ciphertext are compared to determine whether the smart door lock is unlocked.
[0084] In some implementations, step S207 may include:
[0085] If the first ciphertext is consistent with the second ciphertext, the smart door lock determines to unlock;
[0086] If the first ciphertext is inconsistent with the second ciphertext, the smart door lock determines not to unlock the door.
[0087] Specifically, if the two ciphertexts are consistent, it means that the smart door lock and the CPU card are paired successfully, and the smart door lock is unlocked; conversely, if the two ciphertexts are inconsistent, it means that the smart door lock and the CPU card are paired unsuccessfully, and the smart door lock is not unlocked.
[0088] In the embodiment of the present application, before adding the CPU card to the smart door lock, the host computer encrypts the CPU card, obtains the key factor and saves it in the folder of the CPU card, which can improve the security of the CPU card, prevent it from being added and used on any door lock, reduce interoperability, and increase the security of anti-copying. When using the CPU card to unlock, the smart door lock generates a random number, and the smart door lock and the CPU card generate a ciphertext by encrypting the random number, and compare the two ciphertexts to determine whether to unlock. When unlocking, the key factor written previously is used to encrypt again, and the CPU card is safer.
[0089] It should be noted that, in each of the above embodiments, there is not necessarily a certain order between the above steps. A person skilled in the art can understand, based on the description of the embodiments of the present invention, that in different embodiments, the above steps may have different execution orders, that is, they may be executed in parallel, may be executed interchangeably, and so on.
[0090] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as described above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A CPU card security algorithm for smart door locks. It is characterized in that The algorithm includes: The host computer splices the parameter information of the CPU card and the product information of the smart door lock into data information according to the custom string rule; The host computer encrypts the data information to obtain a key factor, and saves the key factor in a folder of the CPU card; When the smart door lock detects the CPU card, it generates a first random number and sends the first random number to the CPU card; The smart door lock obtains the key factor from the folder; The smart door lock encrypts the first random number using the key factor to generate a first ciphertext; The CPU card encrypts the first random number using the key factor to generate a second ciphertext; The smart door lock compares the first ciphertext with the second ciphertext to determine whether to unlock the door; Wherein, before the host computer splices the parameter information of the CPU card and the product information of the smart door lock into data information according to the custom string rule, the algorithm also includes: The host computer obtains a second random number, and encrypts the second random number to generate a first key; The host computer uses the first key to obtain the read and write permissions of the CPU card; The host computer creates a folder for storing the key factor in the root directory of the CPU card based on the read and write permissions of the CPU card, specifically including: The host computer deletes all files under the root directory of the CPU card based on the read and write permissions, thereby creating the folder for storing the key factor.
2. The algorithm according to claim 1, It is characterized in that After creating the folder for storing the key factors, the algorithm further comprises: The first key is stored in the folder.
3. The algorithm according to claim 1, It is characterized in that The algorithm also includes: The host computer sends an activation instruction to the CPU card to obtain parameter information of the CPU card.
4. The algorithm according to claim 1, It is characterized in that When the smart door lock detects the CPU card, the first random number is generated, including: When the smart door lock detects that the CPU card is approaching, the smart door lock obtains parameter information of the CPU card; The smart door lock determines whether the parameter information of the CPU card is consistent with the pre-stored card information; If the parameter information of the CPU card is consistent with the pre-stored card information, the smart door lock generates a first random number.
5. The algorithm according to claim 4, It is characterized in that The algorithm also includes: If the parameter information of the CPU card is inconsistent with the pre-stored card information, the smart door lock stops unlocking.
6. The algorithm according to claim 1, It is characterized in that The smart door lock compares the first ciphertext with the second ciphertext to determine whether to unlock the door, including: If the first ciphertext is consistent with the second ciphertext, the smart door lock determines to unlock; If the first ciphertext is inconsistent with the second ciphertext, the smart door lock determines not to unlock the door.
7. A CPU card security system for smart door locks, It is characterized in that Applying the algorithm described in any one of claims 1 to 6, the system includes a host computer, a CPU card and a smart door lock, the host computer is communicatively connected to the CPU card, or the CPU card is communicatively connected to the smart door lock.
Citation Information
Patent Citations
Method for encrypting and decrypting certificate card in accreditation system
CN101588238A
Commercial cipher algorithm based security access control system and implementation method thereof
CN104376631A
Intelligent card secret key acquisition method and intelligent card secret key acquisition device
CN106533660A
Intelligent door lock and unlocking method thereof
CN107558821A
Cloud intelligent lock system based on multiple encryption mode and secret key management method
CN109448197A
