A method and system for encrypting access control data based on commercial cryptographic algorithm
By disguising the UID information of the CPU card and encrypting and verifying the commercial password algorithm, the security risk of the CPU card being cracked is solved, the security performance of the access control system is improved, and user property is protected.
Patent Information
- Application Number
- CN202410271732.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-03-11
AI Technical Summary
With the upgrade of cracking technology, CPU cards are facing the security risk of being cracked. How to improve the security capabilities of CPU cards, eliminate potential security risks, improve the security level of access control systems, and protect users' property safety has become an urgent problem.
By camouflaging the UID information of the CPU card, it communicates with the access card reading control device to avoid exposure of the real UID information, and uses preset commercial password algorithms and keys for encryption verification to ensure user access.
It effectively improves the security performance of the CPU card, prevents criminals from copying legitimate CPU cards, improves the security level of the access control system, and ensures the safety of user property.
Smart Images

Figure CN118172853B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of encryption technology, and in particular to a method and system for encrypting access control data based on a commercial cryptographic algorithm. Background Art
[0002] With the rapid development of the Internet of Things and smart city construction projects and the rapid update and iteration of technology, the application of access control systems has become more and more extensive, playing an irreplaceable and important role in office security control, resident property protection and other aspects. Most traditional access control systems use IC card access control systems, and their encryption algorithms have been cracked. Criminals only need to get a legal IC card, an access control copier and blank IC cards to batch copy IC cards that can freely enter and exit the access control system.
[0003] In order to reduce the potential safety hazards of the access control system, the current IC cards are gradually being replaced by CPU cards with higher security levels. However, in actual use, with the upgrade and iteration of cracking technology, CPU cards are also facing the security risk of being cracked. How to improve the security capabilities of CPU cards, eliminate potential safety hazards, improve the security level of the access control system, and protect the property safety of users has become an urgent problem to be solved. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a door access data encryption method and system based on a commercial cryptographic algorithm. By disguising the UID information of the CPU card, the leakage of the real UID information of the CPU card can be avoided, and the security performance of the CPU card can be greatly improved, thereby improving the security level of the door access system.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, the present invention provides an access control data encryption method based on a commercial cryptographic algorithm, which is applied to an access control system, wherein the access control system includes an access control card reader control device, a CPU access control card and a door lock; wherein the access control data encryption method based on a commercial cryptographic algorithm includes the following steps: when a user uses a CPU access control card to swipe the access control card reader control device, the access control card reader control device sends a card reading request instruction to the CPU access control card; in response to the card reading request instruction, the CPU access control card obtains real UID information and a preset information disguise algorithm from a first storage module, processes the real UID information according to the preset information disguise algorithm to obtain disguised UID information, and sends the disguised UID information to the access control card reader control device; wherein the format of the disguised UID information is consistent with the format of the real UID information, and the content of the disguised UID information is different from the content of the real UID information; upon receiving the disguised UID information, the The access control card reader control device obtains the preset information disguise algorithm from the second storage module, and solves the disguised UID information according to the preset information disguise algorithm to obtain the real UID information; the access control card reader control device determines whether the CPU access card is legal based on the legal CPU access card list and the real UID information; if the CPU access card is legal, the access control card reader control device sends a first random number to the CPU access card; the CPU access card encrypts the first random number using a preset commercial encryption algorithm and a preset first key to obtain encrypted verification information, and sends the encrypted verification information to the access control card reader control device; the access control card reader control device performs a decryption operation on the encrypted verification information according to the real UID information and the preset commercial encryption algorithm to obtain a second random number; when the first random number is the same as the second random number, the access control card reader control device allows the user to pass and controls the door lock to open.
[0007] In a second aspect, the present invention provides an access control system. The system includes an access control card reading control device, a CPU access control card and a door lock. When a user uses a CPU access control card to swipe the access control card reading control device, the access control card reading control device sends a card reading request instruction to the CPU access control card; in response to the card reading request instruction, the CPU access control card obtains real UID information and a preset information disguise algorithm from a first storage module, processes the real UID information according to the preset information disguise algorithm to obtain disguised UID information, and sends the disguised UID information to the access control card reading control device; the format of the disguised UID information is consistent with the format of the real UID information, and the content of the disguised UID information is different from the content of the real UID information; upon receiving the disguised UID information, the access control card reading control device obtains the preset information disguise algorithm from the second storage module, and processes the fake UID information according to the preset information disguise algorithm. The CPU access card is loaded with UID information for decoding and processing to obtain the real UID information; the access control card reading control device determines whether the CPU access card is legal according to the legal CPU access card list and the real UID information; if the CPU access card is legal, the access control card reading control device sends a first random number to the CPU access card; the CPU access card encrypts the first random number using a preset commercial encryption algorithm and a preset first key to obtain encrypted verification information, and sends the encrypted verification information to the access control card reading control device; the access control card reading control device decrypts the encrypted verification information according to the real UID information and the preset commercial encryption algorithm to obtain a second random number; when the first random number is the same as the second random number, the access control card reading control device allows the user to pass and controls the door lock to open.
[0008] In an optional embodiment, the preset information camouflage algorithm includes a camouflage function and transformation reference information; wherein, the processing of the real UID information according to the preset information camouflage algorithm to obtain the camouflaged UID information includes the following steps: the CPU access control card operates on the real UID information and the transformation reference information based on the camouflage function to obtain the camouflaged UID information; wherein, the processing of the camouflaged UID information according to the preset information camouflage algorithm to obtain the real UID information includes the following steps: the access control card reading control device performs processing on the camouflaged UID information and the transformation reference information based on the camouflage function to obtain the real UID information.
[0009] In an optional embodiment, the camouflage function includes the following calculation formula: i =(T i +R i)MOD10; where F i represents the value of the i-th digit in the camouflaged UID information, T i represents the value of the i-th digit in the real UID information, R i represents the value of the i-th digit in the transformation reference information, and MOD represents a modulo operation.
[0010] In an optional embodiment, the method also includes: in the process of sending the first random number to the CPU access control card, the access control card reading control device also obtains update information corresponding to the transformation reference information from the second storage module, and sends an update instruction and the update information to the CPU access control card; wherein the update instruction instructs to update the transformation reference information using the update information; the CPU access control card receives the update information and the update instruction, and updates the transformation reference information using the update information according to the update instruction.
[0011] In an optional embodiment, the method further includes: the access control card reading control device generates update information corresponding to the transformation reference information according to the current time and the current year and month, and stores the update information in the second storage module.
[0012] In an optional embodiment, the method also includes: when the CPU access card is illegal, the access control card reading control device sends the update instruction and the update information to the CPU access card, and displays on the display screen a message that the card reading failed and please swipe the card again; when the user uses the CPU access card to swipe the access control card reading control device for the second time, the access control card reading control device sends the card reading request instruction to the CPU access card; the access control card reading control device receives the second UID information fed back by the CPU access card according to the card reading request instruction, and determines whether the second UID information is consistent with the disguised UID information; when the second UID information is consistent with the disguised UID information, the access control card reading control device sends a warning message to the control center that the CPU card has been illegally copied.
[0013] In an optional embodiment, the access control card reading device includes an access control device and a card reading device, and the card reading device is electrically connected to the access control device via a wire.
[0014] In an optional embodiment, the method further includes: when the card reading device sends data to the access control device, a processor of the card reading device parallelly calculates a preset power consumption hashing algorithm.
[0015] In an optional embodiment, the processor of the card reader device parallelly calculates a preset power consumption hashing algorithm, including the following steps: executing the first calculation formula and the second calculation formula in a loop for multiple rounds until the data is sent, and the first calculation formula and the second calculation formula are executed once in each round of execution; wherein the first calculation formula includes: RK j =(X j +M1)MOD M2,X j+1 =RK j ; where j is an integer greater than 0, X j represents the input data of the first calculation formula when it is executed for the jth time, M1 represents the preset value, RK j Represents the output data of the first calculation formula when it is executed for the jth time, X1 is set to 1 when the first calculation formula is executed for the first time, M2 is the maximum storage value of the processor, and MOD represents the modulo operation; the second calculation formula includes: RK=(sin(a)+cos(b))^(log(c*d)); wherein RK represents the output data of the second calculation formula, and a, b, c, and d are each preset empirical constants.
[0016] According to the embodiments provided in the above-mentioned various aspects, in the access control data encryption method based on the commercial cryptographic algorithm provided in the first aspect: according to the card reading request instruction, the CPU access control card processes the real UID information to obtain the disguised UID information; the access control card reading control device performs a solution process on the disguised UID information to obtain the real UID information; when the CPU access control card is judged to be legal according to the real UID information, the access control card reading control device sends the first random number to the CPU access control card; the CPU access control card encrypts the first random number to obtain the encrypted verification information; the access control card reading control device performs a decryption operation on the encrypted verification information to obtain the second random number; when the first random number is the same as the second random number, the user is allowed to pass and the door lock is controlled to open. In this method, by disguising the UID information of the CPU card, the security performance of the CPU card can be well improved, thereby improving the security level of the access control system.
[0017] It can be seen that the CPU access card can disguise the real UID information and communicate with the access card reader control device with disguised UID information that is different from the real UID information but has the same format. This can prevent the real UID information of the CPU access card from being exposed during the communication process, and prevent criminals from cracking the key of the CPU access card and copying a large number of CPU access cards that are exactly the same as the legitimate CPU access card, thereby greatly improving the security performance of the CPU card and thus improving the security level of the access control system.
[0018] In addition, in this solution, the preset information disguise algorithm in the first storage module of the CPU access card and the preset information disguise algorithm in the second storage module of the access control card reader control device can be periodically updated synchronously. In this way, even if the key of the CPU access card is cracked, since the copied CPU access card actually gets the disguised UID information without the real UID information, with the update of the preset information disguise algorithm, the copied CPU access card will also become invalid, thereby further improving the security performance of the CPU card and thus improving the security level of the access control system.
[0019] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the embodiments of the present invention are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments of the present invention are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A module block diagram of a door access data encryption system based on a commercial cryptographic algorithm provided by an embodiment of the present invention;
[0022] Figure 2 A schematic diagram of a flow chart of a method for encrypting access control data based on a commercial cryptographic algorithm provided by an embodiment of the present invention is shown;
[0023] Figure 3 A functional module diagram of a door access data encryption device based on a commercial cryptographic algorithm provided by an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0025] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0026] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0027] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0028] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0029] In order to solve the problem in the above prior art that "with the upgrade and iteration of cracking technology, CPU cards are also facing the security risk of being cracked. How to improve the security capabilities of CPU cards, eliminate potential safety hazards, improve the security level of access control systems, and protect the property safety of users has become an urgent problem to be solved." The embodiment of the present invention proposes a technical solution, including a method and system for encrypting access control data based on a commercial cryptographic algorithm. In the embodiment of the present invention: the CPU access control card can disguise the real UID information, and communicate with the access control card reader control device with disguised UID information that is different from the real UID information but has the same format. In this way, the real UID information of the CPU access control card can be prevented from being exposed during the communication process, and the criminals can be prevented from cracking the key of the CPU access control card and then copying a large number of CPU access control cards that are exactly the same as the legitimate CPU access control card, thereby greatly improving the security performance of the CPU card, thereby improving the security level of the access control system. In addition, in this solution, the preset information disguise algorithm in the first storage module of the CPU access control card and the preset information disguise algorithm in the second storage module of the access control card reader control device can be periodically updated synchronously. In this way, even if the key of the CPU access card is cracked, the copied CPU access card actually obtains the disguised UID information without the real UID information. With the update of the preset information disguise algorithm, the copied CPU access card will also become invalid, which can further improve the security performance of the CPU card and thus improve the security level of the access control system.
[0030] First, the access control system provided by the embodiment of the present invention is described with reference to the accompanying drawings. Figure 1 , Figure 1 The module block diagram of the access control system provided by the embodiment of the present invention is shown in FIG. 1 , wherein the access control system 100 may include: an access control card reading control device 110 , a CPU access control card 120 and a door lock 130 .
[0031] Among them, the access control card reading control device 110 may include an access control device (also referred to as an access controller) and a card reading device (also referred to as a card reader). In one embodiment, the access control device and the card reading device may be combined into one physical electronic device, that is, one electronic device may simultaneously realize the functions of the access control device and the card reading device, thereby reducing the equipment cost and simplifying the installation method of the equipment. In another embodiment, the access control device and the card reading device may each be an electronic device, the access control device may be arranged behind a security door, and the card reading device may be arranged in front of a security door, and the two may be connected by wired electricity, the card reading device realizes the communication process with the CPU access card, the access control device realizes obtaining the information of the CPU access card obtained by the card reading device and judging whether the CPU access card is legal based on the information, and the specific implementation process is referred to below.
[0032] Among them, the access control device is, for example, a device specifically used to process and judge access control signals, which usually contains a microprocessor, a memory and other necessary electronic components for executing access control logic. The card reading device is, for example, a radio frequency card reader, which can read the information in the CPU access card and communicate with the access control device.
[0033] The CPU access control card 120 refers to a card with a microprocessor and memory embedded therein, which can perform complex encryption and authentication operations.
[0034] The door lock 130 may include, for example, an electromagnetic lock or a motor-driven lock, which can perform locking or unlocking operations according to instructions from a door control device.
[0035] It is understood that the access control system 100 provided in the embodiment of the present invention may also include more devices (for example, security doors, security fences, control centers (also called central servers), etc. Figure 1 (not shown) to implement the access control data encryption method based on commercial cryptographic algorithm provided by the present invention. For the sake of brevity, it will not be repeated here.
[0036] The following is an implementation of a method for encrypting access control data based on a commercial encryption algorithm. Figure 2 , Figure 2A flow chart of a method for encrypting access control data based on a commercial cryptographic algorithm provided by an embodiment of the present invention is shown. The method for encrypting access control data based on a commercial cryptographic algorithm can be applied to the above-mentioned access control system 100, by disguising the real UID information of the CPU access control card 120, and communicating with the access control card reading control device 110 with disguised UID information that is different from the real UID information but has the same format. In this way, the real UID information of the CPU access control card 120 can be prevented from being exposed during the communication process, and the criminals can be prevented from cracking the key of the CPU access control card 120 and then copying a large number of CPU access control cards 120 that are exactly the same as the legitimate CPU access control card 120, thereby greatly improving the security performance of the CPU card, thereby improving the security level of the access control system.
[0037] Specifically, the access control data encryption method based on the commercial cryptographic algorithm may include the following steps S210 to S280, which are described in turn below.
[0038] S210 , when the user uses the CPU access card 120 to swipe the access card control device 110 , the access card control device 110 sends a card reading request instruction to the CPU access card 120 .
[0039] The card read request instruction may be used to instruct the CPU access control card 120 to feedback UID information.
[0040] The card swiping operation here may refer to the first card swiping operation of the user using the CPU access card 120 to the access control card reading control device 110 within a preset time period (for example, within 1 day or 1 hour).
[0041] UID information refers to the unique identification code of the CPU access card. For example, UID information is a hexadecimal string encoded during the card manufacturing process.
[0042] S220, in response to the card reading request instruction, the CPU access control card 120 obtains the real UID information and the preset information disguise algorithm from the first storage module, processes the real UID information according to the preset information disguise algorithm to obtain the disguised UID information, and sends the disguised UID information to the access control card reading control device 110.
[0043] The format of the disguised UID information is consistent with the format of the real UID information, and the content of the disguised UID information is different from the content of the real UID information.
[0044] The first storage module is a memory (e.g., a memory chip) embedded in the CPU access card 120. The first storage module can be connected to the processor in the CPU access card 120 so that the processor can read and write information during operation. The UID information and the preset information disguise algorithm can be written into the first storage module when the card is issued (i.e., when the CPU access card 120 is made).
[0045] S230, when receiving the disguised UID information, the access control card reading control device 110 obtains the preset information disguise algorithm from the second storage module, and solves the disguised UID information according to the preset information disguise algorithm to obtain the real UID information.
[0046] Similar to the first storage module, the second storage module is a memory (e.g., a memory chip) embedded in the access control card reader control device 110, and the second storage module can be connected to the processor in the access control card reader control device 110 so that the processor can read and write information during operation. The preset information camouflage algorithm can be pre-written into the second storage module. It should be noted that when issuing a card, the access control card reader control device 110 can generate a preset information camouflage algorithm, store the preset information camouflage algorithm in the second storage module, and write the preset information camouflage algorithm into the first storage module of the CPU access control card 120, so that the same preset information camouflage algorithm is used between the two.
[0047] See below for the solution method.
[0048] In one embodiment, the method may further include: periodically synchronizing and updating the preset information disguise algorithm in the first storage module of the CPU access control card 120 and the preset information disguise algorithm in the second storage module of the access control card reading control device 110.
[0049] For example, during each card swiping process, the access control card reading control device 110 updates the preset information disguise algorithm, stores the updated preset information disguise algorithm in the second storage module, and writes the updated preset information disguise algorithm into the first storage module of the CPU access control card 120. In this way, even if the key of the CPU access control card is cracked, since the copied CPU access control card actually obtains the disguised UID information without the real UID information, with the update of the preset information disguise algorithm, the copied CPU access control card will also become invalid, thereby further improving the security performance of the CPU card, thereby improving the security level of the access control system.
[0050] In an optional embodiment, the preset information camouflage algorithm includes a camouflage function and transformation reference information.
[0051] The disguise function can include the following calculation formula:
[0052] Fi =(T i +R i )MOD10;
[0053] Among them, F i Indicates the value of the i-th digit in the disguised UID information, T i Represents the value of the i-th digit in the real UID information, R i represents the value of the ith digit in the transformation reference information, and MOD represents the modulo operation. Through MOD10, F i The data does not overflow.
[0054] The modification reference information may be a preset random number sequence, and the length of the random number sequence may be greater than or equal to the length of the real UID information.
[0055] Specifically:
[0056] In S220, the real UID information is processed according to a preset information camouflage algorithm to obtain camouflaged UID information, including step 1.1, the CPU access card 120 operates on the real UID information and the modified reference information based on the camouflage function to obtain the camouflaged UID information.
[0057] For example, based on the camouflage function, the process of calculating the real UID information and the modified reference information to obtain the camouflage UID information may include: if the real UID information is T1T2T3T4T5T6T7T8T9T10 and the modified reference information is R1R2R3R4R5R6R7R8R9R10, then through the camouflage function F i =(T i +R i )MOD10 calculates the disguised UID information F1F2F3F4F5F6F7F8F9F10, where F1=(T1+R1)MOD10, F2=(T2+R2)MOD10, and so on.
[0058] In S230, the disguised UID information is solved and processed according to the preset information disguise algorithm to obtain the real UID information, including step 1.2, the access control card reading control device 110 solves the disguised UID information and the modified reference information based on the disguise function to obtain the real UID information.
[0059] The solution process is the inverse operation of generating the disguised UID information in the above step 1.1. This process relies on the preset information disguise algorithm pre-stored in the second storage module. Specifically, the solution process includes applying the inverse operation formula corresponding to the preset information disguise algorithm to each digit in the disguised UID information, thereby obtaining the corresponding number of digits in the real UID information. The implementation principle of the inverse operation can refer to the relevant technical means, which will not be repeated here.
[0060] S240, the access control card reading control device 110 determines whether the CPU access control card 120 is legal according to the list of legal CPU access control cards 120 and the real UID information.
[0061] The list of legal CPU access control cards 120 refers to a list of UID information of legal CPU access control cards pre-stored in the access control card reading control device 110. The list of legal CPU access control cards 120 can be pre-stored in the second storage module. The generation and acquisition process of the list of legal CPU access control cards 120 can be implemented in the card issuance stage. For details, please refer to relevant technical means, which will not be repeated here.
[0062] When the real UID information exists in the list of legal CPU access control cards 120, the access control card reading control device 110 determines that the CPU access control card 120 is legal; otherwise, the CPU access control card 120 is determined to be illegal.
[0063] S250 , when the CPU access card 120 is legal, the access card reading control device 110 sends a first random number to the CPU access card 120 .
[0064] The first random number refers to a random number generated by the access control card reading control device and is used in the subsequent encryption verification process.
[0065] Figure 2 The method may further include the following steps 2.1-2.2:
[0066] Step 2.1, in the process of sending the first random number to the CPU access card 120, the access card control device 110 also obtains update information corresponding to the modification reference information from the second storage module, and sends an update instruction and update information to the CPU access card 120.
[0067] The update instruction indicates that the transformation reference information is updated using the update information.
[0068] The update information corresponding to the transformation reference information may be information having different contents from the transformation reference information but having the same format.
[0069] In step 2.2, the CPU access card 120 receives the update information and the update instruction, and uses the update information to update the reference information according to the update instruction. In this way, each time the card is swiped, the preset information disguise algorithm stored therein is updated, so that the UID information sent by the same CPU access card is different each time the card is swiped.
[0070] For example, under the instruction of the update instruction, the CPU access card 120 replaces the modification reference information originally stored in the first storage module with the update information corresponding to the modification reference information.
[0071] Figure 2 The method shown may also include: the access control card reading control device 110 generates update information corresponding to the transformation reference information according to the current time and the current year and month, and stores the update information in the second storage module.
[0072] For example, the implementation process of generating update information corresponding to the modification reference information according to the current time and the current year and month includes: performing mathematical operations (such as hash operations, encryption operations, etc.) on the timestamp of the current time and the numbers of the current year and month to obtain update information that is consistent with the format of the modification reference information but different in content. This generation method not only ensures the randomness of the update information, but also makes the update information generated each time different, thereby effectively preventing the situation where a copy card forges a legitimate card by stealing the modification reference information during a communication process.
[0073] Optionally, the process of updating the modification reference information can be performed in real time during the communication between the access control card reader control device 110 and the CPU access card 120. For example, after each card swipe verification, the access control card reader control device will generate a new update information and send it to the CPU access card for updating. In this way, even if the copy card steals the modification reference information during a certain communication process, it cannot forge a legal CPU access card because it cannot obtain the latest update information in time. This real-time update method greatly improves the security and reliability of the access control system.
[0074] Figure 2 The method may further include the following steps 3.1-3.4:
[0075] Step 3.1, when the CPU access card 120 is illegal, the access card control device 110 sends an update instruction and update information to the CPU access card 120, and displays a message on the display screen indicating that the card reading failed and please swipe the card again.
[0076] For instructions on updating and updating information, refer to the above.
[0077] Step 3.2: When the user uses the CPU access card to perform a second card swiping operation on the access card reading control device 110, the access card reading control device 110 sends a card reading request instruction to the CPU access card.
[0078] The CPU access card used by the user here may be a legitimate CPU access card, or it may be a CPU access card that is copied after the key is cracked but the UID information is actually a disguised UID information.
[0079] Step 3.3, the access control card reading control device 110 receives the second UID information fed back by the CPU access control card according to the card reading request instruction, and determines whether the second UID information is consistent with the disguised UID information.
[0080] Specifically, the example of step 3.3 is as follows: Assume that the UID information received when the card is swiped for the first time is A1A2A3...A10, and the UID information received when the card is swiped for the second time is B1B2B3...B10. Compare whether the UID information received in the two times is the same. If B1B2B3...B10 is exactly the same as A1A2A3...A10, it means that the same CPU access card is used in the two card swiping processes, and the card has not updated its disguise algorithm according to the update instruction, so it is likely to be an illegal copy card. If B1B2B3...B10 is different from A1A2A3...A10, it means that a legal CPU access card is used in the two card swiping processes, and the card has updated its disguise algorithm according to the update instruction, so different UID information is generated. That is to say, when the CPU access card is a legal access card, with the update of the disguise algorithm, the UID information is inconsistent in the two card swiping processes; when the CPU access card is an illegal access card, the UID information is consistent in the two card swiping processes.
[0081] Step 3.4, when the second UID information is consistent with the disguised UID information, the access control card reading control device 110 sends a warning message that the CPU card has been illegally copied to the control center.
[0082] It can be understood that through the above steps, the legitimate CPU card will update the camouflage algorithm according to the update instruction, so that the UID of the second card swipe will be different, while the copied CPU card will have the same UID for the two card swipes. In this way, if the UID of the two card swipes is the same and the UID is not in the blacklist, an early warning message that the CPU card has been illegally copied will be sent to the control center immediately.
[0083] S260 , the CPU access card 120 encrypts the first random number using a preset commercial cryptographic algorithm and a preset first key to obtain encrypted verification information, and sends the encrypted verification information to the access card reading control device 110 .
[0084] Preset commercial encryption algorithms refer to encryption algorithms that have been certified by the National Cryptography Administration and are suitable for commercial use, such as domestic encryption algorithms such as SM2, SM3, and SM4. These algorithms are highly secure and widely applicable, and can effectively protect the confidentiality and integrity of data.
[0085] The preset first key refers to a set of key data agreed upon with the access card reader control device during the production process of the CPU access card. It is used to ensure that only legitimate CPU access cards can perform correct encrypted communication with the access card reader control device during the encryption verification process.
[0086] The process of encrypting the first random number using a preset commercial encryption algorithm includes: the CPU access card first converts the first random number into a data block format suitable for encryption, and then uses the SM4 algorithm and the first key to perform encryption operation on the data block to generate an encrypted ciphertext data block, i.e., encrypted verification information. This encrypted verification information contains the information of the encrypted first random number, and the original first random number can only be restored through the corresponding decryption process.
[0087] Of course, the process of encrypting the first random number using a preset commercial encryption algorithm may also refer to other related encryption technology principles with different implementation methods, which will not be described in detail here.
[0088] S270, the access control card reading control device 110 performs a decryption operation on the encrypted verification information according to the real UID information and a preset commercial cryptographic algorithm to obtain a second random number.
[0089] The use of a preset commercial cryptographic algorithm to perform a decryption operation on the encrypted verification information includes: after receiving the encrypted verification information, the access control card reader control device uses the same preset commercial cryptographic algorithm (such as SM4) and the first key agreed with the CPU access card to perform a decryption operation on the encrypted verification information. The decryption process is the inverse operation of the encryption process. By applying the corresponding decryption algorithm and key, the access control card reader control device can restore the original first random number from the encrypted verification information.
[0090] Of course, the use of a preset commercial encryption algorithm to perform decryption operations on encrypted verification information can also refer to other related encryption technology principles with different implementation methods, which will not be repeated here.
[0091] S280: When the first random number is the same as the second random number, the access control card reading control device 110 allows the user to pass through and controls the door lock to open.
[0092] Optionally, the access control card reader control device 110 may include an access control device and a card reader, each of which may be an electronic device, the access control device may be arranged behind a security door, and the card reader may be arranged in front of the security door, and the card reader and the access control device may be connected by wire. In this way, the access control device is not directly exposed to an unsafe environment, thereby improving the security of the access control system.
[0093] Furthermore, Figure 2 The method shown may also include: when the card reading device sends data to the access control device, the processor of the card reading device parallelly calculates a preset power consumption hashing algorithm.
[0094] Specifically, the processor of the card reader device parallelly calculates the preset power consumption hashing algorithm, which may include the following step 4.1, looping and executing the first calculation formula and the second calculation formula for multiple rounds until the data is sent, and the first calculation formula and the second calculation formula are executed once in each round of execution.
[0095] The first calculation formula includes:
[0096] R j =(X j +M1)MOD M2,X j+1 =RK j ; where j is an integer greater than 0, X j represents the input data of the first calculation formula when it is executed for the jth time, M1 represents the preset value, RK j It represents the output data of the first calculation formula when it is executed for the jth time. When the first calculation formula is executed for the first time, X1 is set to 1, M2 is the maximum storage value of the processor, and MOD represents the modulo operation.
[0097] For example, M1 may be 1, 2, or 3, etc. MOD M2 may ensure that the calculation of the first calculation formula does not overflow.
[0098] The second calculation formula includes:
[0099] RK=(sin(a)+cos(b))^(log(c*d)); wherein RK represents the output data of the second calculation formula, and a, b, c, and d are each preset empirical constants.
[0100] For example, a, b, c, and d can be set to 1, 1, 2, 2, or 1, 1, 3, 2, etc., respectively, without limitation.
[0101] In the process of the processor of the card reader device calculating the preset power consumption hashing algorithm in parallel, by cyclically executing the first calculation formula and the second calculation formula, and superimposing the data sending process of the card reader device, the card reader device can generate a complex and constantly changing power consumption pattern when sending data. The change of this power consumption pattern is difficult to predict and analyze, thereby effectively preventing the theft of data transmitted by the card reader device through power consumption analysis attacks. In addition, since the first calculation formula and the second calculation formula are executed once each round of execution, and the input data and output data of the first calculation formula are constantly changing each time they are executed, the complexity and unpredictability of the power consumption pattern are further increased, thereby improving the security of the access control system.
[0102] exist Figure 2 In the method embodiment shown, the CPU access card 120 can disguise the real UID information, and communicate with the access card reading control device 110 with disguised UID information that is different from the real UID information but has the same format. This can prevent the real UID information of the CPU access card 120 from being exposed during the communication process, and prevent criminals from cracking the key of the CPU access card 120 and then copying a large number of CPU access cards 120 that are exactly the same as the legitimate CPU access card 120, thereby greatly improving the security performance of the CPU card, thereby improving the security level of the access control system.
[0103] In addition, in this solution, the preset information disguise algorithm in the first storage module of the CPU access card 120 and the preset information disguise algorithm in the second storage module of the access control card reading control device 110 can be periodically synchronized and updated. In this way, even if the key of the CPU access card 120 is cracked, since the copied CPU access card 120 actually obtains the disguised UID information without the real UID information, with the update of the preset information disguise algorithm, the copied CPU access card 120 will also become invalid, thereby further improving the security performance of the CPU card, thereby improving the security level of the access control system.
[0104] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a door access data encryption device based on a commercial encryption algorithm is also provided below. Figure 3 , Figure 3 The functional module diagram of a door access data encryption device based on a commercial cryptographic algorithm provided by an embodiment of the present invention is shown. The door access data encryption device based on a commercial cryptographic algorithm 300 can be applied to the above Figure 1The access control card reading control device 110 in the system 100 shown can be used to execute various or part of the steps in the above method embodiment. It should be noted that the access control data encryption device 300 based on a commercial cryptographic algorithm provided in this embodiment has the same basic principle and technical effects as the above embodiment. For the sake of brief description, the parts not mentioned in this embodiment can refer to the corresponding contents in the above embodiment. The access control data encryption device 300 based on a commercial cryptographic algorithm can include: a transceiver module 310 and a processing module 320.
[0105] Among them, the transceiver module 310 is used to send a card reading request instruction to the CPU access card when the user uses the CPU access card to swipe the access card reading control device. The processing module 320 is used to obtain the preset information disguise algorithm from the second storage module when receiving the disguised UID information, and solve the disguised UID information according to the preset information disguise algorithm to obtain the real UID information. The processing module 320 is used to determine whether the CPU access card is legal based on the list of legal CPU access cards and the real UID information. The processing module 320 is used to send the first random number to the CPU access card if the CPU access card is legal. The processing module 320 is used to decrypt the encrypted verification information according to the real UID information and the preset commercial cryptographic algorithm to obtain a second random number. The processing module 320 is used to allow the user to pass and control the door lock to open when the first random number is the same as the second random number.
[0106] Optionally, the above modules can be stored in the memory in the form of software or firmware or fixed in the memory provided by the present invention. Figure 1 The operating system (OS) of the access control card reading control device 110 in the system 100 shown in FIG. Figure 1 The access control card reading control device 110 in the system 100 is shown to execute. Meanwhile, the data, program codes, etc. required to execute the above modules can be stored in the memory.
[0107] It is understandable that the transceiver module 310 and the processing module 320 can be used to support Figure 1 The access control card reading control device 110 in the system 100 shown in the figure performs the relevant steps in the above method embodiment, and / or other processes used in the technology described herein, such as the above Figure 2 The method embodiments shown and some or all of the method embodiments described above are not limited to this.
[0108] Based on the above embodiments, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each step in the above method is executed.
[0109] Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk, etc. When the computer program on the storage medium is run, the method in the above embodiment can be executed, by disguising the real UID information of the CPU access card, and communicating with the access control card reading control device with the disguised UID information that is different from the real UID information but has the same format. In this way, the real UID information of the CPU access card can be prevented from being exposed during the communication process, and the criminals can be prevented from cracking the key of the CPU access card and then copying a large number of CPU access cards that are exactly the same as the legitimate CPU access card, thereby greatly improving the security performance of the CPU card, thereby improving the security level of the access control system. This solves the problem in the prior art that "with the upgrade and iteration of cracking technology, CPU cards are also facing the security risk of being cracked. How to improve the security capabilities of CPU cards, eliminate potential safety hazards, improve the security level of access control systems, and protect the property safety of users has become an urgent problem to be solved."
[0110] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0111] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0112] Furthermore, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0113] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0114] The above description is only an embodiment of the present invention and is not intended to limit the protection scope of the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for encrypting access control data based on a commercial cryptographic algorithm, characterized in that: Applied to access control system, the access control system includes access control card reader control device, CPU access control card and door lock; The access control data encryption method based on the commercial cryptographic algorithm comprises the following steps: When the user uses the CPU access card to swipe the access card control device, the access card control device sends a card reading request instruction to the CPU access card; In response to the card reading request instruction, the CPU access control card obtains the real UID information and the preset information disguise algorithm from the first storage module, processes the real UID information according to the preset information disguise algorithm to obtain the disguised UID information, and sends the disguised UID information to the access control card reading control device; wherein the format of the disguised UID information is consistent with the format of the real UID information, and the content of the disguised UID information is different from the content of the real UID information; When receiving the disguised UID information, the access control card reading control device obtains the preset information disguise algorithm from the second storage module, and performs a solution processing on the disguised UID information according to the preset information disguise algorithm to obtain the real UID information; The access control card reading control device determines whether the CPU access control card is legal based on the legal CPU access control card list and the real UID information; If the CPU access card is legal, the access card reading control device sends a first random number to the CPU access card; The CPU access card encrypts the first random number using a preset commercial cryptographic algorithm and a preset first key to obtain encrypted verification information, and sends the encrypted verification information to the access card reading control device; The access control card reading control device performs a decryption operation on the encrypted verification information according to the real UID information and the preset commercial encryption algorithm to obtain a second random number; When the first random number is the same as the second random number, the access control card reading control device allows the user to pass through and controls the door lock to open; The preset information disguise algorithm includes a disguise function and transformation reference information, and the real UID information is processed according to the preset information disguise algorithm to obtain the disguised UID information, including the following steps: The CPU access card operates the real UID information and the modified reference information based on the disguise function to obtain the disguised UID information; The process of solving the disguised UID information according to the preset information disguise algorithm to obtain the real UID information includes the following steps: The access control card reading control device performs a calculation on the disguised UID information and the modified reference information based on the disguise function to obtain the real UID information; In the process of sending the first random number to the CPU access control card, the access control card reading control device also obtains the update information corresponding to the transformation reference information from the second storage module, and sends an update instruction and the update information to the CPU access control card; wherein the update instruction instructs to update the transformation reference information using the update information; the CPU access control card receives the update information and the update instruction, and updates the transformation reference information using the update information according to the update instruction.
2. The access control data encryption method based on commercial cryptographic algorithm according to claim 1 is characterized in that: The camouflage function includes the following calculation formula: F i =(T i +R i )MOD10; Among them, F i represents the value of the i-th digit in the camouflaged UID information, T i represents the value of the i-th digit in the real UID information, R i represents the value of the i-th digit in the transformation reference information, and MOD represents a modulo operation.
3. The access control data encryption method based on commercial cryptographic algorithm according to claim 1 is characterized in that: The method further comprises: The access control card reading control device generates update information corresponding to the transformation reference information according to the current time and the current year and month, and stores the update information in the second storage module.
4. The access control data encryption method based on commercial cryptographic algorithm according to claim 1 is characterized in that: The method further comprises: In the case that the CPU access card is illegal, the access card reading control device sends the update instruction and the update information to the CPU access card, and displays a message on the display screen indicating that the card reading failed and the card needs to be swiped again; When the user uses the CPU access card to swipe the access card control device for the second time, the access card control device sends the card reading request instruction to the CPU access card; The access control card reading control device receives the second UID information fed back by the CPU access control card according to the card reading request instruction, and determines whether the second UID information is consistent with the disguised UID information; When the second UID information is consistent with the disguised UID information, the access control card reading control device sends an early warning message that the CPU card has been illegally copied to the control center.
5. The access control data encryption method based on a commercial cryptographic algorithm according to any one of claims 1 to 4, characterized in that: The access control card reading device comprises an access control device and a card reading device, and the card reading device is electrically connected to the access control device via a wire.
6. The access control data encryption method based on commercial cryptographic algorithm according to claim 5 is characterized in that: The method further comprises: When the card reading device sends data to the access control device, the processor of the card reading device calculates a preset power consumption hashing algorithm in parallel.
7. The access control data encryption method based on commercial cryptographic algorithm according to claim 6 is characterized in that: The processor of the card reader device parallelly calculates a preset power consumption hashing algorithm, including the following steps: Execute the first calculation formula and the second calculation formula in a loop for multiple rounds until the data is sent, wherein the first calculation formula and the second calculation formula are executed once in each round of execution; Wherein, the first calculation formula includes: R j =(X j +M1)MOD M2,X j+1 =RK j ; where j is an integer greater than 0, X j represents the input data of the first calculation formula when it is executed for the jth time, M1 represents the preset value, RK j represents the output data of the first calculation formula when it is executed for the jth time, X1 is set to 1 when the first calculation formula is executed for the first time, M2 is the maximum storage value of the processor, and MOD represents a modulo operation; The second calculation formula includes: RK=(sin(a)+cos(b))^(log(c*d)); wherein RK represents the output data of the second calculation formula, and a, b, c, and d are each preset empirical constants.
8. An access control system, characterized in that: include: Access control card reading control device, CPU access control card and door lock; wherein, the access control system is used to execute the access control data encryption method based on commercial cryptographic algorithm as described in any one of claims 1-7 when running.
Citation Information
Patent Citations
Commercial cipher algorithm based security access control system and implementation method thereof
CN104376631A
Hash function construction method applicable to RFID authentication system
CN105391544A
