Method and device for deeply binding identity card reading machine and identity card security module
Through the deep binding method of ID card reading equipment and ID card security module, the Beidou positioning module and 16-byte random number generator in U-Shield, combined with the SM series of national secret algorithms, the illegal circulation of ID card security module in the second-hand market is solved, and the deep binding of ID card reading equipment and ID card security module is realized, and security and market management are strengthened.
Patent Information
- Application Number
- CN202411868165.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The illegal circulation of ID card security modules in the second-hand market has caused difficulties in the management of the state's specialized management agencies, affecting the product sales and social stability of formal manufacturers.
Through the deep binding method of ID card reading equipment and ID card security module, the Beidou positioning module and 16-byte random number generator in the U-Shield are used, combined with the SM series of national secret algorithms, the digest value is generated and verified, the startup code is generated and encrypted, and written to the tool motherboard MCU to realize the deep binding of ID card reading equipment and ID card security module.
It effectively prevents the second-hand circulation of security modules, strengthens the coupling between the equipment and the motherboard, standardizes market management, and enhances the security and traceability of the ID card security module.
Smart Images

Figure CN119808058A_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 identity card reading equipment and identity card security modules, a deep binding device for identity card reading equipment and identity card security modules, 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 state 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 one is the ID card reading machine. Through the ID card reading machine, enterprises, institutions and other organizations can read the ID card information of visitors or customers and save it to the system to achieve the corresponding business purpose. The state has relatively strict control over ID card reading machines: for example, the manufacturer of the machine must pass a series of assessments and formal tests by the state's specialized management agency and obtain a qualification certificate before production. The core components of ID card reading machines, such as security modules, are also strictly controlled by the state's specialized management agencies. For example, each security module has a corresponding SAMID, and at the same time, each batch of security modules sold by the security module supplier to the machine manufacturer will be equipped with the same number of GA code labels. During production, manufacturers need to associate 5 codes with the reading machines (GA code, SAMID, machine SN code, fingerprint collector SN code, fingerprint algorithm code, where the fingerprint algorithm code is built into the fingerprint collector, and the fingerprint collector is not mandatory. Therefore, machine manufacturers usually upload the GA code, SAMID, and machine SN code to the association system) and upload them together with the machine's sales information 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 machine manufacturer and the market flow of the machine.
[0004] However, due to the cost, the corresponding price of the security module is relatively high. At the same time, since 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 standard interfaces. For example, it generally communicates with the motherboard of the ID card reader through UART or USB ports, and can be connected to the motherboard of any machine manufacturer. And because the ID card security module has a high security level, its design standards are also very high. After the product life cycle of many ID card readers ends, their built-in security modules can still provide stable decryption functions. For the above reasons, many merchants 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 prices after the machine is scrapped, but are more willing to sell the security module to second-hand vendors who offer higher prices.
[0005] In summary, the three reasons mentioned above have caused the ID card security modules to circulate in the second-hand market. Many manufacturers without production qualifications purchase and reassemble them at a lower price than the original factory, and then put them into the market again to make profits. Because the security modules are transferred twice or even multiple times, it causes management difficulties for the national specialized management agencies. At the same time, due to the existence of second-hand modules, it has caused a great impact on regular and qualified ID card reading equipment manufacturers, resulting in a decline in product sales of these manufacturers and making their business unsustainable. At the same time, due to the illegal circulation of security modules and the lack of control, it also has a great impact on social stability.
[0006] Although the national specialized management agency attaches great importance to this problem and has made relevant efforts, such as joint law enforcement with 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 the present invention is to fundamentally solve the problem of illegal circulation of second-hand safety modules.
[0007] As mentioned in the second paragraph above, the main control method of the national specialized management agency is through the 5-code association system. When producing, the machine tool manufacturers usually enter the SN code, GA code, and SAMID (security module internal code) of each machine tool into the 5-code association system through a combination of a barcode scanner and online reading of the production fixture. The national specialized management agency uses the data from this system to grasp the situation of each machine tool manufacturer in real time and conduct management. As mentioned in the fourth paragraph above, this method has problems that need to be solved urgently.
[0008] In order to solve the problem, some machine tool manufacturers have also come up with some solutions, such as binding the SAMID (security module internal code, each module has a different internal code, as described above) of the security module with the MCU of the machine tool mainboard, so that the security module cannot be disassembled. When the customers of this manufacturer need after-sales maintenance services, such as when the MCU on the machine tool mainboard is damaged and needs to be replaced, they need to contact the manufacturer to unbind the security module from the old MUC and bind it to the new MCU so that the machine tool can work normally. However, there is a problem with this solution: this solution can only solve the problem within the manufacturer and there is no relevant unified promotion. Therefore, when his customer scraps the machine tool for some reason, he may still sell the security module to the recycling vendor at a high price and reassemble it by using the manufacturer's machine tool mainboard. It can be seen from this that to solve the problem of second-hand module circulation, a more scientific and reasonable method is needed, and it must be promoted uniformly among all machine 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 deep binding method for an ID card reading machine and an ID card security module. The ID card security module is built into the ID card reading machine, the ID card security module supports SM1, SM2, SM3, SM4 national secret algorithms and provides various API interfaces; the ID card reading machine is connected to a computer via a data cable through a production fixture; a 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 secret algorithm; the Beidou positioning module is used to locate the location of the ID card reading machine manufacturer; the method comprises:
[0011] After the U shield is connected to the computer, it obtains the current location information of the ID card reading machine manufacturer and sends the current location information of the ID card reading machine 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 shield 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 uses the SM2 algorithm to encrypt the startup code using the public key of the ID card security module to obtain the 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 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, including:
[0020] The ID card security module combines the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module in a preset format, and generates a new summary value using the SM3 hash algorithm.
[0021] comparing the digest value with a new digest value;
[0022] If the summary value is the same as the new summary 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 summary value are concatenated in a preset format to obtain the startup code, which is then sent 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 comprises:
[0029] The current location information of the ID card reading machine manufacturer is matched 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 reported to the management agency in advance. 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;
[0030] If the current location information matches the backup address successfully, it is determined that the location verification is passed;
[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 comprises:
[0033] When the ID card reader mainboard MCU is damaged and needs repair, the production data is called out through the 5-code association system, and is 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 comprises:
[0035] Before the ID card reader is connected to the computer via a data cable through a production fixture, a single board test is performed 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 functions of the mainboard of the ID card reader are normal, the ID card reader is connected to the computer via a data cable through a production fixture.
[0037] Optionally, the method further comprises:
[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 reading machine and an ID card security module, wherein the ID card security module is built into the ID card reading machine, the ID card security module supports SM1, SM2, SM3, SM4 national secret algorithms and provides various API interfaces; the ID card reading machine is connected to a computer via a data cable through a production fixture; a U shield is connected to a 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 secret algorithm; the Beidou positioning module is used to locate the location of the ID card reading machine manufacturer; the device comprises:
[0040] The location verification module is used for obtaining the current location information of the ID card reading machine manufacturer after the USB shield is connected to the computer and sending the current location information of the ID card reading machine manufacturer to the management agency for location verification. After the verification is passed, the USB shield works normally;
[0041] The unique identification code and random number acquisition module is used for 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, the random number, and the SAM_ID of the ID card security module to the USB shield;
[0042] The summary 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 summary 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 the summary value of the ID card reading device to the ID card security module;
[0044] The startup code generation module is used for the ID card security module to verify the summary value according to the SN code and random number of the ID card reader, and after the verification is passed, a 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 reading machine 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 splice 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 for comparing 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 summary value according to a preset format if the summary value and the new summary 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, used for the computer host program to add a timestamp at the end of the random number after receiving the random number;
[0054] A time interval determination module, which is used for the identity card security module to read the end timestamp and the 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 the 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 effective time interval.
[0057] Optionally, the device further comprises:
[0058] A location matching module is used to match 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 reported to the management agency in advance. 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, used to determine that the location verification is passed if the current location information matches the backup address successfully;
[0060] The location matching failure module is used to determine that the location verification has failed 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 mainboard of the ID card reader 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, 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 function of the mainboard of the ID card reader is 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 machine and the identity card security module complete the binding.
[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 machine 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 on which instructions are stored, which, when executed by one or more processors, enable the processors to execute the deep binding method of the identity card reading machine and the identity card security module as described in the present invention.
[0072] The present invention includes the following advantages:
[0073] The deep binding method of the ID card reading machine and the ID card security module of the present invention verifies the location of the machine manufacturer through the U shield (including Beidou positioning and random number generator), and uses the SM series national secret algorithm to generate and verify the summary value, and finally generates and encrypts the startup code to write into the machine motherboard MCU. The ID card reading machine and the ID card security module decrypt the startup code after each power-on to start the complete decryption function of the ID card information, realizing the deep binding of the ID card reading machine and the ID card security module, effectively preventing the second-hand circulation of the security module, strengthening the coupling degree between the machine and the motherboard, and standardizing market management. At the same time, Beidou positioning assists the competent department in tracking and management, the startup code generated by random numbers 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 It is a flowchart of the steps of a deep binding method of an ID card reading device and an ID card security module provided by an embodiment of the present invention;
[0075] Figure 2 It is a principle block diagram of a deep binding ID card reading machine and an ID card security module provided by an embodiment of the present invention;
[0076] Figure 3 It is a block diagram of the encryption and decryption principle of the asymmetric encryption system provided by an embodiment of the present invention;
[0077] Figure 4 The present invention is a block diagram of the principle of loading a startup code for an identity 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 U shield is connected to the computer, it obtains the current location information of the ID card reading machine manufacturer and sends the current location information of the ID card reading machine manufacturer to the management agency for location verification. After the verification is passed, the U shield works normally;
[0081] Step 102, 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;
[0082] Step 103, the USB shield splices 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, 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 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;
[0085] Step 106, the computer host program uses the SM2 algorithm to encrypt the startup code using the public key of the ID card security module to obtain the 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 ciphertext to the ID card security module each time it is powered on;
[0087] Step 108, the ID card security module uses the 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.
[0088] Reference Figure 2 The scheme of the present invention is composed 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 device for the implementation of this scheme. It has a built-in Beidou positioning module, a 16-byte random number generator, and supports the SM3 national secret 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, it is necessary to reapply. The ID card security module supports SM1, SM2, SM3, SM4 national secret algorithms and provides various rich API interfaces. This is a prerequisite for the implementation of this scheme. 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 subsequent maintenance of the mainboard is involved, the startup code of the reading machine can be associated through SAM_ID.
[0089] The specific workflow is as follows:
[0090] 1. Connect the U shield to the computer, and when its indicator light flashes slowly (it is used to indicate whether the U shield is successfully located. After successful positioning, the U 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). 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 machine 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 machine.
[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 U shield and concatenates them with the 16 random numbers obtained in step 4. It generates a summary through the SM3 hash algorithm. The summary value is a fixed length of 160 bytes and a fixed format, 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 mainboard 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 identifies it successfully, it provides a complete decryption function, thereby completing the deep binding of the ID card reader mainboard and the security module.
[0099] Among them, reference Figure 3 and 4 , it can be seen from the principle diagram of encryption and decryption of the asymmetric encryption system that the advantages of asymmetric encryption algorithms, such as long secret keys, high cracking difficulty and high security, can be fully utilized to complete the business using the SM2 asymmetric encryption algorithm: First, the computer end encrypts the startup code generated by the security module through the public key of the security module end and saves it to the MCU. When the machine is started, the machine end actively reports the startup code ciphertext to the security module, and the security module uses the private key to decrypt the ciphertext to obtain the startup code plaintext. After the comparison is successful, it provides a complete decryption function. If the machine is powered off, it needs to be compared again. Because the data stored on the security module end is highly confidential and does not provide an interface, and the ciphertext of the startup code can only be decrypted by the private key of the security module (the manufacturer sets a pair of public and private keys for each security module when leaving the factory, only the public key is published, and the private key is not disclosed), the confidentiality of the startup code information can be fully guaranteed.
[0100] In one embodiment of the present invention, 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:
[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 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, including:
[0106] The ID card security module combines the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module in a preset format, and generates a new summary value using the SM3 hash algorithm.
[0107] comparing the digest value with a new digest value;
[0108] If the summary value is the same as the new summary 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 summary value are concatenated in a preset format to obtain the startup code, which is then sent to the computer host program.
[0109] The present invention adds a timestamp to each communication data stream of the host computer program, U shield, and security module (adds real time in front of each instruction and response), so that the host computer program, U shield, and security module can maintain time synchronization. And add a timestamp at the end of the received random number (the real time when the host computer program receives the random number from the U shield).
[0110] A 60-second effective time window is set inside the security module, and the following calculation is performed:
[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, and use the interval time as the basis for judging whether the random number has expired. If it has expired, it will directly return failure 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 summary.
[0117] Inside the security module, the newly generated digest is compared with the received digest. After a match, a startup code is returned to the computer. The startup code is 16 bytes, and the last 8 digits are obtained from the SAM_ID, SN code, and digest value, and the result is spliced in a fixed format. Because the startup code contains the digest value content, and the digest value is generated by a random number, the startup code is unique, thus ensuring that each reader has a unique startup code without duplication.
[0118] In one embodiment of the present invention, the method further comprises:
[0119] The current location information of the ID card reading machine manufacturer is matched 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 reported to the management agency in advance. 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;
[0120] If the current location information matches the backup address successfully, it is determined that the location verification is passed;
[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 manufacturer of the ID card reading machine, the current location information of the manufacturer of the ID card reading machine will be sent to the management agency for location verification. The management agency will compare the longitude and latitude of the current location information with the backup address (i.e., the production address) reported in advance by the manufacturer. 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 properly, 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 mainboard MCU is damaged and needs repair, the production data is called out through the 5-code association system, and is 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 view of the situation that the MCU of the mainboard of the ID card reader may be damaged, the present invention can also provide deep binding recovery during maintenance. When the mainboard MCU of the machine is damaged and needs maintenance, the maintenance personnel can call out the production data through the 5-code association system. Then, it is associated with the previously generated startup code through SAM_ID. After ensuring that the information is accurate, the 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 can still maintain the original security and functional integrity after maintenance.
[0126] In one embodiment of the present invention, the method further comprises:
[0127] Before the ID card reader is connected to the computer via a data cable through a production fixture, a single board test is performed 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 functions of the mainboard of the ID card reader are 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 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 machine 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, for example, 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] 1. It can eliminate the circulation of ID card security modules in the second-hand market from the source. The security module and the ID card reader mainboard are strongly coupled, so they cannot be disassembled functionally. If users need after-sales service or scrap products, they can only contact the manufacturer of the machine through formal channels, making the market management of ID card reading machines more standardized.
[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, which makes it impossible for the ID card reading machine manufacturer to deny and better clarify responsibilities during subsequent tracing.
[0136] 3. The ID card reader startup code 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 exactly the same startup code. Therefore, it can effectively resist replay attacks.
[0137] 4. The startup code is encrypted by the SM2 algorithm and saved on the MCU side. The key length of the algorithm is more than 1024 bits. The encryption uses the public key and the decryption uses the private key. 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 action combinations, but 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 the 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 reading machine and an ID card security module is also provided. The ID card security module is built into the ID card reading machine, and the ID card security module supports SM1, SM2, SM3, and SM4 national encryption algorithms and provides various API interfaces; the ID card reading machine 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, and 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 machine manufacturer; specifically, it may include the following modules:
[0140] The location verification module is used for obtaining the current location information of the ID card reading machine manufacturer after the USB shield is connected to the computer and sending the current location information of the ID card reading machine manufacturer to the management agency for location verification. After the verification is passed, the USB shield works normally;
[0141] The unique identification code and random number acquisition module is used for 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, the random number, and the SAM_ID of the ID card security module to the USB shield;
[0142] The summary 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 summary 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 the summary value of the ID card reading device to the ID card security module;
[0144] The startup code generation module is used for the ID card security module to verify the summary value according to the SN code and random number of the ID card reader, and after the verification is passed, a 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 reading machine 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 splice 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 for comparing 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 summary value according to a preset format if the summary value and the new summary 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, used for the computer host program to add a timestamp at the end of the random number after receiving the random number;
[0154] A time interval determination module, which is used for the identity card security module to read the end timestamp and the 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 the 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 effective time interval.
[0157] Optionally, the device further comprises:
[0158] A location matching module is used to match 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 reported to the management agency in advance. 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, used to determine that the location verification is passed if the current location information matches the backup address successfully;
[0160] The location matching failure module is used to determine that the location verification has failed 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 mainboard of the ID card reader 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, 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 function of the mainboard of the ID card reader is 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 machine and the identity card security module complete the binding.
[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, used to store computer programs;
[0171] The processor is used to implement the deep binding method of the ID card reading machine 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 above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0173] The communication interface is used for communication between the above terminal and other devices.
[0174] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned 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, discrete hardware components.
[0176] In another embodiment provided by the present invention, a computer-readable storage medium is also provided, in which instructions are stored. When the computer-readable storage medium is run on a computer, the computer executes 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 is run on the computer, the computer executes the deep binding method of the identity card reading machine and the identity card security module described in the above embodiment.
[0178] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part 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, the process or function described in the embodiment of the present invention is generated in whole or in part. 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 a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. 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 hard disk Solid State Disk (SSD)), etc.
[0179] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0180] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, 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.
[0181] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims
1. A deep binding method for an ID card reading device and an ID card security module, characterized in that: The ID card security module is built into the ID card reading machine, and 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, and 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 equipment manufacturer; the method includes: After the U shield is connected to the computer, it obtains the current location information of the ID card reading machine manufacturer and sends the current location information of the ID card reading machine 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 shield 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 uses the SM2 algorithm to encrypt the startup code using the public key of the ID card security module to obtain the 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 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.
2. The method according to claim 1, characterized in that 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, including: The ID card security module combines the SN code of the ID card reader, the random number, and the SAM_ID of the ID card security module in a preset format, and generates a new summary value using the SM3 hash algorithm. comparing the digest value with a new digest value; If the summary value is the same as the new summary 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 summary value are concatenated in a preset format to obtain the startup code, which is then sent to the computer host program.
3. The method according to claim 2, 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.
4. The method according to claim 1, characterized in that: The method further comprises: The current location information of the ID card reading machine manufacturer is matched 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 reported to the management agency in advance. 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; If the current location information matches the backup address successfully, it is determined that the location verification is passed; If the current location information fails to match the backup address, it is determined that the location verification has failed.
5. The method according to claim 1, characterized in that The method further comprises: When the ID card reader mainboard MCU is damaged and needs repair, the production data is called out through the 5-code association system, and is 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.
6. The method according to claim 1, characterized in that The method further comprises: Before the ID card reader is connected to the computer via a data cable through a production fixture, a single board test is performed on the ID card reader to verify whether the hardware function of the mainboard of the ID card reader is normal; If the hardware functions of the mainboard of the ID card reader are normal, the ID card reader is connected to the computer via a data cable through a production fixture.
7. 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.
8. 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 reading machine, and 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, and 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 equipment manufacturer; the device includes: The location verification module is used for obtaining the current location information of the ID card reading machine manufacturer after the USB shield is connected to the computer and sending the current location information of the ID card reading machine manufacturer to the management agency for location verification. After the verification is passed, the USB shield works normally; The unique identification code and random number acquisition module is used for 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, the random number, and the SAM_ID of the ID card security module to the USB shield; The summary 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 summary 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 the summary value of the ID card reading device to the ID card security module; The startup code generation module is used for the ID card security module to verify the summary 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 reading machine 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.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through 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 machine and the identity card security module as described in any one of claims 1 to 7 when executing the program stored in the memory.
10. 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 identity card reading machine and an identity card security module as described in any one of claims 1-7.
Citation Information
Patent Citations
Identity card reading terminal and cloud authentication platform data transmission method and system
CN106027473A
Secure crypto element in identity card reading machine and application method thereof
CN106487796A
Manufacturing method and device for identity feature acquisition products in public security field
CN107180252A
Method for binding intelligent gateway through binding code
CN118827749A
Protection of identification documents using open cryptography
US20050132194A1