A method and system for checking firmware integrity of a QKD device based on an SM3_HMAC algorithm
By employing the SM3_HMAC algorithm in QKD devices and using a key agreed upon between the security chip and the PC to verify the integrity of the device firmware, the problem of easy firmware tampering in existing technologies is solved, thus achieving security and integrity protection for the device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QUANTUMCTEK CO LTD
- Filing Date
- 2021-12-31
- Publication Date
- 2026-04-24
AI Technical Summary
Existing QKD devices have shortcomings in firmware integrity protection, are unable to effectively verify and protect security, and are easily tampered with.
The SM3_HMAC algorithm is adopted. By agreeing on a consistent key between the PC and the security chip, the security chip calls the SM3_HMAC algorithm to process the device firmware, obtain the SM3_HMAC value, and compare it with the preset value to ensure firmware integrity.
It provides strong protection for the firmware of QKD devices, preventing device attacks caused by firmware tampering and ensuring the security and integrity of the devices.
Smart Images

Figure CN116415289B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to quantum key distribution (QKD) devices, and in particular to firmware integrity verification of QKD devices. Background Technology
[0002] In quantum key distribution (QKD) devices, ensuring the security and integrity of the device firmware and preventing malicious tampering is crucial. The common practice is to embed the firmware package within the device and protect it using hardware anti-tampering methods. However, there are limited methods for integrity and firmware verification. Typical firmware verification methods, such as comparing firmware version numbers, offer weak protection. Existing devices either lack software-level firmware verification, relying solely on hardware anti-tampering, or only perform simple software-level comparisons, resulting in weak protection against firmware tampering and failing to provide effective verification and security.
[0003] The invention patent CN201410780458, entitled "A Password-Based Process Authentication Method," describes a method that sets an authentication password for a process, calculates the process's HMAC value based on the authentication password, and stores it in extended attributes. It pre-sets a password retrieval control switch in the operating system and configures its state. Upon receiving a process's operation request, it determines whether password verification is required based on the password retrieval control switch. If password verification is required, it retrieves the authentication password, calculates the process's HMAC value based on the authentication password, and compares the calculated HMAC value with the HMAC value in the process's extended attributes. If they match, the process is deemed to have successfully authenticated the password and can continue its operation request; otherwise, the process's operation request is rejected. The invention patent with document number CN201710829211, entitled "Method and System for Quickly Opening Information Security Device Applications on a Mobile Platform," describes the following steps: When an information security device is detected connecting to a mobile app, the system determines whether this is the first connection based on the device code. If so, it saves the data from the information security device to the mobile app and calculates the HMAC value. When the information security device is detected connecting again, the system checks if there is cached data for the device on the mobile app. If so, it calculates the HMAC value of the cached data and determines whether it matches HMAC2. If they match, the system proceeds to the next step, directly accessing the data saved on the mobile app.
[0004] Existing technologies offer weak protection for the integrity of firmware packages. Within QKD devices, there is no verification of the device firmware. Even if the device firmware is tampered with, it cannot be detected. Furthermore, there are no algorithmic measures to calculate, verify, or compare the device firmware, thus failing to protect the device firmware. Summary of the Invention
[0005] The technical problem to be solved by this invention is how to provide strong protection for the firmware integrity of QKD devices.
[0006] This invention solves the above-mentioned technical problems through the following technical means: a firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm, comprising:
[0007] The computing software on the dedicated PC is agreed to be consistent with the SM3_HMAC key inside the security chip;
[0008] The computing software on the PC uses the SM3_HMAC algorithm to process the device firmware to obtain the SM3_HMAC value, and then pre-sets the SM3_HMAC value into the security chip.
[0009] The device firmware is placed into the QKD device. After the device is powered on, the SM3_HMAC algorithm of the security chip is called to process the device firmware and obtain the SM3_HMAC calculation result. Then, it is compared with the SM3_HMAC value preset in the security chip. If the comparison is consistent, it means that the device firmware is complete and the device firmware is run. If the comparison is inconsistent, it means that the device firmware has a problem.
[0010] This invention pre-determines the SM3_HMAC key between the PC-side computing software and the security chip to ensure input consistency for the SM3_HMAC algorithm. This solution proposes a firmware verification scheme for QKD devices based on the SM3_HMAC algorithm. The security chip uses the SM3_HMAC algorithm to process the firmware packet, obtaining the SM3_HMAC processing result. If the result matches, the firmware verification is successful. This solution uses both hardware (security chip) and software (SM3_HMAC algorithm) methods to verify the integrity of the device firmware, protecting the firmware integrity and security of QKD devices and preventing attacks on QKD devices due to firmware defects.
[0011] In a more specific technical solution, the step of ensuring that the computing software on the designated dedicated PC is consistent with the SM3_HMAC key inside the security chip includes:
[0012] Acquire device data from the PC and the security chip;
[0013] Obtain consistent key data between the PC and the security chip, and then obtain the SM3_HMAC key.
[0014] Based on the device data, the SM3_HMAC key is set as the consistency key between the PC and the security chip.
[0015] In a more specific technical solution, the size of the consistency key is 16 bytes.
[0016] In a more specific technical solution, the security chip stores the SM3_HMAC value in a specified FLASH address.
[0017] In a more specific technical solution, the PC-side computing software uses the SM3_HMAC algorithm to process the device firmware to obtain the SM3_HMAC value, specifically including:
[0018] The consistent SM3_HMAC key and authentication index are acquired and processed to obtain the first output data and the second output data.
[0019] Obtain device firmware data to be processed;
[0020] The first output data and the device firmware data to be processed are processed to obtain the first SM3 data to be processed.
[0021] The first SM3 data to be processed is processed using the SM3 algorithm to obtain a hash data.
[0022] The hash data and the second output data are processed using the SM3 algorithm to obtain the second SM3 data to be processed.
[0023] The second SM3 data to be processed is processed using the SM3 algorithm to obtain the SM3_HMAC processing result.
[0024] In a more specific technical solution, the step of placing the device firmware into the QKD device, and after the device is powered on, calling the SM3_HMAC algorithm of the security chip to process the device firmware to obtain the SM3_HMAC calculation result, and then comparing it with the preset SM3_HMAC value in the security chip, includes:
[0025] Step 31: Power on the QKD device;
[0026] Step 32: The firmware verification software in the QKD device reads the SM3_HMAC value stored in the security chip;
[0027] Step 33: The firmware verification software reads the firmware size data of the device firmware and sends it to the security chip. The security chip uses the SM3_HMAC algorithm to process the device firmware according to the agreed consistent SM3_HMAC key, so as to obtain the SM3_HMAC calculation result of the device firmware.
[0028] Step 34: The firmware verification software compares the SM3_HMAC value stored in the security chip read in step 32 with the SM3_HMAC calculation result of the device firmware obtained in step S33. If they match, proceed to step S35; if they do not match, proceed to step S36.
[0029] Step 35: If the results are consistent, the firmware verification software generates a specific flag file and proceeds to step S37;
[0030] Step 36: If the results are inconsistent, it indicates that there is a problem with the device firmware. It will not trigger the operating system to generate a specific flag file, and the operating system will not process the device firmware, thus failing to obtain the QKD business software and causing the QKD device to malfunction.
[0031] Step 37: After the operating system processes the device firmware, it obtains the QKD business software and runs it.
[0032] In a more specific technical solution, in step 36, the QKD device illuminates the fault light, and the device enters manual maintenance mode.
[0033] The present invention also provides a firmware integrity verification system for QKD devices based on the SM3_HMAC algorithm, the system comprising:
[0034] Key agreement module: Used to ensure that the computing software on the dedicated PC is consistent with the SM3_HMAC key inside the security chip;
[0035] Device firmware processing module: The computing software on the PC uses the SM3_HMAC algorithm to process the device firmware to obtain the SM3_HMAC value, and then presets the SM3_HMAC value into the security chip, which then stores it in the specified FLASH address;
[0036] The verification module places the device firmware into the QKD device. After the device firmware is powered on, it calls the SM3_HMAC algorithm of the security chip to process the device firmware, obtains the SM3_HMAC calculation result, and then compares it with the preset SM3_HMAC value in the security chip. If the comparison is consistent, it indicates that the device firmware is complete and the device firmware is run. If the comparison is inconsistent, it indicates that the device firmware has a problem.
[0037] In a more specific technical solution, the key agreement module includes:
[0038] The device data acquisition unit is used to acquire device data from the PC and the security chip.
[0039] The SM3_HMAC key acquisition unit is used to acquire consistent key data between the PC and the security chip, thereby obtaining the SM3_HMAC key;
[0040] The key setting unit sets the SM3_HMAC key as a consistency key between the PC and the security chip based on the device data.
[0041] In a more specific technical solution, the device firmware processing module specifically includes:
[0042] The power-on unit powers on the QKD device;
[0043] The SM3_HMAC value reading unit allows the firmware verification software within the QKD device to read the SM3_HMAC value stored in the security chip.
[0044] The SM3_HMAC calculation unit reads the firmware size data of the device firmware by the firmware verification software and sends it to the security chip. The security chip uses the SM3_HMAC algorithm to process the device firmware according to the consistent SM3_HMAC key agreed by the key agreement module, so as to obtain the SM3_HMAC calculation result of the device firmware.
[0045] In the comparison unit, the firmware verification software compares the SM3_HMAC value stored in the security chip read by the SM3_HMAC value reading unit with the SM3_HMAC calculation result of the device firmware obtained in step S33. If they match, the comparison proceeds to the specific flag file generation unit; if they do not match, the comparison proceeds to the alarm unit.
[0046] If the results match, the firmware verification software generates a specific flag file and enters the execution unit.
[0047] If the alarm unit's results are inconsistent, it indicates that there is a problem with the device firmware. It will not trigger the operating system to generate a specific flag file, and the operating system will not process the device firmware, thus failing to obtain the QKD business software and preventing the QKD device from operating normally.
[0048] The operating system processes the device firmware to obtain the QKD business software and then runs it.
[0049] The present invention has the following advantages over the prior art:
[0050] This invention provides a firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm. This invention pre-determines the SM3_HMAC key (16 bytes in size) between the PC-side computing software and the security chip to ensure input consistency for the SM3_HMAC algorithm. This solution proposes a firmware verification scheme for QKD devices based on the SM3_HMAC algorithm. The security chip calls the SM3_HMAC algorithm to process the firmware packet, obtaining a 32-byte SM3_HMAC processing result. If the result matches, the firmware verification is successful. This solution achieves firmware integrity verification through both hardware (security chip) and software (SM3_HMAC algorithm) methods, protecting the firmware integrity and security of QKD devices and preventing attacks on QKD devices due to firmware corruption. Attached Figure Description
[0051] Figure 1 This is a schematic diagram of the processing flow of the existing SM3_HMAC algorithm;
[0052] Figure 2 This is a schematic diagram comparing the SM3_HMAC calculation results in an embodiment of the present invention;
[0053] Figure 3 This is a flowchart of the firmware integrity verification process for the QKD device in this embodiment of the invention. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0055] Example 1:
[0056] Introduction to the SM3_HMAC algorithm:
[0057] The SM3_HMAC algorithm is based on the SM3 algorithm, with the addition of a 16-byte authentication key. Before processing, the 16-byte authentication key and the data to be processed are used as input variables, and the return value is a 32-byte SM3_HMAC value.
[0058] like Figure 1 As shown, the specific processing flow of the SM3_HMAC algorithm is as follows:
[0059] First, the SM3_HMAC processing instruction is received;
[0060] Process the authentication key and authentication index data;
[0061] We get output 1 (ipad) and output 2 (opad);
[0062] The output iPad is processed along with the data to be processed to obtain the first SM3 data to be processed;
[0063] Then, SM3 processing is performed. If the processing is successful, the 32-byte hash value from the first processing is obtained. If the processing fails, the algorithm ends.
[0064] The 32-byte hash value obtained from the first processing is processed together with the output 2 opad to obtain the second SM3 data to be processed;
[0065] If the SM3 processing is successful, a 32-byte hash value is obtained, which is the SM3_HMAC value. If the processing fails, the algorithm ends.
[0066] like Figure 2 and Figure 3 As shown, the firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm of this invention includes the following steps:
[0067] Step S1: The computing software on the dedicated PC must be consistent with the SM3_HMAC key inside the security chip;
[0068] Specifically, it includes:
[0069] Acquire device data from the PC and the security chip;
[0070] Obtain consistent key data between the PC and the security chip, and then obtain the SM3_HMAC key.
[0071] Based on the device data, the SM3_HMAC key is set as the consistency key between the PC and the security chip, and the size of the consistency key is 16 bytes.
[0072] Step S2: The computing software on the PC uses the SM3_HMAC algorithm to process the device firmware to obtain a 32-byte SM3_HMAC value, and then pre-sets the 32-byte SM3_HMAC value in the security chip. The security chip then stores it in the specified FLASH address.
[0073] On the PC, dedicated computing software is used to perform SM3_HMAC processing on the device firmware. After successful processing, the SM3_HMAC processing result is pre-stored in a designated non-volatile storage area inside the security chip for security comparison with the firmware SM3_HMAC calculation result, thereby ensuring the integrity of the security firmware.
[0074] The PC-side computing software processes the device firmware using the SM3_HMAC algorithm to obtain a 32-byte SM3_HMAC value. Specifically, it employs the aforementioned disclosed SM3_HMAC algorithm, including:
[0075] The consistent SM3_HMAC key and authentication index are acquired and processed to obtain the first output data and the second output data.
[0076] Obtain device firmware data to be processed;
[0077] The first output data and the device firmware data to be processed are processed to obtain the first SM3 data to be processed.
[0078] The first SM3 data to be processed is processed using the SM3 algorithm to obtain a hash data.
[0079] The hash data and the second output data are processed using the SM3 algorithm to obtain the second SM3 data to be processed.
[0080] The second SM3 data to be processed is processed using the SM3 algorithm to obtain the SM3_HMAC processing result.
[0081] Step S3: Place the device firmware into the QKD device. After the device is powered on, call the SM3_HMAC algorithm of the security chip to process the device firmware and obtain the SM3_HMAC calculation result. Then compare it with the preset SM3_HMAC value in the security chip. If the comparison is consistent, it means that the device firmware is complete and the device firmware is run. If the comparison is inconsistent, it means that the device firmware has a problem and needs to be repaired.
[0082] This invention pre-determines that the PC-side computing software and the SM3_HMAC key (16 bytes in size) inside the security chip are consistent, ensuring the input consistency of the SM3_HMAC algorithm.
[0083] like Figure 3 As shown, this step specifically includes:
[0084] Step 31: Power on the QKD device;
[0085] Step 32: The firmware verification software in the QKD device reads the SM3_HMAC value stored in the security chip, which is the 32-byte SM3_HMAC value obtained in step S2;
[0086] Step 33: The firmware verification software reads the firmware size data of the device firmware and sends it to the security chip. The security chip uses the SM3_HMAC algorithm to process the device firmware according to the consistent SM3_HMAC key agreed in step S1, so as to obtain the SM3_HMAC calculation result of the device firmware.
[0087] Step 34: The firmware verification software compares the SM3_HMAC value stored in the security chip read in step 32 with the SM3_HMAC calculation result of the device firmware obtained in step S33. If they match, proceed to step S35; if they do not match, proceed to step S36.
[0088] Step 35: If the results are consistent, the firmware verification software generates a specific flag file and proceeds to step S37;
[0089] Step 36: If the results are inconsistent, it means that there is a problem with the device firmware. It will not trigger the operating system to generate a specific flag file, and the operating system will not process the device firmware. It cannot obtain the QKD business software, and the QKD device cannot operate normally. At this time, the QKD device will light up the fault light and the device will enter the manual maintenance state.
[0090] Step 37: After the operating system processes the device firmware, it obtains the QKD business software and runs it.
[0091] In summary, this invention provides a firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm. It pre-agrees on the SM3_HMAC key (16 bytes in size) between the PC-side computing software and the security chip, ensuring input consistency for the SM3_HMAC algorithm. This solution proposes a firmware verification scheme for QKD devices based on the SM3_HMAC algorithm. The security chip calls the SM3_HMAC algorithm to process the firmware packet, obtaining a 32-byte SM3_HMAC processing result. If the result matches, the firmware verification is successful. This solution achieves firmware integrity verification through both hardware (security chip) and software (SM3_HMAC algorithm) methods, protecting the firmware integrity and security of QKD devices and preventing attacks on QKD devices due to firmware corruption.
[0092] Example 2:
[0093] This embodiment provides a firmware integrity verification system for QKD devices based on the SM3_HMAC algorithm, including the following modules:
[0094] Key agreement module: Used to ensure that the computing software on the dedicated PC is consistent with the SM3_HMAC key inside the security chip;
[0095] Specifically, it includes:
[0096] The device data acquisition unit is used to acquire device data from the PC and the security chip.
[0097] The SM3_HMAC key acquisition unit is used to acquire consistent key data between the PC and the security chip, thereby obtaining the SM3_HMAC key;
[0098] The key setting unit sets the SM3_HMAC key as a consistency key between the PC and the security chip based on the device data. The size of the consistency key is 16 bytes.
[0099] Device firmware processing module: The computing software on the PC uses the SM3_HMAC algorithm to process the device firmware to obtain a 32-byte SM3_HMAC value, and then pre-sets the 32-byte SM3_HMAC value in the security chip, which then stores it in the specified FLASH address;
[0100] On the PC, dedicated computing software is used to perform SM3_HMAC processing on the device firmware. After successful processing, the SM3_HMAC processing result is pre-stored in a designated non-volatile storage area inside the security chip for security comparison with the firmware SM3_HMAC calculation result, thereby ensuring the integrity of the security firmware.
[0101] The PC-side computing software processes the device firmware using the SM3_HMAC algorithm to obtain a 32-byte SM3_HMAC value. Specifically, it employs the aforementioned disclosed SM3_HMAC algorithm, including:
[0102] The consistent SM3_HMAC key and authentication index are acquired and processed to obtain the first output data and the second output data.
[0103] Obtain device firmware data to be processed;
[0104] The first output data and the device firmware data to be processed are processed to obtain the first SM3 data to be processed.
[0105] The first SM3 data to be processed is processed using the SM3 algorithm to obtain a hash data.
[0106] The hash data and the second output data are processed using the SM3 algorithm to obtain the second SM3 data to be processed.
[0107] The second SM3 data to be processed is processed using the SM3 algorithm to obtain the SM3_HMAC processing result.
[0108] The verification module places the device firmware into the QKD device. After the device firmware is powered on, it calls the SM3_HMAC algorithm of the security chip to process the device firmware, obtains the SM3_HMAC calculation result, and then compares it with the preset SM3_HMAC value in the security chip. If the comparison is consistent, it indicates that the device firmware is complete and the device firmware is run. If the comparison is inconsistent, it indicates that the device firmware has a problem and needs to be repaired.
[0109] This invention pre-determines that the PC-side computing software and the SM3_HMAC key (16 bytes in size) inside the security chip are consistent, ensuring the input consistency of the SM3_HMAC algorithm.
[0110] like Figure 3 As shown, the device firmware processing module specifically includes:
[0111] The power-on unit powers on the QKD device;
[0112] The SM3_HMAC value reading unit reads the SM3_HMAC value stored in the security chip, i.e., the 32-byte SM3_HMAC value obtained in step S2, from the firmware verification software in the QKD device.
[0113] The SM3_HMAC calculation unit reads the firmware size data of the device firmware by the firmware verification software and sends it to the security chip. The security chip uses the SM3_HMAC algorithm to process the device firmware according to the consistent SM3_HMAC key agreed by the key agreement module, so as to obtain the SM3_HMAC calculation result of the device firmware.
[0114] In the comparison unit, the firmware verification software compares the SM3_HMAC value stored in the security chip read by the SM3_HMAC value reading unit with the SM3_HMAC calculation result of the device firmware obtained in step S33. If they match, the comparison proceeds to the specific flag file generation unit; if they do not match, the comparison proceeds to the alarm unit.
[0115] If the results match, the firmware verification software generates a specific flag file and enters the execution unit.
[0116] If the alarm unit results are inconsistent, it indicates that there is a problem with the device firmware. It will not trigger the operating system to generate a specific flag file, and the operating system will not process the device firmware. It will not be able to obtain the QKD business software, and the QKD device will not be able to operate normally. At this time, the QKD device will light up the fault light and the device will enter the manual maintenance state.
[0117] The operating system processes the device firmware to obtain the QKD business software and then runs it.
[0118] In summary, this invention provides a firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm. It pre-agrees on the SM3_HMAC key (16 bytes in size) between the PC-side computing software and the security chip, ensuring input consistency for the SM3_HMAC algorithm. This solution proposes a firmware verification scheme for QKD devices based on the SM3_HMAC algorithm. The security chip calls the SM3_HMAC algorithm to process the firmware packet, obtaining a 32-byte SM3_HMAC processing result. If the result matches, the firmware verification is successful. This solution achieves firmware integrity verification through both hardware (security chip) and software (SM3_HMAC algorithm) methods, protecting the firmware integrity and security of QKD devices and preventing attacks on QKD devices due to firmware corruption.
[0119] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm, characterized in that, include: The computing software on the dedicated PC is agreed to be consistent with the SM3_HMAC key inside the security chip, including: Acquire device data from the PC and the security chip; Obtain consistent key data between the PC and the security chip, and then obtain the SM3_HMAC key. Based on the device data, the SM3_HMAC key is set as the consistency key between the PC and the security chip; Before the device firmware is placed into the QKD device, the computing software on the PC uses the SM3_HMAC algorithm to process the device firmware to obtain the SM3_HMAC value, and then pre-sets the SM3_HMAC value into the security chip. Specifically, this includes: Obtain and process the consistent SM3_HMAC key and authentication index to obtain the first and second output data. Obtain device firmware data to be processed; The first output data and the device firmware data to be processed are processed to obtain the first SM3 data to be processed. The first SM3 data to be processed is processed using the SM3 algorithm to obtain a hash data. The hash data and the second output data are processed using the SM3 algorithm to obtain the second SM3 data to be processed. The second SM3 data to be processed is processed using the SM3 algorithm to obtain the SM3_HMAC value. The device firmware is placed into the QKD device. After the device firmware is powered on, the SM3_HMAC algorithm of the security chip is called to process the device firmware and obtain the SM3_HMAC calculation result. Then, it is compared with the SM3_HMAC value preset in the security chip. If the comparison is consistent, it means that the device firmware is complete and the device firmware is run. If the comparison is inconsistent, it means that the device firmware has a problem.
2. The firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm according to claim 1, characterized in that, The size of the consistency key is 16 bytes.
3. The firmware integrity verification method for QKD devices based on the SM3_HMAC algorithm according to claim 1, characterized in that, The security chip stores the SM3_HMAC value in a specified FLASH address.
4. The firmware integrity verification method for a QKD device based on the SM3_HMAC algorithm according to claim 1, characterized in that, The process involves placing the device firmware into the QKD device. After the device is powered on, the SM3_HMAC algorithm of the security chip is called to process the device firmware, obtain the SM3_HMAC calculation result, and then compare it with the preset SM3_HMAC value in the security chip, including: Step 31: Power on the QKD device; Step 32: The firmware verification software in the QKD device reads the SM3_HMAC value stored in the security chip; Step 33: The firmware verification software reads the firmware size data of the device firmware and sends it to the security chip. The security chip uses the SM3_HMAC algorithm to process the device firmware according to the agreed consistent SM3_HMAC key, so as to obtain the SM3_HMAC calculation result of the device firmware. Step 34: The firmware verification software compares the SM3_HMAC value stored in the security chip read in step 32 with the SM3_HMAC calculation result of the device firmware obtained in step S33. If they match, proceed to step S35; if they do not match, proceed to step S36. Step 35: If the results are consistent, the firmware verification software generates a specific flag file and proceeds to step S37; Step 36: If the results are inconsistent, it indicates that there is a problem with the device firmware. It will not trigger the operating system to generate a specific flag file, and the operating system will not process the device firmware, thus failing to obtain the QKD business software and causing the QKD device to malfunction. Step 37: After the operating system processes the device firmware, it obtains the QKD business software and runs it.
5. The firmware integrity verification method for a QKD device based on the SM3_HMAC algorithm according to claim 4, characterized in that, In step 36, the QKD device illuminates the fault indicator light, and the device enters manual maintenance mode.
6. A firmware integrity verification system for QKD devices based on the SM3_HMAC algorithm, characterized in that, The system includes: Key agreement module: Used to ensure that the computing software on the dedicated PC is consistent with the SM3_HMAC key inside the security chip, including: The device data acquisition unit is used to acquire device data from the PC and the security chip. The SM3_HMAC key acquisition unit is used to acquire consistent key data between the PC and the security chip, thereby obtaining the SM3_HMAC key; The key setting unit sets the SM3_HMAC key as a consistent key between the PC and the security chip based on the device data. Device firmware processing module: Before the device firmware is placed into the QKD device, the calculation software on the PC uses the SM3_HMAC algorithm to process the device firmware to obtain the SM3_HMAC value, and pre-sets the SM3_HMAC value in the security chip. The security chip then stores it in a specified FLASH address. Specifically, it includes: Obtain and process the consistent SM3_HMAC key and authentication index to obtain the first and second output data. Obtain device firmware data to be processed; The first output data and the device firmware data to be processed are processed to obtain the first SM3 data to be processed. The first SM3 data to be processed is processed using the SM3 algorithm to obtain a hash data. The hash data and the second output data are processed using the SM3 algorithm to obtain the second SM3 data to be processed. The second SM3 data to be processed is processed using the SM3 algorithm to obtain the SM3_HMAC value. Verification module: The device firmware is placed into the QKD device. After the device firmware is powered on, the SM3_HMAC algorithm of the security chip is called to process the device firmware and obtain the SM3_HMAC calculation result. Then, it is compared with the preset SM3_HMAC value in the security chip. If the comparison is consistent, it means that the device firmware is complete and the device firmware is run. If the comparison is inconsistent, it means that the device firmware has a problem.
7. The firmware integrity verification system for QKD devices based on the SM3_HMAC algorithm as described in claim 6, characterized in that, The verification module specifically includes: The power-on unit powers on the QKD device; The SM3_HMAC value reading unit allows the firmware verification software within the QKD device to read the SM3_HMAC value stored in the security chip. The SM3_HMAC calculation unit reads the firmware size data of the device firmware by the firmware verification software and sends it to the security chip. The security chip uses the SM3_HMAC algorithm to process the device firmware according to the consistent SM3_HMAC key agreed by the key agreement module, so as to obtain the SM3_HMAC calculation result of the device firmware. The comparison unit and firmware verification software compare the SM3_HMAC value stored in the security chip read by the SM3_HMAC value reading unit with the SM3_HMAC calculation result of the device firmware obtained by the SM3_HMAC calculation unit. If they match, the comparison proceeds to the specific flag file generation unit; if they do not match, the comparison proceeds to the alarm unit. If the results match, the firmware verification software generates a specific flag file and enters the execution unit. If the alarm unit's results are inconsistent, it indicates that there is a problem with the device firmware. It will not trigger the operating system to generate a specific flag file, and the operating system will not process the device firmware, thus failing to obtain the QKD business software and preventing the QKD device from operating normally. The operating system processes the device firmware to obtain the QKD business software and then runs it.
Citation Information
Patent Citations
A Password-Based Process Authentication Method
CN104408365B
Method and system of quickly opening information security device application on mobile platform
CN107465514A
Method and device for safely starting video card and computer readable storage medium
CN107729069A
Data authentication method based on HMAC-SM3 algorithm and quantum key distribution system
CN109274480A