Supply chain firmware encryption method based on algorithm subpackage and information embedding

By subpackaging and embedding information into firmware packages, a hybrid package set is generated and its integrity is verified. This solves the problem of insufficient confidentiality in firmware security protection and enables efficient and secure firmware transmission and burning.

CN121036987APending Publication Date: 2025-11-28SHENZHEN YIBANG IOT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511165246.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2025-11-28

AI Technical Summary

Technical Problem

Existing firmware security measures are insufficient in terms of confidentiality when facing complex and ever-changing threats, making them easy to crack. Furthermore, traditional encryption algorithms are unable to cope with external attacks and internal security vulnerabilities.

Method used

A method based on algorithm-based packet splitting and information embedding is adopted to split the real supply chain firmware package into multiple real sub-packages and record file characteristics. Invalid packets are mixed in to generate a mixed package set. The verification information of the packet splitting algorithm and the names and order of the real sub-packages are embedded. After the integrity is verified by the flashing terminal, the firmware is flashed.

Benefits of technology

The firmware's confidentiality has been enhanced, its anti-cracking capabilities have been improved, and the integrity and security of the firmware during transmission and burning have been ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121036987A_ABST
    Figure CN121036987A_ABST
Patent Text Reader

Abstract

The supply chain firmware encryption method based on algorithm subpackaging and information embedding provided by the invention comprises the following steps: subpackaging a real supply chain firmware package based on a subpackaging algorithm to obtain a plurality of real sub-packages, and recording file characteristics of each real sub-package; generating a plurality of corresponding invalid packages based on the file features; mixing the invalid packets into a packet set containing the real sub-packets to obtain a mixed packet set; and generating names and sequences of the real sub-packages, and embedding the test information of the subpackaging algorithm and the names and sequences of the real sub-packages into firmware information. According to the method and the device, the firmware package of the supply chain is subpackaged, and the invalid package is mixed, so that the firmware package is difficult to crack, and the confidentiality of firmware is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, and in particular relates to a supply chain firmware encryption method based on algorithm sub-packet and information embedding. BACKGROUND

[0002] Various devices in the supply chain system are widely used in various key fields, from the core operation devices of data centers, to the automation control equipment in industrial production, to the basic node infrastructure in communication networks, and the stable operation of these devices plays a decisive role in the normal operation of the entire industrial ecosystem. As firmware is the basic software for device operation, it is directly related to the realization of device functions and key performance indicators such as security and stability.

[0003] In recent years, the number of devices in the supply chain has grown exponentially, which has not only improved industrial efficiency and promoted economic development, but also brought unprecedented severe challenges to firmware security. From the source of threats, external attackers are watching closely and trying to invade devices through various means to steal sensitive information, disrupt system operation, or implant malicious programs to achieve illegal profits or create chaos. For example, some malicious organizations may launch attacks on the firmware of data center devices, and once they successfully invade, they may obtain a large amount of user privacy data, causing immeasurable damage to enterprise reputation and user rights. Internal security risks cannot be ignored, and employees within the enterprise may cause firmware security vulnerabilities or be exploited due to operational errors, rule violations, or external temptations.

[0004] From the perspective of attack methods, there are numerous firmware security threat methods. During the firmware update process, attackers often use man-in-the-middle attack methods to intercept and tamper with firmware update packages in transit, implanting malicious code to control the device after updating. Some unscrupulous individuals may also use social engineering methods to induce users to download and install firmware that appears to be normal but has been tampered with, easily breaking through the security defenses of the device. At the hardware level, attackers may physically access the device and directly modify the boot firmware code or chip, bypassing the device's original security measures to illegally control the device.

[0005] Traditional firmware security protection methods have gradually exposed many limitations in dealing with complex and variable threats. For example, some devices rely only on simple encryption algorithms to protect firmware, and with the rapid development of computing technology, these encryption algorithms can be easily cracked, rendering the firmware completely insecure. SUMMARY

[0006] The main purpose of the present application is to provide a supply chain firmware encryption method based on algorithm sub-packet and information embedding, aiming to overcome the current weakness of firmware security.

[0007] To achieve the above object, the application provides a supply chain firmware encryption method based on algorithm sub-packet and information embedding, comprising the following steps: The real supply chain firmware package is sub-packeted based on a sub-packet algorithm to obtain multiple real sub-packets, and the file features of each real sub-packet are recorded; Based on the file features, multiple corresponding invalid packets are generated; The invalid packets are mixed into a packet set containing each real sub-packet to obtain a mixed packet set; The name and order of the real sub-packet are generated, and the verification information of the sub-packet algorithm and the name and order of the real sub-packet are embedded into firmware information.

[0008] Further, the method further comprises: The burning end extracts the real sub-packet from the mixed packet set by extracting the name and order of the real sub-packet embedded in the firmware information for the mixed packet set; Based on the verification information of the sub-packet algorithm embedded in the firmware information, the real sub-packet is combined using the corresponding sub-packet algorithm to obtain a supply chain firmware package, and integrity verification is performed; If the integrity verification passes, firmware burning is performed.

[0009] Further, the integrity verification includes md5 value verification, sha-1 hash verification, and sha-256 hash verification.

[0010] Further, the file features of the real sub-packet include recording the file size, file header information, and specific byte sequence features of the sub-packet.

[0011] Further, based on the file features, multiple corresponding invalid packets are generated, comprising: For the real sub-packet, at least three levels of invalid packets are generated: the first level invalid packet simulates the file size and file header information of the real sub-packet, but the internal byte sequence is randomly generated and does not include specific valid instructions; the second level invalid packet includes the same specific byte sequence fragment as the real sub-packet, but the file size exceeds the floating threshold of the real sub-packet and the file header information is slightly tampered; the third level invalid packet is generated by a dynamic variation algorithm, which retains part of the real sub-packet file features while periodically inserting anti-debugging fields and false check bits; Based on the number and file feature complexity of the real sub-packet, the number of generated invalid packets is dynamically adjusted according to a preset ratio, and the feature similarity of each invalid packet to the real sub-packet is controlled within a preset interval; The file features of different real sub-packets are cross combined to perform feature confusion processing on the generated invalid packets to form mixed invalid packets including multiple real sub-packet partial features. Further, based on the file features, a plurality of corresponding invalid packages are generated, including: The file features of the real sub-packages are parsed, a feature mapping model is constructed, and the feature mapping model includes file size intervals, fixed fields and variable fields of file header information, and position distribution rules of specific byte sequences; Based on the feature mapping model, an invalid package is generated using a multi-dimensional variation strategy; A unique dynamic identifier is generated for each invalid package, and after encryption using an encryption key, it is embedded in the invalid package; wherein the encryption key is associated with the file features of the real sub-package; An invalid package feature library is constructed, the features of the generated invalid packages are recorded in real time, and comparison is made in the subsequent generation process of the invalid packages to ensure that the newly generated invalid packages have a feature repetition rate lower than a preset threshold with the existing invalid packages and real sub-packages.

[0012] Further, the invalid package is generated using a multi-dimensional variation strategy, including: In the file size dimension, a value outside the file size interval of the real sub-package is randomly generated, or a value that meets the preset condition is generated although it is within the interval; In the file header information dimension, the fixed field is flipped or replaced, and random content that does not match the real rules is generated for the variable field; In the specific byte sequence dimension, a byte stream containing part of the real sequence fragment but with a broken logic as a whole, or a byte stream with a sequence position completely contrary to the real distribution rule is generated; Based on the variation strategies in the file size dimension, the file header information dimension, and the specific byte sequence dimension, the corresponding invalid package is generated.

[0013] Further, when generating the invalid package using the multi-dimensional variation strategy, the expected security level of the mixed package set is obtained, and the generation dimension and variation degree of the invalid package are dynamically adjusted based on the expected security level; wherein the higher the security level, the more dimensions involved in the variation, and the greater the variation degree.

[0014] Further, the name of the real sub-package is generated, including: The core parameters of the sub-packaging algorithm are extracted; for each real sub-package, the core parameters are fused with the file features of the real sub-package, and a basic key is generated based on the fusion result; The logic serial number of the real sub-package in the overall supply chain firmware package is encrypted based on the basic key to obtain an encrypted serial number; A pseudo-random sequence is generated based on the encrypted serial number of the real sub-package, a preset encoding table is mutated based on the pseudo-random sequence, and a mutated encoding table is obtained; wherein the mutation position is determined by the pseudo-random sequence and the file size of the real sub-package, and the position of the mutated character in the mutated encoding table has a mapping relationship with the feature code of the file header information; The encrypted serial number is encoded and converted based on the mutated encoding table to generate the name.

[0015] Further, the core parameters include a starting offset of sub-package cutting, a cutting step, and a check factor; The core parameters are fused with the file features of the real sub-package, and a basic key is generated based on the fusion result, including: The starting offset is subjected to a modulo operation with the file size to obtain a first fusion value; The cutting step is subjected to a convolution operation with the feature code of the file header information to obtain a second fusion value; The check factor is spliced with the hash value of the specific byte sequence and then subjected to a hash operation to obtain a third fusion value; The basic key is constructed based on the first fusion value, the second fusion value, and the third fusion value; wherein the first fusion value serves as an initial vector of the key, the second fusion value serves as an encryption factor of the key, and the third fusion value serves as a length parameter of the key.

[0016] Further, the encrypted serial number is encoded and converted based on the mutated encoding table to generate the name, including: The encrypted serial number is encoded and converted based on the mutated encoding table to obtain an encoding sequence as a name body; the name is determined based on the name body; wherein the length of the name is determined by the third fusion value, and an identification segment formed by the feature code of the file header information is also embedded in the name body, and the position of the identification segment in the name body is determined by the first fusion value. The application also provides a supply chain firmware encryption device based on algorithm sub-packaging and information embedding, including: A sub-packaging module is configured to sub-package a real supply chain firmware package based on a sub-packaging algorithm to obtain a plurality of real sub-packages and record file features of each real sub-package; A generating module is configured to generate a plurality of corresponding invalid packages based on the file features; A mixing module is configured to mix the invalid packages into a package set containing the real sub-packages to obtain a mixed package set; An embedding module is configured to generate names and sequences of the real sub-packages and embed inspection information of the sub-packaging algorithm and the names and sequences of the real sub-packages into firmware information.

[0018] This invention provides a supply chain firmware encryption method based on algorithm-based packet splitting and information embedding, comprising: splitting a real supply chain firmware package into multiple real sub-packages based on a packet splitting algorithm, and recording the file characteristics of each real sub-package; generating multiple corresponding invalid packets based on the file characteristics; mixing the invalid packets into a package set containing each of the real sub-packages to obtain a mixed package set; generating the names and order of the real sub-packages, and embedding the verification information of the packet splitting algorithm and the names and order of the real sub-packages into the firmware information. In this invention, by splitting the supply chain firmware package and mixing in invalid packets, the firmware package becomes difficult to crack, thus enhancing the confidentiality of the firmware. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the steps of a supply chain firmware encryption method based on algorithm packet splitting and information embedding in one embodiment of the present invention; Figure 2 This is a structural block diagram of a supply chain firmware encryption device based on algorithm packet splitting and information embedding in one embodiment of the present invention; Figure 3 This is a schematic block diagram of the structure of a computer device according to an embodiment of the present invention.

[0020] The implementation, functional features, and advantages of this invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0022] Reference Figure 1 One embodiment of the present invention provides a supply chain firmware encryption method based on algorithm packet segmentation and information embedding, comprising the following steps: Step S1: Based on the packet splitting algorithm, the real supply chain firmware package is split into multiple real sub-packages, and the file characteristics of each real sub-package are recorded. Step S2: Based on the file characteristics, generate multiple corresponding invalid packets; Step S3: Mix the invalid packets into the packet set containing each of the real sub-packets to obtain a mixed packet set; Step S4: Generate the name and order of the real sub-packets, and embed the verification information of the packet splitting algorithm and the name and order of the real sub-packets into the firmware information.

[0023] In this embodiment, as described in step S1 above, the complete real supply chain firmware package is structurally split using a preset packet splitting algorithm, and key features of the split sub-packages are collected simultaneously. Specifically, firstly, an appropriate packet splitting algorithm (such as a fixed-length segmentation algorithm, a dynamic segmentation algorithm based on data features, etc.) needs to be selected according to the type, size, and application scenario of the firmware package to ensure that the splitting process meets data integrity requirements and provides a foundation for subsequent security verification. During the packet splitting process, the algorithm divides the firmware package into several independent real sub-packages according to preset rules. Each sub-package contains some valid data of the firmware, and all sub-packages can be combined to completely restore the original firmware.

[0024] Meanwhile, to achieve accurate identification and verification of sub-packages, the file characteristics of each genuine sub-package must be recorded simultaneously. These file characteristics include, but are not limited to: the sub-package's byte length (file size), file header information identifying data types (such as specific format identifiers, version numbers, etc.), and unique data segments within the sub-package (such as specific byte sequences, hash values ​​of key instruction segments, etc.). These file characteristics will serve as the core basis for subsequently generating invalid packets and verifying the authenticity of sub-packages, ensuring that the split sub-packages can still be accurately identified even after being mixed with invalid packets.

[0025] As described in step S2 above, by generating invalid packets with characteristics similar to the real sub-packets, the difficulty for attackers to identify the real sub-packets is increased, thereby improving the firmware package's resistance to cracking. This step uses the characteristics of the real sub-packet files recorded in step S1 as a basis, and generates a large number of invalid packets through feature imitation and mutation strategies.

[0026] Specifically, in one embodiment, the file characteristics of the real sub-packet are first analyzed in depth to extract key parameters that can be imitated (such as the numerical range of file size, the format characteristics of the file header, and the local structure of a specific byte sequence). Then, invalid packets are generated based on these parameters: for file size, random data blocks within the size range of the real sub-packet but without practical meaning, or forged data exceeding the range but with a similar format, can be generated; for file header information, the header format of the real sub-packet can be copied, but the core identifier field can be tampered with, making it appear legitimate but unable to participate in firmware restoration; for a specific byte sequence, fragments of the real sequence can be extracted and concatenated with random data to form a logically broken forged sequence.

[0027] In addition, the number of invalid packets generated must be greater than that of real sub-packets (e.g., at a ratio of 5:1 or higher), and the feature similarity between each invalid packet and the real sub-packet must be controlled within a specific range (to avoid complete consistency leading to confusion failure, and to prevent excessive differences from losing the disguise effect), thereby forming an effective cover for the real sub-packets.

[0028] As described in step S3 above, a deceptive packet set is constructed by mixing invalid packets with real sub-packets, further enhancing the security of the firmware packet. In this step, all real sub-packets obtained in step S1 are first integrated into an initial packet set, and then invalid packets generated in step S2 are mixed into it in a random order to form the final mixed packet set.

[0029] The mixing process must meet two core requirements: first, the randomness of the mixing method, meaning the order of invalid packets and real sub-packets is not fixed, preventing attackers from inferring real sub-packets based on location features; second, the integrity of the set, meaning all real sub-packets are included after mixing and remain unaltered. After mixing, the mixed package set appears externally as a collection of unordered, similarly characterized file packages. Attackers cannot directly distinguish real sub-packets from invalid packets from appearance or simple verification, thus preventing them from directly obtaining valid data that can be used for burning.

[0030] As described in step S4 above, this is a key step in achieving secure transmission and restoration of the firmware package. By generating identification information for the real sub-package and embedding firmware information, it provides a basis for accurate extraction and verification by the subsequent flashing end.

[0031] First, a unique name is generated for each real sub-packet. This name is not a random string, but is generated through encryption encoding based on the sub-packet's file characteristics and packet splitting algorithm parameters (for example, using a custom encoding table to convert the characteristic parameters to ensure a unique mapping relationship between the name and the sub-packet). Simultaneously, the concatenation order of all real sub-packets is determined. This order must correspond to the packet splitting logic in step S1 to ensure that the combined sub-packets can be restored to a complete firmware.

[0032] Secondly, three types of core information are embedded in the firmware information (such as firmware metadata, header description area, or preset encrypted fields): First, the verification information of the packet sub-algorithm (such as algorithm version, hash value of key parameters, etc.), which is used by the flashing end to confirm the validity of the packet sub-algorithm used; second, the list of real sub-packet names, which is used to accurately locate the real sub-packets in the mixed packet set; and third, the splicing order of the real sub-packets, which is used to guide the correct combination of sub-packets.

[0033] The embedding process must employ covert encoding methods (such as encrypting the information and storing it in specific fields of the firmware information, or hiding it in filenames and descriptions through character substitution, bitwise operations, etc.) to ensure that attackers cannot directly read or tamper with this critical information. Ultimately, through this step, although the hybrid package set cannot be directly flashed, the legitimate flashing terminal can use the embedded information to extract, verify, and restore the real sub-packages.

[0034] In one embodiment, the method further includes: For the mixed packet set, the programming end extracts the real sub-packets from the mixed packet set by extracting the names and order of the real sub-packets embedded in the firmware information; Based on the verification information of the packet sub-packet algorithm embedded in the firmware information, the real sub-packets are combined using the corresponding packet sub-packet algorithm to obtain the supply chain firmware package, and then integrity verification is performed. If the integrity check passes, proceed with firmware flashing.

[0035] In this embodiment, the flashing end first needs to parse the firmware information (such as firmware metadata, encrypted fields, or preset description areas) and extract the key hidden content through preset decoding rules: First, the list of real sub-packet names, which contains the unique identifiers of all real sub-packets, and each name corresponds one-to-one with the sub-packet name generated in step S4; Second, the splicing order of the real sub-packets, which clarifies the arrangement logic of the sub-packets when restored to complete firmware.

[0036] After obtaining the above information, the flashing device will traverse all file packages in the mixed package set, comparing the filenames with the extracted name list to filter out all genuine sub-packages. Since the mixed package set contains a large number of invalid packages with similar characteristics, and the order of these packages is random, this extraction process must strictly rely on the uniqueness verification of the names (such as verifying legality through check bits or feature codes in the names) to ensure that no genuine sub-packages are missed and no invalid packages are mistakenly selected. After extraction, the flashing device will perform a preliminary sorting of the genuine sub-packages according to the embedded order information, laying the foundation for subsequent firmware restoration.

[0037] Next, the flashing terminal extracts the verification information of the packet sub-algorithm from the firmware information, including the algorithm type identifier, version number, and hash values ​​of core parameters. By verifying this information (such as verifying whether the parameter hash value is consistent with the preset value), the flashing terminal can confirm the legality and integrity of the packet sub-algorithm used, avoiding restoration errors caused by algorithm tampering.

[0038] After confirming the algorithm's effectiveness, the programming terminal calls the packet segmentation algorithm corresponding to step S1 (such as a fixed-length segmentation algorithm or a dynamic segmentation algorithm) to reverse-combine the extracted real sub-packets according to the determined sub-packet order. The combination process will strictly follow the splitting rules during packet segmentation (such as splicing by offset, recombining by matching feature fields, etc.) to ensure that the valid data of all sub-packets are completely integrated, ultimately generating a supply chain firmware package consistent with the original firmware package.

[0039] To further ensure firmware reliability, integrity checks must be performed on the firmware package after assembly. Check methods include, but are not limited to: calculating the MD5, SHA-1, or SHA-256 hash value of the firmware package and comparing it with a preset baseline value (usually embedded in the firmware information); or verifying the publisher's identity and data integrity through digital signature verification. If the check results are inconsistent, it indicates that the firmware package may have been tampered with during transmission or storage, requiring termination of subsequent operations and triggering of an exception handling mechanism.

[0040] Finally, when the integrity check passes, the programming terminal confirms that the currently restored supply chain firmware package is consistent with the original firmware and has not been modified or replaced without authorization. At this point, the programming terminal will start the programming program adapted to the target device and write the firmware package to the device's storage medium (such as flash memory, EEPROM, etc.) according to the device hardware interface protocol (such as SPI, I2C, or USB).

[0041] During the flashing process, the flashing terminal monitors the data transmission status in real time, including writing progress, verification, and matching status, to ensure that the firmware data is accurately and completely stored in the device. After flashing is complete, a secondary verification is performed in some scenarios (such as reading the flashed firmware fragment in the device and comparing it with the original packet) to finally confirm the validity of the flashing result. If flashing is successful, the device can start and run normally based on the firmware; if an abnormality occurs during the process (such as transmission error or verification failure), flashing is terminated and an error message is returned to prevent the device from malfunctioning due to firmware corruption.

[0042] In one embodiment, the integrity check includes MD5 check, SHA-1 hash check, and SHA-256 hash check.

[0043] In one embodiment, the file characteristics of the real sub-packet include recording the file size of the sub-packet, file header information, and specific byte sequence characteristics.

[0044] In one embodiment, based on the file characteristics, multiple corresponding invalid packets are generated, including: For the real sub-packet, at least three levels of invalid packets are generated: the first level invalid packet mimics the file size and header information of the real sub-packet, but the internal byte sequence is randomly generated and does not include specific valid instructions; the second level invalid packet includes the same specific byte sequence fragments as the real sub-packet, but the file size exceeds the floating threshold of the real sub-packet and the header information is slightly tampered with; the third level invalid packet is generated by a dynamic mutation algorithm, which retains some of the characteristics of the real sub-packet file while periodically inserting anti-debugging fields and false check bits. Based on the number of real sub-packages and the complexity of file features, the number of invalid packages generated is dynamically adjusted according to a preset ratio, and the feature similarity between each invalid package and the real sub-package is controlled within a preset range. The file features of different real sub-packages are cross-combined to obfuscate the generated invalid package, forming a mixed invalid package that includes partial features of multiple real sub-packages. In this embodiment, firstly, by constructing a multi-dimensional and differentiated invalid packet system, the disguise effect of real sub-packets is improved, increasing the difficulty for attackers to identify them. Specifically, the invalid packet generation logic at three levels is as follows: Level 1 Invalid Packet: This type of invalid packet mimics the basic characteristics of the real sub-packet, focusing on copying its file size and header information. The file size strictly matches the byte length of the real sub-packet, and the header information completely replicates the format of the real sub-packet (such as identifiers, version fields, type markers, etc.), making the invalid packet appear identical to the real sub-packet during initial verification. However, the core data area of ​​this type of invalid packet is a randomly generated byte sequence, and this sequence does not contain any executable valid instructions or functional data, ensuring that it cannot participate in the normal restoration and operation of the firmware.

[0045] The second level of invalid packets focuses on mimicking the local features of the real sub-packets. While retaining some key data fragments, it achieves a fundamental difference from the real sub-packets through parameter distortion. Specifically, this type of invalid packet extracts specific byte sequences (such as key function fragments, data check segments, etc.) that are distinctive from the real sub-packets and embeds them to form some real features; however, it tampers with the overall parameters: the file size is adjusted to be outside the preset floating threshold of the real sub-packets (such as exceeding the ±10% deviation range), and the file header information undergoes minor modifications in core fields (such as check bits, version numbers) (such as flipping a single bit, offsetting field values), so that while the invalid packet satisfies local feature matching, it fails the complete validity check.

[0046] The third level of invalid packets is generated using a dynamic mutation strategy, achieving a higher level of camouflage through feature reuse and the embedding of interference information. This type of invalid packet first retains some core features of the real sub-packet (such as the range of file size, core identifiers in the file header, and the distribution pattern of specific byte sequences), making it correlated with the real sub-packet in feature analysis. Simultaneously, it periodically inserts two types of interference information into the data area using a dynamic mutation algorithm: first, anti-debugging fields (such as special instructions that trigger debugger interrupts and obfuscated code that disrupts memory analysis), interfering with the attacker's reverse engineering tools; second, false checksums (such as checksums generated by mimicking real checksum rules but not matching the actual data), misleading the judgment of data packet integrity. Ultimately, this forms a complex invalid packet that both possesses traces of real features and incorporates proactive defense mechanisms.

[0047] Next, the scale and feature distribution of invalid packets are quantitatively controlled to ensure a balance between their deceptiveness and system efficiency. Specifically, two core parameters of the real sub-packets need to be evaluated: first, the number of sub-packets—a larger number means more invalid packets are needed for coverage; second, the complexity of file features (such as the dimensionality of feature parameters and the uniqueness of specific byte sequences). Higher complexity requires more refined generation of invalid packets to avoid easy differentiation. Based on the above evaluation, the total number of invalid packets generated is dynamically calculated according to a preset ratio (e.g., the ratio of real sub-packets to invalid packets is no less than 1:5), ensuring that invalid packets have an absolute numerical advantage, overshadowing the presence of real sub-packets. At the same time, the feature similarity between each invalid packet and its corresponding real sub-packet is strictly controlled, keeping it within a preset range (e.g., 30%~70%): similarity below 30% loses its deceptive significance and is easily excluded; similarity above 70% may be misjudged as a real sub-packet, interfering with the legitimate extraction process. Through this control, invalid packets can effectively confuse attackers' judgments without hindering the accurate identification by the burning end.

[0048] Finally, the obfuscation effect is further enhanced by breaking the feature binding relationship between invalid packets and individual real sub-packets. Specifically, file features of multiple real sub-packets (such as the file size of sub-packet A, the file header information of sub-packet B, and a specific byte sequence of sub-packet C) are extracted and cross-combined to generate hybrid invalid packets. For example, a hybrid invalid packet may use the file size of sub-packet A, the core fields of the file header of sub-packet B, and partial byte sequence fragments of sub-packet C, while incorporating randomly generated interference data.

[0049] The aforementioned cross-combination allows a single invalid packet to simultaneously possess local features of multiple real sub-packets, breaking the fixed pattern where invalid packets merely mimic a single real sub-packet. Even if an attacker identifies feature fragments of some real sub-packets through feature analysis, it becomes difficult to locate the corresponding real sub-packets by associating these fragments, thus significantly increasing the difficulty of filtering real sub-packets from the mixed packet set. Furthermore, the cross-combination rules are dynamically generated by the system and correlated with the feature distribution patterns of real sub-packets, ensuring that legitimate programming terminals can exclude these mixed invalid packets using preset algorithms.

[0050] In one embodiment, based on the file characteristics, multiple corresponding invalid packets are generated, including: The file characteristics of the real sub-package are analyzed, and a feature mapping model is constructed. The feature mapping model includes the file size range, fixed and variable fields of the file header information, and the positional distribution pattern of specific byte sequences. Based on the aforementioned feature mapping model, an invalid packet is generated using a multi-dimensional mutation strategy; A unique dynamic identifier is generated for each invalid packet, which is then encrypted using an encryption key and embedded into the invalid packet; the encryption key is associated with the file characteristics of the real sub-packet. An invalid packet feature library is constructed, and the features of generated invalid packets are recorded in real time. The features are then compared during the subsequent generation of invalid packets to ensure that the feature repetition rate between newly generated invalid packets and existing invalid packets and real sub-packets is below a preset threshold.

[0051] In this embodiment, firstly, by performing structured analysis and modeling of the features of real sub-packages, an accurate imitation benchmark is provided for the generation of invalid packages. Specifically, the file features of real sub-packages are first comprehensively extracted and analyzed, covering three core dimensions: File size range: Based on the byte length of the actual sub-packet, determine its upper and lower fluctuation range (e.g., ±5%~±10%), forming the size constraint boundary in the feature mapping model; Fixed and variable fields in the header information: The header information is broken down into two types of fields—fixed fields (such as constants that identify firmware type, version number format, etc., which are stable) and variable fields (such as timestamps, checksums, etc., which are dynamic), and the position, length and format rules of each field are recorded. The positional distribution pattern of specific byte sequences: Locate specific byte sequences (such as key instruction segments, data markers, etc.) that are identifiable in the real sub-packet, analyze their starting offset, length and relative positional relationship with other data in the sub-packet, and form a sequence distribution model.

[0052] By integrating the information from the above dimensions, a complete feature mapping model is constructed. This model not only includes the static feature parameters of the real sub-packages, but also covers the association rules between each feature, providing an accurate reference framework for the subsequent multi-dimensional imitation of invalid packages.

[0053] Next, an invalid packet is generated using a multi-dimensional mutation strategy based on the feature mapping model. This step, based on the feature mapping model, generates an invalid packet that is similar to the real sub-packet but also fundamentally different by performing controlled mutations across multiple dimensions. In one embodiment, the mutation strategy targets three core dimensions of the feature mapping model: File size dimension: Randomly generate values ​​that are outside the actual sub-package file size range, or values ​​that are within the range but whose difference from the actual value meets preset conditions (such as the difference being greater than 30% of the range threshold), to ensure that the size feature is distinguishable. Header information dimension: Fixed fields are modified to a limited extent (such as flipping specific bits or replacing some characters) to keep their surface format unchanged but invalidate the core identifier; for variable fields, random content that conforms to the format rules but is unrelated to the actual logic is generated (such as forged timestamps or invalid check values) to maintain the similarity of the header structure; Specific byte sequence dimension: Mutant sequences are generated in two ways: one is to extract a part of the real sequence and splice it with random data to form a pseudo sequence with logical breaks; the other is to keep the sequence length and distribution position unchanged, but replace the core byte content to make it lose its actual function.

[0054] The implementation of a multi-dimensional mutation strategy ensures that invalid packets maintain a certain degree of similarity to real sub-packets in terms of appearance features, which is enough to confuse simple feature recognition methods. At the same time, through controllable mutations in key dimensions, it makes it impossible for them to pass strict validity checks.

[0055] Furthermore, by adding encrypted identifiers to invalid packets, tracking and anti-counterfeiting of invalid packets are achieved, while strengthening the correlation with the characteristics of genuine sub-packets. The specific process is as follows: Generate dynamic identifiers: Assign a unique identifier to each invalid packet. The identifier consists of two parts: the timestamp of the invalid packet's generation (to ensure timeliness) and a random number fragment (to ensure uniqueness). The two are combined to form an original identifier that cannot be repeated. Generate associated encryption key: Based on the file feature parameters of the real sub-packet (such as the hash value of the file size, the digest value of a specific byte sequence, etc.), an encryption key is generated through a preset algorithm (such as a key derivation function) to form a strong association between the key and the real sub-packet; Encryption and Embedding: The dynamic identifier is encrypted using the above encryption key (e.g., using the AES algorithm) to obtain an encrypted identifier; then the encrypted identifier is embedded in the data area of ​​the invalid packet in a covert manner (e.g., scattered storage at specific offset positions, disguised as normal data fragments), which neither destroys the overall characteristics of the invalid packet, but can also be extracted and verified by the legitimate system when needed.

[0056] Through the above process, each invalid packet has a unique and encrypted identity, and the encryption key of the identity is bound to the real sub-packet, providing a security foundation for subsequent invalid packet management and identification.

[0057] By establishing a feature library and a duplication rate verification mechanism, the diversity and uniqueness of invalid packets are ensured, avoiding security degradation caused by feature duplication. Specifically: Build a feature library: Record the core features of all generated invalid packets in real time (such as file size, key fields in the file header, specific byte sequence fragments, dynamically identified encrypted digests, etc.), and store these features in a structured manner in the invalid packet feature library to form a historical feature dataset; Real-time comparison and duplication rate control: When a new invalid packet is generated, the system compares its features with the existing invalid packet features and real sub-packet features in the feature library, and calculates the feature duplication rate (such as the number of matches of the same field, the degree of overlap of sequence segments, etc.). Threshold verification: If the feature duplication rate of the newly generated invalid packet is higher than the preset threshold (e.g., 30%), it is determined to be a duplicate feature. The system will re-execute the mutation generation process until the feature duplication rate of the new invalid packet is lower than the threshold.

[0058] The above mechanism ensures that all invalid packets have sufficient differences in features, which avoids mutual interference between invalid packets and prevents attackers from discovering patterns due to excessive similarity in features, thereby maintaining the complexity and deceptiveness of the mixed packet set.

[0059] In one embodiment, an invalid packet is generated using a multi-dimensional mutation strategy, including: In terms of file size, randomly generate values ​​that are outside the range of the actual sub-package file size, or values ​​that are within the range but whose difference from the actual sub-package meets the preset conditions. In the header information dimension, fixed fields are flipped or replaced, and variable fields are generated with random content that does not conform to the actual pattern. In a specific byte sequence dimension, generate a byte stream that contains some real sequence fragments but has overall logical breaks, or a byte stream whose sequence position completely contradicts the real distribution pattern; Based on the mutation strategy of file size dimension, file header information dimension, and specific byte sequence dimension, a corresponding invalid packet is generated.

[0060] In this embodiment, a baseline range is first determined based on the actual sub-packet file size (e.g., if the actual size is 100KB, the range is set to 90KB~110KB). Then, the invalid packet file size is generated using two methods: The first method is to randomly generate values ​​that exceed the baseline range, such as generating file sizes of 80KB or 120KB, so that invalid packets differ significantly in size from real sub-packets. The second method is to generate a value that is within the baseline range but whose difference from the actual sub-packet size meets preset conditions. For example, the difference must be greater than 5KB (that is, for a 100KB actual sub-packet, generate a size of 90KB~95KB or 105KB~110KB) to ensure that although it is within the range, it maintains a sufficient distance from the actual value.

[0061] Using the two strategies described above, the file size of invalid packets will not be completely identical to that of real sub-packets, while maintaining similarity within a certain range. This avoids direct exclusion due to excessive differences and provides identifiable feature basis for subsequent authenticity verification.

[0062] A mutation strategy is implemented at the header information level: this mutation focuses on structural alteration of the header information, compromising the validity of key identifier fields to prevent invalid packets from passing header validation, while maintaining surface format similarity. Specific operations fall into two categories: For fixed fields in the file header (such as constants used to identify firmware type, protocol version number, etc., whose values ​​are stable in the actual sub-packets), tampering is performed using flipping or replacement operations. For example, specific bits of fixed fields are flipped (e.g., changing binary "1010" to "1000"), or invalid characters are used to replace part of the field content (e.g., changing the version number "V2.1" to "V2.x"), causing the field to lose its actual identification function; For variable fields in the file header (such as timestamps and temporary checksums, whose values ​​are dynamic but follow certain patterns within the actual sub-packets), random content that does not conform to the actual patterns is generated. For example, the timestamp of an actual sub-packet is usually the current generation time, while the timestamp of an invalid packet may be a future time or a meaningless value; the actual checksum is associated with the file content, while the checksum of an invalid packet is a randomly generated string unrelated to the data within the packet.

[0063] Through the above operations, the header of the invalid packet is consistent with the format of the real sub-packet, which is sufficient to pass the initial structure check. However, the validity of the core fields has been destroyed, and they cannot participate in the normal parsing and operation of the firmware.

[0064] A mutation strategy is implemented along a specific byte sequence dimension: mutations in this dimension disrupt the logic and distribution patterns of key data sequences, rendering invalid packets ineffective while preserving local features to enhance deception. Two specific strategies are employed: The first strategy is to generate a byte stream that contains fragments of the actual sequence but is logically broken. The system extracts specific byte sequence fragments with identifying characteristics from the actual sub-packets (such as the first half of a key instruction or header markers for data blocks), concatenates them with randomly generated invalid data, forming a byte stream that appears to contain valid information but is logically incoherent. For example, the actual sequence might be "ABCDEFG" (representing a complete instruction), while the invalid packet might contain "ABCXYZ" (keeping the first three characters and then random characters), making the sequence unparseable. The second strategy is to generate byte streams whose sequence positions completely contradict the actual distribution patterns. The system analyzes the distribution characteristics of specific byte sequences in the real sub-packets (such as appearing in the first 10% of the file or being adjacent to a certain marker field), and then places the same sequence fragments in completely different positions in the invalid packets (such as at the end of the file or adjacent to irrelevant fields), breaking the positional correlation of the real sequences.

[0065] Through the two strategies described above, although invalid packets may contain the same local sequence fragments as real sub-packets, they cannot form valid functional data due to the disruption of the overall logic or positional distribution, thus ensuring that they cannot participate in the normal restoration of firmware.

[0066] Next, by integrating the mutation results from the above three dimensions, a complete invalid packet is generated. First, the byte length of the invalid packet is determined according to the file size dimension strategy to ensure that it meets the preset conditions for size mutation; then, a tampered file header is generated based on the file header information dimension strategy, containing fixed fields that have been flipped or replaced, as well as variable fields that do not conform to the actual pattern; finally, a byte stream of the data area is generated according to the specific byte sequence dimension strategy, forming logically broken or misplaced sequence fragments.

[0067] During the integration process, it is essential to ensure that the mutation results across all dimensions are consistent. For example, the length of the file header must match the overall file size, and the sequence fragments of the data area must be reasonably distributed within a preset size range. This prevents the invalid packet features from being too abrupt due to inconsistencies between dimensions. The final generated invalid packet exhibits controllable differences from the real sub-packet in multiple dimensions, including file size, header structure, and data sequence. This ensures sufficient deception to confuse attackers while retaining identifiable feature differences, guaranteeing that legitimate flashing devices can accurately exclude it using preset algorithms.

[0068] In one embodiment, when generating invalid packets using a multi-dimensional mutation strategy, the expected security level of the mixed packet set is obtained, and the generation dimension and mutation degree of the invalid packets are dynamically adjusted based on the expected security level; wherein, the higher the security level, the more dimensions participate in the mutation, and the greater the mutation degree.

[0069] In this embodiment, determining the expected security level requires comprehensive consideration of multiple factors, including the importance of the device to which the firmware belongs (e.g., the security requirements of core server firmware differ from those of ordinary terminal firmware), the threat level of the supply chain environment (e.g., high-risk areas require higher security protection), and the sensitivity of the firmware data (e.g., firmware containing core algorithms requires enhanced protection). A pre-defined security level assessment model (e.g., classifying security levels into basic, enhanced, and highest levels) is used, combined with the above factors, to quantify and score the data, ultimately determining the expected security level of the hybrid packet set. This level directly determines the strength and scope of the mutation strategy during invalid packet generation, ensuring that security protection measures match actual needs.

[0070] Based on the determined expected security level, the number of dimensions involved in mutation can be flexibly configured to achieve precise control over the security protection strength. Specifically, the adjustment of generated dimensions follows the principle of "the higher the security level, the more dimensions": When the expected security level is basic, only some core dimensions (such as file size and file header information) can be selected for mutation. Basic protection needs can be met by mutation of fewer dimensions, while also taking into account generation efficiency. When the expected security level is enhanced, all three dimensions (file size, file header information, and specific byte sequence) should be enabled to participate in mutation. Through multi-dimensional collaborative mutation, the deceptiveness of invalid packets can be improved to deal with medium-intensity attack threats. When the expected security level is the highest, in addition to the three basic dimensions mentioned above, the system can also introduce additional mutation dimensions (such as data block checksum dimension, file metadata dimension, etc.) to further increase the difficulty for attackers to identify the real sub-packets by expanding the mutation range, thus meeting the high security requirements of the scenario.

[0071] Through the above dynamic adjustments, the generation dimension of invalid packets is directly related to the expected security level, ensuring a balance between resource investment and protection effectiveness.

[0072] After identifying the dimensions involved in the mutation, the degree of mutation in each dimension is further adjusted according to the expected security level to achieve refined control of protection strength. The adjustment of the mutation degree follows the principle of "the higher the level, the greater the degree of mutation," specifically manifested as follows: In terms of file size, at the basic security level, the difference between the size of the invalid packet and the real sub-packet can be controlled within a small range (e.g., ±15%); at the enhanced level, the difference range expands to ±30%; at the highest level, the difference range further expands to ±50%, or completely deviates from the size range of the real sub-packet, forming a larger difference.

[0073] In terms of file header information, the basic level only slightly modifies fixed fields (such as flipping a single bit); the enhanced level replaces fixed fields in multiple positions and generates content that deviates significantly from the actual pattern for variable fields; the highest level completely reconstructs fixed fields (such as replacing the core identifier) ​​while making variable fields lose all logical correlation.

[0074] At a specific byte sequence level, the basic level only performs short-distance positional offsets on the real sequence fragments; the enhanced level randomly splices the sequence fragments, forming obvious logical breaks; and the highest level completely disrupts the sequence distribution pattern or embeds a large number of interference sequences, causing the real fragments to be completely submerged.

[0075] By adjusting the degree of variation in the above-mentioned graded manner, the degree of difference of invalid packets in each dimension is adapted to the expected security level, ensuring that invalid packets in high-security scenarios have stronger anti-analysis capabilities and effectively resist complex attack methods.

[0076] Integrating the above dynamic adjustment results, invalid packets matching the expected security level are generated. First, the dimensions involved in mutation are determined based on the security level (e.g., 2 dimensions for the basic level, 4 dimensions for the highest level). Then, mutation operations are performed on each dimension according to the corresponding mutation degree parameters (e.g., range of size difference, field tampering strength, sequence scrambling degree, etc.). During the generation process, it is necessary to ensure that the mutation parameters of each dimension are coordinated to avoid an imbalance in the overall protection effect due to excessive or insufficient mutation in one dimension. The final generated invalid packet will have a feature difference range and complexity that strictly matches the expected security level, satisfying the security protection needs in different scenarios while avoiding waste of system resources or obstruction of the legitimate extraction process due to excessive mutation.

[0077] In one embodiment, generating the name of the real sub-package includes: Extract the core parameters of the packet splitting algorithm; for each real sub-packet, fuse the core parameters with the file features of the real sub-packet, and generate a basic key based on the fusion result; The logical sequence number of the real sub-packet in the overall supply chain firmware package is encrypted based on the base key to obtain the encrypted sequence number. A pseudo-random sequence is generated using the encrypted sequence number of the real sub-package. Based on the pseudo-random sequence, a preset encoding table is mutated to obtain a mutated encoding table. The mutated position is determined by the pseudo-random sequence and the file size of the real sub-package. The position of the mutated character in the mutated encoding table is mapped to the feature code of the file header information. The encrypted sequence number is encoded and converted based on the mutation encoding table to generate the name.

[0078] In this embodiment, by deeply integrating the core parameters of the packet sub-packet algorithm with the file characteristics of the real sub-packets, a basic key for subsequent encryption processing is constructed, ensuring that the key is closely related to the core elements of the firmware encryption process.

[0079] First, the core parameters of the packet splitting algorithm when cutting the real firmware package are extracted. These parameters include, but are not limited to: the starting offset of the packet splitting (the position identifier where the splitting begins in the firmware package), the splitting step size (the length of bytes or the size of data blocks for each split), and the built-in verification factor of the algorithm (a feature value used to verify the integrity of the packet splitting process). These parameters directly determine the generation logic of the real sub-packets.

[0080] Subsequently, for each real sub-packet, the aforementioned core parameters are fused with the sub-packet's file characteristics (such as file size, header information signature, hash value of a specific byte sequence, etc.). The fusion process employs a pre-defined algorithm logic, ultimately forming a unique base key strongly correlated with the sub-packet's characteristics.

[0081] Through this process, the base key not only contains the core logical information of the packet splitting algorithm, but also embeds the unique characteristics of the real sub-packets, providing a secure and unique key foundation for subsequent encryption steps and ensuring that the encryption processes of different sub-packets are independent and related.

[0082] Next, the logical sequence number of the real sub-packet is converted into an irreversible encrypted sequence number through encryption processing, which enhances the security of the sub-packet identifier and ensures the binding relationship between the sequence number and the sub-packet characteristics.

[0083] The logical sequence number of a real sub-packet refers to its position within the complete supply chain firmware package (e.g., the first, second, etc.), used to determine the order in which sub-packets are combined. Using the base key generated in the previous step, this logical sequence number is encrypted using a preset encryption algorithm. During encryption, the base key serves both as the encryption key in computation and as the round key generated through a key expansion algorithm, ensuring encryption strength.

[0084] The encrypted sequence number obtained after encryption not only hides the true logical order (preventing attackers from deducing the sub-packet arrangement pattern through the sequence number), but also forms a unique mapping with the base key. That is, only with the corresponding base key can the original logical sequence number be decrypted. In addition, the choice of encryption algorithm is related to the type of sub-packet algorithm (e.g., a specific sub-packet algorithm corresponds to a specific encryption algorithm), further strengthening the correlation between the encryption process and the overall encryption method.

[0085] Furthermore, by constructing a variant encoding table associated with sub-package features, unique encoding rules are provided for subsequent name generation, avoiding the security risks associated with using a general encoding table.

[0086] Using the encrypted sequence number of the real sub-packet as a seed, a pseudo-random sequence is generated using a pseudo-random number generation algorithm (such as the Mason swivel algorithm). The length of this sequence matches the number of characters in the preset encoding table, ensuring that the sequence covers all character positions in the encoding table.

[0087] Subsequently, the preset encoding table is mutated based on this pseudo-random sequence. The mutation process follows a dual constraint rule: The mutation location is determined by the pseudo-random sequence and the file size of the real sub-packet: each value in the pseudo-random sequence corresponds to a character position in the encoding table. The system performs a modulo operation on the value according to the file size to further adjust the mutation location, ensuring that the location selection is related to the sub-packet size feature. In the mutated encoding table, the position of the mutated character is mapped to the feature code of the file header information: the file header feature code (such as CRC check value, hash value of core identifier field) is converted into position index, and the mutated character needs to be distributed according to the index rule, so that the mutation pattern of the encoding table is bound to the header feature of the sub-packet.

[0088] Specific mutation operations include character substitution (such as swapping the character at position A with the character at position B) and character replacement (such as replacing the original character with another character from a preset character set), ultimately forming a mutation encoding table that applies only to the current real sub-packet. This encoding table possesses both randomness (based on pseudo-random sequences) and strong correlation with the sub-packet's encryption sequence number, file size, and file header characteristics, ensuring its uniqueness and security.

[0089] Finally, the encrypted sequence number is encoded using a mutation encoding table, transforming the abstract encrypted information into a name that can identify the sub-packet, while ensuring a unique binding between the name and the sub-packet characteristics.

[0090] First, the encrypted sequence number is converted into a binary byte stream. Then, the byte stream is encoded according to the rules of the mutation encoding table. That is, each fixed-length binary segment (such as 6 bits) corresponds to a character in the mutation encoding table. The character sequence is generated by looking up the table and mapping.

[0091] During the encoding process, due to the multiple relationships between the mutation encoding table and the encryption sequence number, file size, and file header features of the actual sub-package, the generated character sequence (i.e., the sub-package name) not only represents the encryption sequence number but also implicitly contains the core characteristic information of the sub-package. Furthermore, the length of the name is jointly determined by the byte length of the encryption sequence number and the character mapping rules of the mutation encoding table, ensuring that the names of different sub-packages have significant distinguishability.

[0092] The final generated real sub-package name cannot be reverse-analyzed through the general encoding table (because it is based on the variant encoding table), and it is deeply bound to the logical sequence number, file characteristics, and sub-packet algorithm parameters of the sub-package, providing a unique and secure identification basis for the subsequent burning end to extract the real sub-package.

[0093] In one embodiment, the core parameters include the starting offset of the sub-packet cutting, the cutting step size, and the verification factor; The core parameters are fused with the file characteristics of the actual sub-packages, and a base key is generated based on the fusion result, including: The starting offset is moduloed by the file size to obtain the first fusion value; The cutting step size is convolved with the feature code of the file header information to obtain the second fusion value; The verification factor is concatenated with the hash value of a specific byte sequence and then hashed to obtain the third fusion value; Based on the first fusion value, the second fusion value, and the third fusion value, a basic key is constructed; wherein, the first fusion value serves as the initial vector of the key, the second fusion value serves as the encryption factor of the key, and the third fusion value serves as the length parameter of the key.

[0094] In this embodiment, firstly, the starting offset of the packet splitting algorithm and the file size of the actual sub-packet are correlated and fused through mathematical operations to generate an initial vector for the basic key. The starting offset is the starting position identifier (in bytes) when the packet splitting algorithm cuts the actual firmware packet, directly determining the starting boundary of the sub-packet in the original firmware; the file size is the byte length of the actual sub-packet, reflecting the physical size of the sub-packet. The significance of the above operation is that by normalizing the starting offset through the file size, the fusion result retains the characteristics of the starting position and is correlated with the physical size of the sub-packet, avoiding feature redundancy caused by excessively large absolute values ​​of the offset. The final first fused value will serve as the initial vector of the basic key, providing initial state parameters for subsequent encryption operations, ensuring that the key is closely bound to the starting point and size characteristics of the sub-packet splitting.

[0095] The encryption factor for the base key is generated by deeply fusing the segmentation step size of the packet splitting algorithm with the file header feature code of the actual sub-packets through convolution operations. The segmentation step size is the fixed byte length of each segmentation by the packet splitting algorithm, which determines the segmentation interval of the sub-packets; the feature code of the file header information is the hash value or digest value of the core identification fields (such as firmware type, version number, etc.) in the file header, which is unique and can be used to identify the logical attributes of the sub-packets.

[0096] The convolution operation process is as follows: the segmentation stride is converted into a numerical sequence (e.g., the stride value in bytes is expanded into an integer sequence), and the file header feature code is converted into a feature sequence of equal length (e.g., the binary bits of the hash value are split into a sequence). Then, a weighted sum of the two sequences is calculated using a sliding window to obtain the convolution result. The core of this operation is to strengthen the correlation between the segmentation pattern and the sub-packet header features, so that the fusion result contains both the algorithm's segmentation logic and the sub-packet's identification attributes. The final second fusion value will serve as the encryption factor for the base key, directly participating in subsequent encryption operations to ensure that the key reflects the sub-packet's segmentation pattern and logical identification.

[0097] Next, the check factor of the packet splitting algorithm is fused with the specific byte sequence characteristics of the actual sub-packet through a double hash operation to generate the length parameter of the base key. The check factor is a feature value (such as polynomial coefficients, checksum, etc.) built into the packet splitting algorithm to verify the integrity of the segmentation, ensuring that the segmentation process has not been tampered with; the hash value of the specific byte sequence is the hash result of key data fragments (such as core instructions, data tags, etc.) in the sub-packet, used to identify the content characteristics of the sub-packet.

[0098] The process consists of two steps: First, the check factor (in string or byte stream form) is concatenated with the hash value of a specific byte sequence in a preset order to form a combined string (e.g., check factor first, hash value second, separated by a delimiter). Then, a hash operation (e.g., using the SHA-1 algorithm) is performed on this combined string to obtain a fixed-length hash value, the third fusion value. This process strengthens the correlation between the check factor and the characteristics of the sub-packet content through two hash operations, while compressing the fusion result into a fixed length for easy use as a key length parameter.

[0099] By integrating the fusion values ​​obtained from the previous three steps, a complete base key is constructed, ensuring that the key simultaneously contains multiple pieces of information, including packet splitting algorithm parameters and sub-packet characteristics. The construction process follows clearly defined role allocation rules: The first fusion value serves as the initialization vector (IV) of the key, used to initialize the state of the encryption algorithm, ensuring that the same plaintext generates different ciphertexts under different initial states, thus enhancing the randomness of encryption. The second fusion value serves as the encryption factor of the key, directly participating in the round function operation of the encryption algorithm, determining the strength and pattern of data obfuscation. The third fusion value serves as the length parameter of the key, dynamically determining the effective byte length of the key through its numerical range (e.g., taking the first N bits of the hash value as the key length, where N is determined by the magnitude of the third fusion value).

[0100] In the specific implementation, the first and second fusion values ​​are concatenated byte-wise, and then the effective portion is truncated according to the length determined by the third fusion value to form the final base key. For example, if the first fusion value is 32 bytes, the second fusion value is 64 bytes, and the third fusion value determines the key length to be 48 bytes, then the first 48 bytes of the concatenated key are taken as the base key. Through this construction method, the base key simultaneously carries the packet splitting logic of the packet splitting algorithm and the physical, logical, and content characteristics of the actual sub-packets, achieving a deep binding between algorithm parameters and sub-packet characteristics.

[0101] In one embodiment, the name is generated by encoding and converting the encrypted sequence number based on a mutation encoding table, including: The encrypted sequence number is encoded and converted based on the mutation encoding table to obtain an encoded sequence as the name body; the name is determined based on the name body; wherein, the length of the name is determined by the third fusion value, and an identifier segment formed by the feature code of the file header information is also embedded in the name body, and the position of the identifier segment in the name body is determined by the first fusion value.

[0102] In this embodiment, firstly, the encrypted sequence number is converted into a specific encoded sequence using a mutation encoding table to form the name body. This allows the name to both hide the original information of the encrypted sequence number and be closely associated with the sub-packet characteristics. The encrypted sequence number is a logical sequence number encrypted with the base key, existing in the form of a binary byte stream, and needs to be converted into a recognizable character sequence through encoding conversion.

[0103] Because the generation of the mutation encoding table is associated with the encryption sequence number, file size, and file header feature code of the real sub-package, the generated name body is not only an external representation of the encryption sequence number, but also implies the core feature information of the sub-package, ensuring its uniqueness and irreplaceability.

[0104] Next, by adjusting the length of the main name and embedding an identifier segment, the binding relationship between the name and the sub-package features is further strengthened, forming the final real sub-package name.

[0105] First, the total length of the name is determined based on the third fusion value. The third fusion value is the result of concatenating and hashing the check factor with the hash value of a specific byte sequence; its value range determines the number of valid characters in the name. For example, if the parsed length of the third fusion value is 32 characters, the name body needs to be truncated or expanded to 32 characters (if the body length is insufficient, it is padded according to preset rules; if it exceeds the limit, the first 32 characters are truncated), ensuring that the name length is related to the content characteristics of the sub-packages and the verification logic of the sub-package algorithm.

[0106] Secondly, an identifier segment formed by the feature code of the file header information is embedded in the name body. The feature code of the file header information is converted into a fixed-length character sequence, serving as an explicit identifier of the sub-packet's logical attributes. The embedding position of the identifier segment in the name body is determined by a first fusion value: the first fusion value is the result of a modulo operation between the starting offset and the file size, and its value is mapped to a specific index position in the name body after modulo processing (e.g., if the first fusion value is 500 and the name length is 32, then 500 modulo 32 equals 20, meaning the identifier segment is embedded at the 20th character position). During the embedding process, the identifier segment will either cover the characters at the corresponding position in the name body or insert them into it (in this case, the total name length needs to be adjusted accordingly to maintain consistency with the third fusion value).

[0107] The final, true sub-package name not only links the sub-package's content features and verification logic through length constraints, but also strengthens its binding with file header features through identifier segment embedding, while retaining the main sequence generated based on the mutation encoding table, thus achieving the fusion of multiple feature information. This name not only serves as a unique identifier for the sub-package, but also provides the programming end with implicit feature evidence for verifying the authenticity of the sub-package, ensuring accurate identification within the mixed package set.

[0108] In one embodiment, generating the name of the real sub-package includes: Extract dynamic parameters of the packet splitting algorithm when splitting firmware packages in the supply chain, including the real-time system load value during splitting, the ID encoding of the splitting thread, and the file characteristic parameters of the actual sub-packages; A parameter correlation matrix is ​​established, with the cutting thread ID encoding and the CRC check value of the file header information as the row vectors of the matrix, and the real-time system load value and the position offset array of a specific byte sequence as the column vectors. The first correlation value is obtained through matrix multiplication. The binary representation of the file size is converted to decimal and then weighted and summed with the real-time system load value at the time of cutting to obtain the second correlation value. Obtain the number of invalid packets and the average file size of invalid packets, and calculate the interference coefficient; the interference coefficient is the base interference value obtained by multiplying the product of the number of invalid packets and the average file size, taking the modulo operation, and then XORing it with the first correlation value. The second correlation value is fused with the basic interference value to form a dynamic key seed; the dynamic key seed is used to drive the stream encryption algorithm to encrypt the logical sequence number of the real sub-packet to obtain the encrypted sequence number; Based on the Base64 encoding table, the character removal rules of the encoding table are determined according to the file feature distribution pattern of invalid packets, and characters that are highly similar to the features of invalid packets are removed; combined with the hash value of a specific byte sequence of the real sub-packet, the remaining characters are rearranged in position, and the replacement rules are generated by the parity of the encryption sequence number and the feature code of the file header information. The encrypted sequence number is encoded using a dynamic encoding table to generate the name.

[0109] In this embodiment, dynamic parameters of the packet splitting algorithm during the segmentation of the supply chain firmware package are first extracted, including: real-time system load value during segmentation (reflecting the system resource usage at the moment of segmentation, such as quantitative indicators like CPU utilization and memory usage), and the ID encoding of the segmentation thread (a string or numerical value that uniquely identifies the thread performing the packet splitting operation). Simultaneously, file characteristic parameters of the actual sub-packages are extracted. These parameters include, but are not limited to, file size (byte length of the sub-package), CRC checksum of the file header information (a hash value used to verify the integrity of the file header), position offset array of a specific byte sequence (recording the position index of key data segments in the sub-package within the overall firmware package), and hash value of a specific byte sequence (a feature value obtained by hashing the key data segments).

[0110] By extracting the above parameters, a dataset containing dynamic features of the packet splitting process and static features of sub-packets was constructed, providing comprehensive basic information for subsequent steps such as establishing parameter associations and generating encryption keys.

[0111] By using mathematical operations to associate and fuse dynamic parameters with file feature parameters, a basic association value is generated for subsequent encryption processing, strengthening the binding relationship between the name and the sub-packet process and sub-packet characteristics.

[0112] Calculating the first correlation value: First, a parameter correlation matrix is ​​constructed. The ID encoding of the split thread (converted to a numerical vector) and the CRC checksum of the file header information (represented in numerical form) are used as the row vectors of the matrix, and the real-time system load value (quantized value) and the position offset array of a specific byte sequence (converted to a numerical sequence) are used as the column vectors. Then, the row and column vectors are fused through matrix multiplication to obtain a multidimensional numerical result. This result is then converted into a single value, the first correlation value, using a preset dimensionality reduction algorithm (such as modulo or summation). This process integrates thread identification, file header integrity features, system load, and key sequence position information to form a feature value reflecting multidimensional correlation.

[0113] The second correlation value is calculated by converting the binary representation of the actual sub-package file size into a decimal value, and then performing a weighted sum with the real-time system load value at the time of splitting. The weighting coefficients are determined by preset rules, such as assigning weights based on the importance of file size and system load in the packet splitting process. Through this calculation, the physical size characteristics of the sub-package are correlated with the dynamic state of the system at the time of splitting, generating a second correlation value, which further enriches the dimensions of the correlation characteristics.

[0114] Next, the feature information of invalid packets is introduced to generate interference coefficients to enhance the complexity of the encryption process. This makes the generation of real sub-packet names not only related to their own features, but also associated with the features of invalid packets in the mixed packet set, thereby improving the anti-cracking capability.

[0115] Obtain the number of invalid packets and the average file size of invalid packets in the mixed packet set. Then, calculate the product of the two and perform a modulo operation on the product (the modulus is usually a preset fixed value, such as 256 or the sub-packet file size) to obtain a preliminary interference value. Based on this, perform an XOR operation between the preliminary interference value and the first correlation value to finally obtain the base interference value.

[0116] By introducing characteristic parameters of invalid packets, the basic interference value contains both the correlation information between real sub-packets and the packet splitting process, and incorporates the overall characteristics of the mixed packet set, making it more difficult for the subsequently generated keys and names to be cracked individually.

[0117] An encryption key is generated by fusing correlation values ​​and interference values, and the logical sequence number of the real sub-packet is encrypted to ensure the security of the sequence number information, while strengthening the association between the key and multi-dimensional features. The second correlation value is fused with the basic interference value. The fusion method can be byte concatenation followed by hashing, or combination using preset bitwise operations (such as bitwise AND and bitwise OR) to form a fixed-length value, i.e., a dynamic key seed. This seed simultaneously carries the correlation information of sub-packet characteristics, system dynamic parameters, and invalid packet characteristics, possessing high uniqueness and randomness. Subsequently, this dynamic key seed is used to drive a stream encryption algorithm (such as RC4, Salsa20, etc.) to encrypt the logical sequence number of the real sub-packet in the overall supply chain firmware package. The stream encryption algorithm generates a pseudo-random key stream through the key seed, performs an XOR operation with the binary data of the logical sequence number, and generates an encrypted sequence number. During the encryption process, the key stream and the dynamic key seed are strictly bound to ensure that the encrypted sequence numbers of different sub-packets cannot be decrypted using the same decryption rules, thus hiding the true arrangement order of the sub-packets.

[0118] Next, by modifying the general encoding table, a dynamic encoding table is generated that applies only to the current real sub-package. This deeply associates the encoding rules of the names with the characteristics of the mixed package set and the sub-package characteristics, avoiding the security risks associated with using a general encoding table. The modification is carried out in two steps, based on the Base64 encoding table: Character removal: Based on the distribution patterns of invalid packet file characteristics (such as common characters in the invalid packet file header, high-frequency characters in specific byte sequences, etc.), character removal rules are determined. Characters in the encoding table that are highly similar to the characteristics of invalid packets (such as the frequently appearing characters "Z" and "9" in the invalid packet file header) are removed, while characters that are significantly different from the characteristics of invalid packets are retained, ensuring that the characters in the encoding table are distinguishable from the characteristics of invalid packets.

[0119] Position rearrangement: The remaining characters after removal are rearranged. The replacement rules are generated by two factors: first, the parity of the encryption sequence number (rule A is used if the encryption sequence number is odd, and rule B is used if it is even); second, the feature code of the file header information (such as a hash fragment of the CRC check value). The feature code is mapped to the replacement index of the character position through a preset algorithm. Through this process, the arrangement order of characters is closely related to the encryption sequence number and the sub-packet header features, forming a dynamic encoding table.

[0120] The encrypted sequence number is converted into a recognizable character sequence using a dynamic encoding table, forming the name of the actual sub-packet. This name both hides the original information of the encrypted sequence number and is uniquely bound to multi-dimensional features. The binary data of the encrypted sequence number is split into fixed-length segments, with each group of binary numbers corresponding to a character in the dynamic encoding table. By traversing all groups and querying the dynamic encoding table, a continuous character sequence is generated, which is the name of the actual sub-packet. Because the construction of the dynamic encoding table is strongly correlated with invalid packet characteristics, encrypted sequence numbers, and file header features, the generated name is not only unique but also contains multiple implicit feature information. It cannot be reverse-analyzed using a general encoding table and can be recognized by the programming end based on preset rules, ensuring accurate extraction within the mixed packet set. The final generated name of the actual sub-packet, through deep binding of encoding rules and multi-dimensional features, becomes the unique security identifier of the sub-packet.

[0121] Reference Figure 2 In another embodiment of the present invention, a supply chain firmware encryption device based on algorithmic packet splitting and information embedding is also provided, comprising: The packet sub-packet module is used to sub-packet the real supply chain firmware package based on the packet sub-packet algorithm to obtain multiple real sub-packets and record the file characteristics of each real sub-packet. The generation module is used to generate multiple corresponding invalid packets based on the file characteristics; A mixing module is used to mix the invalid packets into a packet set containing each of the real sub-packets to obtain a mixed packet set; An embedding module is used to generate the name and order of the real sub-packets, and embed the verification information of the packet splitting algorithm and the name and order of the real sub-packets into the firmware information.

[0122] In this embodiment, the specific implementation of each module in the above device embodiment is described in the above method embodiment, and will not be repeated here.

[0123] Reference Figure 3 This invention also provides a computer device, which can be a server, and its internal structure can be as follows: Figure 3 As shown, the computer device includes a processor, memory, display screen, input device, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores the data corresponding to this embodiment. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the above-described method.

[0124] Those skilled in the art will understand that Figure 3 The structures shown are merely block diagrams of some structures related to the present invention and do not constitute a limitation on the computer devices on which the present invention is applied.

[0125] An embodiment of the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.

[0126] In summary, the supply chain firmware encryption method based on algorithm-based packet splitting and information embedding provided in this embodiment of the invention includes: splitting a real supply chain firmware package into multiple real sub-packages based on a packet splitting algorithm, and recording the file characteristics of each real sub-package; generating multiple corresponding invalid packets based on the file characteristics; mixing the invalid packets into a package set containing each of the real sub-packages to obtain a mixed package set; generating the names and order of the real sub-packages, and embedding the verification information of the packet splitting algorithm and the names and order of the real sub-packages into the firmware information. In this invention, by splitting the supply chain firmware package and mixing in invalid packets, the firmware package becomes difficult to crack, thus enhancing the confidentiality of the firmware.

[0127] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the present invention and embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM, etc.

[0128] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0129] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A supply chain firmware encryption method based on algorithm-based packet segmentation and information embedding, characterized in that, Includes the following steps: The actual supply chain firmware package is divided into multiple real sub-packages based on the packet splitting algorithm, and the file characteristics of each real sub-package are recorded. Based on the file characteristics, multiple corresponding invalid packets are generated; The invalid packets are mixed into a packet set containing each of the real sub-packets to obtain a mixed packet set; Generate the name and order of the real sub-packets, and embed the verification information of the packet splitting algorithm and the name and order of the real sub-packets into the firmware information.

2. The supply chain firmware encryption method based on algorithm-based packet splitting and information embedding according to claim 1, characterized in that, Also includes: For the mixed packet set, the programming end extracts the real sub-packets from the mixed packet set by extracting the names and order of the real sub-packets embedded in the firmware information; Based on the verification information of the packet sub-packet algorithm embedded in the firmware information, the real sub-packets are combined using the corresponding packet sub-packet algorithm to obtain the supply chain firmware package, and then integrity verification is performed. If the integrity check passes, proceed with firmware flashing.

3. The supply chain firmware encryption method based on algorithm packet segmentation and information embedding according to claim 2, characterized in that, The integrity verification includes MD5 value verification, SHA-1 hash verification, and SHA-256 hash verification.

4. The supply chain firmware encryption method based on algorithm-based packet segmentation and information embedding according to claim 1, characterized in that, The file characteristics of the real sub-package include the file size of the sub-package, file header information, and specific byte sequence characteristics.

5. The supply chain firmware encryption method based on algorithm packet segmentation and information embedding according to claim 4, characterized in that, Based on the file characteristics, multiple corresponding invalid packets are generated, including: For the real sub-packet, at least three levels of invalid packets are generated: the first level invalid packet mimics the file size and header information of the real sub-packet, but the internal byte sequence is randomly generated and does not include specific valid instructions; the second level invalid packet includes the same specific byte sequence fragments as the real sub-packet, but the file size exceeds the floating threshold of the real sub-packet and the header information is slightly tampered with; the third level invalid packet is generated by a dynamic mutation algorithm, which retains some of the characteristics of the real sub-packet file while periodically inserting anti-debugging fields and false check bits. Based on the number of real sub-packages and the complexity of file features, the number of invalid packages generated is dynamically adjusted according to a preset ratio, and the feature similarity between each invalid package and the real sub-package is controlled within a preset range. The file features of different real sub-packages are cross-combined to obfuscate the generated invalid package, forming a mixed invalid package that includes partial features of multiple real sub-packages.

6. The supply chain firmware encryption method based on algorithm-based packet segmentation and information embedding according to claim 4, characterized in that, Based on the file characteristics, multiple corresponding invalid packets are generated, including: The file characteristics of the real sub-package are analyzed, and a feature mapping model is constructed. The feature mapping model includes the file size range, fixed and variable fields of the file header information, and the positional distribution pattern of specific byte sequences. Based on the aforementioned feature mapping model, an invalid packet is generated using a multi-dimensional mutation strategy; A unique dynamic identifier is generated for each invalid packet, which is then encrypted using an encryption key and embedded into the invalid packet; the encryption key is associated with the file characteristics of the real sub-packet. An invalid packet feature library is constructed, and the features of generated invalid packets are recorded in real time. The features are then compared during the subsequent generation of invalid packets to ensure that the feature repetition rate between newly generated invalid packets and existing invalid packets and real sub-packets is below a preset threshold.

7. The supply chain firmware encryption method based on algorithm-based packet segmentation and information embedding according to claim 6, characterized in that, Invalid packets are generated using a multi-dimensional mutation strategy, including: In terms of file size, randomly generate values ​​that are outside the range of the actual sub-package file size, or values ​​that are within the range but whose difference from the actual sub-package meets the preset conditions. In the header information dimension, fixed fields are flipped or replaced, and variable fields are generated with random content that does not conform to the actual pattern. In a specific byte sequence dimension, generate a byte stream that contains some real sequence fragments but has overall logical breaks, or a byte stream whose sequence position completely contradicts the real distribution pattern; Based on the mutation strategy of the file size dimension, file header information dimension, and specific byte sequence dimension, a corresponding invalid packet is generated.

8. The supply chain firmware encryption method based on algorithm packet segmentation and information embedding according to claim 6, characterized in that, When generating invalid packets using a multi-dimensional mutation strategy, the expected security level of the mixed packet set is obtained, and the generation dimension and mutation degree of the invalid packets are dynamically adjusted based on the expected security level; wherein, the higher the security level, the more dimensions participate in the mutation, and the greater the mutation degree.

9. The supply chain firmware encryption method based on algorithm packet segmentation and information embedding according to claim 4, characterized in that, The name of the actual sub-package is generated, including: Extract the core parameters of the packet splitting algorithm; for each real sub-packet, fuse the core parameters with the file features of the real sub-packet, and generate a basic key based on the fusion result; The logical sequence number of the real sub-packet in the overall supply chain firmware package is encrypted based on the base key to obtain the encrypted sequence number. A pseudo-random sequence is generated using the encrypted sequence number of the real sub-package. Based on the pseudo-random sequence, a preset encoding table is mutated to obtain a mutated encoding table. The mutated position is determined by the pseudo-random sequence and the file size of the real sub-package. The position of the mutated character in the mutated encoding table is mapped to the feature code of the file header information. The encrypted sequence number is encoded and converted based on the mutation encoding table to generate the name.

10. The supply chain firmware encryption method based on algorithm packet segmentation and information embedding according to claim 9, characterized in that, The core parameters include the starting offset of the sub-package cutting, the cutting step size, and the verification factor; The core parameters are fused with the file characteristics of the actual sub-packages, and a base key is generated based on the fusion result, including: The starting offset is moduloed by the file size to obtain the first fusion value; The cutting step size is convolved with the feature code of the file header information to obtain the second fusion value; The verification factor is concatenated with the hash value of a specific byte sequence and then hashed to obtain the third fusion value; Based on the first fusion value, the second fusion value, and the third fusion value, a basic key is constructed; wherein, the first fusion value serves as the initial vector of the key, the second fusion value serves as the encryption factor of the key, and the third fusion value serves as the length parameter of the key.