Deep binding method and device for ID card reading device and ID card security module
The U-shield built-in Beidou positioning and random number generator combined with the National Secret algorithm to generate the startup code, solve the problem of second-hand circulation of ID card security modules, realize the deep binding between the equipment and the module, and improve security and management efficiency.
Patent Information
- Application Number
- CN202411868165.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-08-19
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The illegal circulation of ID card security modules in the second-hand market has led to a decline in product sales and social stability of formal manufacturers, and it is difficult to fundamentally solve the existing technology.
Through the U-Shield built-in Beidou positioning module and random number generator, combined with the SM series of national secret algorithms to generate and verify the digest value, generate and encrypt the startup code to write it into the tool motherboard MCU, realizing the deep binding of ID card reading equipment and security modules, preventing second-hand circulation, and assisting management departments to track through Beidou positioning.
Effectively prevent the second-hand circulation of security modules, strengthen the coupling between the equipment and the motherboard, standardize market management, improve the security of ID card security modules, and resist replay attacks.
Smart Images

Figure CN119808058B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of identity card security modules, and in particular to a deep binding method for an identity card reader and an identity card security module, a deep binding device for an identity card reader and an identity card security module, an electronic device, and a computer-readable medium. Background Art
[0002] With the progress of society, people pay more and more attention to the protection of personal privacy, and the country has also promulgated laws and introduced relevant policies to protect citizens' personal information.
[0003] Among the various methods of obtaining citizens' personal information, the most common is ID card reading machines. Through these machines, organizations such as enterprises and institutions can read the ID card information of visitors or customers and save it to their systems to achieve their business objectives. The state has strict controls over ID card reading machines: for example, manufacturers must pass a series of assessments and formal tests by specialized national regulatory agencies and obtain a qualification certificate before production. Core components of ID card reading machines, such as security modules, are also subject to strict control by specialized national regulatory agencies. For example, each security module has a corresponding SAMID, and security module suppliers must include the same number of GA code tags for each batch of security modules sold to machine manufacturers. During production, manufacturers need to associate 5 codes with the reading equipment (GA code, SAMID, equipment SN code, fingerprint collector SN code, fingerprint algorithm code, among which the fingerprint algorithm code is built into the fingerprint collector, and the fingerprint collector is not mandatory. Therefore, equipment manufacturers usually upload the GA code, SAMID, and equipment SN code to the association system) and upload them together with the sales information of the equipment to the 5-code association system. This system is connected to the management system of the national specialized management agency through a dedicated network. Therefore, the national specialized management agency can form better control over the production of each ID card reading equipment manufacturer and the market flow of the equipment.
[0004] However, due to the cost, the corresponding price of the security module is relatively high. At the same time, because the security module is a device independent of the software and hardware platform (not subject to software and hardware restrictions), it provides decryption functions through a standard interface. For example, it generally communicates with the ID card reader's motherboard via a UART or USB port, and can be connected to the motherboard of any device manufacturer. In addition, due to the high security level of the ID card security module, its design standards are also very high. After the product life cycle of many ID card readers has ended, their built-in security modules can still stably provide decryption functions. For these reasons, many businesses or organizations are unwilling to recycle the core components of the machine, such as the security module, to the machine manufacturer through normal channels and at a reasonable price after the machine is scrapped. Instead, they prefer to sell the security module to second-hand dealers who offer higher prices.
[0005] The three reasons mentioned above contribute to the circulation of ID card security modules in the secondhand market. Many unlicensed manufacturers purchase them at prices lower than the original manufacturer, reassemble them, and then re-sell them to the market, profiting from their profits. The secondary or even multiple resale of security modules creates management difficulties for national regulatory agencies. Furthermore, the presence of secondhand modules has had a significant impact on legitimate and licensed ID card reader manufacturers, leading to declining sales and unsustainable business. Furthermore, the illegal circulation of security modules and the lack of regulatory control have significantly impacted social stability.
[0006] Although the national specialized management agency attaches great importance to this issue and has made relevant efforts, such as joint law enforcement with the industrial and commercial departments in many places, which has achieved relatively good results, it can only play a temporary role and cannot solve the problem from the root. The purpose of this invention is to fundamentally solve the problem of illegal circulation of second-hand security modules.
[0007] As mentioned in the second paragraph above, the primary control method used by national specialized management agencies is through a five-code linkage system. During production, equipment manufacturers typically enter each machine's SN, GA, and SAMID (Security Module Inner Code) into the five-code linkage system using a combination of barcode scanners and online reading on production fixtures. The national specialized management agency uses this data to monitor the status of each equipment manufacturer in real time and conduct management. As mentioned in the fourth paragraph above, this method has problems that need to be addressed urgently.
[0008] To address this issue, some tool manufacturers have come up with solutions. For example, they bind the security module's SAMID (Security Module Internal Code, each module has a different internal code, as described above) to the tool's mainboard MCU, thus preventing the security module from being removed. When a customer of this manufacturer requires after-sales service, such as when the MCU on the tool's mainboard is damaged and needs to be replaced, they need to contact the manufacturer to unbind the security module from the old MCU and bind it to the new MCU, allowing the tool to function properly. However, this solution has a problem: it only addresses the manufacturer's internal issues and is not widely promoted. Therefore, when a customer scraps the tool for some reason, they may still sell the security module to a recycler at a high price and reassemble it using the manufacturer's mainboard. Therefore, to solve the problem of second-hand module circulation, a more scientific and reasonable method is needed, and it must be uniformly promoted by all tool manufacturers to completely solve the problem. Summary of the Invention
[0009] In view of the above problems, the present invention is proposed to provide a deep binding method for an ID card reading machine and an ID card security module and a corresponding deep binding device for an ID card reading machine and an ID card security module, an electronic device and a computer-readable medium that overcome the above problems or at least partially solve the above problems.
[0010] The present invention discloses a method for deep binding an ID card reader and an ID card security module. The ID card security module is built into the ID card reader, and the ID card security module supports SM1, SM2, SM3, and SM4 national encryption algorithms and provides various API interfaces. The ID card reader is connected to a computer via a data cable through a production fixture; a USB shield is connected to the computer via a data cable, and the USB shield has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national encryption algorithm. The Beidou positioning module is used to locate the location of the ID card reader manufacturer. The method comprises:
[0011] After the U-Shield is connected to the computer, it obtains the current location information of the ID card reader manufacturer and sends the current location information of the ID card reader manufacturer to the management agency for location verification. After the verification is passed, the U-Shield works normally;
[0012] The computer host program obtains an SN code as the SN code of the ID card reader, obtains a 16-bit random number from the USB shield, obtains the SAM_ID of the ID card security module, and sends the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module to the USB shield;
[0013] The USB key combines the SN code, random number, and SAM_ID of the ID card reader according to the preset format, and uses the SM3 hash algorithm to generate a summary value, which is then returned to the computer host program.
[0014] The computer host program sends the SN code, random number and summary value of the ID card reader to the ID card security module;
[0015] The ID card security module verifies the summary value according to the SN code and random number of the ID card reader, generates a startup code after the verification is passed, and sends it to the computer host program;
[0016] The computer host program encrypts the startup code using the public key of the ID card security module through the SM2 algorithm to obtain a startup code ciphertext, writes the startup code ciphertext into the mainboard MCU of the ID card reader and sets write protection;
[0017] Each time the ID card reader is powered on, it sends the startup code ciphertext to the ID card security module;
[0018] The ID card security module uses a private key to decrypt the startup code ciphertext and verify the startup code, and provides a complete decryption function for the ID card information after the verification is passed.
[0019] Optionally, the ID card security module verifies the digest value according to the SN code and random number of the ID card reader, generates a startup code after the verification is passed, and sends it to the computer host program, including:
[0020] The ID card security module combines the ID card reader's SN code, random number, and ID card security module's SAM_ID in a preset format, and generates a new digest value using the SM3 hash algorithm.
[0021] comparing the digest value with a new digest value;
[0022] If the digest value is the same as the new digest value, the SN code of the ID card reader, the SAM_ID of the ID card security module and the last eight digits of the digest value are concatenated in a preset format to obtain the startup code and send it to the computer host program.
[0023] Optionally, each communication data stream between the computer host program, the U shield, and the ID card security module carries a timestamp to maintain time synchronization; the method further includes:
[0024] After receiving the random number, the computer host program adds a timestamp to the end of the random number;
[0025] After receiving the random number, the ID card security module reads the end timestamp and the delivery timestamp of the random number, calculates the time interval between the end timestamp and the delivery timestamp, and determines whether the time interval is within the preset valid time interval;
[0026] If the time interval is within the preset valid time interval, verifying the digest value;
[0027] If the time interval is not within the preset valid time interval, a random number expiration notification is returned to the computer host program.
[0028] Optionally, the method further includes:
[0029] Matching the current location information of the ID card reading machine manufacturer with the backup address of the ID card reading machine manufacturer in terms of longitude and latitude; the backup address is the address that the ID card reading machine manufacturer has previously reported to the management agency. When the production address is changed, the ID card reading machine manufacturer will re-report the new address to the management agency as the backup address;
[0030] If the current location information matches the backup address successfully, it is determined that the location verification is successful;
[0031] If the current location information fails to match the backup address, it is determined that the location verification has failed.
[0032] Optionally, the method further includes:
[0033] When the ID card reader's mainboard MCU is damaged and needs repair, the production data is retrieved through the 5-code association system and associated with the startup code through SAM_ID. The startup code is rewritten into the MCU to restore the deep binding between the ID card reader and the ID card security module.
[0034] Optionally, the method further includes:
[0035] Before connecting the ID card reader to the computer via a data cable through a production fixture, perform a single-board test on the ID card reader to verify whether the hardware function of the mainboard of the ID card reader is normal;
[0036] If the hardware function of the mainboard of the ID card reader is normal, the ID card reader is connected to the computer via a data cable through a production fixture.
[0037] Optionally, the method further includes:
[0038] Before the ID card reading device and the ID card security module are bound together, the ID card information read by the ID card security module, except for the photo, the rest of the ID card information is presented in a hidden form.
[0039] The present invention also discloses a deep binding device for an ID card reader and an ID card security module. The ID card security module is built into the ID card reader, and the ID card security module supports SM1, SM2, SM3, and SM4 national encryption algorithms and provides various API interfaces. The ID card reader is connected to a computer via a data cable through a production fixture; a USB shield is connected to the computer via a data cable, and the USB shield has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national encryption algorithm. The Beidou positioning module is used to locate the location of the ID card reader manufacturer. The device includes:
[0040] A location verification module is used to obtain the current location information of the ID card reader manufacturer after the USB shield is connected to the computer and send the current location information of the ID card reader manufacturer to the management agency for location verification. After the verification is passed, the USB shield will work normally;
[0041] The unique identification code and random number acquisition module is used by the computer host program to obtain an SN code as the SN code of the ID card reader, obtain a 16-bit random number from the USB shield, obtain the SAM_ID of the ID card security module, and send the SN code of the ID card reader, random number, and SAM_ID of the ID card security module to the USB shield;
[0042] The digest value generation module is used for the USB shield to splice the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module according to the preset format, and use the SM3 hash algorithm to generate the digest value and return it to the computer host program;
[0043] The summary value sending module is used for the computer host program to send the SN code, random number and summary value of the ID card reader to the ID card security module;
[0044] The startup code generation module is used for the ID card security module to verify the digest value according to the SN code and random number of the ID card reader, and after the verification is passed, the startup code is generated and sent to the computer host program;
[0045] The binding module is used for the computer host program to encrypt the startup code using the public key of the ID card security module through the SM2 algorithm to obtain the startup code ciphertext, write the startup code ciphertext into the mainboard MCU of the ID card reader and set write protection;
[0046] The startup code sending module is used to send the startup code ciphertext to the ID card security module every time the ID card reader is powered on;
[0047] The decryption function startup module is used for the ID card security module to use the private key to decrypt the startup code ciphertext and verify the startup code, and provide the complete decryption function of the ID card information after the verification is passed.
[0048] Optionally, the startup code generation module includes:
[0049] A new summary value generation submodule is used for the ID card security module to combine the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module according to a preset format, and use the SM3 hash algorithm to generate a new summary value;
[0050] A digest value comparison submodule, used to compare the digest value with a new digest value;
[0051] The startup code generation submodule is used to obtain the startup code by splicing the SN code of the ID card reader, the SAM_ID of the ID card security module and the last eight digits of the digest value according to a preset format if the digest value and the new digest value are the same, and send it to the computer host program.
[0052] Optionally, each communication data stream between the computer host program, the U shield, and the ID card security module carries a timestamp to maintain time synchronization; the device also includes:
[0053] A timestamp adding module is used for the computer host program to add a timestamp to the end of the random number after receiving the random number;
[0054] A time interval determination module is used for the ID card security module to read the end timestamp and delivery timestamp of the random number after receiving the random number, calculate the time interval between the end timestamp and the delivery timestamp, and determine whether the time interval is within a preset valid time interval;
[0055] a digest value verification module, configured to verify the digest value if the time interval is within a preset valid time interval;
[0056] The failure feedback module is used to return a random number failure notification to the computer host program if the time interval is not within the preset valid time interval.
[0057] Optionally, the device further comprises:
[0058] a location matching module for matching the current location information of the ID card reading machine manufacturer with the backup address of the ID card reading machine manufacturer in terms of latitude and longitude; the backup address is the address that the ID card reading machine manufacturer has previously reported to the management agency; when the production address is changed, the ID card reading machine manufacturer re-reports the new address to the management agency as the backup address;
[0059] A location matching success module, configured to determine that the location verification is successful if the current location information matches the backup address successfully;
[0060] The location matching failure module is used to determine that the location verification fails if the current location information fails to match the backup address.
[0061] Optionally, the device further comprises:
[0062] The binding recovery module is used to call out the production data through the 5-code association system when the MCU of the ID card reader mainboard is damaged and repaired, and associate it with the startup code through SAM_ID, and rewrite the startup code into the MCU to restore the deep binding between the ID card reader and the ID card security module.
[0063] Optionally, the device further comprises:
[0064] A single-board test module is used to perform a single-board test on the ID card reader before connecting the ID card reader to a computer via a data cable through a production fixture to verify whether the hardware functions of the mainboard of the ID card reader are normal;
[0065] The test pass module is used to connect the ID card reader to the computer via a data cable through a production fixture if the hardware function of the mainboard of the ID card reader is normal.
[0066] Optionally, the device further comprises:
[0067] The pre-binding reading module is used to present the identity card information read by the identity card security module in a hidden form except for the photo before the identity card reading device and the identity card security module are bound.
[0068] The present invention also discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0069] The memory is used to store computer programs;
[0070] The processor is used to implement the deep binding method of the identity card reading device and the identity card security module as described in the present invention when executing the program stored in the memory.
[0071] The present invention also discloses one or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the deep binding method of the identity card reading device and the identity card security module as described in the present invention.
[0072] The present invention includes the following advantages:
[0073] The present invention's deep binding method for an ID card reader and an ID card security module verifies the machine manufacturer's location through a U-shield (including Beidou positioning and a random number generator), generates and verifies a summary value using the SM series national secret algorithm, and ultimately generates and encrypts a startup code written into the machine's mainboard MCU. The ID card reader decrypts the startup code with the ID card security module each time it is powered on, enabling a complete decryption function for the ID card information. This achieves deep binding between the ID card reader and the ID card security module, effectively preventing the second-hand circulation of the security module, strengthening the coupling between the machine and the mainboard, and standardizing market management. At the same time, Beidou positioning assists the competent authorities in tracking and management, the startup code generated by the random number resists replay attacks, and the SM2 algorithm encryption ensures the security of the startup code. The overall solution significantly improves the security of the ID card security module. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] Figure 1 This is a flowchart of the steps of a deep binding method for an ID card reading device and an ID card security module provided by an embodiment of the present invention;
[0075] Figure 2 This is a principle block diagram of a deep binding ID card reader and an ID card security module provided by an embodiment of the present invention;
[0076] Figure 3 This is a block diagram of the encryption and decryption principles of the asymmetric encryption system provided by an embodiment of the present invention;
[0077] Figure 4 This is a block diagram of the principle of loading a startup code for an ID card reader provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0078] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0079] Reference Figure 1 , shows a flowchart of the steps of the deep binding method of the ID card reading device and the ID card security module provided in an embodiment of the present invention, which may specifically include the following steps:
[0080] Step 101: After the USB-Shield is connected to the computer, it obtains the current location information of the ID card reader manufacturer and sends the current location information of the ID card reader manufacturer to the management agency for location verification. After the verification is passed, the USB-Shield works normally.
[0081] Step 102: The computer program obtains an SN as the SN of the ID card reader, obtains a 16-bit random number from the USB-Shield, obtains the SAM_ID of the ID card security module, and sends the SN of the ID card reader, the random number, and the SAM_ID of the ID card security module to the USB-Shield.
[0082] Step 103: The USB key combines the SN code, random number, and SAM_ID of the ID card reader according to a preset format, generates a digest value using the SM3 hashing algorithm, and returns it to the computer host program.
[0083] Step 104: The computer host program sends the SN code, random number, and summary value of the ID card reader to the ID card security module;
[0084] Step 105: The ID card security module verifies the digest value based on the SN code and random number of the ID card reader. After the verification is successful, it generates a startup code and sends it to the computer host program.
[0085] Step 106: The computer host program encrypts the startup code using the public key of the ID card security module through the SM2 algorithm to obtain a startup code ciphertext, writes the startup code ciphertext into the mainboard MCU of the ID card reader, and sets write protection;
[0086] Step 107: The ID card reader sends the startup code encrypted text to the ID card security module each time it is powered on.
[0087] In step 108, the ID card security module uses the private key to decrypt the activation code ciphertext and verify the activation code, and provides a complete decryption function for the ID card information after the verification is passed.
[0088] Reference Figure 2 The solution of the present invention consists of a U-shield, a production fixture, an ID card security module, an ID card reading machine, and a host computer program (computer side). The ID card reading machine is connected to the computer through a data cable together with the production fixture and the U-shield. The U-shield is the core component for the implementation of this solution. It has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national encryption algorithm. The Beidou positioning module is used to locate the location of the ID card machine manufacturer. The machine manufacturer needs to report to the management agency in advance. It can only be used normally after successful positioning. If the production address needs to be changed, a new application is required. The ID card security module supports SM1, SM2, SM3, and SM4 national encryption algorithms and provides a variety of rich API interfaces. This is a prerequisite for the implementation of this solution. The production fixture is mainly to facilitate the connection of the ID card reading machine to the computer. The computer is the carrier of the host computer program. It plays a central scheduling role, is responsible for the issuance of various operation instructions, and writes the startup code generated by the security module into the ID card reading machine motherboard MCU, and encrypts the startup code in batches and transmits it to the 5-code association system. If the motherboard needs to be repaired later, the startup code of the reading machine can be associated through SAM_ID.
[0089] The specific workflow is as follows:
[0090] 1. Connect the USB shield to the computer, and when its indicator light flashes slowly (it is used to indicate whether the USB shield has been successfully located. After successful positioning, the USB shield will return the positioning information to the management agency. It can only work normally if it matches the longitude and latitude of the previous backup address). Then open the host computer program on the computer.
[0091] 2. Connect the ID card reader (hereinafter referred to as the reader) to the computer via a clamp.
[0092] 3. Operate the host computer program to obtain an SN code for the current reading device and save it to the buffer queue. At the same time, trigger the label printer to print out the SN code and paste it to the corresponding position of the device.
[0093] 4. The host computer program sends a command to obtain a 16-bit random number from the USB shield.
[0094] 5. The host computer obtains SAM_ID from the security module through instructions.
[0095] 6. The host computer program sends the SN code and SAM_ID to the USB-Shield and concatenates them with the 16 random numbers obtained in step 4. It generates a digest through the SM3 hash algorithm. The digest value has a fixed length and format of 160 bytes and is returned to the computer for storage.
[0096] 7. The host computer program sends the summary value to the security module. After successful identification and verification, the security module returns a startup code to the computer.
[0097] 8. The computer saves the startup code, encrypts it using the public key of the security module through the SM2 algorithm, writes the startup code ciphertext into the MCU of the ID card reader motherboard and sets write protection.
[0098] 9. Each time the ID card reader is powered on, the startup code ciphertext is first sent to the security module. After the security module decrypts and recognizes it successfully, it provides a complete decryption function, thereby completing the deep binding between the ID card reader motherboard and the security module.
[0099] Among them, reference Figure 3 and 4 As shown in the block diagram of the asymmetric encryption system's encryption and decryption principles, the SM2 asymmetric encryption algorithm can fully leverage the advantages of asymmetric encryption algorithms: long secret keys, high cracking difficulty, and high security. First, the computer encrypts the boot code generated by the security module using the security module's public key and stores it in the MCU. When the device boots up, the device proactively reports the boot code ciphertext to the security module. The security module decrypts the ciphertext using its private key, obtaining the boot code plaintext. After a successful comparison, full decryption functionality is provided. If the device loses power, a new comparison is required. Because the data stored in the security module is highly confidential and does not provide an interface, the boot code ciphertext can only be decrypted using the security module's private key (the manufacturer sets a public-private key pair for each security module at the factory, publishing only the public key; the private key remains private). Therefore, the confidentiality of the boot code information is fully guaranteed.
[0100] In one embodiment of the present invention, each communication data stream between the computer host program, the USB shield, and the ID card security module carries a timestamp to maintain time synchronization; the method further includes:
[0101] After receiving the random number, the computer host program adds a timestamp to the end of the random number;
[0102] After receiving the random number, the ID card security module reads the end timestamp and the delivery timestamp of the random number, calculates the time interval between the end timestamp and the delivery timestamp, and determines whether the time interval is within the preset valid time interval;
[0103] If the time interval is within the preset valid time interval, verifying the digest value;
[0104] If the time interval is not within the preset valid time interval, a random number expiration notification is returned to the computer host program.
[0105] In one embodiment of the present invention, the ID card security module verifies the digest value based on the SN code and random number of the ID card reader, generates a startup code after the verification is passed, and sends it to the computer host program, including:
[0106] The ID card security module combines the ID card reader's SN code, random number, and ID card security module's SAM_ID in a preset format, and generates a new digest value using the SM3 hash algorithm.
[0107] comparing the digest value with a new digest value;
[0108] If the digest value is the same as the new digest value, the SN code of the ID card reader, the SAM_ID of the ID card security module and the last eight digits of the digest value are concatenated in a preset format to obtain the startup code and send it to the computer host program.
[0109] This invention adds a timestamp to each communication data stream between the host program, USB shield, and security module (adding real-time time before each instruction and response), ensuring that the host program, USB shield, and security module maintain time synchronization. It also adds a timestamp to the end of the received random number (the real-time time when the host program receives the random number from the USB shield).
[0110] The security module sets a 60-second effective time window and performs the following calculations:
[0111] 1) Read the random number delivery timestamp,
[0112] 2) Read the timestamp at the end of the random number,
[0113] 3) Subtract the two times to get an interval time, which is used as the basis for judging whether the random number has expired. If it has expired, a failure is directly returned to the host computer program. If it is within the time window, proceed to the next step.
[0114] If the random number is within the time window, proceed to the next step:
[0115] 1) Restore the received random number and remove the timestamp at the end of the random number.
[0116] 2) Inside the security module, the received SN code, SAM_ID, and the restored random number are spliced in the same format as the USB shield, and the spliced data is calculated using the same SM3 algorithm as the USB shield to generate a new digest.
[0117] Inside the security module, this newly generated digest is compared with the received digest. If a match is found, a 16-byte activation code is returned to the computer. This code is the result of concatenating the last 8 digits of the SAM_ID, SN, and digest value according to a fixed format. Because the activation code includes the digest value, which is generated using a random number, the activation code is unique, ensuring that each reader has a unique activation code without duplication.
[0118] In one embodiment of the present invention, the method further comprises:
[0119] Matching the current location information of the ID card reading machine manufacturer with the backup address of the ID card reading machine manufacturer in terms of longitude and latitude; the backup address is the address that the ID card reading machine manufacturer has previously reported to the management agency. When the production address is changed, the ID card reading machine manufacturer will re-report the new address to the management agency as the backup address;
[0120] If the current location information matches the backup address successfully, it is determined that the location verification is successful;
[0121] If the current location information fails to match the backup address, it is determined that the location verification has failed.
[0122] In this embodiment, when the U-Shield is connected to the computer and locates the manufacturer of the ID card reading machine, after obtaining the current location information of the ID card reading machine manufacturer, the current location information of the ID card reading machine manufacturer will be sent to the management agency for location verification. The management agency will compare the current location information with the backup address (i.e., the production address) reported in advance by the manufacturer for longitude and latitude. If the two match successfully, it means that the location information of the machine manufacturer is true and valid, the location verification passes, and the U-Shield can work normally. On the contrary, if the match fails, the location verification fails, the U-Shield will not work normally, and the ID card reading machine and the ID card security module cannot be bound, which effectively prevents the ID card security module from being illegally migrated or misused, and enhances the security and traceability of the ID card security module.
[0123] In one embodiment of the present invention, the method further comprises:
[0124] When the ID card reader's mainboard MCU is damaged and needs repair, the production data is retrieved through the 5-code association system and associated with the startup code through SAM_ID. The startup code is rewritten into the MCU to restore the deep binding between the ID card reader and the ID card security module.
[0125] In the event that the ID card reader's mainboard MCU is damaged, the present invention also provides deep binding recovery during repairs. When the mainboard MCU is damaged and requires repair, maintenance personnel can retrieve production data through the 5-code association system. Subsequently, the previously generated startup code is linked to it via the SAM_ID. After ensuring the accuracy of the information, maintenance personnel can rewrite the startup code into the new or repaired MCU, thereby restoring the deep binding between the ID card reader and the ID card security module, ensuring that the ID card security module and the reader maintain their original security and functional integrity after repair.
[0126] In one embodiment of the present invention, the method further comprises:
[0127] Before connecting the ID card reader to the computer via a data cable through a production fixture, perform a single-board test on the ID card reader to verify whether the hardware function of the mainboard of the ID card reader is normal;
[0128] If the hardware function of the mainboard of the ID card reader is normal, the ID card reader is connected to the computer via a data cable through a production fixture.
[0129] Before connecting the ID card reader to the computer via the fixture, the ID card reader needs to complete a single-board test. The purpose of the single-board test is to verify whether the hardware functions of the ID card reader's mainboard are normal, so as to improve the efficiency of this operation.
[0130] In one embodiment of the present invention, the method further comprises:
[0131] Before the ID card reading device and the ID card security module are bound together, the ID card information read by the ID card security module, except for the photo, the rest of the ID card information is presented in a hidden form.
[0132] In this embodiment, before the ID card reading device and the ID card security module are deeply bound, except for the photo information on the ID card that can be displayed normally, the rest of the ID card information (such as name, ID card number, address and other sensitive data) will be presented in a hidden form, such as with an asterisk, which means that this information will not be directly and completely displayed on the screen or easily obtained in other ways.
[0133] The solution of the present invention has the following advantages:
[0134] First, it eliminates the circulation of ID card security modules in the secondhand market. The security module is tightly coupled to the ID card reader motherboard, preventing functional disassembly. Users seeking after-sales service or product scrapping can only contact the device manufacturer through formal channels, further standardizing market management of ID card readers.
[0135] 2. Through Beidou positioning, management agencies can better manage and track ID card reading machines, because each machine manufacturer can only have one production address, making it impossible for ID card reading machine manufacturers to deny their identities and better clarifying responsibilities during subsequent tracing.
[0136] 3. The activation code of the ID card reader is generated by a random number. Even if someone illegally obtains the U-Shield, the SN code, SAM_ID and other information of the ID card reader, they cannot generate the same activation code. Therefore, it can effectively resist replay attacks.
[0137] 4. The startup code is encrypted using the SM2 algorithm and saved on the MCU. The key length of this algorithm is more than 1024 bits. The public key is used for encryption and the private key is used for decryption. Even if the ciphertext is illegally obtained, it is extremely difficult to crack, so it has high security.
[0138] It should be noted that for the sake of simplicity, the method embodiments are described as a series of actions. However, those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0139] In an embodiment of the present invention, a deep binding device for an ID card reader and an ID card security module is also provided. The ID card security module is built into the ID card reader. The ID card security module supports the SM1, SM2, SM3, and SM4 national encryption algorithms and provides various API interfaces. The ID card reader is connected to a computer via a data cable through a production fixture. The U shield is connected to the computer via a data cable. The U shield has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national encryption algorithm. The Beidou positioning module is used to locate the location of the ID card reader manufacturer. Specifically, the following modules may be included:
[0140] A location verification module is used to obtain the current location information of the ID card reader manufacturer after the USB shield is connected to the computer and send the current location information of the ID card reader manufacturer to the management agency for location verification. After the verification is passed, the USB shield will work normally;
[0141] The unique identification code and random number acquisition module is used by the computer host program to obtain an SN code as the SN code of the ID card reader, obtain a 16-bit random number from the USB shield, obtain the SAM_ID of the ID card security module, and send the SN code of the ID card reader, random number, and SAM_ID of the ID card security module to the USB shield;
[0142] The digest value generation module is used for the USB shield to splice the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module according to the preset format, and use the SM3 hash algorithm to generate the digest value and return it to the computer host program;
[0143] The summary value sending module is used for the computer host program to send the SN code, random number and summary value of the ID card reader to the ID card security module;
[0144] The startup code generation module is used for the ID card security module to verify the digest value according to the SN code and random number of the ID card reader, and after the verification is passed, the startup code is generated and sent to the computer host program;
[0145] The binding module is used for the computer host program to encrypt the startup code using the public key of the ID card security module through the SM2 algorithm to obtain the startup code ciphertext, write the startup code ciphertext into the mainboard MCU of the ID card reader and set write protection;
[0146] The startup code sending module is used to send the startup code ciphertext to the ID card security module every time the ID card reader is powered on;
[0147] The decryption function startup module is used for the ID card security module to use the private key to decrypt the startup code ciphertext and verify the startup code, and provide the complete decryption function of the ID card information after the verification is passed.
[0148] Optionally, the startup code generation module includes:
[0149] A new summary value generation submodule is used for the ID card security module to combine the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module according to a preset format, and use the SM3 hash algorithm to generate a new summary value;
[0150] A digest value comparison submodule, used to compare the digest value with a new digest value;
[0151] The startup code generation submodule is used to obtain the startup code by splicing the SN code of the ID card reader, the SAM_ID of the ID card security module and the last eight digits of the digest value according to a preset format if the digest value and the new digest value are the same, and send it to the computer host program.
[0152] Optionally, each communication data stream between the computer host program, the U shield, and the ID card security module carries a timestamp to maintain time synchronization; the device also includes:
[0153] A timestamp adding module is used for the computer host program to add a timestamp to the end of the random number after receiving the random number;
[0154] A time interval determination module is used for the ID card security module to read the end timestamp and delivery timestamp of the random number after receiving the random number, calculate the time interval between the end timestamp and the delivery timestamp, and determine whether the time interval is within a preset valid time interval;
[0155] a digest value verification module, configured to verify the digest value if the time interval is within a preset valid time interval;
[0156] The failure feedback module is used to return a random number failure notification to the computer host program if the time interval is not within the preset valid time interval.
[0157] Optionally, the device further comprises:
[0158] a location matching module for matching the current location information of the ID card reading machine manufacturer with the backup address of the ID card reading machine manufacturer in terms of latitude and longitude; the backup address is the address that the ID card reading machine manufacturer has previously reported to the management agency; when the production address is changed, the ID card reading machine manufacturer re-reports the new address to the management agency as the backup address;
[0159] A location matching success module, configured to determine that the location verification is successful if the current location information matches the backup address successfully;
[0160] The location matching failure module is used to determine that the location verification fails if the current location information fails to match the backup address.
[0161] Optionally, the device further comprises:
[0162] The binding recovery module is used to call out the production data through the 5-code association system when the MCU of the ID card reader mainboard is damaged and repaired, and associate it with the startup code through SAM_ID, and rewrite the startup code into the MCU to restore the deep binding between the ID card reader and the ID card security module.
[0163] Optionally, the device further comprises:
[0164] A single-board test module is used to perform a single-board test on the ID card reader before connecting the ID card reader to a computer via a data cable through a production fixture to verify whether the hardware functions of the mainboard of the ID card reader are normal;
[0165] The test pass module is used to connect the ID card reader to the computer via a data cable through a production fixture if the hardware function of the mainboard of the ID card reader is normal.
[0166] Optionally, the device further comprises:
[0167] The pre-binding reading module is used to present the identity card information read by the identity card security module in a hidden form except for the photo before the identity card reading device and the identity card security module are bound.
[0168] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0169] In addition, an embodiment of the present invention further provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus.
[0170] Memory for storing computer programs;
[0171] The processor is used to implement the deep binding method of the ID card reading device and the ID card security module as described in the above embodiment when executing the program stored in the memory.
[0172] The communication bus mentioned in the terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is used in the figure, but this does not mean that there is only one bus or only one type of bus.
[0173] The communication interface is used for communication between the above terminal and other devices.
[0174] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage. Alternatively, the memory may be at least one storage device located away from the processor.
[0175] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.
[0176] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, which stores instructions. When the computer-readable storage medium is run on a computer, it enables the computer to execute the deep binding method of the identity card reading machine and the identity card security module described in the above embodiment.
[0177] In another embodiment provided by the present invention, a computer program product containing instructions is also provided. When the computer program product is run on a computer, it enables the computer to execute the deep binding method of the identity card reading device and the identity card security module described in the above embodiment.
[0178] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0179] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply the existence of any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0180] Each embodiment in this specification is described in a related manner. Similar portions between the embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, the device embodiments are generally similar to the method embodiments, so their description is relatively simple. For related portions, refer to the description of the method embodiments.
[0181] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention are included in the scope of protection of the present invention.
Claims
1. A deep binding method for an ID card reader and an ID card security module, characterized in that: The ID card security module is built into the ID card reader. The ID card security module supports SM1, SM2, SM3, SM4 national encryption algorithms and provides various API interfaces; The ID card reader is connected to the computer via a data cable through a production fixture; the U shield is connected to the computer via a data cable. The U shield has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national encryption algorithm. The Beidou positioning module is used to locate the location of the ID card reading device manufacturer; the method includes: After the U-Shield is connected to the computer, it obtains the current location information of the ID card reader manufacturer and sends the current location information of the ID card reader manufacturer to the management agency for location verification. After the verification is passed, the U-Shield works normally; The computer host program obtains an SN code as the SN code of the ID card reader, obtains a 16-bit random number from the USB shield, obtains the SAM_ID of the ID card security module, and sends the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module to the USB shield; The USB key combines the SN code, random number, and SAM_ID of the ID card reader according to the preset format, and uses the SM3 hash algorithm to generate a summary value, which is then returned to the computer host program. The computer host program sends the SN code, random number and summary value of the ID card reader to the ID card security module; The ID card security module verifies the summary value according to the SN code and random number of the ID card reader, generates a startup code after the verification is passed, and sends it to the computer host program; The computer host program encrypts the startup code using the public key of the ID card security module through the SM2 algorithm to obtain a startup code ciphertext, writes the startup code ciphertext into the mainboard MCU of the ID card reader and sets write protection; Each time the ID card reader is powered on, it sends the startup code ciphertext to the ID card security module; The ID card security module uses the private key to decrypt the startup code ciphertext and verify the startup code, and provides the complete decryption function of the ID card information after the verification is passed; The ID card security module verifies the digest value based on the SN code and random number of the ID card reader. After the verification is passed, it generates a startup code and sends it to the computer host program, including: The ID card security module combines the ID card reader's SN code, random number, and ID card security module's SAM_ID in a preset format, and generates a new digest value using the SM3 hash algorithm. comparing the digest value with a new digest value; If the digest value is the same as the new digest value, the SN code of the ID card reader, the SAM_ID of the ID card security module and the last eight digits of the digest value are concatenated in a preset format to obtain the startup code and send it to the computer host program.
2. The method according to claim 1, characterized in that Each communication data stream between the computer host program, the U shield, and the ID card security module carries a timestamp to maintain time synchronization; the method also includes: After receiving the random number, the computer host program adds a timestamp to the end of the random number; After receiving the random number, the ID card security module reads the end timestamp and the delivery timestamp of the random number, calculates the time interval between the end timestamp and the delivery timestamp, and determines whether the time interval is within the preset valid time interval; If the time interval is within the preset valid time interval, verifying the digest value; If the time interval is not within the preset valid time interval, a random number expiration notification is returned to the computer host program.
3. The method according to claim 1, characterized in that The method further comprises: Matching the current location information of the ID card reading machine manufacturer with the backup address of the ID card reading machine manufacturer in terms of longitude and latitude; the backup address is the address that the ID card reading machine manufacturer has previously reported to the management agency. When the production address is changed, the ID card reading machine manufacturer will re-report the new address to the management agency as the backup address; If the current location information matches the backup address successfully, it is determined that the location verification is successful; If the current location information fails to match the backup address, it is determined that the location verification has failed.
4. The method according to claim 1, wherein The method further comprises: When the ID card reader's mainboard MCU is damaged and needs repair, the production data is retrieved through the 5-code association system and associated with the startup code through SAM_ID. The startup code is rewritten into the MCU to restore the deep binding between the ID card reader and the ID card security module.
5. The method according to claim 1, wherein The method further comprises: Before connecting the ID card reader to the computer via a data cable through a production fixture, perform a single-board test on the ID card reader to verify whether the hardware function of the mainboard of the ID card reader is normal; If the hardware function of the mainboard of the ID card reader is normal, the ID card reader is connected to the computer via a data cable through a production fixture.
6. The method according to claim 1, characterized in that The method further comprises: Before the ID card reading device and the ID card security module are bound together, the ID card information read by the ID card security module, except for the photo, the rest of the ID card information is presented in a hidden form.
7. A deep binding device for an ID card reader and an ID card security module, characterized in that: The ID card security module is built into the ID card reader. The ID card security module supports SM1, SM2, SM3, SM4 national encryption algorithms and provides various API interfaces; The ID card reader is connected to the computer via a data cable through a production fixture; the U shield is connected to the computer via a data cable. The U shield has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national encryption algorithm. The Beidou positioning module is used to locate the location of the ID card reading device manufacturer; the device includes: A location verification module is used to obtain the current location information of the ID card reader manufacturer after the USB shield is connected to the computer and send the current location information of the ID card reader manufacturer to the management agency for location verification. After the verification is passed, the USB shield will work normally; The unique identification code and random number acquisition module is used by the computer host program to obtain an SN code as the SN code of the ID card reader, obtain a 16-bit random number from the USB shield, obtain the SAM_ID of the ID card security module, and send the SN code of the ID card reader, random number, and SAM_ID of the ID card security module to the USB shield; The digest value generation module is used for the USB shield to splice the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module according to the preset format, and use the SM3 hash algorithm to generate the digest value and return it to the computer host program; The summary value sending module is used for the computer host program to send the SN code, random number and summary value of the ID card reader to the ID card security module; The startup code generation module is used for the ID card security module to verify the digest value according to the SN code and random number of the ID card reader, and after the verification is passed, the startup code is generated and sent to the computer host program; The binding module is used for the computer host program to encrypt the startup code using the public key of the ID card security module through the SM2 algorithm to obtain the startup code ciphertext, write the startup code ciphertext into the mainboard MCU of the ID card reader and set write protection; The startup code sending module is used to send the startup code ciphertext to the ID card security module every time the ID card reader is powered on; The decryption function startup module is used for the ID card security module to use the private key to decrypt the startup code ciphertext and verify the startup code, and provide the complete decryption function of the ID card information after the verification is passed; The startup code generation module includes: A new summary value generation submodule is used for the ID card security module to combine the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module according to a preset format, and use the SM3 hash algorithm to generate a new summary value; A digest value comparison submodule, used to compare the digest value with a new digest value; The startup code generation submodule is used to obtain the startup code by splicing the SN code of the ID card reader, the SAM_ID of the ID card security module and the last eight digits of the digest value according to a preset format if the digest value and the new digest value are the same, and send it to the computer host program.
8. An electronic device, characterized in that: comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; The memory is used to store computer programs; The processor is used to implement the deep binding method of the identity card reading device and the identity card security module as described in any one of claims 1 to 6 when executing the program stored in the memory.
9. One or more computer-readable media having instructions stored thereon, which, when executed by one or more processors, enable the processors to execute the deep binding method for an ID card reading device and an ID card security module as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Secure crypto element in identity card reading machine and application method thereof
CN106487796A
Protection of identification documents using open cryptography
US20050132194A1