Access control system and secret key verification method
By dynamically updating the key using the access control controller, generating a new key using secure random numbers, and conducting encrypted communication, the problem of electronic devices being able to pass through the access control system even after card information has been copied is solved, thus improving the system's security and reliability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, electronic devices can continuously pass access control system authentication after copying card information using NFC, leading to system security vulnerabilities.
By dynamically updating the key of the object to be verified through the access control controller, the key information copied by the NFC module of the electronic device becomes invalid. A new key is generated using a secure random number and encrypted communication is performed to ensure the randomness and security of the key.
This enhances the security of the access control system, prevents illegally copied keys from passing verification, and ensures the security and reliability of the system.
Smart Images

Figure CN121811536A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of access control system technology, and in particular relates to an access control system and a key verification method. Background Technology
[0002] In systems such as public transportation fare collection, access control, warehouse management, and e-wallets, card authentication is typically required to open doors, such as contactless integrated circuit cards (IC cards) and virtual cards in electronic devices. With the increasing capabilities of portable electronic devices like smartphones and smartwatches, Near Field Communication (NFC) functionality is becoming increasingly prevalent. NFC-enabled electronic devices can completely copy card information via an NFC module. Therefore, after copying the card information entered into the access control system using the electronic device's NFC function, access control authentication can be performed through the electronic device.
[0003] In related technologies, after copying card information using the NFC function of an electronic device, the electronic device can continuously authenticate system permissions. However, in some use cases, such as systems with high security requirements, the ability of the electronic device to continuously pass system verification after copying card information via NFC can lead to security vulnerabilities in the system. Summary of the Invention
[0004] This application provides an access control system and a key verification method that can dynamically update the key of the object to be verified, thereby invalidating the key information copied by the NFC module of the electronic device and improving the security of the system.
[0005] In a first aspect, embodiments of this application provide an access control system, including an access controller and a card reader; the card reader is used to respond to a user's access control verification operation, obtain first information of an object to be verified, and send the first information of the object to be verified to the access controller, wherein the first information of the object to be verified is stored in the storage area of the object to be verified, and the first information of the object to be verified includes at least the identification information of the object to be verified; the access controller is used to generate a first key based on the identification information of the object to be verified, and send the first key to the card reader; the card reader is used to use the first key to perform encrypted communication with the object to be verified to determine the key verification result corresponding to the object to be verified, and send the key verification result to the access controller, wherein the key verification result is used to indicate whether the first key matches the key stored in the object to be verified; the access controller is used to regenerate a second key corresponding to the object to be verified based on the identification information of the object to be verified when the key verification result indicates that the first key matches the key stored in the object to be verified, and send the second key to the card reader, wherein the second key is different from the first key; the card reader is used to send the second key to the object to be verified to update the key stored in the object to be verified with the second key.
[0006] In this embodiment, the key of the access control system is dynamically updated after each successful verification by performing key verification on the object to be verified based on the identification information of the object to be verified, and updating the key corresponding to the object to be verified when the key verification is successful. This makes the key copied by other electronic devices invalid, thereby improving the security of the access control system.
[0007] In one possible implementation of the first aspect, the aforementioned access controller is specifically used for: Generate a first key based on the identification information of the object to be verified; or... A first key is generated based on the identification information of the object to be verified and the first secure random number corresponding to the object to be verified, wherein the first secure random number is stored locally on the access control controller.
[0008] In this implementation, the access control controller can generate a key corresponding to the object to be verified using a secure random number and send it to the object. Therefore, the access control controller can query whether it has a first secure random number stored locally for the object. If the first secure random number is not stored locally, it indicates that the object is being used for the first time. The controller can then calculate the reference key (i.e., the initial key) based on the object's identification information using a pre-set key algorithm. If the first secure random number is stored locally, it means the object has already been used and the access control controller has generated a key based on the currently stored first secure random number and sent it to the object. The controller can then calculate the reference key based on the object's identification information and the first secure random number using a pre-set key algorithm. This allows the card reader to verify the object using the reference key, thereby generating the key for the verified object through secure random numbers, improving the randomness of the key, and further enhancing the security of the access control system.
[0009] Optionally, in another possible implementation of the first aspect, the aforementioned access controller is specifically used for: Generate a second secure random number corresponding to the object to be verified; A second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second security random number and the identification information of the object to be verified.
[0010] In this implementation, the access control controller generates a key corresponding to the object to be verified using a secure random number and sends it to the object. Therefore, when the object is verified using the key and its corresponding key is updated, the access control controller generates a new second secure random number for the object and generates a new second key based on this second secure random number. This updates the object's key to the second key, and the second secure random number is stored. This second secure random number is then used to verify the object's key the next time it is accessed. Thus, dynamically updating the object's key using a secure random number enhances the randomness of the key, thereby further improving the security of the access control system.
[0011] Optionally, in another possible implementation of the first aspect, the aforementioned access controller is specifically used for: If the key verification result indicates that the first key matches the key stored in the object to be verified, then the object to be verified is authorized for permission verification based on the identification information of the object to be verified. If the object to be verified passes the authorization verification, a second key is regenerated based on the identification information of the object to be verified.
[0012] In this implementation, since not all objects registered in the access control system have the permission to open the access control, after the object to be verified passes key verification, permission authorization verification can be performed on the object to be verified to check whether the object to be verified has been authorized to open the access control. If the object to be verified passes the permission authorization verification, it means that the object to be verified has the permission to open the access control, and the key of the object to be verified can be updated, and the object to be verified is confirmed to have been successfully authenticated, so the access control can be opened. If the object to be verified fails the permission authorization verification, it means that the object to be verified does not have the permission to open the access control, and the object to be verified is confirmed to have failed authentication, and the key of the object to be verified is not updated, so the access control is refused. This satisfies the permission verification needs of different types of access control systems, further improves the practicality of key verification in access control systems, and further enhances the security of access control systems.
[0013] Optionally, in another possible implementation of the first aspect, the aforementioned card reader is further used for: In response to an access control verification operation, the second information of the object to be verified is obtained, wherein the second information of the object to be verified is stored in the storage area of the object to be verified, and the information of the object to be verified includes at least the type of the object to be verified; If the type of the object to be verified is a preset type and the access control system has enabled the key verification function for the preset type of object to be verified, the first information of the object to be verified is sent to the access control controller.
[0014] In this implementation, since the access controller may be connected to multiple card readers, and different card readers may support different object types, there is no need to perform key verification on the object to be verified if the type of the object to be verified is not the preset type or if the access control system has not enabled key verification for that type of object. This satisfies the verification requirements of different types of cards, further improves the practicality of key verification in the access control system, and further enhances the security of the access control system.
[0015] Optionally, in another possible implementation of the first aspect, the aforementioned card reader is specifically used for: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate the second key verification random number. The first key verification random number is generated by the object to be verified according to the key verification request and returned to the card reader. The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key. The second encrypted data is generated by the object to be verified using the key stored in the object to be verified to encrypt a random number for verification of the second key and then returned to the card reader. If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be a match between the first key and the key stored in the object to be verified.
[0016] In this implementation, the card reader and the object to be verified use a three-way handshake mechanism to ensure secure communication and key verification between them, thus guaranteeing the security and reliability of key verification.
[0017] Secondly, embodiments of this application provide a key verification method, comprising: in response to a user's permission verification operation, obtaining information about an object to be verified, wherein the information about the object to be verified is stored in a storage area of the object to be verified, and the information about the object to be verified includes at least identification information of the object to be verified; generating a first key based on the identification information of the object to be verified; using the first key to perform encrypted communication with the object to be verified to determine a key verification result corresponding to the object to be verified, wherein the key verification result is used to indicate whether the first key matches a key stored in the object to be verified; if the key verification result indicates that the first key matches a key stored in the object to be verified, regenerating a second key corresponding to the object to be verified based on the identification information of the object to be verified, wherein the second key is different from the first key; and sending the second key to the object to be verified to update the key stored in the object to be verified with the second key.
[0018] In one possible implementation of the second aspect, generating the first key based on the identification information of the object to be verified includes: Generate a first key based on the identification information of the object to be verified; or... A first key is generated based on the identification information of the object to be verified and the first secure random number corresponding to the object to be verified, wherein the first secure random number is stored locally.
[0019] Optionally, in another possible implementation of the second aspect, the above-mentioned regenerating the second key corresponding to the object to be verified based on the identification information of the object to be verified includes: Generate a second secure random number corresponding to the object to be verified; A second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second security random number and the identification information of the object to be verified.
[0020] Optionally, in another possible implementation of the second aspect, when the key verification result indicates that the first key matches the key stored in the object to be verified, regenerating the second key corresponding to the object to be verified based on the identification information of the object to be verified includes: If the key verification result indicates that the first key matches the key stored in the object to be verified, then the object to be verified is authorized for permission verification based on the identification information of the object to be verified. If the object to be verified passes the authorization verification, a second key is regenerated based on the identification information of the object to be verified.
[0021] Optionally, in another possible implementation of the second aspect, before generating the first key based on the identification information of the object to be verified, the method further includes: Get the type of the object to be verified; Accordingly, the first key is generated based on the identification information of the object to be verified, including: If the type of the object to be verified is a preset type and the key verification function for the preset type of object to be verified is enabled, a first key is generated based on the identification information of the object to be verified.
[0022] Optionally, in another possible implementation of the second aspect, the above-mentioned use of the first key to perform encrypted communication with the object to be verified in order to determine the key verification result corresponding to the object to be verified includes: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate the second key verification random number. The first key verification random number is generated and returned by the object to be verified based on the key verification request. The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key. The second encrypted data is generated by the object to be verified using the key stored in the object to be verified to encrypt a random number for verification of the second key and then returned. If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be a match between the first key and the key stored in the object to be verified.
[0023] Thirdly, embodiments of this application provide an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the key verification method as described above.
[0024] Fourthly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the key verification method as described above.
[0025] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the key verification method as described above.
[0026] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a schematic diagram of the structure of an access control system provided in one embodiment of this application; Figure 2 This is a flowchart illustrating a key verification method provided in an embodiment of this application; Figure 3 This is a schematic diagram of the sector data structure of an M1 card according to an embodiment of this application; Figure 4 This is a flowchart illustrating a key verification method provided in another embodiment of this application; Figure 5 This is a flowchart illustrating a key verification method provided in another embodiment of this application; Figure 6 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation
[0029] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0030] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0031] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0032] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0033] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0034] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0035] The access control system, key verification method for the access control system, electronic device, storage medium and computer program provided in this application are described in detail below with reference to the accompanying drawings.
[0036] As one possible implementation, such as Figure 1 As shown, Figure 1 The access control system provided in this application embodiment may include: an access control controller and at least one card reader. A card reader primarily refers to a component with card reading functionality.
[0037] The access control controller can communicate with at least one card reader. The connection between the access control controller and the card reader can be wired or wireless, and this application embodiment does not limit this.
[0038] It should be noted that the card reader can be physically integrated with the access control controller, or the card reader and the access control controller can be two physically independent parts that can communicate with each other. This application does not limit this.
[0039] In this embodiment, the card reader is used to read relevant information about the access control card when the card is near it, including but not limited to: the card's identification information and type. The card reader then sends the read access control card information to the access control controller. The access control controller verifies the access control card based on the received information to determine if the card has permission to open the access control system, and dynamically updates the access control card's key when successful authentication.
[0040] As an example, the card reader can be installed in terminal devices such as door locks, access control devices, and turnstiles. The object to be verified in this application embodiment can be a physical card or a virtual card set in an electronic device (such as a mobile phone); this application embodiment does not limit this.
[0041] It should be noted that the key verification method in the embodiments of this application can be applied to, for example, Figure 1 The access control system shown can also be applied to systems such as public transportation automatic fare collection, access control management, warehouse management, and e-wallets.
[0042] Figure 2 A flowchart illustrating a key verification method provided in an embodiment of this application is shown.
[0043] like Figure 2 As shown, the key verification method includes the following steps: Step 101: In response to the user's permission verification operation, obtain the information of the object to be verified.
[0044] The information of the object to be verified is stored in the storage area of the object to be verified, and the information of the object to be verified includes at least the identification information of the card to be verified.
[0045] In this context, authorization verification operations can refer to bringing the object to be verified close to or into contact with the card reading area (such as a card reader) in the system so that the system can obtain information about the object to be verified. For example, authorization verification operations can be card swiping operations.
[0046] As an example, the identification information of the object to be verified can be used to identify the object. For example, the identification information of the object to be verified can be the serial number of the object to be verified, or information associated with the serial number of the object to be verified. This application embodiment does not limit this. In this application embodiment, when the user brings the object to be verified close to or touches it with the card reading area in the system, the system can obtain the information of the object to be verified through communication.
[0047] Step 102: Generate the first key based on the identification information of the object to be verified.
[0048] As one possible implementation, a first key can be generated by using a preset key algorithm to calculate the identification information of the object to be verified, and then used to verify whether the first key is the same as the key stored in the object to be verified.
[0049] As an example, generating a first key based on the identification information of the object to be verified can be achieved in the following way: Generate a first key based on the identification information of the object to be verified; or... A first key is generated based on the identifier information of the object to be verified and the corresponding first secure random number, wherein the first secure random number is stored locally. The first secure random number may refer to the secure random number used to generate the currently stored key within the object to be verified.
[0050] It should be noted that, in the embodiments of this application, "local" refers to the local device of the device executing the key verification method of this application (which can also be understood as the storage area set by the device itself). For example, when the key verification method of this application is applied to an access control machine, it can refer to the local device of the access control machine; when applied to an access control system in which the card reader and the access control controller are physically separated, "local" in the embodiments of this application can refer to the local access control system or the local access control controller.
[0051] As one possible implementation, taking the key verification method of this application in an access control system as an example, the access control system can generate a first key based on the identification information of the object to be verified in the following ways: one is to not use a secure random number, for example, if no secure random number associated with the identification information of the object to be verified is stored locally, then the access control system can generate a first key based on the identification information of the object to be verified; the other is to use a secure random number, for example, if a secure random number associated with the identification information of the object to be verified is stored locally, then the access control system can obtain the first secure random number and generate a first key based on the identification information of the object to be verified and the first secure random number.
[0052] As an example, the access control system can query whether a first secure random number corresponding to the object to be verified is stored locally based on the identification information of the object to be verified. If the first secure random number is not stored locally, it means that the object to be verified is being used for the first time. In this case, a pre-set key algorithm can be used to calculate the object's identification information to generate the first key (i.e., the initial key). If the first secure random number is stored locally, it means that the object to be verified has already been used, and the access control system has already generated a key corresponding to the object based on the currently stored first secure random number and issued it to the object. Therefore, the pre-set key algorithm can be used to calculate the first key corresponding to the object to be verified based on the object's identification information and the first secure random number. This method of generating the access card key using a secure random number enhances the randomness of the key, thereby further improving the system's security.
[0053] As one possible implementation, some objects to be verified may internally store multiple keys, such as an M1 card (an IC card) with multiple sectors. An M1 card can contain 16 sectors, such as... Figure 3 The diagram shows the data structure of one sector (sector 0) of the M1 card. Sector control block 3 stores the key, which can be copied using the NFC function of the electronic device. Figure 3 The sector information shown. It should be noted that... Figure 3 The diagram only shows the data structure of one sector of the M1 card; the data structures of other sectors can be the same, and will not be elaborated here. Therefore, for this type of object to be verified, the keys for each sector can be partially the same or completely different. In this case, the access control system can store a secure random number corresponding to each sector (such as the first secure random number or the second secure random number described below). When verifying the key of the object to be verified, a first key corresponding to each sector can be generated based on the identification information of the object to be verified and the first secure random number corresponding to each sector, so as to verify whether the first key corresponding to each sector is the same as the key stored in the corresponding sector of the object to be verified.
[0054] Furthermore, since different types of access control cards have different functions—for example, some access control cards allow copying while others do not—and different users have different needs, in order to meet the key verification requirements of different types of access control cards and the needs of different user groups, it is possible to determine whether the method of this application is needed to perform key verification and dynamic key updates on the object to be verified based on the object types that need dynamic key updates preset in the access control system and whether the access control system has enabled key verification functions for specific types of objects. That is, in one possible implementation of this application embodiment, before step 102 above, it may further include: Get the type of the object to be verified; Accordingly, step 102 above may include: If the type of the object to be verified is a preset type and the key verification function for the preset type of object to be verified is enabled, a first key is generated based on the identification information of the object to be verified.
[0055] The preset type refers to the type of access control card that requires key verification and dynamic key updates according to the method of this application embodiment. In actual use, the preset type can be pre-set according to the functional characteristics of various access control cards, or it can be set according to the actual usage needs of users. This application embodiment does not limit this. For example, the preset type can be an M1 card.
[0056] As one possible implementation, taking its application in an access control system as an example, the access control system or its components (such as...) Figure 1 The card reader in the system can obtain the type of the object to be verified when it receives a user's authorization verification operation (such as a user's card swipe operation), and determine whether the access control system has enabled the key verification function for that type of object.
[0057] As an example, based on user needs or the functional characteristics of access control cards, preset types requiring key verification and dynamic key updates can be pre-defined. Users can also decide whether to enable the access control system's key verification function for certain types of objects based on their own needs. Therefore, if the type of the object to be verified is a preset type and the access control system has enabled key verification for preset types of objects, it can be determined that key verification of the object to be verified is required according to the method of this application embodiment. Upon successful verification, the key of the object to be verified will be dynamically updated to ensure system security.
[0058] Correspondingly, if it is determined that the type of the object to be verified is not the preset type, the object to be verified can be verified according to the verification process of other types of objects to determine whether the object to be verified can be successfully authenticated; if it is determined that the type of the object to be verified is the preset type, and the access control system has not enabled the key verification function for the preset type of object to be verified, the key verification and key update process for the object to be verified can be skipped directly; if there are other verification processes for the preset type of object to be verified, the other verification processes can be continued until it is determined whether the object to be verified has been successfully authenticated.
[0059] It should be noted that after determining that the type of the object to be verified is a preset type and the access control system has enabled the key verification function for the preset type of object to be verified, the first key can be generated according to the identification information of the object to be verified and the subsequent key verification process can be carried out in accordance with the detailed description of the foregoing embodiments of this application. This will not be repeated here.
[0060] Step 103: Use the first key to perform encrypted communication with the object to be verified in order to determine the key verification result corresponding to the object to be verified. The key verification result is used to indicate whether the first key matches the key stored in the object to be verified.
[0061] As one possible implementation, taking the application in an access control system as an example, after generating a first key based on the identification information of the object to be verified, the access control system can use the first key to conduct encrypted communication with the object to be verified in order to verify whether the key stored in the object to be verified matches the first key, that is, to determine the key verification result corresponding to the object to be verified.
[0062] As an example, a three-way handshake mechanism can be used between the access control system and the object to be verified to ensure secure communication and key verification, thereby guaranteeing the security and reliability of key verification. Specifically, in one possible implementation of this application embodiment, step 103 may include: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate the second key verification random number. The first key verification random number is generated and returned by the object to be verified based on the key verification request. The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key. The second encrypted data is generated by the object to be verified using the key stored in the object to be verified to encrypt a random number for verification of the second key and then returned. If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be a match between the first key and the key stored in the object to be verified.
[0063] The key verification request can carry the key identification information that needs to be verified. For example, if the key in sector 0 of the object to be verified needs to be verified, the sector identifier corresponding to sector 0 can be carried as key identification information in the key verification request and sent to the object to be verified, so that the object to be verified knows which sector's key needs to be verified.
[0064] As an example, taking an access control system as an example, after generating a first key, the access control system can send a key verification request to the object to be verified. After receiving the key verification request, the object to be verified can generate a first key verification random number and return it to the access control system. Then, after receiving the first key verification random number returned by the object to be verified, the access control system can generate a second key verification random number, and encrypt the first key verification random number and the second key verification random number using the first key to obtain the first encrypted data. Finally, the access control system sends the first encrypted data to the object to be verified.
[0065] After obtaining the first encrypted data, the object to be verified can use the key specified in the key verification request to decrypt the first encrypted data. If the first key verification random number obtained after decryption matches the first key verification random number generated by the object to be verified, it is preliminarily indicated that the first key matches the key stored in the object to be verified. The object to be verified can then continue to use its stored key to encrypt the second key verification random number obtained after decryption to generate the second encrypted data and return the second encrypted data to the access control system.
[0066] If the access control system successfully receives the second encrypted data, it can use the first key to decrypt the second encrypted data. If the decrypted second encrypted data matches the second key verification random data generated by the access control system, it can be concluded that the first key matches the key stored in the object to be verified, and the key verification result can be determined as the first key matching the key stored in the object to be verified.
[0067] If the object to be verified cannot successfully decrypt the first encrypted data (i.e., the first key verification random number obtained by decrypting the first encrypted data does not match the first key verification random number generated by the object to be verified), or if the access control system cannot successfully decrypt the second encrypted data (i.e., the decrypted second encrypted data does not match the second key verification random number generated by the access control system), it can be concluded that the first key does not match the key stored in the object to be verified, and the key verification result can be determined as the first key not matching the key stored in the object to be verified.
[0068] It should be noted that the process described above, in which the first key is used to perform encrypted communication with the object to be verified to determine the key verification result corresponding to the object to be verified, can be performed by any component in the system capable of communicating with the object to be verified. As an example, if the key verification method of this application is applied to, for example... Figure 1 In the access control system shown, the process of using the first key to conduct encrypted communication with the object to be verified in order to determine the key verification result corresponding to the object to be verified can be executed by the card reader in the access control system.
[0069] It should be noted that the matching mentioned in the embodiments of this application may refer to the sameness, or it may refer to other custom criteria for judging whether two are matched, such as the similarity between the two being greater than or equal to the set similarity threshold. The embodiments of this application do not limit this.
[0070] As one possible implementation, for an object to be verified with multiple keys, such as an M1 card with multiple sectors, the keys for each sector can be partially the same or completely different. In this case, if it is necessary to verify the keys of multiple sectors, the aforementioned method can be used to verify the keys of each sector sequentially. For example, multiple sector identification information can be carried in the key verification request. Only if the first key corresponding to each sector matches the key stored in the corresponding sector of the object to be verified, it can be determined that the object to be verified has passed the key verification; if the first key corresponding to any sector does not match the key stored in the corresponding sector of the object to be verified, it can be determined that the object to be verified has failed the key verification.
[0071] Step 104: If the key verification result indicates that the first key matches the key stored in the object to be verified, regenerate the second key corresponding to the object to be verified based on the identification information of the object to be verified.
[0072] In this embodiment, the second key is different from the first key.
[0073] In this embodiment, if it is determined that the object to be verified has passed key verification, then the object can be confirmed as successfully authenticated and the system can be opened (e.g., opening the access control system). The key stored in the object to be verified is then updated, rendering the previous historical key invalid. Thus, even if the object to be verified has been copied before, the copied information will be invalidated, preventing the access control system from being opened again. Therefore, if the object to be verified passes key verification, a second key corresponding to the object to be verified can be regenerated based on the object's identification information to update the key of the object to be verified.
[0074] Furthermore, when generating the access card key using a secure random number, a new secure random number can be generated to update the key of the object to be verified when a key update is required, thereby improving the randomness of the key and further enhancing the security of the system. That is, in one possible implementation of this application embodiment, step 104 above may include: Generate a second secure random number corresponding to the object to be verified; A second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second security random number and the identification information of the object to be verified.
[0075] It is worth noting that in the embodiments of this application, the first secure random number and the second secure random number can be the same or different. When the first secure random number and the second secure random number are different, a first pre-set key algorithm and the first secure random number can be used to generate a first key, and a second pre-set key algorithm and the second secure random number can be used to generate a second key. The first pre-set key algorithm and the second pre-set key algorithm can be the same or different. When the first secure random number and the second secure random number are the same, the first pre-set key algorithm and the second pre-set key algorithm are different, so that the first key and the second key are different; when the first secure random number and the second secure random number are different, the first pre-set key algorithm and the second pre-set key algorithm can be the same.
[0076] In one possible implementation of this application, when a corresponding key is generated using a secure random number and sent to the object to be verified, a new second secure random number can also be generated when the object to be verified verifies the key and updates the key corresponding to the object. This second secure random number is then calculated based on the object's identifier information and the second secure random number using a pre-set key algorithm to generate a new second key for the object. The association between the second secure random number and the object's identifier information is then stored; that is, the association between the object's identifier information and the first secure random number is updated to the association between the object's identifier information and the second secure random number. This allows the object to be verified using the second secure random number the next time it is used. Therefore, dynamically updating the access card key using a secure random number improves the randomness of the key, thereby further enhancing the system's security.
[0077] It should be noted that if a user enables key verification for multiple sectors of the object to be verified, then if the object to be verified passes the key verification, a second security random number can be generated for each sector of the object to be verified, and a new second key can be generated for each sector in the same way as described above, and the key for each sector can be updated to the corresponding second key.
[0078] Step 105: Send the second key to the object to be verified to update the key stored in the object to be verified with the second key.
[0079] In this embodiment of the application, after the second key is generated, the second key can be sent to the object to be verified through a secure channel to update the key of the object to be verified to the second key.
[0080] As an example, taking an access control system as an example, after generating the second key, the second key can be sent through a secure channel to any component in the access control system that can communicate with the object to be verified (such as...). Figure 1 (The card reader in the middle) to send the second key to the object to be verified, so as to update the key of the object to be verified to the second key.
[0081] Accordingly, if the key verification result indicates that the first key does not match the key stored in the object to be verified, it can be determined that the authentication of the object to be verified has failed.
[0082] It should be noted that the matching of the first key mentioned in the embodiments of this application with the key stored in the object to be verified can mean that the two are the same, or that the similarity between the two is greater than or equal to the set similarity threshold or other custom criteria for judging whether they match. The embodiments of this application do not limit this.
[0083] It is worth noting that even if the NFC module of the electronic device that copies the physical card can write a new key after copying, if the object to be verified this time is the NFC module that copied the physical card, then the key copied in the NFC module will be updated, while the key stored in the original physical card will not be updated. As a result, the original physical card will become invalid. In this way, the user will realize that the physical card is invalid and contact the card issuer again to reassign the key. Thus, the key in the NFC module becomes an invalid historical key again. Therefore, even if the NFC module can rewrite the key, the method of dynamically updating the key in this application embodiment can still ensure the security of the system.
[0084] The key verification method provided in this application verifies the key of the object to be verified based on the identification information of the object to be verified, and updates the key corresponding to the object to be verified when the key verification is successful. Thus, the key of the object to be verified is dynamically updated after each successful verification, making the key copied by other electronic devices invalid and improving the security of the system.
[0085] Figure 4 A flowchart illustrating another key verification method provided in an embodiment of this application is shown.
[0086] like Figure 4 As shown, this key verification method includes the following steps: Step 401: In response to the user's permission verification operation, obtain the information of the object to be verified.
[0087] The information of the object to be verified is stored in the storage area of the object to be verified, and the information of the object to be verified includes at least the identification information of the object to be verified.
[0088] Step 402: Generate the first key based on the identification information of the object to be verified.
[0089] Step 403: Use the first key to perform encrypted communication with the object to be verified to determine the key verification result corresponding to the object to be verified. The key verification result is used to indicate whether the first key matches the key stored in the object to be verified. If the key verification result indicates that the first key matches the key stored in the object to be verified, proceed to step 404. If the object to be verified fails the key verification, proceed to step 407. In step 407, it is determined that the authentication of the object to be verified has failed.
[0090] The specific implementation process and principle of steps 401-403 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0091] Step 404: Perform permission verification on the object to be verified based on its identification information; if the object to be verified passes the permission verification, proceed to steps 405 and 406; Step 405: Regenerate the second key corresponding to the object to be verified based on its identification information; Step 406: Send the second key to the object to be verified to update the key stored in the object to the second key; if the object to be verified fails the permission verification, proceed to step 407.
[0092] As one possible implementation, since not all cards entered into the system have the permission to open the access control system, for example, all employees in a company can be entered into the access control system, but some important access control systems may be set to allow only some employees to enter. Therefore, after the object to be verified is of a preset type and key verification is enabled, and it is determined that the object to be verified has passed the key verification, the object to be verified can be further verified for permission to determine whether the object to be verified has been authorized to open the access control system.
[0093] It should be noted that in actual use, existing methods can be used to authenticate the object to be verified, and this application embodiment does not limit this.
[0094] As one possible implementation, if the object to be verified passes the permission verification, it means that the object has the permission to open the access control system. In this case, the key of the object to be verified can be updated, and the object to be verified can be confirmed as successfully authenticated to open the access control system. If the object to be verified fails the permission verification, it means that the object to be verified does not have the permission to open the access control system. In this case, the object to be verified can be confirmed as having failed authentication, and the key of the object to be verified will not be updated to refuse to open the access control system. This satisfies the permission verification needs of different types of systems, further improves the practicality of system key verification, and further enhances the security of the system.
[0095] The specific implementation process and principle of steps 404-407 above can be found in the detailed description of the above embodiments, and will not be repeated here.
[0096] The key verification method provided in this application embodiment addresses the issue that access control cards entered into the system may not all have the authority to open the access control. Therefore, after the object to be verified passes the key verification, the object to be verified is then subjected to permission verification to confirm whether it has been authorized to open the access control. This satisfies the permission verification requirements of different types of systems, further enhances the practicality of the system key verification, and further improves the system security.
[0097] Figure 5 This illustration shows a flowchart of another key verification method provided in an embodiment of this application. Figure 5 Taking an example, the overall process of the key verification method in this application will be described as follows, as an example. Figure 5 The method shown can be applied to, for example Figure 1 The access control system shown is illustrated. In this embodiment, the card reader can refer to a standalone card reader device or a card reader component on an access control terminal (such as an integrated access control machine, a turnstile, etc.).
[0098] First, when the card reader detects the object to be verified using RFID, it determines whether the object to be verified is of a preset type. If the object to be verified is not of a preset type, it performs a verification process for other types of objects. If the verification process for other types of objects is successful, it performs permission verification on the object to be verified. If the object to be verified passes the permission verification, it is determined that the object to be verified is successfully authenticated. If the object to be verified fails the permission verification, it is determined that the object to be verified has failed to be authenticated.
[0099] If the object to be verified is of a preset type, it is further determined whether the access control system has enabled the key verification function for the preset type of object to be verified; if the access control system has not enabled the key verification function, the object to be verified can be authorized for permission verification. If the object to be verified passes the permission verification, it is determined that the object to be verified is successfully authenticated; if the object to be verified fails the permission verification, it is determined that the object to be verified has failed to be authenticated.
[0100] If the key verification function is enabled for the object to be verified, the system can check whether the identification information of the object to be verified is stored in the access control controller (or in the storage area set in the system). If the identification information of the object to be verified is not stored in the access control controller (or in the storage area set in the system), the authentication of the object to be verified is deemed to have failed. If the identification information of the object to be verified is stored in the access control controller (or in the storage area set in the system), a first secure random number corresponding to the object to be verified can be obtained based on the identification information of the object to be verified. If the first secure random number is not obtained, an initial key for the object to be verified is generated based on the identification information of the object to be verified. If the first secure random number is obtained, a first key is generated based on the identification information of the object to be verified and the first secure random number. The generated first key or initial key is then sent to the card reader (or access control controller). The system includes components capable of key verification, enabling card readers (or components capable of key verification in access control systems) to perform key verification on the object to be verified; determining authentication failure if the object to be verified fails key verification; requesting permission verification if the object to be verified passes key verification; further determining authentication failure if the object to be verified fails permission verification; and regenerating a new second security random number and generating a new second key corresponding to the object to be verified based on the second security random number and the object's identification information when the object to be verified passes permission verification; sending the second key to the card reader (or components capable of key verification in access control systems) to update the object's key, storing the second security random number, and determining successful authentication of the object to be verified.
[0101] This application also proposes a key verification method, comprising: in response to a user's permission verification operation, obtaining information about an object to be verified, wherein the information about the object to be verified is stored in the storage area of the object to be verified, and the information about the object to be verified includes at least the identification information of the object to be verified; generating a first key based on the identification information of the object to be verified; using the first key to perform encrypted communication with the object to be verified to determine the key verification result corresponding to the object to be verified, wherein the key verification result is used to indicate whether the first key matches the key stored in the object to be verified; if the key verification result indicates that the first key matches the key stored in the object to be verified, regenerating a second key corresponding to the object to be verified based on the identification information of the object to be verified, wherein the second key is different from the first key; and sending the second key to the object to be verified to update the key stored in the object to be verified with the second key.
[0102] In one possible implementation of this application, generating the first key based on the identification information of the object to be verified includes: Generate a first key based on the identification information of the object to be verified; or... A first key is generated based on the identification information of the object to be verified and the first secure random number corresponding to the object to be verified, wherein the first secure random number is stored locally.
[0103] Optionally, in another possible implementation of this application, the above-mentioned regenerating the second key corresponding to the object to be verified based on the identification information of the object to be verified includes: Generate a second secure random number corresponding to the object to be verified; A second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second security random number and the identification information of the object to be verified.
[0104] Optionally, in another possible implementation of this application, when the key verification result indicates that the first key matches the key stored in the object to be verified, regenerating the second key corresponding to the object to be verified based on the identification information of the object to be verified includes: If the key verification result indicates that the first key matches the key stored in the object to be verified, then the object to be verified is authorized for permission verification based on the identification information of the object to be verified. If the object to be verified passes the authorization verification, a second key is regenerated based on the identification information of the object to be verified.
[0105] Optionally, in another possible implementation of this application, before generating the first key based on the identification information of the object to be verified, the method further includes: Get the type of the object to be verified; Accordingly, the first key is generated based on the identification information of the object to be verified, including: If the type of the object to be verified is a preset type and the key verification function for the preset type of object to be verified is enabled, a first key is generated based on the identification information of the object to be verified.
[0106] Optionally, in another possible implementation of this application, the above-mentioned use of the first key to perform encrypted communication with the object to be verified in order to determine the key verification result corresponding to the object to be verified includes: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate the second key verification random number. The first key verification random number is generated and returned by the object to be verified based on the key verification request. The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key. The second encrypted data is generated by the object to be verified using the key stored in the object to be verified to encrypt a random number for verification of the second key and then returned. If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be a match between the first key and the key stored in the object to be verified.
[0107] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0108] Corresponding to the key verification method described in the above embodiments, Figure 1 A schematic diagram of the access control system provided in the embodiments of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0109] Reference Figure 1 The aforementioned access control system includes a card reader and an access controller.
[0110] The card reader is used to respond to the user's access control verification operation, obtain the first information of the object to be verified, and send the first information of the object to be verified to the access control controller. The first information of the object to be verified is stored in the storage area of the object to be verified, and the first information of the object to be verified includes at least the identification information of the object to be verified. The access control controller is used to generate a first key based on the identification information of the object to be verified, and send the first key to the card reader; The card reader is used to perform encrypted communication with the object to be verified using a first key to determine the key verification result corresponding to the object to be verified, and to send the key verification result to the access control controller. The key verification result is used to indicate whether the first key matches the key stored in the object to be verified. The access control controller is used to regenerate a second key corresponding to the object to be verified based on the identification information of the object to be verified when the key verification result indicates that the first key matches the key stored in the object to be verified, and send the second key to the card reader. The second key is different from the first key. The card reader is used to send a second key to the object to be verified, so as to update the key stored in the object to the second key.
[0111] It should be noted that the first information of the object to be verified in this application embodiment may be the same as the information of the object to be verified in the aforementioned method embodiment, and will not be repeated here.
[0112] The access control system provided in this application verifies the key of the object to be verified based on the identification information of the object to be verified, and updates the key corresponding to the object to be verified when the key verification is successful. Thus, the key of the object to be verified is dynamically updated after each successful verification, making the key copied by other electronic devices invalid, thereby improving the security of the access control system.
[0113] In one possible implementation of this application, the access controller is specifically used for: Generate a first key based on the identification information of the object to be verified; or... A first key is generated based on the identification information of the object to be verified and the first secure random number corresponding to the object to be verified, wherein the first secure random number is stored locally on the access control controller.
[0114] Optionally, in another possible implementation of this application, the above-mentioned access controller is specifically used for: Generate a second secure random number corresponding to the object to be verified; A second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second security random number and the identification information of the object to be verified.
[0115] Optionally, in another possible implementation of this application, the above-mentioned access controller is specifically used for: If the key verification result indicates that the first key matches the key stored in the object to be verified, then the object to be verified is authorized for permission verification based on the identification information of the object to be verified. If the object to be verified passes the authorization verification, a second key is regenerated based on the identification information of the object to be verified.
[0116] Optionally, in yet another possible implementation of this application, the card reader is further used for: In response to an access control verification operation, the second information of the object to be verified is obtained, wherein the second information of the object to be verified is stored in the storage area of the object to be verified, and the information of the object to be verified includes at least the type of the object to be verified; If the type of the object to be verified is a preset type and the access control system has enabled the key verification function for the preset type of object to be verified, the first information of the object to be verified is sent to the access control controller.
[0117] Optionally, in another possible implementation of this application, the card reader described above is specifically used for: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate the second key verification random number. The first key verification random number is generated by the object to be verified according to the key verification request and returned to the card reader. The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key. The second encrypted data is generated by the object to be verified using the key stored in the object to be verified to encrypt a random number for verification of the second key and then returned to the card reader. If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be a match between the first key and the key stored in the object to be verified.
[0118] It should be noted that the information interaction and execution process between the access control controller and the card reader of the above-mentioned access control system are based on the same concept as the method embodiment of this application. For details on its specific functions and the resulting technical effects, please refer to the method embodiment section, and it will not be repeated here.
[0119] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0120] To implement the above embodiments, this application also proposes an electronic device.
[0121] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application.
[0122] like Figure 6 As shown, the above-mentioned electronic device 200 includes: The system includes a memory 210 and at least one processor 220, and a bus 230 connecting the different components (including the memory 210 and the processor 220). The memory 210 stores a computer program, which, when executed by the processor 220, implements the key verification method described in the embodiments of this application.
[0123] Bus 230 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0124] Electronic device 200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by electronic device 200, including volatile and non-volatile media, removable and non-removable media.
[0125] Memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. Electronic device 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 260 may be used to read and write non-removable, non-volatile magnetic media (not shown, commonly referred to as "hard disk drives"). Although not shown in the figures, disk drives for reading and writing to removable non-volatile disks (e.g., "floppy disks") and optical disk drives for reading and writing to removable non-volatile optical disks (e.g., CD-ROMs, DVD-ROMs, or other optical media) may be provided. In these cases, each drive may be connected to bus 230 via one or more data media interfaces. Memory 210 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.
[0126] A program / utility 280 having a set (at least one) of program modules 270 may be stored in, for example, memory 210. Such program modules 270 include—but are not limited to—an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 270 typically perform the functions and / or methods described in the embodiments of this application.
[0127] Electronic device 200 can also communicate with one or more external devices 290 (e.g., keyboard, pointing device, display 291, etc.), and with one or more devices that enable a user to interact with electronic device 200, and / or with any device that enables electronic device 200 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 292. Furthermore, electronic device 200 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 293. As shown, network adapter 293 communicates with other modules of electronic device 200 via bus 230. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0128] The processor 220 performs various functional applications and data processing by running programs stored in the memory 210.
[0129] It should be noted that the implementation process and technical principles of the electronic device in this embodiment are explained in the foregoing description of the key verification method in the embodiments of this application, and will not be repeated here.
[0130] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0131] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0132] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks.
[0133] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0134] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0135] In the embodiments provided in this application, it should be understood that the disclosed devices / electronic devices and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0136] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0137] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An access control system, characterized in that, The access control system includes an access controller and a card reader; The card reader is used to respond to the user's access control verification operation, obtain the first information of the object to be verified, and send the first information of the object to be verified to the access control controller. The first information of the object to be verified is stored in the storage area of the object to be verified, and the first information of the object to be verified includes at least the identification information of the object to be verified. The access control controller is used to generate a first key based on the identification information of the object to be verified, and send the first key to the card reader; The card reader is used to perform encrypted communication with the object to be verified using the first key to determine the key verification result corresponding to the object to be verified, and to send the key verification result to the access control controller, wherein the key verification result is used to indicate whether the first key matches the key stored in the object to be verified; The access control controller is used to regenerate a second key corresponding to the object to be verified based on the identification information of the object to be verified when the key verification result indicates that the first key matches the key stored in the object to be verified, and send the second key to the card reader, wherein the second key is different from the first key; The card reader is used to send the second key to the object to be verified, so as to update the key stored in the object to be verified to the second key.
2. The access control system as described in claim 1, characterized in that, The access control controller is specifically used for: The first key is generated based on the identification information of the object to be verified; or... The first key is generated based on the identification information of the object to be verified and the first secure random number corresponding to the object to be verified, wherein the first secure random number is stored locally on the access control controller.
3. The access control system as described in claim 1 or 2, characterized in that, The access control controller is specifically used for: Generate a second secure random number corresponding to the object to be verified; The second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second secure random number and the identification information of the object to be verified.
4. The access control system as described in claim 1, characterized in that, The access control controller is specifically used for: If the key verification result indicates that the first key matches the key stored in the object to be verified, then the object to be verified is subject to permission authorization verification based on the identification information of the object to be verified. If the object to be verified passes the authorization verification, the second key is regenerated based on the identification information of the object to be verified.
5. The access control system as described in any one of claims 1-2 or 4, characterized in that, The card reader is also used for: In response to the access control verification operation, the second information of the object to be verified is obtained, wherein the second information of the object to be verified is stored in the storage area of the object to be verified, and the information of the object to be verified includes at least the type of the object to be verified; When the type of the object to be verified is a preset type and the access control system has enabled the key verification function for the object to be verified of the preset type, the first information of the object to be verified is sent to the access control controller.
6. The access control system as described in any one of claims 1-2 or 4, characterized in that, The card reader is specifically used for: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate a second key verification random number, wherein the first key verification random number is generated by the object to be verified according to the key verification request and returned to the card reader; The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key. The second encrypted data is generated by the object to be verified using the key stored in the object to be verified to encrypt a random number for verifying the second key and then returning it to the card reader. If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be that the first key matches the key stored in the object to be verified.
7. A key verification method, characterized in that, include: In response to a user's permission verification operation, information about the object to be verified is obtained, wherein the information about the object to be verified is stored in the storage area of the object to be verified, and the information about the object to be verified includes at least the identification information of the object to be verified; A first key is generated based on the identification information of the object to be verified; The first key is used to perform encrypted communication with the object to be verified in order to determine the key verification result corresponding to the object to be verified, wherein the key verification result is used to indicate whether the first key matches the key stored in the object to be verified; If the key verification result indicates that the first key matches the key stored in the object to be verified, a second key corresponding to the object to be verified is regenerated based on the identification information of the object to be verified, wherein the second key is different from the first key; The second key is sent to the object to be verified to update the key stored in the object to be verified with the second key.
8. The method as described in claim 7, characterized in that, The step of generating a first key based on the identification information of the object to be verified includes: The first key is generated based on the identification information of the object to be verified; or... The first key is generated based on the identification information of the object to be verified and the first secure random number corresponding to the object to be verified, wherein the first secure random number is stored locally.
9. The method as described in claim 7 or 8, characterized in that, The step of regenerating the second key corresponding to the object to be verified based on the identification information of the object to be verified includes: Generate a second secure random number corresponding to the object to be verified; The second key is generated based on the identification information of the object to be verified and the second security random number; Store the association between the second secure random number and the identification information of the object to be verified.
10. The method as described in claim 7, characterized in that, When the key verification result indicates that the first key matches the key stored in the object to be verified, the step of regenerating the second key corresponding to the object to be verified based on the identification information of the object to be verified includes: If the key verification result indicates that the first key matches the key stored in the object to be verified, then the object to be verified is subject to permission authorization verification based on the identification information of the object to be verified. If the object to be verified passes the authorization verification, the second key is regenerated based on the identification information of the object to be verified.
11. The method as described in any one of claims 7-8 or 10, characterized in that, Before generating the first key based on the identification information of the object to be verified, the method further includes: Obtain the type of the object to be verified; The step of generating a first key based on the identification information of the object to be verified includes: When the type of the object to be verified is a preset type and the key verification function for the object to be verified of the preset type is enabled, the first key is generated based on the identification information of the object to be verified.
12. The method as described in any one of claims 7-8 or 10, characterized in that, The step of using the first key to perform encrypted communication with the object to be verified, in order to determine the key verification result corresponding to the object to be verified, includes: Send a key verification request to the object to be verified; Obtain the first key verification random number returned by the object to be verified, and generate a second key verification random number, wherein the first key verification random number is generated and returned by the object to be verified according to the key verification request; The first key is used to encrypt the first key verification random number and the second key verification random number to obtain the first encrypted data, and the first encrypted data is sent to the object to be verified. If the second encrypted data returned by the object to be verified is obtained, the second encrypted data is decrypted using the first key, wherein the second encrypted data is generated and returned by the object to be verified by encrypting a random number for verifying the second key using the key stored in the object to be verified; If the decrypted second encrypted data matches the second key verification random number, the key verification result is determined to be that the first key matches the key stored in the object to be verified.