A configurable white-box AES algorithm for in-vehicle systems
By introducing a configurable white box AES algorithm in the on-board system, using the intermediate value variable state and multiple rounds of encryption operations, dynamically adjusting the usage ratio of the obfuscation table and optimizing the algorithm structure, the problem of lack of flexibility and configurability of the white box AES algorithm in the existing technology is solved, and a more efficient, secure and flexible encryption solution is achieved.
Patent Information
- Application Number
- CN202411578974.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-07
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-11-07
AI Technical Summary
The white box AES algorithm in existing vehicle-mounted systems lacks flexibility and configurability, and cannot be dynamically adjusted according to different application scenarios and security needs, resulting in the inability to provide the best security solution in specific scenarios, affecting the overall security and performance of the system.
A configurable white box AES algorithm is proposed, which makes the encryption process more flexible and complex by introducing intermediate value variable state and multiple rounds of encryption operations. According to CipherState dynamically judges the ratio of obfuscation tables and algorithm restoration during encryption, optimizes the algorithm structure, eliminates redundant calculation tables, and reduces the use of non-necessary obfuscation tables to adjust the size of the algorithm's space occupied.
It improves the algorithm's attack resistance and adaptability, enhances the security and encryption efficiency of data, ensures that it can still operate efficiently under resource constraints, and adapts to the specific needs of different on-board environments.
Smart Images

Figure CN119449274B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of white box AES algorithms, and in particular relates to a configurable white box AES algorithm for a vehicle-mounted system. Background Art
[0002] With the rapid development of automobile intelligence and networking, the security of vehicle systems has become increasingly important. Vehicle systems not only involve the basic functions of the vehicle, but are also connected to various sensors, communication modules, and infotainment systems. Therefore, how to protect these systems from cyber attacks and data leakage has become an important research topic. In this context, AES (Advanced Encryption Standard), as a symmetric key encryption algorithm widely used in data encryption, is increasingly used in vehicle systems due to its high efficiency and security.
[0003] However, the AES algorithm currently used in vehicle systems still has some technical defects and needs to be improved. First, existing AES implementations are often fixed and lack flexibility and configurability. In different application scenarios, the requirements of vehicle systems for encryption algorithms may vary. For example, the required security strength and performance may vary in data transmission, storage, and processing. Traditional AES implementations are usually unable to adapt to these changes, resulting in the inability to provide the best security solution in specific scenarios, which in turn affects the overall security and performance of the system.
[0004] Most current white-box implementations of the AES algorithm fail to fully consider the balance between security and performance. Although white-box encryption technology can improve the algorithm's anti-attack capabilities to a certain extent, in actual applications, the complexity and resource consumption of white-box AES are often high, which may lead to poor performance of vehicle-mounted systems under resource-constrained conditions. In addition, the lack of optimization for the vehicle environment means that the existing white-box AES algorithm may face problems such as slow response speed and high power consumption in actual applications, which is a considerable challenge for vehicle-mounted systems that require real-time processing and fast response.
[0005] The existing technology also has deficiencies in the security analysis of the white-box AES algorithm. Although white-box encryption provides a certain degree of security protection, the existing security protection measures are often not mature enough for the means of attack implemented against it (such as side-channel attacks, etc.). This makes the security of data encryption in the vehicle environment potentially threatened and unable to effectively resist advanced attack methods. Finally, the AES algorithm in current vehicle systems generally lacks good manageability and monitorability. When faced with potential vulnerabilities or attacks, system administrators often find it difficult to quickly locate and fix problems, resulting in long-term security risks.
[0006] Therefore, the development of a configurable white-box AES algorithm for in-vehicle systems aims to solve the above problems by introducing flexible configuration options and optimization strategies. The algorithm will be able to be adjusted according to different application requirements and security strategies to adapt to the specific needs of various in-vehicle environments. Through further optimization design, the performance of the algorithm can be improved to ensure that it can still run efficiently under resource-constrained conditions. In addition, enhancing the security analysis and protection capabilities of the algorithm will enable it to better resist various attacks and improve overall security. In short, the development of this configurable white-box AES algorithm will provide a more secure, flexible and efficient encryption solution for in-vehicle systems and promote the development and application of smart car technology. Therefore, there is an urgent need for a configurable white-box AES algorithm for in-vehicle systems. Summary of the invention
[0007] The present invention proposes a configurable white-box AES algorithm for an in-vehicle system, which solves the problem that the white-box AES in the in-vehicle system in the prior art occupies too much space.
[0008] The technical solution of the present invention is implemented as follows: a configurable white box AES algorithm for an in-vehicle system, including setting an intermediate value variable state, setting it as a byte array, then performing round key addition, performing byte replacement after performing XOR on the intermediate value state and the round key, mapping through an S box, then starting row shifting, performing replacement between bytes inside the intermediate value state matrix, performing column confusion after completing the replacement, performing a reversible matrix on the intermediate value, each action affects a column of the intermediate value state, repeating the above operations, and completing 10 rounds of encryption, wherein the encryption process determines the ratio of the confusion table and the algorithm reduction used in the encryption process according to CipherState, and then encrypts through the confusion table query method, and partially restores the confusion table to the algorithm to participate in the encryption and decryption process;
[0009] The restoration algorithm first removes redundant calculation tables to reduce the size of the confusion table by removing redundant tables; performs algorithm optimization to reduce the use of unnecessary confusion tables, and configures the algorithm through optimization and algorithm restoration to adjust the size of the space occupied by the algorithm.
[0010] Currently, the White-box AES algorithm is a method of protecting AES keys, designed to prevent key leakage and adversarial attacks. Here are some key points about the White-box AES algorithm:
[0011] Key processing: In white-box AES, the AES key is not used directly as a traditional plaintext input, but is stored inside the algorithm after being transformed and obfuscated. This can hide the actual AES key value and increase the difficulty for attackers to obtain the key. Implementation technology: White-box AES implementations usually use a variety of techniques to enhance key protection. These include using software and hardware randomization techniques to generate keys, hiding the actual AES key value, and algorithmically decomposing and recombining the key to protect its structure. Security and strength: White-box AES is a complex key protection technology that introduces a variety of techniques and methods based on traditional AES cryptography to increase the security and strength of the key. The purpose of this algorithm is to prevent attacks and leaks on the AES key. Symmetric encryption algorithm: The white-box AES algorithm is a symmetric encryption algorithm that uses the same key for encryption and decryption. This means that the encryption and decryption processes use the same algorithm and key, but the operation direction is opposite.
[0012] Compared with the existing technology, this configurable white-box AES algorithm for vehicle-mounted systems has many significant differences and innovations. First, the existing AES algorithm implementation is usually fixed, lacks flexibility and configurability, and cannot be dynamically adjusted according to different application scenarios and security requirements. This algorithm introduces an intermediate value variable state and performs operations such as XOR, byte replacement, row shift, and column confusion in each round of encryption, so that the encryption process can flexibly adapt to different security strategies and performance requirements. This configurability enables the algorithm to play a better role in a variety of vehicle-mounted environments and meet the specific needs of different users.
[0013] Secondly, in traditional AES implementations, the generation and use of round keys are often fixed, and the degree of obfuscation in the encryption process is not fully considered. However, this algorithm dynamically determines the ratio of the obfuscation table used in the encryption process to the algorithm restoration based on CipherState, thus achieving flexible query and use of the obfuscation table. This design effectively improves the algorithm's adaptability in the face of different attack scenarios, making it more difficult for attackers to conduct effective analysis and cracking, and enhancing overall security.
[0014] Furthermore, the existing technology often has the problem of redundant calculation in the use of confusion tables, resulting in low computing efficiency and waste of resources. However, this algorithm reduces the size of the confusion table by eliminating redundant calculation tables, and optimizes the algorithm, effectively improving the efficiency of encryption and decryption. This optimization not only improves the running speed of the algorithm, but also reduces the occupation of computing resources, providing a guarantee for the real-time requirements of the vehicle system. In addition, many traditional AES implementations lack the ability to adjust the algorithm space occupation, which makes it difficult to perform as expected in resource-constrained environments. However, this algorithm can flexibly adjust the algorithm according to the specific application scenario and hardware environment by configuring the size of the algorithm occupied space, thereby improving the versatility and adaptability of the algorithm. This flexible configuration capability enables the algorithm to be well applied on different vehicle-mounted devices, enhancing its practical value. This configurable white-box AES algorithm significantly overcomes various defects of the existing technology by introducing flexible design and optimization strategies, and provides a safer, more efficient and flexible encryption solution.
[0015] As a preferred implementation, the byte array is a two-dimensional byte array, which becomes a 4x4 array after being expanded, and when round key addition is performed, the intermediate value state is XORed with the 16-byte round key.
[0016] As a preferred implementation, when the S-box performs mapping, any byte in the array is marked, and the mapping of the marked byte to another byte is completed through the S-box.
[0017] As a preferred implementation, the column-confused intermediate value state is left-multiplied by a reversible matrix over a finite field, and each action affects 4 bytes in a column of the intermediate value state.
[0018] As a preferred implementation, the space occupied by the algorithm is between 5KB and 700KB. By performing algorithm optimization and algorithm restoration, the size of the space occupied by the algorithm is adjusted between 5KB and 700KB.
[0019] After adopting the above technical scheme, the beneficial effect of the present invention is that the encryption process is more complex and unpredictable by introducing the intermediate value variable state and designing multiple rounds of encryption operations, thereby improving the anti-attack ability of the algorithm. When facing this configurable encryption process, it is difficult for attackers to obtain effective information through simple analysis methods, which enhances the security of the data. Dynamically judging the use ratio of the confusion table enables the encryption process to be more in line with actual application requirements. In different application scenarios, the algorithm can adjust the degree of confusion according to real-time security requirements, make full use of available resources, and improve the overall encryption efficiency. In addition, by eliminating redundant calculation tables and optimizing the algorithm structure, the speed of encryption and decryption is significantly improved, and the waste of computing resources is reduced. This efficient processing capability enables the vehicle-mounted system to maintain good performance when performing complex encryption tasks, providing strong support for real-time applications. The algorithm can flexibly adjust the occupied space according to the specific hardware environment to ensure that it can run smoothly on resource-constrained devices. This flexibility not only improves the scope of application of the algorithm, but also provides more possibilities for the future development of the vehicle-mounted system, enabling it to better adapt to the ever-changing technical requirements and market environment. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0021] Figure 1 This is a schematic diagram of state byte replacement and row shift transformation performed by the present invention;
[0022] Figure 2 The present invention adopts a specific embodiment to perform left multiplication of the array by state to obtain the confusion result. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0024] Example:
[0025] like Figures 1-2As shown, a configurable white box AES algorithm for an in-vehicle system includes setting an intermediate value variable state, setting it as a byte array, then performing round key addition, performing byte replacement after performing XOR on the intermediate value state and the round key, mapping through an S box, and then starting row shifting, performing substitution between bytes within the intermediate value state matrix, performing column confusion after completing the substitution, performing a reversible matrix on the intermediate value, each action affects a column of the intermediate value state, repeating the above operations, and completing 10 rounds of encryption, wherein the encryption process determines the ratio of the confusion table and the algorithm restoration used in the encryption process according to CipherState, and then encrypts through the confusion table query method, and partially restores the confusion table to the algorithm to participate in the encryption and decryption process;
[0026] The restoration algorithm first removes redundant calculation tables to reduce the size of the confusion table by removing redundant tables; performs algorithm optimization to reduce the use of unnecessary confusion tables, and configures the algorithm through optimization and algorithm restoration to adjust the size of the space occupied by the algorithm.
[0027] The present invention provides a white box AES implementation with controllable resource size, and provides a feasible implementation method for key encryption on MCU with limited resources. The white box technology can be used to protect the AES algorithm key, and the corresponding ROM usage version can be released according to the actual situation of the vehicle. The trusted root in the vehicle is generated through white box AES encryption, which is used for subsequent encryption and decryption operations;
[0028] The specific operating principles and processes are as follows:
[0029] The algorithm is designed based on AES (Advanced Encryption Standard) and uses white box encryption technology to make it more secure and flexible in specific environments. The characteristic of white box encryption is that even if the key and algorithm are obtained by attackers, the data security can still be maintained. This design is crucial for vehicle systems, because the intelligent and networked characteristics of automobiles make them face various security risks, and it is particularly important to protect user data and system security.
[0030] In the specific operation steps, first set the intermediate value variable state and define it as a byte array. This state variable carries the data to be encrypted during the AES encryption process. As the encryption process proceeds, the state will gradually be converted into encrypted data. Next, the round key is added, and the intermediate value state is XORed with the round key. This process is the first step of AES encryption. Through the XOR operation with the round key, it ensures that each round of encryption is affected by a different key, thereby enhancing the security of encryption.
[0031] Subsequently, byte replacement is performed and mapping is performed through the S-box. The S-box is the core component of the AES algorithm. It enhances the complexity of encryption through nonlinear replacement, making the output result difficult to predict. The use of the S-box effectively breaks the linear relationship between input and output, and improves the anti-attack ability of the encryption algorithm. After the byte replacement is completed, the row shift step is entered. The row shift operation increases the degree of data obfuscation and further improves security by replacing the internal bytes of the intermediate value state matrix.
[0032] After completing the row shift, the column confusion operation is performed. Figure 2 As shown, Figure 2 The result shown is the following array obfuscated by left-multiplying state:
[0033]
[0034] The intermediate value is processed through a reversible matrix, and each action affects a column of the intermediate value state. This design causes the data to undergo a complex transformation process in each round of encryption, making it difficult for an attacker to restore the original information even if he obtains part of the data. Repeat the above operation to complete 10 rounds of encryption, and each round uses a unique key and transformation to ensure the security and complexity of the data.
[0035] During the encryption process, the ratio of the obfuscation table to the algorithm restoration is determined according to CipherState, which optimizes the efficiency and flexibility of encryption. Encryption through obfuscation table query can improve computing efficiency while ensuring security. This dynamic adjustment capability means that the system can be flexibly configured according to actual conditions, speeding up the encryption process and reducing the processing burden.
[0036] The steps of the restoration algorithm first remove redundant calculation tables, and reduce the size of the confusion table by removing redundant tables. The purpose of this process is to optimize the performance of the algorithm and reduce unnecessary computing overhead. By analyzing the frequency and importance of the confusion table, the system can identify which parts are redundant, thereby improving operational efficiency while maintaining security.
[0037] Next, we optimize the algorithm to reduce the use of unnecessary obfuscation tables. Through optimization and algorithm restoration, we configure the algorithm and adjust the size of the algorithm's occupied space. This process ensures that the algorithm can run at its best performance in the vehicle system while avoiding performance degradation caused by excessive resource usage.
[0038] The reasons for the setting and operation of this design are mainly reflected in the following aspects: Security: Using white-box encryption technology, data security can be protected even if the key is compromised; Flexibility: Configurable algorithms can adapt to different application scenarios and security requirements; Optimized performance: By eliminating redundant calculations and optimizing confusion tables, the encryption process is ensured to be efficient and fast; Strong anti-attack capability: Multiple rounds of encryption, complex replacement and permutation operations enhance the algorithm's anti-attack capability; Dynamic adjustment: Flexible adjustment of the use of confusion tables according to the situation of CipherState improves the sensitivity and responsiveness of the system.
[0039] The byte array is a two-dimensional byte array, which becomes a 4x4 array after expansion. When performing round key addition, the intermediate value state is XORed with the 16-byte round key. The byte array is defined as a two-dimensional byte array, and forms a 4x4 matrix structure after expansion. Compared with the prior art, this design is different from the conventional AES algorithm, which usually processes data in the form of a one-dimensional array, and structuring data into a two-dimensional array can improve the readability and processing efficiency of the data. The structure of the 4x4 array enables the position of each byte in the matrix to clearly correspond to a specific encryption operation, which is convenient for the subsequent round key addition and other operations.
[0040] When performing round key addition, the intermediate value state is XORed with the 16-byte round key. This method is a key encryption step in the AES algorithm. Through the XOR operation, the influence of the key is directly applied to the data, thus ensuring that each round of encryption is based on a different key. This design ensures the security of the encryption process because even if an attacker obtains part of the key or data, they cannot easily deduce the complete key.
[0041] The difference from the existing technology is that the use of this two-dimensional array makes it easier to perform row and column operations during processing, especially when it comes to complex matrix calculations. Compared with the linear structure of a one-dimensional array, the two-dimensional structure can more intuitively reflect the relationship between data. This structured design improves the scalability of the algorithm and can adapt to possible algorithm optimization or expansion needs in the future.
[0042] When the S-box is mapped, any byte in the array is marked, and the S-box completes the mapping of the marked byte to another byte. The innovation of this method is that a byte marking mechanism is introduced, which allows specific bytes to be processed separately during the S-box mapping process. Traditional S-box mapping is usually performed on the entire byte array, lacking flexible control over individual bytes.
[0043] The marking mechanism can be used to optimize or adjust specific bytes during the encryption process, thereby improving the security of encryption. For example, in some cases, specific bytes may be more vulnerable to attacks, and the use of a marking mechanism can ensure that these bytes receive additional protection during the mapping process. Marked bytes can be defined as bytes that require special attention, and the S-box may be processed differently after mapping, thereby enhancing the complexity of encryption and anti-attack capabilities.
[0044] This approach allows for more flexible adjustments to the use of S-boxes, which can be optimized for specific application scenarios or security requirements. This flexibility enables the encryption algorithm to quickly adapt to the rapidly changing security threat environment and provide higher security protection.
[0045] The intermediate value state of the column obfuscation is multiplied by a reversible matrix on a finite field, and each action affects 4 bytes in a column of the intermediate value state. This design is a further optimization of the column obfuscation operation in the traditional AES algorithm. Traditional column obfuscation is generally performed through multiplication and addition of finite fields, and the introduction of the concept of reversible matrices makes the obfuscation process more flexible and efficient. The use of reversible matrices allows more complex transformations of data during the obfuscation process, so that each operation can affect multiple bytes of the entire column of data, rather than relying solely on simple linear transformations. This process increases the complexity of the data and further enhances the security of encryption by means of matrix multiplication. Through the introduction of reversible matrices, obfuscation operations are not limited to simple multiplication operations, but can be implemented through complex mathematical structures. This method increases the complexity of the algorithm, increases the ability to resist linear attacks and differential attacks, and can improve overall security.
[0046] The algorithm occupies a space of 5KB to 700KB. By performing algorithm optimization and algorithm restoration, the size of the algorithm occupies a space of 5KB to 700KB. Especially in resource-constrained environments (such as embedded systems or mobile devices), the space complexity of the algorithm is an important consideration. Traditional encryption algorithms often focus on security and speed when designed, but insufficient consideration of storage occupancy may result in ineffective deployment in practical applications.
[0047] By setting the occupied space range, developers can adjust and optimize the algorithm according to specific application requirements. This not only helps to achieve flexible deployment of the algorithm in different environments, but also improves the compatibility of the algorithm on a variety of hardware platforms. The optimization process may include eliminating redundant calculation steps, simplifying algorithm logic, or using more efficient data structures to reduce memory usage. This flexibility in space adjustment enables the algorithm to adapt to different deployment environments, especially in situations where resources are limited, and to minimize resource consumption while ensuring security and efficiency. This design not only increases the scope of application of the algorithm, but also enhances its applicability in actual scenarios.
[0048] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A configurable white-box AES algorithm for vehicle-mounted systems, characterized in that: It includes setting the intermediate value variable state, setting it as a byte array, then performing round key addition, performing byte replacement after XORing the intermediate value state and the round key, mapping through the S box, and then starting row shifting, replacing the bytes inside the intermediate value state matrix, and performing column confusion after completing the replacement. The intermediate value is reversible matrix, and each action affects a column of the intermediate value state. Repeat the above operation to complete 10 rounds of encryption, wherein the encryption process determines the ratio of the obfuscation table and the algorithm used in the encryption process according to CipherState, and then encrypts through the obfuscation table query method, and restores part of the obfuscation table to the algorithm to participate in the encryption and decryption process; The restoration algorithm first removes redundant calculation tables to reduce the size of the confusion table by removing redundant tables; performs algorithm optimization to reduce the use of unnecessary confusion tables, and configures the algorithm through optimization and algorithm restoration to adjust the size of the space occupied by the algorithm.
2. A configurable white-box AES algorithm for an in-vehicle system as claimed in claim 1, characterized in that: The byte array is a two-dimensional byte array, which becomes a 4x4 array after being expanded. When the round key is added, the intermediate value state is XORed with the 16-byte round key.
3. A configurable white-box AES algorithm for an in-vehicle system as claimed in claim 1, characterized in that: When the S box performs mapping, any byte in the array is marked, and the mapping of the marked byte to another byte is completed through the S box.
4. The configurable white-box AES algorithm for an in-vehicle system according to claim 1, characterized in that: The column-confused intermediate value state is left-multiplied by a reversible matrix over a finite field, and each action affects 4 bytes in a column of the intermediate value state.
5. The configurable white-box AES algorithm for an in-vehicle system according to claim 1, characterized in that: The space occupied by the algorithm is between 5KB and 700KB. By performing algorithm optimization and algorithm restoration, the size of the space occupied by the algorithm is adjusted between 5KB and 700KB.
Citation Information
Patent Citations
White box encryption method and apparatus, and storage medium
CN108494546A
Data encryption method and related equipment
CN111600867A