Computer firmware secure loading system and computer equipment

By using different types of memory and peripheral controllers in the computer to generate random numbers for verification, the problem of inability to effectively prevent viruses or Trojans before loading in the firmware in the prior art is solved, and multiple security barriers are realized, which improves the Security and stability of computer systems.

CN119396491APending Publication Date: 2025-02-07BEIJING ZHENGYANG TIANCHENG TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411486502.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art only performs file integrity verification before the computer firmware is loaded, which cannot effectively prevent third parties from implanting viruses or Trojans through comparison rules, resulting in computer system failure or security problems.

Method used

Different types of memory (such as the EEPROM of the I2C bus and the FLASH of the SPI bus) are used to store the boot firmware, and the peripheral controller generates random numbers for data consistency verification to ensure that the verification can only be loaded to the computer processor after it is passed.

Benefits of technology

By increasing the difficulty of firmware modification and using random number verification, multiple security barriers are established to effectively prevent abnormal firmware loading and improve the security and stability of the computer system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396491A_ABST
    Figure CN119396491A_ABST
Patent Text Reader

Abstract

The invention provides a computer firmware secure loading system and computer equipment, the computer firmware secure loading system comprises a first firmware memory and a second firmware memory, the first firmware memory and the second firmware memory are different types of memories, first firmware is stored in the first firmware memory, and second firmware is stored in the second firmware memory. Second firmware is stored in the second firmware memory, and the first firmware is the same as the second firmware; the random number generator is used for generating random numbers; the peripheral controller is respectively connected with the first firmware memory, the second firmware memory and the random number generator, and is used for respectively reading the first firmware, the second firmware and the random number when a startup instruction input by a startup key unit is detected; and performing data consistency verification on the first firmware and the second firmware based on the random number, and when the verification succeeds, opening the computer processor to execute a firmware loading step.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a firmware loading method, and in particular to a computer firmware security loading system and computer equipment. Background Art

[0002] Firmware refers to the device "driver" stored inside the device. Through firmware, the operating system can implement the operation of a specific machine according to the standard device driver. For example, optical drives and burners all have internal firmware. In hardware devices, firmware is the soul of the hardware device and determines the function and performance of the hardware device. For notebook computers, its firmware is stored in the single-chip firmware memory. When the computer starts, the firmware is directly loaded from the single-chip firmware memory and the firmware startup operation is executed.

[0003] As computer systems become more and more complex, the functions and program volume of the firmware itself are increasing, and various logic and program definitions are distributed in the firmware program. Once a problem occurs in the firmware program, it will cause computer system failure or security problems.

[0004] At present, there are some solutions to verify the firmware before loading the computer firmware, such as CN114741091A and CN117972731A, but they are basically aimed at the integrity verification of the firmware file itself, and verify whether the file is correct and complete and available by comparing specific fields in the firmware file. This means that once a third party obtains this comparison rule, it can implant a virus or Trojan in the firmware according to the rule, so that the firmware after the virus or Trojan is implanted still meets the preset comparison rules. Before the computer loads the firmware again, it will be verified as a trusted firmware, which will cause the computer to malfunction or have security problems after loading the firmware.

[0005] In order to solve the above problems, people have been seeking an ideal technical solution. Summary of the invention

[0006] The purpose of the present invention is to provide a computer firmware secure loading system and a computer device in view of the deficiencies in the prior art.

[0007] In order to achieve the above object, the technical solution adopted by the present invention is: A first aspect provides a computer firmware secure loading system, comprising: a first firmware memory and a second firmware memory, wherein the first firmware memory and the second firmware memory are memories of different types, the first firmware memory stores a first firmware, the second firmware memory stores a second firmware, wherein the first firmware and the second firmware are the same; A first random number generator, used to generate a first random number; The peripheral controller is connected to the first firmware memory, the second firmware memory and the random number generator respectively, and is used to read the first firmware, the second firmware and the first random number respectively when a power-on instruction input by a power-on button unit is detected; based on the first random number, the first firmware and the second firmware are checked for data consistency, and when the check is successful, the computer processor is turned on to execute the firmware loading step.

[0008] Furthermore, when the first firmware memory stores the first firmware, the received first firmware is divided into N1 segments according to a preset segmentation rule, and a CRC checksum of the first firmware is added as the N1+1th segment character; When the second firmware memory stores the second firmware, the received second firmware is divided into N2 segments according to a preset segmentation rule, and a CRC check code of the second firmware is added as the N2+1th segment character; When the peripheral controller detects the power-on command input by the power-on button unit, it obtains the number N1 of the character segments of the first firmware and the number N2 of the character segments of the second firmware, and compares whether N1 and N2 are consistent. If they are consistent, N1 or N2 is sent to the first random number generator as the target number of bits, so that the first random number generator can generate a first random number of the target number of bits.

[0009] Further, the peripheral controller includes a first firmware comparison module and a second firmware comparison module; The first firmware comparison module performs consistency check on the first firmware and the second firmware; The second firmware comparison module is used to generate a third firmware based on the first random number, the first firmware and the second firmware after the first firmware and the second firmware pass the consistency check, verify the security of the third firmware, and after the security check of the third firmware passes, turn on the computer processor and send the third firmware to the computer processor.

[0010] Furthermore, the second firmware comparison module generates a third firmware based on the first random number, the first firmware and the second firmware, and verifies the security of the third firmware, including: Traverse each bit of the first random number from high to low, and read the corresponding character segment in the first firmware or the second firmware respectively according to the parity of each bit of data to form a third firmware; wherein, when the value of the i-th bit of data is an odd number, read the i-th segment of characters in the first firmware; when the value of the i-th bit of data is an even number, read the i-th segment of characters in the second firmware; The CRC check code of the third firmware is calculated and compared with the CRC check code of the first firmware or the CRC check code of the second firmware. If they are consistent, it is determined that the security check of the third firmware has passed, otherwise it is determined that it has failed.

[0011] Furthermore, when it is determined that the test fails, the second firmware comparison module accumulates the number of failures and determines whether the accumulated number of failures is less than the preset number of failures. When the accumulated number of failures is less than the preset number of failures, a new first random number is obtained again from the generation of the first random number, and a third firmware is generated again based on the new first random number, the first firmware and the second firmware, and the security of the third firmware is verified; when the accumulated number of failures is equal to the preset number of failures, the verification process is exited.

[0012] Furthermore, the first firmware comparison module performs consistency check on the first firmware and the second firmware, including: Extracting N1+1 segments of characters from the first firmware, and extracting N1+1 segments of characters from the second firmware; Compare the N1+1 segment characters of the first firmware and the N1+1 segment characters of the second firmware to see if they are consistent. If they are consistent, it is determined that the consistency check has passed.

[0013] Furthermore, after the first firmware memory divides the received first firmware into N1 segments according to a preset segmentation rule, a special character is pre-embedded in the last digit of each character segment according to a character adding rule; After the second firmware memory divides the received second firmware into N2 segments according to the preset segmentation rule, a special character is pre-embedded in the last digit of each character segment according to the character adding rule; The first firmware comparison module randomly selects at least one special character after the consistency check of the N1+1 segment characters of the first firmware and the N1+1 segment characters of the second firmware passes, and verifies the consistency of the special character by comparison; after the consistency check of the special character passes, it is determined that the check passes; The special character is a special character value obtained by performing a specific operation on all data in the character segment, and may also be a special character defined by a user.

[0014] Furthermore, the peripheral controller also includes a second random number generator and a random selector; The second random number generator is connected to the peripheral controller and generates a second random number according to the upper limit of the random number input by the peripheral controller; wherein the upper limit of the random number is the target number of bits sent by the peripheral controller to the first random number generator; The random selector is connected to the second random number generator, obtains a random number array based on the second random number generated by the second random number generator and the random number upper limit, and sends the random number array to the peripheral controller so that the peripheral controller obtains special characters of corresponding order from the first firmware memory and the second firmware memory according to the random number array for consistency verification.

[0015] Furthermore, it also includes a status indication unit, which is connected to the peripheral controller and is used to notify the user of firmware comparison abnormality when the verification fails.

[0016] A second aspect provides a computer device, comprising: A computer firmware secure loading system provided by the first aspect; It also includes a computer processor, which is used to load the startup firmware sent by the computer firmware security loading system when it is turned on.

[0017] The present invention has outstanding substantive features and significant progress compared to the prior art. Specifically, the present invention increases the difficulty of firmware modification by setting different types of memories to store startup firmware, thereby establishing the first security barrier for computer processors.

[0018] Before loading the firmware on the computer, the peripheral controller is used to verify the data. Since the peripheral controller only exists inside the device board and there is no direct bus to communicate data with the external network of the device, this also increases the difficulty of modifying the firmware data and establishes a second security barrier for the computer processor.

[0019] Furthermore, the peripheral controller uses the random number generated by the random number generator to verify the startup firmware stored in the two firmware memories. Only after the verification is passed can it be loaded into the computer processor, thereby verifying abnormal firmware and preventing the abnormal firmware from being directly loaded into the computer processor and directly affecting the computer processor body. That is, a third protection barrier is established before the abnormal firmware is loaded, which effectively improves computer system failures or security issues caused by firmware loading.

[0020] Specifically, the peripheral controller first performs a consistency judgment on the CRC check codes of the first firmware and the second firmware, and when the consistency judgment is passed, further generates a third firmware based on the first random number, the first firmware and the second firmware, and verifies the consistency of the CRC check code of the third firmware and the first firmware or the second firmware, thereby preventing the existence of viruses and Trojans, but the firmware with viruses and Trojans is consistent with the CRC check code of the real firmware, resulting in it not being detected by the first step of consistency. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 It is a schematic diagram of the framework of the computer firmware secure loading system described in Example 1 of the present invention.

[0022] Figure 2 It is a flow chart of the peripheral processor of the present invention.

[0023] Figure 3 It is a schematic diagram of the structure of the firmware data described in Example 2 of the present invention.

[0024] Figure 4 It is a flow chart of the peripheral controller described in Example 3 of the present invention.

[0025] Figure 5 It is a flowchart of the second firmware comparison module in Example 3 of the present invention.

[0026] Figure 6 It is a schematic diagram of the structure of the firmware data described in Example 4 of the present invention.

[0027] Figure 7 It is a flowchart of a new embodiment of performing consistency check on the first firmware according to Embodiment 4 of the present invention.

[0028] Figure 8 It is a schematic diagram of a framework of the computer device of the present invention. DETAILED DESCRIPTION

[0029] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] Example 1 This embodiment 1 provides a computer firmware secure loading system, such as Figure 1 Shown, including A first firmware memory and a second firmware memory, wherein the first firmware memory and the second firmware memory are memories of different types, the first firmware memory stores a first firmware, the second firmware memory stores a second firmware, wherein the first firmware and the second firmware are the same.

[0031] In one embodiment, the first firmware memory and the second firmware memory are both non-volatile memories, such as hard disk drives, peripheral hard disks, optical disks, flash drives, and electronic memories, wherein the electronic memories include erasable programmable read-only memories (EPROM), erasable programmable read-only memories (EEPROM), and flash memories (Flash), and these non-volatile memories all provide the ability to maintain stored data when power is off.

[0032] This embodiment is described by taking the first firmware memory being an EEPEOM medium firmware memory of an I2C bus and the second firmware memory being a FLASH medium firmware memory of an SPI bus as an example: Since EEPROM media storage and FLASH media storage are different types of storage, their read and write operation steps are different. If you want to modify the data on the two firmware storages through viruses or Trojans, you need to first detect the storage type and bus structure before you can modify the storage data on the two types of storages one by one to the same data with the virus.

[0033] Therefore, compared with existing computers that generally use a single-chip firmware memory to directly load the startup firmware when powered on, which may cause data errors and easily lead to failures, this embodiment increases the difficulty of firmware modification by providing different types of memory, thereby establishing the first safety barrier for the computer processor.

[0034] The first random number generator is used to generate a first random number.

[0035] There are many ways to generate random numbers: true random number generators, pseudo-random number generators, quantum random number generators, and hash functions.

[0036] A true random number generator is a random number generator based on physical processes. It uses the randomness of physical processes to generate random numbers. For example, physical processes such as radioactive decay, thermal noise, and photon counting can be used to generate random numbers. Its advantage is that the generated random number sequence is truly random and unpredictable, so it is suitable for occasions with high security requirements. The disadvantage is that it is slow and difficult to implement.

[0037] A pseudo-random number generator is a random number generator based on a deterministic algorithm. It generates a series of seemingly random numbers through an initial seed. Its advantages are fast speed and easy implementation. Its disadvantage is that the generated random number sequence is predictable, so it is not suitable for occasions with high security requirements.

[0038] A quantum random number generator is a random number generator based on quantum mechanics. It uses the randomness of quantum mechanics to generate random numbers. For example, the randomness of a single photon can be used to generate random numbers. Its advantages are that the generated random numbers are truly random numbers, unpredictable, more random, and fast to generate, which is suitable for occasions with high security requirements. The disadvantages are: few random numbers are generated, difficult to implement, and the output needs to be verified.

[0039] A hash function is a function that maps input data of any length to an output of a fixed length. If the input data is random, then the output should also be random. Therefore, hash functions can be used to generate random numbers. The advantages of hash functions are fast speed and easy implementation, and the disadvantage is that the generated random number sequence may have a certain correlation.

[0040] Therefore, when using, you can choose according to the level of demand. It is understandable that when the security level is high, you can also use multiple random number generators, splice the random numbers generated by the multiple random number generators according to the set rules, and use the spliced ​​random numbers to participate in subsequent verification.

[0041] The peripheral controller is connected to the first firmware memory, the second firmware memory and the first random number generator respectively.

[0042] A peripheral controller refers to a controller that manages computer power on and off, battery charging and discharging, scanning keyboard keys, processing touchpad data, and controlling fan speed in real time. Specifically, it is a super input / output controller (SuperIO) in desktop computers and an embedded controller (EC) in laptops and embedded systems.

[0043] Among them, SuperIO is generally located at the lower left or upper left of the motherboard, and communicates with the South Bridge through the LPC (low pin count) bus. It is itself an MCU that can independently control input and output devices.

[0044] An embedded controller is an embedded main control chip that is connected to the LPC (Low Pin Count) bus of the CPU and is mainly used in mobile computer systems and embedded computer systems.

[0045] Generally speaking, peripheral controllers only exist inside the device board, and there is no direct bus to communicate data with the network outside the device, so this also increases the difficulty of modifying firmware data and establishes the first security barrier for the computer processor.

[0046] like Figure 2 As shown, the peripheral controller is used to read the first firmware, the second firmware and the random number respectively when detecting the power-on command input by the power-on button unit; perform data consistency check on the first firmware and the second firmware based on the first random number, and when the check is successful, turn on the computer processor to execute the firmware loading step.

[0047] Principle of this embodiment: Before the computer processor loads the startup firmware, the peripheral controller establishes a second security barrier for the computer processor through data verification; specifically, the peripheral controller performs data consistency verification on the first firmware and the second firmware based on the first random number. If the consistency verification passes, it means that the startup firmware contents stored in the two firmware memories have not been modified. If they are different, it means that external or internal factors have caused the abnormality of the startup firmware content on at least one firmware memory. Once it is loaded into the computer processor, it may cause the computer processor to be abnormal or infected with a virus, thereby preventing the contents on the two firmware memories from being loaded into the computer processor.

[0048] Specifically, the existing CRC verification method can be used to verify whether the boot firmware in the first firmware memory and the second firmware memory is successful. The sending end calculates a verification code for the boot firmware according to a certain algorithm, and the obtained verification code is attached to the back of the boot firmware data frame and sent to the first firmware memory and the second firmware memory. The first firmware memory and the second firmware memory respectively verify the received boot firmware and the verification code according to the same algorithm to determine whether the received boot firmware data is correct and complete.

[0049] It is understandable that other methods may be used to verify whether the boot firmware in the first firmware memory and the second firmware memory is successful, such as MD5 verification or DES verification, which will not be described in detail here.

[0050] Furthermore, it also includes a status indication unit, which is connected to the peripheral controller and is used to indicate and notify the user that the firmware comparison is abnormal and cannot be started normally when the verification code is inconsistent.

[0051] Example 2 This embodiment provides an embodiment in which a first firmware, a second firmware, and the first random number generator generate random numbers.

[0052] This embodiment is described by taking the first firmware memory being an EEPEOM medium firmware memory of an I2C bus and the second firmware memory being a FLASH medium firmware memory of an SPI bus as an example: When the first firmware memory stores the first firmware, the received first firmware is divided into N1 segments according to a preset segmentation rule, and a CRC check code of the first firmware is added as the N1+1th segment character.

[0053] When the second firmware memory stores the second firmware, the received second firmware is divided into N2 segments according to a preset segmentation rule, and a CRC check code of the second firmware is added as the N2+1th segment character; For details, please refer to the structure diagram of firmware data. Figure 3 shown.

[0054] When the peripheral controller detects the power-on command input by the power-on button unit, it obtains the number N1 of the character segments of the first firmware and the number N2 of the character segments of the second firmware, and compares whether N1 and N2 are consistent. If they are consistent, N1 or N2 is sent to the first random number generator as the target number of bits, so that the first random number generator can generate a first random number of the target number of bits.

[0055] Through the above method, the situation where the firmware bit number changes due to the first firmware or the second firmware being implanted with a virus or a Trojan horse can be detected. In this case, the first random number will not be generated, and therefore no subsequent verification will be performed. Instead, the status indication unit will be directly used to provide an abnormal prompt.

[0056] Example 3 This embodiment provides a specific working principle of the peripheral controller. Figure 4 As shown, the peripheral controller includes a first firmware comparison module and a second firmware comparison module; The peripheral controller includes a first firmware comparison module and a second firmware comparison module; The first firmware comparison module performs consistency check on the first firmware and the second firmware; The second firmware comparison module is used to generate a third firmware based on the first random number, the first firmware and the second firmware after the first firmware and the second firmware pass the consistency check, verify the security of the third firmware, and after the security check of the third firmware passes, turn on the computer processor and send the third firmware to the computer processor.

[0057] The first firmware comparison module performs consistency check on the first firmware and the second firmware, including: Extracting N1+1 segments of characters from the first firmware, and extracting N1+1 segments of characters from the second firmware; Compare the N1+1 segment characters of the first firmware and the N1+1 segment characters of the second firmware to see if they are consistent. If they are consistent, it is determined that the consistency check has passed.

[0058] Specifically, the N1+1 segment of characters of the first firmware is the CRC check code of the first firmware, and the N1+1 segment of characters of the second firmware is the CRC check code of the second firmware. When the CRC check code of the first firmware is consistent with the CRC check code of the second firmware, it is determined that the first firmware and the second firmware are also consistent.

[0059] Specifically, the second firmware comparison module generates a third firmware based on the first random number, the first firmware and the second firmware, and verifies the security of the third firmware, such as Figure 5 As shown, including: Traverse each bit of the first random number from high to low, and read the corresponding character segment in the first firmware or the second firmware respectively according to the parity of each bit of data to form a third firmware; wherein, when the value of the i-th bit of data is an odd number, read the i-th segment of characters in the first firmware; when the value of the i-th bit of data is an even number, read the i-th segment of characters in the second firmware; The CRC check code of the third firmware is calculated and compared with the CRC check code of the first firmware or the CRC check code of the second firmware. If they are consistent, it is determined that the security check of the third firmware has passed, otherwise it is determined that it has failed.

[0060] For example, the first random number is 64 bits, among which the values ​​of the 2nd, 7th, 9th, 10th, 22nd, 35th, and 60th bits are odd numbers. When reading, the 2nd, 7th, 9th, 10th, 22nd, 35th, and 60th characters in the first firmware are read, and the rest are read from the characters in the second firmware to form a third firmware.

[0061] The reason for generating the third firmware and sending the third firmware to the computer controller is, on the one hand, to prevent the first firmware and / or the second firmware from being implanted with a Trojan virus. However, due to compliance with the CRC check rule, the CRC check is not checked out, and because special characters are not necessarily all checked, when the problematic special characters are not drawn for comparison, the firmware implanted with the Trojan virus passes the previous CRC check and the special character check. In this case, the CRC check code of the third firmware formed in the present application will inevitably be inconsistent with the CRC check code of the first firmware or the second firmware, so the firmware implanted with the Trojan virus can be finally prevented from entering the computer processor; on the other hand, even if the first firmware and / or the second firmware is implanted with a Trojan virus, a character segment that does not contain an infected block can be randomly extracted to form a new firmware without a virus. This firmware is loaded and executed by the computer processor and will not cause computer system failures or security issues.

[0062] Furthermore, when it is determined that the third firmware fails the security check, multiple extractions can be performed to ensure that the final third firmware is safe, thereby reducing the problem of the computer failing to load due to the failure of the third firmware to pass the security check.

[0063] Specifically, when it is determined that the security check of the third firmware has failed, the second firmware comparison module accumulates the number of failures and determines whether the accumulated number of failures is less than the preset number of failures. When the accumulated number of failures is less than the preset number of failures, a new first random number is obtained again from the first random number generation, and the third firmware is generated again based on the new first random number, the first firmware and the second firmware, and the security of the third firmware is verified; when the accumulated number of failures is equal to the preset number of failures, the verification process is exited.

[0064] Example 4 This embodiment proposes a new embodiment in which the first firmware comparison module performs consistency check on the first firmware and the second firmware.

[0065] In this embodiment, after the first firmware memory divides the received first firmware into N1 segments according to the preset segmentation rule, a special character is pre-embedded in the last digit of each character segment according to the character adding rule; After the second firmware memory divides the received second firmware into N2 segments according to the preset segmentation rule, a special character is pre-embedded in the last digit of each character segment according to the character adding rule; The first firmware comparison module randomly selects at least one special character after the consistency check of the N1+1 segment characters of the first firmware and the N1+1 segment characters of the second firmware passes, and verifies the consistency of the special character by comparison; after the consistency check of the special character passes, it is determined that the check passes; The special character is a special character value obtained by performing a specific operation on all the data in the character segment. For example, the special character is a CRC checksum obtained by performing a CRC operation on all the data in the character segment. It can also be a special character defined by the user. Figure 6 shown.

[0066] It is understandable that the fewer the number of special characters to be compared, the higher the efficiency, but the lower the accuracy; the more the number of special characters to be compared, the lower the efficiency, but the higher the accuracy. Therefore, during use, the number of special characters to be compared is randomly selected to coordinate the comparison efficiency and accuracy.

[0067] Specifically, in one embodiment, the number of special characters involved in the verification and the specific special characters can be selected by a second random number generator and a random selector. Figure 7 As shown, the specific steps are as follows: The peripheral controller also includes a second random number generator and a random selector; The second random number generator is connected to the peripheral controller and generates a second random number according to the upper limit of the random number input by the peripheral controller; wherein the upper limit of the random number is the target number of bits sent by the peripheral controller to the first random number generator; The random selector is connected to the second random number generator, obtains a random number array based on the second random number generated by the second random number generator and the random number upper limit, and sends the random number array to the peripheral controller so that the first firmware comparison module can obtain special characters of corresponding order from the first firmware memory and the second firmware memory according to the random number array for consistency verification.

[0068] Specifically, assuming that the upper limit of the random number is 64, the code for the second random number generator to generate the second random number is as follows: import random num = random.randint(1,64) print(num) In the above code, the randint function is used to generate a random integer between 1 and 64, and then the print function is used to output it.

[0069] Specifically, assuming that the upper limit of the random number is 64 and the second random number is 10, the code for the random selector to obtain a random number array based on the second random number generated by the second random number generator and the upper limit of the random number is as follows: import random nums = while len(nums) < 10: num = random.randint(1,64) if num not in nums: nums .append(num) for num in nums: print(num).

[0070] In the above code, a while loop is used to continuously generate random integers. When the generated random integer is not in the previously generated random integer, it is added to the list. Finally, a for loop is used to output the elements in the list. The output result is similar to [4,62,25,31,50,8,9,44,22,9].

[0071] It can be understood that the code for the second random number generator to generate the second random number and the code for the random selector to obtain the random number array based on the second random number generated by the second random number generator and the random number upper limit are examples for easy understanding, and the above codes are not necessarily used in practice.

[0072] Furthermore, the firmware comparison module obtains special characters at corresponding positions from the first firmware memory and the second firmware memory according to the random number array, and performs special character comparison.

[0073] For example, still taking the above array [4,62,25,31,50,8,9,44,22,9] as an example, the firmware comparison module obtains the 4th, 62nd, 25th, 31st, 50th, 8th, 9th, 44th, 22nd and 9th special characters in the first firmware at one time, obtains the 4th, 62nd, 25th, 31st, 50th, 8th, 9th, 44th, 22nd and 9th special characters in the second firmware, compares whether the 4th special character in the first firmware is consistent with the 4th special character in the second firmware, and compares whether the 62nd special character in the first firmware is consistent with the 62nd special character in the second firmware.... until the character comparison of all positions is completed. If the character comparison results of all positions are consistent, it is determined that the consistency check of the special characters has passed.

[0074] Of course, the special characters at the corresponding positions of the first firmware and the second firmware can also be extracted and compared in sequence. For example, the 4th special character in the first firmware and the 4th special character in the second firmware are extracted and compared to see if they are consistent. If they are inconsistent, it is determined that the consistency of the special characters has not been verified. If they are consistent, continue to extract and compare the 62nd special character in the first firmware and the 62nd special character in the second firmware to see if they are consistent... until the character comparison at all positions is completed.

[0075] Example 4 This embodiment provides a computer device, such as Figure 8 As shown, including: A computer firmware secure loading system provided by embodiment 1, embodiment 2 or embodiment 3; It also includes a computer processor, which is used to load the startup firmware sent by the computer firmware security loading system when it is turned on.

[0076] This embodiment increases the difficulty of firmware modification by setting different types of memories to store startup firmware, thereby establishing the first security barrier for the computer processor.

[0077] This embodiment uses the peripheral controller to perform data verification before loading the firmware on the computer. Since the peripheral controller only exists inside the device board and there is no direct bus to communicate data with the external network of the device, it also increases the difficulty of modifying the firmware data, thus establishing a second security barrier for the computer processor. Furthermore, in this embodiment, the peripheral controller uses the random number generated by the random number generator to verify the startup firmware stored in the two firmware memories. Only after the verification is passed can it be loaded into the computer processor, thereby verifying abnormal firmware and preventing the abnormal firmware from being directly loaded into the computer processor and directly affecting the computer processor body. That is, a third protection barrier is established before the abnormal firmware is loaded, which effectively improves computer system failures or security issues caused by firmware loading.

[0078] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. A computer firmware secure loading system, characterized in that: include: a first firmware memory and a second firmware memory, wherein the first firmware memory and the second firmware memory are memories of different types, the first firmware memory stores a first firmware, the second firmware memory stores a second firmware, wherein the first firmware and the second firmware are the same; A first random number generator, used to generate a first random number; The peripheral controller is connected to the first firmware memory, the second firmware memory and the first random number generator respectively, and is used to read the first firmware, the second firmware and the first random number respectively when a power-on instruction input by the power-on key unit is detected; A data consistency check is performed on the first firmware and the second firmware based on the first random number, and when the check succeeds, a computer processor is turned on to execute a firmware loading step.

2. A computer firmware secure loading system according to claim 1, characterized in that: When storing the first firmware, the first firmware memory divides the received first firmware into N1 segments according to a preset segmentation rule, and adds a CRC check code of the first firmware as the N1+1th segment character; When the second firmware memory stores the second firmware, the received second firmware is divided into N2 segments according to a preset segmentation rule, and a CRC check code of the second firmware is added as the N2+1th segment character; When the peripheral controller detects the power-on command input by the power-on button unit, it obtains the number N1 of the character segments of the first firmware and the number N2 of the character segments of the second firmware, and compares whether N1 and N2 are consistent. If they are consistent, N1 or N2 is sent to the first random number generator as the target number of bits, so that the first random number generator can generate a first random number of the target number of bits.

3. A computer firmware secure loading system according to claim 2, characterized in that: The peripheral controller includes a first firmware comparison module and a second firmware comparison module; The first firmware comparison module performs consistency check on the first firmware and the second firmware; The second firmware comparison module is used to generate a third firmware based on the first random number, the first firmware and the second firmware after the first firmware and the second firmware pass the consistency check, verify the security of the third firmware, and after the security check of the third firmware passes, turn on the computer processor and send the third firmware to the computer processor.

4. A computer firmware secure loading system according to claim 3, characterized in that: The second firmware comparison module generates a third firmware based on the first random number, the first firmware and the second firmware, and verifies the security of the third firmware, including: Traverse each bit of the first random number from high to low, and read the corresponding character segment in the first firmware or the second firmware respectively according to the parity of each bit of data to form a third firmware; wherein, when the value of the i-th bit of data is an odd number, read the i-th segment of characters in the first firmware; when the value of the i-th bit of data is an even number, read the i-th segment of characters in the second firmware; The CRC check code of the third firmware is calculated and compared with the CRC check code of the first firmware or the CRC check code of the second firmware. If they are consistent, it is determined that the security check of the third firmware has passed, otherwise it is determined that it has failed.

5. A computer firmware secure loading system according to claim 4, characterized in that: When it is determined that the test fails, the second firmware comparison module accumulates the number of failures and determines whether the accumulated number of failures is less than the preset number of failures. When the accumulated number of failures is less than the preset number of failures, a new first random number is obtained again from the generation of the first random number, and a third firmware is generated again based on the new first random number, the first firmware and the second firmware, and the security of the third firmware is verified; when the accumulated number of failures is equal to the preset number of failures, the verification process is exited.

6. A computer firmware secure loading system according to claim 3, characterized in that: The first firmware comparison module performs consistency check on the first firmware and the second firmware, including: Extracting N1+1 segments of characters from the first firmware, and extracting N1+1 segments of characters from the second firmware; Compare the N1+1 segment characters of the first firmware and the N1+1 segment characters of the second firmware to see if they are consistent. If they are consistent, it is determined that the consistency check has passed.

7. A computer firmware secure loading system according to claim 6, characterized in that: After the first firmware memory divides the received first firmware into N1 segments according to the preset segmentation rule, a special character is pre-embedded in the last digit of each character segment according to the character adding rule; After the second firmware memory divides the received second firmware into N2 segments according to the preset segmentation rule, a special character is pre-embedded in the last digit of each character segment according to the character adding rule; The first firmware comparison module randomly selects at least one special character after the consistency check of the N1+1 segment characters of the first firmware and the N1+1 segment characters of the second firmware passes, and verifies the consistency of the special character by comparison; after the consistency check of the special character passes, it is determined that the consistency check of the first firmware and the second firmware passes; The special character is a special character value obtained by performing a specific operation on all data in the character segment, and may also be a special character defined by a user.

8. A computer firmware secure loading system according to claim 7, characterized in that: The peripheral controller also includes a second random number generator and a random selector; The second random number generator is connected to the peripheral controller and generates a second random number according to the upper limit of the random number input by the peripheral controller; wherein the upper limit of the random number is the target number of bits sent by the peripheral controller to the first random number generator; The random selector is connected to the second random number generator, obtains a random number array based on the second random number generated by the second random number generator and the random number upper limit, and sends the random number array to the peripheral controller so that the first firmware comparison module can obtain special characters of corresponding order from the first firmware memory and the second firmware memory according to the random number array for consistency verification.

9. A computer firmware secure loading system according to claim 1, characterized in that: It also includes a status indication unit, which is connected to the peripheral controller and is used to notify the user of firmware comparison abnormality when the verification fails.

10. A computer device, characterized in that: include: A computer firmware secure loading system as described in claims 1-9; It also includes a computer processor, which is used to load the startup firmware sent by the computer firmware security loading system when it is turned on.

Citation Information

Patent Citations

  • Firmware loading method and device, electronic equipment and computer readable storage medium

    CN114741091A

  • Firmware loading method, firmware starting method, embedded device and storage medium

    CN117972731A