System based on hybrid algorithm protection, protection method, BIOS (Basic Input / Output System) and computer
By adopting a hybrid algorithm protection mechanism in the system, multi-level encryption signature protection and lightweight verification of core code and non-core code respectively, the problem of insufficient system code protection in the existing technology is solved, and efficient security and performance balance is achieved.
Patent Information
- Application Number
- CN202510408317.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2045-04-02
AI Technical Summary
The prior art has shortcomings in protecting the integrity and credibility of system code, which cannot effectively prevent the code from being tampered with or damaged during storage and operation, and digital signatures and hash verification have problems such as computational complexity and insufficient attack resistance.
A system based on hybrid algorithm protection is adopted, and different levels of encryption signature algorithms and verification mechanisms are adopted for core code and non-core code respectively. The core code uses collision-resistant encryption signature algorithms, RSA digital signatures and symmetric encryption algorithms to form a multi-level protection mechanism, while the non-core code uses lightweight encryption signature algorithms such as CRC-32 or FNV-1, and uses frequency dynamic selection algorithms based on the code to reduce computational complexity and improve efficiency.
Effectively prevent core code from being tampered with or replaced during storage and loading, significantly enhancing the security of the system; by reducing the complexity of signature verification calculation of non-core codes, improving system performance and efficiency, it is suitable for starting time-sensitive systems; while ensuring system security, it takes into account both system performance and achieves a balance between security and performance.
Smart Images

Figure CN119918081A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer science and technology, and in particular to a system, a protection method, a BIOS and a computer based on hybrid algorithm protection. Background Art
[0002] In modern computer systems, the integrity of system code is an important part of ensuring system security. With the rapid development of computer technology and the diversification of application scenarios, the attacks faced by the system are becoming increasingly complex and diverse, especially the attack methods against low-level systems such as BIOS (Basic Input / Output System) and firmware are constantly evolving. If an attacker successfully tampers with the system code, it will not only cause the system to run abnormally, but may even be used as an entry point for spreading malware, stealing data, or conducting deeper attacks.
[0003] Especially on the X86 platform, the security of system startup directly depends on the integrity of the BIOS code. As the interface between the system and the hardware, the core function of BIOS is to complete the system hardware initialization and boot the operating system. If the BIOS code is tampered with, the attacker can insert malicious code into the startup chain, which not only endangers the security of the operating system, but also may cause the entire system to fall into uncontrollable risks.
[0004] To ensure the integrity and security of system codes, existing technologies mainly use the following methods to encrypt system codes: (1) Symmetric encryption (such as AES): protects the confidentiality of the code, but cannot prevent the code from being tampered with; (2) Digital signature (such as RSA): verifies the source and integrity of the code, but the signature and verification process is computationally complex and may affect system performance; (3) Hash check (such as SHA-256): generates a code digest for integrity verification, but using a hash algorithm alone has the risk of replacing the legitimate hash value or suffering from a hash collision attack.
[0005] Although there are a variety of system code encryption and protection methods listed above, the existing technology still has some problems and limitations in protecting system code. First, the existing encryption technology is mainly used to protect the confidentiality of the code, but the use of encryption technology alone cannot effectively prevent the code from being tampered with or damaged during storage and operation. Secondly, although the existing digital signature technology can verify the source and integrity of the code, its signature and verification process involves complex calculations, which may affect the performance of the system in systems with limited resources or high performance requirements. In addition, although the existing hash function can generate a fixed-length message digest of the code, it is insufficient to rely solely on the hash function for verification. Attackers may replace legitimate hash values or use hash collision attacks, causing the integrity and credibility of the code to be threatened. Therefore, the existing technology still has certain shortcomings in protecting the integrity and credibility of the system code.
[0006] The disclosure of the above background technology content is only used to assist in understanding the inventive concept and technical solution of the present invention. It does not necessarily belong to the prior art of the present application, nor does it necessarily provide technical guidance. In the absence of clear evidence that the above content has been disclosed before the filing date of the present application, the above background technology should not be used to evaluate the novelty and creativity of the present application. Summary of the invention
[0007] The purpose of the present invention is to provide a system, a protection method, a BIOS and a computer based on hybrid algorithm protection, which can improve the security of the system.
[0008] To achieve the above object, the technical solution adopted by the present invention is as follows: A system based on hybrid algorithm protection includes a core code module, wherein the core code module is configured to store and / or load the core code of the system, the core code is the code with relatively high security requirements in the system, and for some systems with high security requirements, it can be determined that all of their codes are the core code; The core code is protected by adopting a first protection strategy, wherein the first protection strategy includes: Calculating the encrypted signature value of the core code using a first encrypted signature algorithm to obtain an original first encrypted signature value; Digitally signing the original first encrypted signature value using an RSA private key to generate original signature data; Encrypting the original signature data using a first symmetric encryption algorithm to generate an encrypted original verification code; The original first encrypted signature value and the original verification code are stored in a first storage area, where the first storage area is a secure storage area.
[0009] Further, any one of the above-mentioned technical solutions or a combination of multiple technical solutions further comprises a dynamic loading module, wherein the dynamic loading module is configured to store and / or load non-core code of the system, wherein the security level of the non-core code is lower than the security level of the core code; The non-core code is protected by a second protection strategy, wherein the second protection strategy includes: A second encryption signature algorithm is used to calculate the encryption signature value of the non-core code to obtain an original second encryption signature value. The first encryption signature algorithm and the second encryption signature algorithm preferably both use a hash algorithm based on a hash function. The first encryption signature algorithm has stronger anti-collision property than the second encryption signature algorithm. The anti-collision property of a hash algorithm refers to the difficulty of finding two different input data such that the hash values generated by the hash function are the same. The second encryption signature algorithm is a lightweight encryption algorithm, and its computational efficiency is higher than that of the first encryption signature algorithm. The original second encrypted signature value is stored in a second storage area, and the security level of the first storage area is higher than the security level of the second storage area.
[0010] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the second protection strategy also includes: Dividing the non-core code into a plurality of continuous sub-codes; For each segment of the sub-code, a second encryption signature algorithm is used to calculate the encryption signature value of the sub-code to obtain a sub-original encryption signature value; The sub-original encrypted signature value is stored in a second storage area.
[0011] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the second protection strategy also includes: for two adjacent segments of the sub-code, using two different second encryption signature algorithms to calculate the encryption signature value of the sub-code.
[0012] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, if the usage frequency of the non-core code is not less than a preset first frequency value, the second encryption signature algorithm adopts the FNV-1 algorithm; If the usage frequency of the non-core code is lower than a preset first frequency value, the second encryption signature algorithm adopts the CRC-32 algorithm.
[0013] Further, based on any one of the technical solutions or a combination of multiple technical solutions mentioned above, the second encryption signature algorithm includes a CRC-32 algorithm and a FNV-1 algorithm.
[0014] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the second protection strategy also includes verifying the security of the non-core code in the following manner: Each time the non-core code is loaded or periodically, the encrypted signature value of the non-core code is recalculated using the second encrypted signature algorithm to obtain a current second encrypted signature value; The consistency of the current second encrypted signature value and the original second encrypted signature value is verified. If they are consistent, it is determined that the non-core code is safe; if they are inconsistent, it is determined that the non-core code is unsafe.
[0015] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the second storage area includes RAM, flash memory, HDD and SSD; and / or, The dynamic loading module includes multiple sub-modules, each sub-module is configured to store and / or load different non-core codes, and the second encryption signature algorithm correspondingly adopted by each sub-module is the same or different.
[0016] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the first protection strategy also includes verifying the security of the core code in the following manner: Decrypting the original verification code using the first symmetric encryption algorithm to obtain decrypted signature data; Calculating the encrypted signature value of the current core code using the first encrypted signature algorithm to obtain a current first encrypted signature value; The decrypted signature data is verified using the RSA public key, and the consistency between the current first encrypted signature value and the original first encrypted signature value is verified. If both verifications pass, the current core code is determined to be safe; otherwise, the current core code is determined to be unsafe.
[0017] Further, based on any one of the above technical solutions or a combination of multiple technical solutions, the first storage area includes ROM, HSM and TPM chip; and / or, The first encryption signature algorithm includes SHA-256 algorithm, SHA-3 algorithm, SM3 algorithm and BLAKE2 algorithm; and / or, The first symmetric encryption algorithm includes AES-256 algorithm, SM4-128 algorithm, Camellia-256 algorithm, and Serpent-256 algorithm.
[0018] According to another aspect of the present invention, the present invention provides a system code protection method based on a hybrid algorithm, comprising the following steps: Determining a core code in the system code and protecting the core code using a first protection strategy includes: Calculating the encrypted signature value of the core code using a first encrypted signature algorithm to obtain an original first encrypted signature value; Digitally signing the original first encrypted signature value using an RSA private key to generate original signature data; Encrypting the original signature data using a first symmetric encryption algorithm to generate an encrypted original verification code; The original verification code is stored in a first storage area, which is a secure storage area.
[0019] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the system code protection method based on the hybrid algorithm further includes the following steps: Determining non-core code in the system code, the security level of the core code is higher than the security level of the non-core code, and using a second protection strategy to protect the non-core code, including: Using a second encryption signature algorithm to calculate the encryption signature value of the non-core code to obtain an original second encryption signature value, wherein the first encryption signature algorithm has stronger collision resistance than the second encryption signature algorithm; The original second encrypted signature value is stored in a second storage area, and the security level of the first storage area is higher than the security level of the second storage area.
[0020] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the second protection strategy also includes verifying the security of the non-core code in the following manner: Each time the non-core code is loaded, the second encryption signature algorithm is used to calculate the encryption signature value of the non-core code to obtain a second encryption signature value; The consistency between the second encrypted signature value and the original second encrypted signature value is verified. If they are consistent, it is determined that the non-core code is safe; if they are inconsistent, it is determined that the non-core code is unsafe.
[0021] Further, based on any one of the above-mentioned technical solutions or a combination of multiple technical solutions, the first protection strategy also includes verifying the security of the core code in the following manner: Decrypting the original verification code using the first symmetric encryption algorithm to obtain decrypted signature data; Calculating the encrypted signature value of the current core code using the first encrypted signature algorithm to obtain a current first encrypted signature value; The decrypted signature data is verified using the RSA public key, and the consistency between the current first encrypted signature value and the original first encrypted signature value is verified. If both verifications pass, the current core code is determined to be safe; otherwise, the current core code is determined to be unsafe.
[0022] According to another aspect of the present invention, a BIOS is provided, which is configured as a system based on hybrid algorithm protection based on any one of the above technical solutions or a combination of multiple technical solutions.
[0023] According to another aspect of the present invention, a computer is provided, comprising a system based on hybrid algorithm protection as described in any one of the above technical solutions or a combination of multiple technical solutions.
[0024] The beneficial effects brought by the technical solution provided by the present invention are as follows: a. The system based on hybrid algorithm protection provided by the present invention adopts the first encryption signature algorithm with strong anti-collision performance to calculate the encryption signature value of the core code of the system, and combines the RSA digital signature and the first symmetric encryption algorithm to form a multi-level protection mechanism for the core code, which can enhance the anti-collision capability of the encryption signature verification, effectively prevent the encryption signature collision attack or the threat of replacing the legitimate encryption signature value, thereby preventing the core code from being tampered with or replaced during the storage and loading process, and significantly enhancing the security of the system; b. The present invention divides the system code into core code and non-core code, adopts a second encryption signature algorithm with lower computational complexity for the non-core code, and dynamically selects a suitable second encryption signature algorithm according to the frequency of code use, thereby reducing the computational complexity of the signature verification process for the non-core code and the computational overhead of the verification process, and is particularly suitable for systems with sensitive startup time; c. The present invention uses different second encryption signature algorithms for multiple sub-codes of non-core codes, and uses different lightweight encryption algorithms to encrypt adjacent sub-codes, thereby ensuring system efficiency while further improving the overall security of the system, and even if some non-core codes are attacked, the diffusion range and diffusion speed of the attacked objects can be reduced; d. The present invention divides core code and non-core code and adopts protection strategies of different security levels for different codes, thereby ensuring system security while taking into account system performance. In particular, a lightweight verification mechanism is adopted for non-core codes with high usage frequency, thereby improving the overall efficiency of the system and achieving a balance between system security and performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0026] Figure 1 A flowchart of an encryption protection process for core code provided for an exemplary embodiment of the present invention; Figure 2 A flowchart of a verification process for a core code provided for an exemplary embodiment of the present invention; Figure 3 A schematic diagram of the partitioning of the system code provided for an exemplary embodiment of the present invention; Figure 4 A flowchart of an encryption protection process for non-core code provided for an exemplary embodiment of the present invention; Figure 5 A flowchart of a non-core code encryption protection process based on usage frequency provided for an exemplary embodiment of the present invention; Figure 6 A flowchart of a non-core code encryption protection process that takes into account both lightweight and high security provided by an exemplary embodiment of the present invention; Figure 7 A flowchart of a verification process for non-core codes is provided for an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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 should fall within the scope of protection of the present invention.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0029] In one embodiment of the present invention, a system based on hybrid algorithm protection is provided, which includes a core code module, wherein the core code module is configured to store and / or load the core code of the system; See also Figure 1 , using a first protection strategy to protect the core code, the first protection strategy comprising: Calculating the encrypted signature value of the core code using a first encrypted signature algorithm to obtain an original first encrypted signature value; Digitally signing the original first encrypted signature value using an RSA private key to generate original signature data; Encrypting the original signature data using a first symmetric encryption algorithm to generate an encrypted original verification code; The original first encrypted signature value and the original verification code are stored in a first storage area, where the first storage area is a secure storage area.
[0030] The first encryption signature algorithm is a strong anti-collision encryption signature algorithm, such as SHA-256, SHA-3, SM3, BLAKE2, etc. Preferably, the first encryption signature algorithm uses SHA-256, and SHA-256 is used to calculate the encryption signature value of the core code to generate a unique code summary set, namely the original first encryption signature value.
[0031] SHA-256 is currently recognized as a highly collision-resistant encryption signature algorithm that can effectively prevent the code from being maliciously tampered with, because the encryption signature value it generates is unique, and the probability of collision (that is, two different inputs produce the same encryption signature value) is extremely low. Using SHA-256 to calculate the encryption signature value of the core code generates a unique code digest, so that the core code can be verified in subsequent steps. If the core code is tampered with in any way, its encryption signature value will change, which is easy to detect.
[0032] RSA is an asymmetric encryption algorithm that uses a public-private key pair for encryption and decryption. The private key is used to generate a signature, and the public key is used to verify the authenticity of the signature. Select the RSA private key to digitally sign the original signature data to generate a digital signature data, namely the original signature data. The integrity and source of the core code can be verified through the original signature data. During the verification process, the signature data is decrypted using the public key to confirm that the code has not been tampered with and is indeed signed by the legitimate private key holder, thereby ensuring that the code has not been tampered with by a third party.
[0033] The first symmetric encryption algorithm adopts a high-security algorithm such as AES-256, SM4-128, Camellia-256, Serpent-256, etc. Preferably, AES-256 is used to encrypt the original signature data to generate the original verification code.
[0034] AES (Advanced Encryption Standard) is a symmetric encryption algorithm in which a 256-bit key provides extremely high encryption strength. Using the AES-256 encryption algorithm to encrypt the original signature data can prevent the encrypted signature data from being accessed or tampered with by unauthorized third parties. The encrypted signature data, i.e. the original checksum, can provide higher security when stored. Even if an attacker obtains the stored content, he cannot directly use or modify the signature.
[0035] Specifically, the original first encrypted signature value and the original verification code are stored in a secure storage area. In the computer field, the secure storage area refers to a storage area protected by hardware. The encrypted original verification code (i.e., the encrypted signature data) and the original first encrypted signature value are stored in a hardware-protected area, for example, using a dedicated hardware security module (HSM), read-only memory (ROM) or TPM chip or other protected storage area. These areas can prevent unauthorized access and can only be read and verified by the system at startup. The encrypted verification code stored in the hardware protection area ensures that even if an attacker obtains the storage device through physical access, the signature data of the code cannot be easily tampered with or modified.
[0036] In this embodiment, the first protection strategy further includes verifying the security of the core code in the following manner: Decrypting the original verification code using the first symmetric encryption algorithm to obtain decrypted signature data; Calculating the encrypted signature value of the current core code using the first encrypted signature algorithm to obtain a current first encrypted signature value; The decrypted signature data is verified using the RSA public key, and the consistency between the current first encrypted signature value and the original first encrypted signature value is verified. If both verifications pass, the current core code is determined to be safe; otherwise, the current core code is determined to be unsafe.
[0037] See also Figure 2 , the verification process for the core code is as follows: when the system starts, it first reads the encrypted signature data, i.e., the original verification code, from the hardware protection area, i.e., the first storage area, and decrypts it using AES. Subsequently, the system verifies the decrypted signature data using the RSA public key, and verifies the consistency between the encrypted signature value of the current core code and the original first encrypted signature value. If both verifications pass, it proves that the core code has not been tampered with, and the system continues to start; if they are inconsistent, the system interrupts the startup and gives a security warning.
[0038] For example, for a server, its BIOS core code is responsible for initializing the hardware and loading the operating system. The specific protection implementation process for the core code in the system is as follows.
[0039] Core code (such as hardware initialization code): This part of the code will perform system hardware initialization operations, including the detection and configuration of devices such as the CPU, memory, hard disk, and graphics card. In order to ensure that this part of the code has not been tampered with at startup, the SHA-256 algorithm is first used to calculate the SHA-256 encrypted signature value of the code. The calculated SHA-256 encrypted signature value is digitally signed with the RSA private key to generate a digital signature data. At this time, the RSA signature data guarantees the source and integrity of the code, and any unauthorized modification will cause the signature verification to fail. The generated digital signature data is encrypted using the AES-256 algorithm. The encrypted signature data is stored in a protected storage area, such as a hardware security module (HSM). This storage area can only be accessed by authorized operating systems or hardware to prevent illegal access.
[0040] During the verification process, after the system loads the core code, it will use a strong anti-collision encryption signature algorithm (such as SHA-256) to recalculate the encryption signature value of the currently loaded code. When recalculating the encryption signature value, the SHA-256 encryption signature algorithm ensures that the generated encryption signature value is unique, and any minor modification will result in a huge change in the encryption signature value, which is easy to detect.
[0041] The decrypted digital signature is verified by the RSA public key. The digital signature is generated by the private key, and the public key is used to verify the validity of the signature. Check whether the original first digital signature value matches the recalculated encrypted signature value. If they match, it means that the source of the core code is reliable and has not been tampered with. If the digital signature cannot be verified, it means that the integrity of the core code is threatened, the system will stop starting and trigger a security warning. Through digital signature and public key verification, the system can confirm whether the loaded code comes from a trusted source and ensure that its content has not been tampered with during storage. Digital signature verification can effectively prevent malware from compromising system security by replacing core code and ensure startup security.
[0042] Countermeasures for verification failure: (1) System interruption startup. If the integrity check of the core code fails, the system will immediately interrupt the startup process; at this time, the system will not continue to load the operating system or other modules to prevent the execution of any malicious code or damaged code. (2) Security warning The system will trigger a security warning to inform the user or administrator that the code integrity check has failed. The warning content usually describes in detail the reason for the verification failure (such as signature mismatch, inconsistent encryption signature value, etc.) and requires the administrator to take further security measures. (3) Prevent damaged code from running. By interrupting the startup and displaying warnings, the system effectively prevents damaged or tampered core code from running. At this time, the administrator can check the system log, perform repair operations, or reinstall the system (such as BIOS) code to ensure system security.
[0043] In one embodiment of the present invention, the system based on hybrid algorithm protection also includes a dynamic loading module, which is configured to store and / or load non-core code of the system, and the security level of the non-core code is lower than the security level of the core code.
[0044] The second protection strategy is used to protect the non-core code. Figure 4 , the second protection strategy includes: The encrypted signature value of the non-core code is calculated using a second encrypted signature algorithm to obtain an original second encrypted signature value, wherein the first encrypted signature algorithm has a stronger anti-collision property than the second encrypted signature algorithm; the second encrypted signature algorithm is a lightweight encryption algorithm, and specifically, CRC-32 or FNV-1 may be used; The original second encrypted signature value is stored in a second storage area. The security level of the first storage area is higher than that of the second storage area. The second storage area may use a non-read-only storage unit, such as RAM, flash memory, HDD, SSD, etc.
[0045] See also Figure 7 The second protection strategy also includes verifying the security of the non-core code in the following manner: each time the non-core code is loaded or periodically, the second encryption signature algorithm is used to recalculate the encryption signature value of the non-core code to obtain a current second encryption signature value. Verifying the consistency of the current second encryption signature value with the original second encryption signature value, if they are consistent, the non-core code is determined to be safe; if they are inconsistent, the non-core code is determined to be unsafe.
[0046] Dynamically loaded modules are usually drivers, extended function modules, etc. in the system, which are required to be loaded and executed after startup. If a computationally complex encryption signature algorithm is used, the module loading speed may be too slow, affecting system performance. Therefore, choosing lightweight algorithms such as CRC-32 and FNV-1 can provide fast and effective integrity verification. These algorithms can provide fast integrity verification without significantly affecting system performance, and are suitable for dynamically loaded modules that are frequently loaded and updated. Some embedded systems or low-power devices have limited computing resources, and the use of complex encryption algorithms will cause the system to be overloaded. Therefore, the use of lightweight algorithms such as CRC-32 and FNV-1 can ensure the security of the module while maintaining reasonable computing efficiency.
[0047] The following is a specific example to illustrate the protection and verification process of dynamically loaded modules. Assume that a server runs on an operating system, which contains multiple dynamically loaded modules, such as network card drivers, graphics card drivers, and other peripheral drivers. These modules are dynamically loaded when the operating system is started, and perform corresponding hardware initialization and resource configuration tasks later.
[0048] Loading a dynamically loaded module for the first time and calculating the second encrypted signature value of its corresponding non-core code: When the system loads the network card driver net_driver.dll for the first time, the encrypted signature value of the driver program code is calculated using the CRC-32 algorithm. For example, the calculated encrypted signature value is C1F9B01F. The encrypted signature value is stored in the system's persistent storage as the unique identifier of the driver.
[0049] Encrypted signature verification when dynamically loading modules: When the operating system loads the network card driver again, the system calculates the CRC-32 encrypted signature value of the net_driver.dll file and compares it with the original encrypted signature value. Assuming that the calculated encrypted signature value is consistent with the original value (C1F9B01F), it proves that the driver has not been tampered with, and the system continues to load the driver.
[0050] Assume that net_driver.dll is tampered with during a loading, and the recalculated encryption signature value is D2A8C041, which does not match the original encryption signature value (C1F9B01F). The system detects the inconsistency of the encryption signature value, triggers a security warning, and refuses to load the module, preventing the system from potential security threats.
[0051] Legally update the module and update the encrypted signature value: The system administrator updates the network card driver version, and the updated driver file net_driver_v2.dll is loaded. The system recalculates the encrypted signature value of the file and updates the stored encrypted signature value to ensure that the new version of the driver can pass the integrity check.
[0052] In this embodiment, the system code is divided into core code and non-core code according to different security requirement levels of the code in the system, and two different protection strategies are adopted.
[0053] like Figure 3As shown in the figure, taking BIOS as an example, the BIOS code is classified into core code and non-core code according to its importance and functional characteristics. The core code includes the key parts of system startup and hardware initialization, which require the highest level of security protection; the non-core code is the functional extension part of the system, which needs to strike a balance between security and performance. According to different code areas, corresponding security policies are formulated, strong security measures are adopted for core code, and lightweight verification mechanisms are adopted for non-core code in dynamically loaded modules.
[0054] The core code module refers to the key part that needs to ensure the normal startup of the system and provide a stable operating environment for the operating system in the early stage of system startup. Specifically, the functions of the core code in the core code module usually include: Hardware initialization: responsible for the initialization of computer hardware, including the detection and configuration of CPU, memory, hard disk, graphics card, input and output devices, etc. This is the basis for ensuring the normal operation of the computer; Booting and loading the operating system: The core code is responsible for guiding the loading of the operating system. It will load the startup image of the operating system through the boot manager to ensure that the system can successfully enter the operating system environment; BIOS configuration management: including management of user-defined BIOS settings, such as date and time, boot sequence, etc., to ensure that user-defined configuration information is correctly applied; These functions are critical to the security of computer systems. If an attacker tampers with any core code, malicious code may be implanted at startup or the operating system may be prevented from loading, causing the system to not work properly. Therefore, this part of the code must be strictly protected to ensure that it is not tampered with during the entire system operation.
[0055] Dynamically loaded modules refer to auxiliary function code modules that are loaded at the end of system startup and executed as needed. Specifically, the functions of dynamically loaded modules usually include: Drivers: some hardware drivers, such as network card drivers, graphics card drivers, etc. These drivers are usually loaded after the operating system is started and loaded dynamically as needed; System extension functions: some non-core system function extensions, such as debugging tools, log collection modules, security inspection tools, etc. These function modules may be dynamically loaded at runtime; Firmware update and configuration tools: Some BIOS support modules for updating firmware or modifying configuration after the operating system is started.
[0056] Compared with core code modules, dynamically loaded modules have less impact on system security. Although these modules need to ensure data integrity and prevent tampering, their security requirements are not as high as core code, and they mainly focus on performance and flexibility. Therefore, these modules usually use lightweight verification mechanisms to ensure that system performance is not affected too much.
[0057] CRC-32 is very advantageous in terms of performance and computational efficiency. CRC-32 is a widely used cyclic redundancy check algorithm that can quickly calculate the encrypted signature value of data. Although its anti-collision performance is weak, for dynamically loaded modules, calculation speed and efficiency are more critical indicators, so CRC-32 is suitable for verifying the integrity of these modules. For example, when the system loads a dynamic module (such as a hardware driver or a system extension module), a network card driver net_driver.dll needs to be verified. The system will calculate the CRC-32 encrypted signature value for this file and generate a 32-bit encrypted signature value as the "fingerprint" of the module.
[0058] Each time a module is dynamically loaded, the system recalculates the encrypted signature value of the module. The recalculated encrypted signature value is compared with the stored original CRC-32 encrypted signature value. If the two encrypted signature values are consistent, it means that the module has not been tampered with, and the system continues to load the module.
[0059] FNV-1 is another lightweight cryptographic signature algorithm that is simpler than CRC-32, provides fast cryptographic signature calculations, and performs well when processing smaller modules. FNV-1 can achieve efficient cryptographic signature calculations in memory-constrained environments and is suitable for small modules that require fast verification. For smaller modules with high usage frequency (such as a device driver), the FNV-1 algorithm can be used to perform cryptographic signature calculations to generate the module's cryptographic signature value. Similarly, the cryptographic signature value recalculated using the FNV-1 algorithm will be compared with the stored cryptographic signature value to ensure the integrity of the module.
[0060] If the recalculated cryptographic signature value does not match the stored cryptographic signature value, the system will consider the module to be potentially tampered with, triggering an alarm or refusing to load the module to prevent malicious code from running. If the module is legally updated, the new version will recalculate the cryptographic signature value and update the stored cryptographic signature value. In this way, the system can always verify the integrity of the module.
[0061] Therefore, in one embodiment of the present invention, see Figure 5If the usage frequency of the non-core code is not lower than the preset first frequency value, the second encryption signature algorithm adopts the FNV-1 algorithm. If the usage frequency of the non-core code is lower than the preset first frequency value, the second encryption signature algorithm adopts the CRC-32 algorithm. The present invention divides the system code into core code and non-core code, adopts a second encryption signature algorithm with lower computational complexity for the non-core code, and dynamically selects a suitable algorithm according to the frequency of code usage, thereby reducing the computational complexity of the signature verification process, reducing the computational overhead of the verification process, and improving the verification efficiency. It is particularly suitable for systems that are sensitive to startup time.
[0062] In one embodiment of the present invention, see Figure 6 , the second protection strategy also includes: dividing the non-core code into multiple continuous sub-codes; for each sub-code, using the second encryption signature algorithm to calculate the encryption signature value of the sub-code to obtain the sub-original encryption signature value; storing the sub-original encryption signature value in the second storage area. More preferably, for two adjacent sub-codes, two different second encryption signature algorithms are used to calculate the encryption signature value of the sub-code. For example, for two adjacent sub-codes, one sub-code uses the CRC-32 algorithm and the other sub-code uses the FNV-1 algorithm. Based on this approach, while achieving lightweight protection for the dynamically loaded module, the security of the dynamically loaded module can be further improved, and a balance between system security and performance can be achieved.
[0063] In one embodiment of the present invention, a system code protection method based on a hybrid algorithm is provided. Figure 1 , Figure 2 , Figure 4 and Figure 7 , the method comprises the following steps.
[0064] The core code and non-core code in the system code are determined, the security level of the core code is higher than the security level of the non-core code, and the non-core code is protected by adopting a second protection strategy.
[0065] The core code is protected by a first protection strategy, including: using a first encryption signature algorithm to calculate the encryption signature value of the core code to obtain an original first encryption signature value; using an RSA private key to digitally sign the original first encryption signature value to generate original signature data; using a first symmetric encryption algorithm to encrypt the original signature data to generate an encrypted original verification code; and storing the original verification code in a first storage area, which is a secure storage area.
[0066] The security of the core code is verified in the following manner: the original verification code is decrypted using the first symmetric encryption algorithm to obtain the decrypted signature data; the encrypted signature value of the current core code is calculated using the first encryption signature algorithm to obtain the current first encrypted signature value; the decrypted signature data is verified using the RSA public key, and the consistency of the current first encrypted signature value and the original first encrypted signature value is verified. If both verifications are passed, the current core code is determined to be secure; otherwise, the current core code is determined to be insecure.
[0067] The encrypted signature value of the non-core code is calculated using a second encrypted signature algorithm to obtain an original second encrypted signature value, wherein the first encrypted signature algorithm has stronger anti-collision performance than the second encrypted signature algorithm. The original second encrypted signature value is stored in a second storage area, wherein the security level of the first storage area is higher than the security level of the second storage area.
[0068] The non-core code is protected by the second protection strategy, and further includes: each time the non-core code is loaded, the encrypted signature value of the non-core code is calculated by the second encryption signature algorithm to obtain a second encryption signature value; the second encryption signature value is verified to be consistent with the original second encryption signature value, if they are consistent, the non-core code is determined to be safe; if they are inconsistent, the non-core code is determined to be unsafe.
[0069] In one embodiment of the present invention, a BIOS is provided, and the BIOS is configured as a system based on hybrid algorithm protection based on a combination of any one or more of the above embodiments.
[0070] In one embodiment of the present invention, a computer is provided, comprising a system based on hybrid algorithm protection as described in any one or more of the above embodiments.
[0071] It should be noted that the system code protection method, BIOS and computer embodiments based on a hybrid algorithm provided by the present invention are the same as the inventive concept of the above-mentioned system code protection method embodiment based on a hybrid algorithm, and all the contents of the system code protection method embodiment based on a hybrid algorithm are incorporated into the system code protection method, BIOS and computer embodiments based on a hybrid algorithm by introduction.
[0072] The BIOS code integrity protection method based on a hybrid algorithm proposed in this technical solution has significant security and performance advantages and has broad application prospects in multiple fields. First, in the field of computer system security, this solution can effectively prevent the BIOS code from being tampered with or replaced, and improve the security of the system startup process. With the increasing threats of hardware-level attacks and firmware malware, protecting the integrity of low-level system codes such as BIOS has become critical. This technical solution provides a solution that takes into account both security and performance, and is suitable for computing environments that require high security, such as personal computers, servers, and large data centers.
[0073] Thirdly, in the field of industrial control and critical infrastructure, such as electricity, transportation, energy and other industries, the reliability and security of the system are of vital importance. This technical solution can be used to protect the firmware code of industrial control systems, prevent security incidents caused by code tampering, and ensure the stable operation of the system. In addition, in fields with extremely high security requirements such as finance, medical care and government agencies, this solution can provide a high level of system code integrity protection, prevent potential security vulnerabilities from being exploited, and protect the security of sensitive data and key businesses. Finally, with the popularization of cloud computing and virtualization technology, the security of the hypervisor and firmware layer has also received more and more attention. This technical solution can be applied to the protection of firmware and system code in a virtualized environment to enhance the security of the cloud environment.
[0074] In short, this technical solution not only ensures high security, but also takes into account system performance, solving the problems of high computational overhead and insufficient anti-attack capability in the existing technology. It has broad application prospects and can meet the needs of various industries for system code integrity protection, with significant market value and promotion significance.
[0075] 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.
[0076] The above is only a specific implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A system based on hybrid algorithm protection, characterized in that: comprising a core code module, wherein the core code module is configured to store and / or load the core code of the system; The core code is protected by adopting a first protection strategy, wherein the first protection strategy includes: Calculating the encrypted signature value of the core code using a first encrypted signature algorithm to obtain an original first encrypted signature value; Digitally signing the original first encrypted signature value using an RSA private key to generate original signature data; Encrypting the original signature data using a first symmetric encryption algorithm to generate an encrypted original verification code; The original first encrypted signature value and the original verification code are stored in a first storage area, where the first storage area is a secure storage area.
2. The system based on hybrid algorithm protection according to claim 1, characterized in that: Also included is a dynamic loading module, the dynamic loading module is configured to store and / or load non-core code of the system, the security level of the non-core code is lower than the security level of the core code; The non-core code is protected by a second protection strategy, wherein the second protection strategy includes: Using a second encryption signature algorithm to calculate the encryption signature value of the non-core code to obtain an original second encryption signature value, wherein the first encryption signature algorithm has a stronger anti-collision property than the second encryption signature algorithm; The original second encrypted signature value is stored in a second storage area, and the security level of the first storage area is higher than the security level of the second storage area.
3. The system based on hybrid algorithm protection according to claim 2, characterized in that: The second protection strategy also includes: Dividing the non-core code into a plurality of continuous sub-codes; For each segment of the sub-code, a second encryption signature algorithm is used to calculate the encryption signature value of the sub-code to obtain a sub-original encryption signature value; The sub-original encrypted signature value is stored in the second storage area.
4. The system based on hybrid algorithm protection according to claim 3 is characterized in that: The second protection strategy also includes: for two adjacent segments of the sub-code, using two different second encryption signature algorithms to calculate the encryption signature value of the sub-code.
5. The system based on hybrid algorithm protection according to claim 2, characterized in that: If the usage frequency of the non-core code is not lower than the preset first frequency value, the second encryption signature algorithm adopts the FNV-1 algorithm; If the usage frequency of the non-core code is lower than a preset first frequency value, the second encryption signature algorithm adopts the CRC-32 algorithm.
6. The system based on hybrid algorithm protection according to claim 2, characterized in that: The second encryption signature algorithm includes a CRC-32 algorithm and a FNV-1 algorithm.
7. The system based on hybrid algorithm protection according to claim 2, characterized in that: The second protection strategy also includes verifying the security of the non-core code in the following manner: Each time the non-core code is loaded or periodically, the encrypted signature value of the non-core code is recalculated using the second encrypted signature algorithm to obtain a current second encrypted signature value; Verifying the consistency between the current second encrypted signature value and the original second encrypted signature value, and if they are consistent, determining that the non-core code is safe; If they are inconsistent, it is determined that the non-core code is unsafe.
8. The system based on hybrid algorithm protection according to claim 2, characterized in that: The second storage area includes RAM, flash memory, HDD and SSD; and / or, The dynamic loading module includes multiple sub-modules, each sub-module is configured to store and / or load different non-core codes, and the second encryption signature algorithm correspondingly adopted by each sub-module is the same or different.
9. The system based on hybrid algorithm protection according to claim 1, characterized in that: The first protection strategy also includes verifying the security of the core code in the following manner: Decrypting the original verification code using the first symmetric encryption algorithm to obtain decrypted signature data; Calculating the encrypted signature value of the current core code using the first encrypted signature algorithm to obtain a current first encrypted signature value; Use the RSA public key to verify the decrypted signature data, and verify the consistency of the current first encrypted signature value with the original first encrypted signature value. If both verifications pass, the current core code is determined to be secure. Otherwise, it is determined that the current core code is unsafe.
10. The system based on hybrid algorithm protection according to claim 1, characterized in that: The first storage area includes ROM, HSM and TPM chip; and / or, The first encryption signature algorithm includes SHA-256 algorithm, SHA-3 algorithm, SM3 algorithm and BLAKE2 algorithm; and / or, The first symmetric encryption algorithm includes AES-256 algorithm, SM4-128 algorithm, Camellia-256 algorithm, and Serpent-256 algorithm.
11. A system code protection method based on a hybrid algorithm, characterized in that: The following steps are involved: Determining a core code in the system code and protecting the core code using a first protection strategy includes: Calculating the encrypted signature value of the core code using a first encrypted signature algorithm to obtain an original first encrypted signature value; Digitally signing the original first encrypted signature value using an RSA private key to generate original signature data; Encrypting the original signature data using a first symmetric encryption algorithm to generate an encrypted original verification code; The original verification code is stored in a first storage area, which is a secure storage area.
12. The system code protection method based on hybrid algorithm according to claim 11, characterized in that: The following steps are also included: Determining non-core code in the system code, the security level of the core code is higher than the security level of the non-core code, and using a second protection strategy to protect the non-core code, including: Using a second encryption signature algorithm to calculate the encryption signature value of the non-core code to obtain an original second encryption signature value, wherein the first encryption signature algorithm has a stronger anti-collision property than the second encryption signature algorithm; The original second encrypted signature value is stored in a second storage area, and the security level of the first storage area is higher than the security level of the second storage area.
13. The system code protection method based on hybrid algorithm according to claim 12, characterized in that: The second protection strategy also includes verifying the security of the non-core code in the following manner: Each time the non-core code is loaded, the second encryption signature algorithm is used to calculate the encryption signature value of the non-core code to obtain a second encryption signature value; Verifying the consistency between the second encrypted signature value and the original second encrypted signature value, and if they are consistent, determining that the non-core code is safe; If they are inconsistent, it is determined that the non-core code is unsafe.
14. The system code protection method based on hybrid algorithm according to claim 11, characterized in that: The first protection strategy also includes verifying the security of the core code in the following manner: Decrypting the original verification code using the first symmetric encryption algorithm to obtain decrypted signature data; Calculating the encrypted signature value of the current core code using the first encrypted signature algorithm to obtain a current first encrypted signature value; Use the RSA public key to verify the decrypted signature data, and verify the consistency of the current first encrypted signature value with the original first encrypted signature value. If both verifications pass, the current core code is determined to be secure. Otherwise, it is determined that the current core code is unsafe.
15. A BIOS, characterized in that: The BIOS is configured as a system based on the hybrid algorithm protection as claimed in any one of claims 1 to 10.
16. A computer, characterized in that: A system comprising hybrid algorithm protection as claimed in any one of claims 1 to 10.
Citation Information
Patent Citations
Signature and verification method based on hybrid encryption algorithm in cloud storage
CN107070948A
A method and apparatus for protecting codes using a random password
CN109145533A
Android platform message-driven core code integrity detection system and Android platform message-driven core code integrity detection method
CN109981283A
Method, system and equipment for real-time early warning of tampering of application program file and medium
CN114676419A
Data fingerprint generation method and device based on block chain and storage medium
CN114880697A
Cited By
Quick start and safety verification method and equipment for embedded device, medium and program product
CN121300876A
A method and apparatus for loading a driver of a real-time operating system
CN122526639A
A method and apparatus for loading a driver of a real-time operating system
CN122526639B