A data processing method and related apparatus

By generating random irreducible polynomials and random bases for the target finite field, a random S-box is constructed, which solves the problem of high computational complexity in evolutionary algorithms and improves the security of cryptographic chips in scenarios with limited computing resources.

CN116073985BActive Publication Date: 2026-01-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111277362.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-29
Publication Date
2026-01-30
Estimated Expiration
2041-10-29

AI Technical Summary

Technical Problem

Existing evolutionary algorithms for generating random S-boxes have high computational complexity, which reduces the security of cryptographic chips in data processing scenarios where computational resources are limited.

Method used

By generating random irreducible polynomials and random bases for the target finite field, a random S-box different from the target S-box is constructed, reducing computational resource consumption and improving security.

Benefits of technology

In scenarios where computing resources are limited, this technology effectively improves the security of cryptographic chips and reduces the computational load on the processor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116073985B_ABST
    Figure CN116073985B_ABST
Patent Text Reader

Abstract

This application provides a data processing method and related apparatus. The method includes: generating a random irreducible polynomial corresponding to a target finite field using a target S-box in a target cryptographic algorithm; determining multiple linearly independent target elements using each element in the target finite field to form a random basis corresponding to the target finite field; generating a random S-box different from the target S-box using the random irreducible polynomial and the random basis; sending the random S-box to a data terminal for subsequent data processing of the data to be processed based on the target cryptographic algorithm, changing the target S-box to a random S-box, and obtaining the data processing result of the data to be processed. Compared with evolutionary algorithms, this method has lower computational complexity, reduces the consumption of computing resources, and lowers the computational load on the processor. Even in data processing scenarios based on target cryptographic algorithms with limited computing resources, it improves the security of data processing based on target cryptographic algorithms and ensures message security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data, and in particular to a data processing method and related apparatus. Background Technology

[0002] With the rapid development of cryptography, cryptographic chips based on target cryptographic algorithms are widely used in various data processing scenarios based on these algorithms. These target cryptographic algorithms include S-boxes, such as the Advanced Encryption Standard (AES) algorithm. The AES algorithm is a cryptographic algorithm that involves multiple iterative operations, each of which is called a round transformation operation.

[0003] The aforementioned round transformation operations generally include byte substitution, row shifting, column mixing, and key addition. Among these, row shifting, column mixing, and key addition are all linear operations; however, byte substitution, typically implemented using a non-linear S-box, is the only non-linear operation and plays a role in obfuscation within the AES algorithm. Related technologies utilize evolutionary algorithms to generate increasingly secure random S-boxes, replacing the original S-boxes to implement the AES algorithm and thus improve the security of AES-based cryptographic chips.

[0004] However, the aforementioned evolutionary algorithm is quite cumbersome and complex, requiring significant computational resources and increasing the processor's computational load. For data processing scenarios based on the target cryptographic algorithm where computational resources are limited, this evolutionary algorithm is subject to certain limitations and cannot effectively improve the security of cryptographic chips based on the target cryptographic algorithm, thus leading to a decrease in the security of data processing based on the target cryptographic algorithm. Summary of the Invention

[0005] To address the aforementioned technical problems, embodiments of this application provide a data processing method that generates a random S-box that differs from the target S-box included in the target cryptographic algorithm. This method has low computational complexity, reduces the consumption of computing resources, and lowers the computational load on the processor. Even in data processing scenarios based on the target cryptographic algorithm where computing resources are limited, a random S-box can be generated to replace the target S-box, effectively improving the security of the cryptographic chip based on the target cryptographic algorithm, thereby effectively improving the security of data processing based on the target cryptographic algorithm.

[0006] The embodiments of this application disclose the following technical solutions:

[0007] On one hand, embodiments of this application provide a data processing method, the method comprising:

[0008] For the target finite field of the target S-box in the target cryptographic algorithm, generate the random irreducible polynomial corresponding to the target finite field;

[0009] Based on each element in the target finite field, determine multiple linearly independent target elements, and construct a random basis corresponding to the target finite field based on the multiple target elements;

[0010] A random S-box is generated based on the random irreducible polynomial and the random basis, and the random S-box is different from the target S-box.

[0011] The random S-box is sent to the data terminal.

[0012] On one hand, embodiments of this application provide a data processing apparatus, the apparatus comprising a generating unit, a determining unit, and a sending unit:

[0013] The generation unit is used to generate a random irreducible polynomial corresponding to the target finite field of the target S-box in the target cryptographic algorithm.

[0014] The determining unit is used to determine multiple linearly independent target elements based on each element in the target finite field, and to construct a random basis corresponding to the target finite field based on the multiple target elements;

[0015] The generation unit is further configured to generate a random S-box based on the random irreducible polynomial and the random basis, wherein the random S-box is different from the target S-box;

[0016] The sending unit is used to send the random S-box to the data terminal.

[0017] On one hand, embodiments of this application provide a computer device, the device including a processor and a memory:

[0018] The memory is used to store program code and transmit the program code to the processor;

[0019] The processor is used to execute the above data processing method according to the instructions in the program code.

[0020] On one hand, embodiments of this application provide a computer-readable storage medium for storing a computer program for executing the above-described data processing method.

[0021] On one hand, embodiments of this application provide a computer program product, including a computer program or instructions; when the computer program or instructions are executed by a processor, the above-described data processing method is performed.

[0022] As can be seen from the above technical solution, a random irreducible polynomial corresponding to the target finite field of the target S-box in the target cryptographic algorithm is generated; multiple linearly independent target elements are determined through each element in the target finite field to form a random basis corresponding to the target finite field; a random S-box different from the target S-box is generated using the random irreducible polynomial and the random basis; the random S-box is sent to the data terminal so that subsequent data processing based on the target cryptographic algorithm can be performed on the data to be processed, changing the target S-box into a random S-box to obtain the data processing result. Based on this, for the target finite field of the target S-box in the target cryptographic algorithm, a suitable random irreducible polynomial and random basis are constructed in a random manner, and a random S-box different from the target S-box is generated. Compared with evolutionary algorithms, this method has lower computational complexity, reduces the consumption of computing resources, and lowers the computational load on the processor. Even in data processing scenarios based on the target cryptographic algorithm with limited computing resources, a random S-box can be generated to replace the target S-box, effectively improving the security of the cryptographic chip based on the target cryptographic algorithm, thereby effectively improving the security of data processing based on the target cryptographic algorithm. Attached Figure Description

[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating data encryption based on the AES algorithm is provided as an embodiment of this application;

[0025] Figure 2 A schematic diagram illustrating a data processing method in a practical application scenario provided by an embodiment of this application;

[0026] Figure 3 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0027] Figure 4 A flowchart of data decryption based on the AES algorithm is provided for embodiments of this application;

[0028] Figure 5 A schematic diagram of a communication system with a key management center provided in an embodiment of this application;

[0029] Figure 6 A schematic diagram of a communication system for distributed key management provided in an embodiment of this application;

[0030] Figure 7A flowchart illustrating a data processing method based on the AES algorithm in a computationally limited data processing scenario, as provided in this application embodiment;

[0031] Figure 8 A structural block diagram of a data processing apparatus provided in an embodiment of this application;

[0032] Figure 9 A structural diagram of a computer device provided in an embodiment of this application;

[0033] Figure 10 This is a structural diagram of a server provided in an embodiment of this application. Detailed Implementation

[0034] The embodiments of this application will now be described with reference to the accompanying drawings.

[0035] Data encryption based on the AES algorithm can refer to performing a cryptographic addition operation on the input 128-bit plaintext and the 128-bit key K0, and then performing N... r The next round of transformation operation outputs 128 bits of ciphertext, such as Figure 1 The diagram shows a flowchart of a data encryption method based on the AES algorithm. In the AES-based data encryption process, the first N... r The -1 round of transformation operations includes byte substitution, row shifting, column mixing, and key addition. In AES-based data encryption, the final round of transformation operations includes byte substitution, row shifting, and key addition; the key addition operation requires a corresponding 128-bit key K. i (1≤i≤N) r When the key length is 128 bits, the number of round transformation operations N r It is 10.

[0036] Among byte substitution, row shifting, column mixing, and key addition operations, only byte substitution is a non-linear operation. It is typically implemented using a non-linear S-box, also known as S-box operation. In related technologies, evolutionary algorithms can be used to generate random S-boxes with continuously increasing security strength, replacing the original S-boxes to implement the AES algorithm and thus improving the security of AES-based cryptographic chips.

[0037] However, the aforementioned evolutionary algorithm is quite cumbersome and complex, requiring significant computational resources and increasing the processor's computational load. For computationally limited data processing scenarios based on the AES algorithm, such as lightweight embedded data processing chips or sensor networks with limited computing resources, the above evolutionary algorithm is limited and cannot effectively improve the security of AES-based cryptographic chips, thus leading to a decrease in the security of AES-based data processing.

[0038] To address the aforementioned technical problems, this application provides a data processing method. For the target finite field of the target S-box in the target cryptographic algorithm, a suitable random irreducible polynomial and random basis are constructed randomly, generating a random S-box different from the target S-box. Compared to evolutionary algorithms, this method has lower computational complexity, reduces computational resource consumption, and lowers the processor's computational load. Even in data processing scenarios based on the target cryptographic algorithm where computational resources are limited, a random S-box can be generated to replace the target S-box, effectively improving the security of the cryptographic chip based on the target cryptographic algorithm, thereby effectively improving the security of data processing based on the target cryptographic algorithm.

[0039] To facilitate understanding of the technical solutions provided in the embodiments of this application, a data processing method provided in the embodiments of this application will be introduced next in conjunction with a practical application scenario.

[0040] See Figure 2 , Figure 2 This is a schematic diagram illustrating a data processing method in a practical application scenario provided by an embodiment of this application. In this practical application scenario, the communication system with distributed key management includes a data transmitter 201 and a data receiver 202.

[0041] Data sender 201 needs to generate a random irreducible polynomial corresponding to the target finite field of the target S-box in the target cryptographic algorithm. For example, taking the AES algorithm as the target cryptographic algorithm, the target finite field of the target S-box in the AES algorithm is... Randomly generate a polynomial If the polynomial is irreducible, then the polynomial is taken as the target finite field. The corresponding random irreducible polynomial.

[0042] Data sender 201 needs to determine multiple linearly independent target elements based on each element in the target finite field, and construct a random basis corresponding to the target finite field based on these multiple target elements. For example, the target finite field... It includes 256 elements, from which 8 elements are randomly selected. If the eight elements are linearly independent, then these eight elements are identified as the eight target elements, forming the target finite field. The corresponding random basis.

[0043] Data sender 201 needs to generate a random S-box that is different from the target S-box based on a random irreducible polynomial and a random basis.

[0044] Before data communication between data sender 201 and data receiver 202, data sender 201 can send a random S-box along with the key to data receiver 202. Based on this, data sender 201 can also replace the target S-box with the random S-box to perform data processing on the data to be processed based on the target cryptographic algorithm, obtaining the data processing result. This allows data sender 201 to subsequently send the data processing result to data receiver 202, thus realizing data communication between them. Therefore, in a key-distributed management communication system including data sender 201 and data receiver 202, constructing a suitable random irreducible polynomial and random basis in a random manner for the target finite field of the target S-box in the target cryptographic algorithm, and generating a random S-box different from the target S-box, offers lower computational complexity, reduces computational resource consumption, and lowers the processor's computational load compared to evolutionary algorithms. Even in data processing scenarios based on the target cryptographic algorithm where computing resources are limited, a random S-box can be generated to replace the target S-box, effectively improving the security of the cryptographic chip based on the target cryptographic algorithm, thereby effectively improving the security of data processing based on the target cryptographic algorithm.

[0045] It is understood that the data processing method provided in this application can be applied to the key management center in a communication system with a key management center, which includes processing devices with data processing functions, such as terminal devices and servers. The method can also be applied to the data sending end in a communication system with distributed key management, which includes processing devices with data processing functions, such as terminal devices and servers. Specifically, the terminal device can be a smartphone, computer, personal digital assistant (PDA), tablet computer, smart voice interaction device, smart home appliance, vehicle terminal, etc., but is not limited to these. The server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The terminal device and the server can be directly or indirectly connected via wired or wireless communication, which is not limited herein.

[0046] The data processing method provided in this application is based on artificial intelligence (AI). AI is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to have perception, reasoning, and decision-making functions.

[0047] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and intelligent transportation.

[0048] In the embodiments of this application, the main artificial intelligence software technologies involved include the aforementioned machine learning / deep learning, autonomous driving, intelligent transportation, and other related fields.

[0049] The data processing method provided in this application embodiment may also involve blockchain, wherein data such as target cryptographic algorithm, target S-box, random irreducible polynomial, random basis and random S-box can be stored on the blockchain.

[0050] Next, with reference to the accompanying drawings, a data processing method provided by an embodiment of this application will be described.

[0051] See Figure 3 , Figure 3 A flowchart of a data processing method provided in this application embodiment, the method including:

[0052] S301: For the target finite field of the target S-box in the target cryptographic algorithm, generate a random irreducible polynomial corresponding to the target finite field.

[0053] In related technologies, evolutionary algorithms are used to generate increasingly secure random S-boxes, replacing the original S-boxes to implement the target cryptographic algorithm. However, evolutionary algorithms are cumbersome and complex, requiring significant computational resources and increasing the processor's computational load. For data processing scenarios based on the target cryptographic algorithm where computational resources are limited, these evolutionary algorithms are subject to certain limitations. Furthermore, these algorithms suffer from premature convergence, failing to evolve to a qualified random S-box, i.e., entering an evolutionary stagnation or slow evolutionary phase. While consuming substantial computational resources, they fail to produce a qualified random S-box, thus failing to effectively improve the security of cryptographic chips based on the target cryptographic algorithm, thereby reducing the security of data processing based on the target cryptographic algorithm.

[0054] In this application, considering that the S-box is actually obtained by performing the inverse multiplication operation and affine operation on each element in its finite field; where the affine operation is a linear operation and the inverse multiplication operation of the finite field is a nonlinear operation, the nonlinearity of the S-box is generated by the inverse multiplication operation of the finite field. This inverse multiplication operation of the finite field is related to the irreducible polynomial and basis used. Different irreducible polynomials and bases result in different inverse multiplication operations of the finite field, thus generating different S-boxes. Therefore, it is necessary to construct suitable random irreducible polynomials and random bases for the target finite field of the target S-box in the target cryptographic algorithm, in order to generate random S-boxes different from the target S-box. Compared with the aforementioned evolutionary algorithm, this method has lower computational complexity, reduces the consumption of computational resources, and lowers the computational load on the processor, thus making it suitable for data processing scenarios based on the target cryptographic algorithm where computational resources are limited. Furthermore, this method does not suffer from evolutionary stagnation or slow evolution and can generate qualified random S-boxes.

[0055] Specifically, for the target finite field of the target S-box in the target cryptographic algorithm, a suitable random irreducible polynomial is constructed in a random manner. In fact, this means that for the target finite field of the target S-box in the target cryptographic algorithm, the corresponding irreducible polynomial is randomly generated and used as the random irreducible polynomial corresponding to the target finite field.

[0056] In a specific implementation of S301, firstly, polynomial coefficients can be randomly generated for the target finite field to generate candidate polynomials; then, it is necessary to detect whether the candidate polynomial is irreducible. If it is, the candidate polynomial is directly used as the random irreducible polynomial corresponding to the target finite field; if not, it indicates that the candidate polynomial is reducible, and the step of randomly generating polynomial coefficients for the target finite field to generate candidate polynomials is returned, until a candidate polynomial is detected as irreducible. The candidate polynomial detected as irreducible is then used as the random irreducible polynomial corresponding to the target finite field. Therefore, this application provides a possible implementation, and S301 may include, for example, steps S3011-S3013 as follows:

[0057] S3011: Randomly generate candidate polynomials based on the target finite field.

[0058] S3012: If a candidate polynomial is detected as a reducible polynomial, the random generation of candidate polynomials based on the target finite field is re-executed until an irreducible candidate polynomial is detected.

[0059] S3013: Determine the candidate polynomial that is detected as an irreducible polynomial as a random irreducible polynomial.

[0060] As an example, the target cryptographic algorithm is the AES algorithm, and the target finite field of the target S-box in the AES algorithm is... Then, for the target finite field 8 polynomial coefficients are randomly generated. To generate a candidate polynomial If the candidate polynomial is detected to be irreducible, then the candidate polynomial is directly used as the target finite field. The corresponding random irreducible polynomial; if the candidate polynomial is detected to be reducible, eight polynomial coefficients are randomly generated again to generate a candidate polynomial, until the candidate polynomial is detected to be irreducible. The candidate polynomial detected as irreducible is taken as the target finite field. The corresponding random irreducible polynomial.

[0061] As another example, the target cryptographic algorithm is the Camellia algorithm, a standard block cipher. In the Camellia algorithm, the target finite field of the target S-box is... First, for the target finite field The first finite field included Four polynomial coefficients are randomly generated. To generate a candidate polynomial If the candidate polynomial is detected to be irreducible, then the candidate polynomial is directly used as the first finite field. The corresponding random irreducible polynomial; if the candidate polynomial is detected to be reducible, four polynomial coefficients are randomly generated again to generate a candidate polynomial, until the candidate polynomial is detected to be irreducible. The candidate polynomial detected as irreducible is used as the first finite field. The corresponding random irreducible polynomial.

[0062] Then, for the target finite field Included second finite field Two polynomial coefficients are randomly generated. To generate a candidate polynomial If all candidate polynomials are detected to be irreducible, then the candidate polynomial is directly used as the second finite field. The corresponding random irreducible polynomial; if the candidate polynomial is detected to be reducible, two more polynomial coefficients are randomly generated to create a candidate polynomial, until the candidate polynomial is detected to be irreducible. The candidate polynomial detected as irreducible is used as the second finite field. The corresponding random irreducible polynomial.

[0063] Based on the two examples above, the target finite field of the target S-box in the target cryptographic algorithm is... In this case, generate the target finite field. The specific implementation of the corresponding random irreducible polynomial; and the target finite field of the target S-box in the target cryptographic algorithm. In this case, generate the target finite field. The specific implementation of the corresponding random irreducible polynomial can be deduced by referring to the specific implementation of the two examples above, and will not be repeated here.

[0064] S302: Based on each element in the target finite field, determine multiple linearly independent target elements, and construct a random basis corresponding to the target finite field based on the multiple target elements.

[0065] In this application, for the target finite field of the target S-box in the target cryptographic algorithm, constructing a suitable random basis in a random manner actually means randomly determining multiple linearly independent target elements through each element in the target finite field, and forming them into the random basis corresponding to the target finite field.

[0066] In a specific implementation of S302, firstly, multiple candidate elements can be randomly selected for each element in the target finite field. Then, based on the linear independence property of the multiple elements constituting the basis, it is necessary to detect whether the multiple candidate elements are linearly independent. If so, the multiple candidate elements are directly determined as multiple target elements to form a random basis corresponding to the target finite field. If not, it indicates that the multiple candidate elements are linearly dependent, and the process returns to the step of randomly selecting multiple candidate elements for each element in the target finite field, until the multiple candidate elements are detected to be linearly independent. The multiple candidate elements detected as linearly independent are then determined as multiple target elements to form a random basis corresponding to the target finite field. Therefore, this application provides a possible implementation method, and S302 may include, for example, steps S3021-S3024 as follows:

[0067] S3021: Randomly select multiple candidate elements based on each element in the target finite field.

[0068] S3022: If multiple candidate elements are detected to be linearly correlated, re-execute the random sampling of multiple candidate elements based on each element in the target finite field until multiple candidate elements are detected to be linearly uncorrelated.

[0069] S3023: Determine multiple candidate elements that are detected as linearly independent as multiple target elements.

[0070] S3024: Construct a random basis based on multiple target elements.

[0071] As an example, the target cryptographic algorithm is the AES algorithm, and the target finite field of the target S-box in the AES algorithm is... Then, for the target finite field Given 256 elements, randomly select 8 candidate elements. If the eight candidate elements are found to be linearly independent, these eight candidate elements are directly identified as the eight target elements to form the target finite field. The corresponding random basis; if linear correlation is detected among the 8 candidate elements, 8 more candidate elements are randomly selected, and this process continues until linear independence is detected among the 8 candidate elements. The 8 candidate elements detected as linearly independent are then identified as the 8 target elements to form the target finite field. The corresponding random basis.

[0072] As another example, the target cryptographic algorithm is the Camellia algorithm, where the target finite field of the target S-box is... First, for the target finite field The first finite field included From a set of 16 elements, 4 candidate elements are randomly selected. If the four candidate elements are found to be linearly independent, they are directly identified as the four target elements to form the first finite field. The corresponding random basis; if linear correlation is detected among the four candidate elements, four more candidate elements are randomly selected, and this process continues until linear independence is detected among the four candidate elements. The four candidate elements that are detected as linearly independent are then identified as the four target elements to form the first finite field. The corresponding random basis.

[0073] Then, for the target finite field Included second finite field Given 256 elements, randomly select 2 candidate elements. If the two candidate elements are detected to be linearly independent, then these two candidate elements are directly identified as the two target elements to form the second finite field. The corresponding random basis; if the two candidate elements are detected to be linearly dependent, two more candidate elements are randomly selected, and this process continues until the two candidate elements are detected to be linearly independent. The two candidate elements detected to be linearly independent are then determined as the two target elements to form the second finite field. The corresponding random basis.

[0074] Based on the two examples above, the target finite field of the target S-box in the target cryptographic algorithm is... Given the situation, determine the target finite field. The specific implementation of the corresponding random basis; and the target finite field of the target S-box in the target cryptographic algorithm. Given the situation, determine the target finite field. The specific implementation of the corresponding random basis can be deduced by referring to the specific implementation of the two examples above, and will not be repeated here.

[0075] S303: Generate random S-boxes based on random irreducible polynomials and random bases. The random S-boxes are different from the target S-boxes.

[0076] In this application, after generating the random irreducible polynomial corresponding to the target finite field in S301 and determining the random basis corresponding to the target finite field in S302, a random S-box different from the target S-box can be generated using the random irreducible polynomial and the random basis. This method not only generates the random S-box using the random irreducible polynomial but also combines it with the random basis. It increases the selection range of the randomly generated random basis on top of the selection range of the randomly generated random irreducible polynomial, and the random permutation and combination of the two selection ranges greatly increases the selection range of the random S-box.

[0077] Since the irreducible multiplicative polynomial and the random basis corresponding to the target finite field are used to perform the inverse multiplication operation of the target finite field; the target constant matrix and target constant vector determined by the target S-box are used to perform the affine operation; and generating the random S-box requires first performing the inverse multiplication operation of the target finite field, and then performing the affine operation. Therefore, in the specific implementation of S303, firstly, the inverse multiplication operation needs to be performed on each element in the target finite field using the irreducible multiplicative polynomial and the random basis to obtain the multiplicative inverse of each element. Then, further, the affine operation needs to be performed on the multiplicative inverse using the target constant matrix and the target constant vector to generate the random S-box. That is, this application provides a possible implementation method, and S303 may include, for example, steps S3031-S3032 as follows:

[0078] S3031: Based on a random irreducible polynomial and a random basis, perform inverse multiplication operations on each element to obtain the multiplicative inverse of each element.

[0079] S3033: Based on the target constant matrix and the target constant vector, perform affine operations on the multiplicative inverse to generate a random S-box; the target constant matrix and the target constant vector are determined by the target S-box.

[0080] Specifically, when the target cryptographic algorithm is AES, the formula for calculating the random S-box is as follows:

[0081]

[0082] in, Represents the elements in the target finite field. Represents the target constant matrix. Represents the target constant vector; when the target finite field is hour, for The constant matrix, It is an 8-bit constant vector.

[0083] Furthermore, in this application, to further improve the security of the cryptographic chip based on the target cryptographic algorithm, after generating the random S-box through steps S301-S303, the random S-box is not fixed. Steps S301-S303 can be re-executed at preset intervals to update the random S-box. Therefore, this application provides a possible implementation, which may further include, for example, step S1: updating the random S-box at preset intervals. The preset interval can be pre-set according to the specific needs of the actual application scenario.

[0084] Furthermore, corresponding to data encryption based on the AES algorithm, data decryption based on the AES algorithm is actually the reverse process of data encryption based on the AES algorithm. Therefore, data decryption based on the AES algorithm can refer to performing Nr rounds of transformation operations on the input 128-bit ciphertext, followed by a cryptographic addition operation to output 128 bits of plaintext. Figure 4 The diagram illustrates a flowchart of data decryption based on the AES algorithm. In AES-based data decryption, the first round of transformation operations is the inverse of the last round of transformation operations in AES-based data encryption. Therefore, the first round of transformation operations in AES-based data decryption includes key addition, reverse column shift, and reverse byte substitution. Similarly, the subsequent Nr-1 rounds of transformation operations in AES-based data decryption are the inverses of the first Nr-1 rounds of transformation operations in AES-based data encryption. Therefore, the subsequent Nr-1 rounds of transformation operations in AES-based data decryption include key addition, inverse column mixing, reverse column shift, and reverse byte substitution. The key used for key addition in AES-based data decryption is in the reverse order of the key used for key addition in AES-based data encryption.

[0085] Since inverse byte substitution operations generally employ non-linear inverse S-boxes to implement byte substitution, also known as inverse S-box operations, in this application, for the target inverse S-box corresponding to the target S-box in the target cryptographic algorithm, after generating the random irreducible polynomial corresponding to the target finite field in S301 and determining the random basis corresponding to the target finite field in S302, a random inverse S-box different from the target inverse S-box can be generated using the random irreducible polynomial and the random basis. Therefore, this application provides a possible implementation, and the method may further include, for example, step S2: generating a random inverse S-box corresponding to the random S-box based on the random irreducible polynomial and the random basis; the random inverse S-box is different from the target inverse S-box corresponding to the target S-box.

[0086] Since generating a random inverse S-box requires performing an affine operation followed by the inverse multiplication operation of the target finite field, in the specific implementation of S2, firstly, an affine operation is performed on each element of the target finite field using the target constant matrix and target constant vector to obtain the affine elements of each element; then, further, the inverse multiplication operation of the target finite field is performed on the affine elements using a random irreducible polynomial and a random basis to generate the random inverse S-box. That is, this application provides a possible implementation, where S2 may include, for example, steps S21-S22 as follows:

[0087] S21: Based on the target constant matrix and the target constant vector, perform affine operations on each element to obtain the affine elements of each element; the target constant matrix and the target constant vector are determined by the target S-box.

[0088] S22: Generate a random inverse S-box by performing inverse multiplication on affine elements based on random irreducible polynomials and random basis.

[0089] Specifically, when the target cryptographic algorithm is AES, the formula for calculating the random inverse S-box is as follows:

[0090]

[0091] in, Represents the elements in the target finite field. Represents the target constant matrix. Represents the target constant matrix The inverse matrix, This represents the target constant vector; similarly, when the target finite field is... hour, for The constant matrix, It is an 8-bit constant vector.

[0092] Similarly, corresponding to updating the random S-box at a preset time interval in S1, the random inverse S-box also needs to be updated; therefore, this application provides a possible implementation method, which may also include step S3 as follows: updating the random inverse S-box at a preset time interval.

[0093] S304: Send the random S-box to the data terminal.

[0094] In this application, after generating a random S-box different from the target S-box in S303, this random S-box is used to replace the target S-box in the target cryptographic algorithm to improve the security of the cryptographic chip based on the target cryptographic algorithm. The random S-box needs to be sent to the data terminal so that the data terminal can perform data processing on the data to be processed based on the target cryptographic algorithm, replacing the target S-box with the random S-box to obtain the data processing result, thereby improving the security of data processing based on the target cryptographic algorithm. In specific implementations of S304, when this application is applied to a communication system with a key management center, for example... Figure 5The diagram illustrates a communication system with a key management center. This system includes a key management center, a data transmitter, and a data receiver. The data processing method provided in this embodiment is executed by the key management center, and the random S-box is generated by the key management center. Before the data transmitter communicates with the data receiver, it first sends a key request and an S-box request to the key management center. In response to these requests, the key management center executes steps S301-S303 to generate the random S-box and distributes it along with the key to the data transmitter via a key distribution mechanism. Therefore, this application provides a possible implementation where, when the random S-box is generated by the key management center, the data terminal is the data transmitter. Step S304 may include, for example, sending the random S-box along with the key to the data transmitter based on the S-box request sent by the data transmitter.

[0095] Generally, the key management center typically uses public-key cryptography to encrypt and send the random S-box and key to the data sender. Furthermore, to enhance the security of data communication between the sender and receiver, the sender also needs to synchronize the random S-box and key to the receiver. Based on this, the sender can replace the target S-box in the target cryptographic algorithm with the random S-box, perform data processing on the data to be processed based on the target cryptographic algorithm, obtain the data processing result, and then communicate with the receiver using this result.

[0096] In a specific implementation of S304, when this application is applied to a communication system with distributed key management, for example, as... Figure 6 The diagram illustrates a communication system for distributed key management. This system includes a data transmitter and a data receiver. The data processing method provided in this embodiment is executed by the data transmitter, so the random S-box can be generated by the data transmitter. The data transmitter needs to send the random S-box and the key together to the data receiver. Therefore, this application provides a possible implementation where, when the random S-box is generated by the data transmitter, the data terminal is the data receiver. Step 304 may include, for example, sending the random S-box along with the key to the data receiver.

[0097] Furthermore, in the aforementioned communication system scenario with distributed key management, to enhance the security of data communication between the data sender and the data receiver, the data sender can replace the target S-box in the target cryptographic algorithm with a random S-box to improve the security of the cryptographic chip based on the target cryptographic algorithm. This allows for data processing of the data to be processed using the target cryptographic algorithm, obtaining the data processing result and thus improving the security of the data processing based on the target cryptographic algorithm. Based on this, the data sender communicates with the data receiver using the data processing result of the data to be processed, thereby enhancing the security of data communication between the two ends. Therefore, this application provides a possible implementation method where, when the random S-box is generated by the data sender, the method may further include, for example, step S3: replacing the target S-box with a random S-box, performing data processing on the data to be processed using the target cryptographic algorithm, and obtaining the data processing result of the data to be processed.

[0098] Furthermore, in this application, the random inverse S-box corresponding to the random S-box generated in S2 above is used to replace the target inverse S-box in the target cryptographic algorithm to improve the security of the cryptographic chip based on the target cryptographic algorithm. Therefore, the random inverse S-box needs to be sent to the data terminal so that the data terminal can perform data processing on the data to be processed based on the target cryptographic algorithm, replacing the target inverse S-box of the target cryptographic algorithm with the random inverse S-box to obtain the data processing result of the data to be processed, thereby improving the security of data processing based on the target cryptographic algorithm. Therefore, this application provides a possible implementation method. Based on S2 above, S304 may include, for example, sending the random inverse S-box to the data terminal. The specific implementation method of sending the random inverse S-box to the data terminal can be derived from the specific implementation of sending the random S-box to the data terminal described above, and will not be repeated here.

[0099] The data processing method provided in this application generates a random irreducible polynomial corresponding to the target finite field of the target S-box in the target cryptographic algorithm; determines multiple linearly independent target elements through each element in the target finite field to form a random basis corresponding to the target finite field; generates a random S-box different from the target S-box using the random irreducible polynomial and the random basis; and sends the random S-box to the data terminal so that subsequent data processing based on the target cryptographic algorithm can be performed on the data to be processed, changing the target S-box to a random S-box to obtain the data processing result. Based on this, for the target finite field of the target S-box in the target cryptographic algorithm, a suitable random irreducible polynomial and random basis are constructed in a random manner, and a random S-box different from the target S-box is generated. Compared with evolutionary algorithms, this method has lower computational complexity, reduces computational resource consumption, and lowers the computational load on the processor. Even in data processing scenarios based on the target cryptographic algorithm with limited computational resources, a random S-box can be generated to replace the target S-box, effectively improving the security of the cryptographic chip based on the target cryptographic algorithm, thereby effectively improving the security of data processing based on the target cryptographic algorithm.

[0100] To better understand the technical solutions provided in the embodiments of this application, the following will describe in detail a data processing method provided in the embodiments of this application, taking into account a data processing scenario based on the AES algorithm with limited computing resources and applied to a communication system with distributed key management.

[0101] See Figure 7 , Figure 7 A flowchart illustrating a data processing method based on the AES algorithm in a computationally limited data processing scenario provided in this application embodiment. This method is executed by a data transmitter in a communication system applied to distributed key management. The method includes:

[0102] S701: Target Finite Field for the Target S-Box in the AES Algorithm 8 polynomial coefficients are randomly generated. To generate a candidate polynomial .

[0103] S702: Check if the candidate polynomial is irreducible. If not, return to execute S701; if yes, execute S703.

[0104] S703: Determine the candidate polynomial as the target finite field The corresponding random irreducible polynomial.

[0105] S704: For a target finite field Given 256 elements, randomly select 8 candidate elements. .

[0106] S705: Check if the 8 candidate elements are linearly independent. If not, return to execute S704; if yes, execute S706.

[0107] S706: Determine the 8 candidate elements as 8 target elements to form the target finite field. The corresponding random basis.

[0108] S707: Based on stochastic irreducible polynomials and stochastic bases, for the target finite field Perform the inverse multiplication operation on each of the 256 elements to obtain the multiplicative inverse of each element.

[0109] S708: Based on the target constant matrix and the target constant vector, perform affine operations on the multiplicative inverse of each element to generate a random S-box; the target constant matrix and the target constant vector are determined by the target S-box.

[0110] S709: Send the random S-box along with the key to the data receiver.

[0111] S710: Replace the target S-box with a random S-box, perform data processing on the data to be processed based on the AES algorithm, and obtain the data processing result of the data to be processed.

[0112] S711: Sends the data processing result of the data to be processed to the data receiving end.

[0113] The data processing method provided in this application embodiment targets the finite field of the target S-box in the AES algorithm. This method constructs suitable random irreducible polynomials and random bases in a random manner, generating random S-boxes different from the target S-box. Compared to evolutionary algorithms, this method has lower computational complexity, reduces computational resource consumption, and lowers the processor's computational load. Even in computationally limited data processing scenarios based on the AES algorithm, it can generate random S-boxes to replace the target S-box, effectively improving the security of AES-based cryptographic chips and thus enhancing the security of AES-based data processing.

[0114] Based on the data processing method provided in the above embodiments, this application also provides a data processing apparatus, see [link to relevant documentation]. Figure 8 , Figure 8 This application provides a structural block diagram of a data processing apparatus 800, which includes a generation unit 801, a determination unit 802, and a transmission unit 803.

[0115] The generation unit 801 is used to generate a random irreducible polynomial corresponding to the target finite field of the target S-box in the target cryptographic algorithm.

[0116] The determining unit 802 is used to determine multiple linearly independent target elements based on each element in the target finite field, and to construct a random basis corresponding to the target finite field based on the multiple target elements;

[0117] The generation unit 801 is also used to generate a random S-box based on a random irreducible polynomial and a random basis, wherein the random S-box is different from the target S-box;

[0118] The acquisition unit 803 is used to send the random S-box to the data terminal.

[0119] In one possible implementation, the generation unit 801 is used for:

[0120] Candidate polynomials are randomly generated based on the target finite field;

[0121] If a candidate polynomial is detected as a reducible polynomial, the random generation of candidate polynomials based on the target finite field is performed again until an irreducible candidate polynomial is detected.

[0122] Candidate polynomials that are detected as irreducible polynomials are determined to be random irreducible polynomials.

[0123] In one possible implementation, the determining unit 802 is used for:

[0124] Multiple candidate elements are randomly selected based on each element in the target finite field;

[0125] If multiple candidate elements are detected to be linearly correlated, the process of randomly selecting multiple candidate elements based on each element in the target finite field is repeated until multiple candidate elements are detected to be linearly uncorrelated.

[0126] Multiple candidate elements detected as linearly independent are identified as multiple target elements;

[0127] A random basis is constructed based on multiple target elements.

[0128] In one possible implementation, the generation unit 801 is used for:

[0129] Based on the random irreducible polynomial and the random basis, the inverse multiplication operation is performed on each element to obtain the multiplicative inverse of each element.

[0130] A random S-box is generated by performing affine operations on the multiplicative inverse based on the target constant matrix and the target constant vector; the target constant matrix and the target constant vector are determined by the target S-box.

[0131] In one possible implementation, the generating unit 801 is further configured to:

[0132] Based on random irreducible polynomials and random basis, generate random inverse S-boxes corresponding to random S-boxes; the random inverse S-boxes are different from the target inverse S-boxes corresponding to the target S-boxes.

[0133] The transmitting unit 803 is also used for:

[0134] Send the random inverse S-box to the data terminal.

[0135] In one possible implementation, the generating unit 801 is further configured to:

[0136] Based on the target constant matrix and the target constant vector, affine operations are performed on each element to obtain the affine elements of each element; the target constant matrix and the target constant vector are determined by the target S-box;

[0137] Based on random irreducible polynomials and random basis, random inverse S-boxes are generated by performing inverse multiplication operations on affine elements.

[0138] In one possible implementation, the device further includes an update unit:

[0139] The update unit is used to update the random S-box at preset intervals.

[0140] In one possible implementation, when the random S-box is generated by the key management center, the data terminal acts as the data sender, and the sending unit 803 is used for:

[0141] Based on the S-box request sent by the data sender, a random S-box is sent to the data sender along with the key.

[0142] In one possible implementation, when the random S-box is generated by the data transmitter, the data terminal acts as the data receiver, and the transmitting unit 803 is used for:

[0143] The random S-box is sent to the data receiver along with the key.

[0144] In one possible implementation, the apparatus further includes an obtaining unit:

[0145] The obtaining unit is used to replace the target S-box with a random S-box, perform data processing on the data to be processed based on the target cryptographic algorithm, and obtain the data processing result of the data to be processed.

[0146] The data processing apparatus provided in this application generates a random irreducible polynomial corresponding to the target finite field of the target S-box in the target cryptographic algorithm; determines multiple linearly independent target elements through each element in the target finite field to form a random basis corresponding to the target finite field; generates a random S-box different from the target S-box using the random irreducible polynomial and the random basis; and sends the random S-box to the data terminal so that subsequent data processing based on the target cryptographic algorithm can be performed on the data to be processed, changing the target S-box to a random S-box to obtain the data processing result of the data to be processed. Based on this, for the target finite field of the target S-box in the target cryptographic algorithm, a suitable random irreducible polynomial and random basis are constructed in a random manner, and a random S-box different from the target S-box is generated. Compared with evolutionary algorithms, this method has lower computational complexity, reduces the consumption of computing resources, and lowers the computational load on the processor. Even in data processing scenarios based on the target cryptographic algorithm with limited computing resources, a random S-box can be generated to replace the target S-box, effectively improving the security of the cryptographic chip based on the target cryptographic algorithm, thereby effectively improving the security of data processing based on the target cryptographic algorithm.

[0147] This application also provides a computer device, which will be described below with reference to the accompanying drawings. Please refer to... Figure 9 As shown in the embodiments of this application, a device is provided. This device can also be a terminal device, which can be any smart terminal including mobile phones, tablets, PDAs, point-of-sale (POS) terminals, in-vehicle computers, etc. Taking a mobile phone as an example:

[0148] Figure 9 This diagram illustrates a partial structural representation of a mobile phone related to the terminal device provided in this embodiment. (Reference) Figure 9 The mobile phone includes components such as a radio frequency (RF) circuit 910, a memory 920, an input unit 930, a display unit 940, a sensor 950, an audio circuit 960, a wireless Fidelity (WiFi) module 970, a processor 980, and a power supply 990. Those skilled in the art will understand that... Figure 9 The mobile phone structure shown does not constitute a limitation on the mobile phone and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0149] The following is combined Figure 9 A detailed introduction to each component of a mobile phone:

[0150] RF circuit 910 can be used for receiving and transmitting signals during information transmission or calls. Specifically, it receives downlink information from the base station and processes it with processor 980; additionally, it transmits uplink data to the base station. Typically, RF circuit 910 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, RF circuit 910 can also communicate wirelessly with networks and other devices. The aforementioned wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0151] The memory 920 can be used to store software programs and modules. The processor 980 executes various mobile phone functions and data processing based on the SM4 block cipher standard by running the software programs and modules stored in the memory 920. The memory 920 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory 920 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0152] The input unit 930 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the mobile phone. Specifically, the input unit 930 may include a touch panel 931 and other input devices 932. The touch panel 931, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 931), and drive the corresponding connected devices according to a pre-set program. Optionally, the touch panel 931 may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, sends it to the processor 980, and can receive and execute commands sent by the processor 980. In addition, the touch panel 931 can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 931, the input unit 930 may also include other input devices 932. Specifically, other input devices 932 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0153] The display unit 940 can be used to display information input by the user or information provided to the user, as well as various menus of the mobile phone. The display unit 940 may include a display panel 941, which may optionally be configured as a liquid crystal display (LCD), organic light-emitting diode (OLED), or similar display. Further, a touch panel 931 may cover the display panel 941. When the touch panel 931 detects a touch operation on or near it, it transmits the information to the processor 980 to determine the type of touch event. Subsequently, the processor 980 provides corresponding visual output on the display panel 941 based on the type of touch event. Although in Figure 9 In this embodiment, the touch panel 931 and the display panel 941 are two separate components to realize the input and output functions of the mobile phone. However, in some embodiments, the touch panel 931 and the display panel 941 can be integrated to realize the input and output functions of the mobile phone.

[0154] The mobile phone may also include at least one sensor 950, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. The ambient light sensor can adjust the brightness of the display panel 941 according to the ambient light level, and the proximity sensor can turn off the display panel 941 and / or backlight when the phone is moved to the ear. As a type of motion sensor, an accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes). When stationary, it can detect the magnitude and direction of gravity, and can be used for applications that recognize the phone's posture (such as landscape / portrait switching, related games, magnetometer posture calibration), vibration recognition-related functions (such as pedometer, taps), etc. Other sensors that may be configured in the mobile phone, such as gyroscopes, barometers, hygrometers, thermometers, and infrared sensors, will not be described in detail here.

[0155] Audio circuit 960, speaker 961, and microphone 962 provide an audio interface between the user and the mobile phone. Audio circuit 960 converts received audio data into electrical signals and transmits them to speaker 961, where speaker 961 converts them into sound signals for output. On the other hand, microphone 962 converts collected sound signals into electrical signals, which are received by audio circuit 960, converted into audio data, and then output to processor 980 for processing. The audio data is then transmitted via RF circuit 915 to, for example, another mobile phone, or output to memory 920 for further processing.

[0156] WiFi is a short-range wireless transmission technology. Mobile phones using the WiFi module 970 can help users send and receive emails, browse web pages, and access streaming media, providing users with wireless broadband internet access. Although Figure 9 The WiFi module 970 is shown, but it is understood that it is not an essential component of a mobile phone and can be omitted as needed without changing the essence of the invention.

[0157] The processor 980 is the control center of the mobile phone, connecting various parts of the phone through various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the memory 920, and by calling data stored in the memory 920. Optionally, the processor 980 may include one or more processing units; preferably, the processor 980 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may also not be integrated into the processor 980.

[0158] The mobile phone also includes a power supply 990 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 980 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0159] Although not shown, mobile phones may also include a camera, Bluetooth module, etc., which will not be described in detail here.

[0160] In this embodiment, the processor 980 included in the terminal device also has the following functions:

[0161] For the target finite field of the target S-box in the target cryptographic algorithm, generate the random irreducible polynomial corresponding to the target finite field.

[0162] Based on each element in the target finite field, determine multiple linearly independent target elements, and construct a random basis corresponding to the target finite field based on the multiple target elements;

[0163] Random S-boxes are generated based on random irreducible polynomials and random bases. The random S-boxes are different from the target S-boxes.

[0164] Send the random S-box to the data terminal.

[0165] This application also provides a server; please refer to [link / reference]. Figure 10 As shown, Figure 10 This is a structural diagram of a server 1000 provided in an embodiment of this application. The server 1000 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1022 (e.g., one or more processors) and a memory 1032, and one or more storage media 1030 (e.g., one or more mass storage devices) for storing application programs 1042 or data 1044. The memory 1032 and storage media 1030 can be temporary or persistent storage. The program stored in the storage media 1030 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server. Furthermore, the central processing unit 1022 may be configured to communicate with the storage media 1030 and execute the series of instruction operations in the storage media 1030 on the server 1000.

[0166] Server 1000 may also include one or more power supplies 1026, one or more wired or wireless network interfaces 1050, one or more input / output interfaces 1058, and / or one or more operating systems 1041, such as Windows Server. TM Mac OS X TM UnixTM Linux TM FreeBSD TM etc.

[0167] The steps performed by the server in the above embodiments can be based on Figure 10 The server structure shown.

[0168] This application also provides a computer-readable storage medium for storing a computer program that executes any one of the data processing methods described in the foregoing embodiments.

[0169] This application also provides a computer program product, including a computer program or instructions; when the computer program or instructions are executed by a processor, any one of the data processing methods described in the foregoing embodiments is executed.

[0170] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium can be at least one of the following media: read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc., and other media capable of storing program code.

[0171] It should be noted that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiments. The device and system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of the solution in this embodiment according to actual needs. Those skilled in the art can understand and implement this without creative effort.

[0172] The above description is merely one specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A data processing method, characterized by, The method comprises: generating a random irreducible polynomial corresponding to a target finite field of a target S-box in a target cryptographic algorithm; randomly extracting a plurality of candidate elements from each element in the target finite field; if the plurality of candidate elements are detected to be linearly dependent, re-executing the step of randomly extracting a plurality of candidate elements from each element in the target finite field until the plurality of candidate elements are detected to be linearly independent; determining the plurality of candidate elements detected to be linearly independent as a plurality of target elements linearly independent; constructing a random basis corresponding to the target finite field according to the plurality of target elements; generating a random S-box based on the random irreducible polynomial and the random basis, the random S-box being different from the target S-box; sending the random S-box to a data terminal.

2. The method of claim 1, wherein, The method comprises: randomly generating a candidate polynomial based on the target finite field; if the candidate polynomial is detected to be a reducible polynomial, re-executing the step of randomly generating a candidate polynomial based on the target finite field until the candidate polynomial is detected to be an irreducible polynomial; determining the candidate polynomial detected to be an irreducible polynomial as the random irreducible polynomial.

3. The method of claim 1, wherein, The method comprises: performing multiplicative inverse operation on each element based on the random irreducible polynomial and the random basis to obtain multiplicative inverses of the elements; performing affine operation on the multiplicative inverses based on a target constant matrix and a target constant vector to generate the random S-box, the target constant matrix and the target constant vector being determined through the target S-box.

4. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: generating a random inverse S-box corresponding to the random S-box based on the random irreducible polynomial and the random basis, the random inverse S-box being different from a target inverse S-box corresponding to the target S-box; The method further comprises: sending the random inverse S-box to the data terminal.

5. The method of claim 4, wherein, The method comprises: performing affine operation on each element based on a target constant matrix and a target constant vector to obtain affine elements of the elements, the target constant matrix and the target constant vector being determined through the target S-box; performing multiplicative inverse operation on the affine elements based on the random irreducible polynomial and the random basis to generate the random inverse S-box.

6. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: updating the random S-box at intervals of a preset time.

7. The method according to any one of claims 1 to 3, characterized in that, When the random S-box is generated by a key management center, the data terminal is a data sending terminal, and the method comprises: sending the random S-box together with a key to the data sending terminal according to an S-box request sent by the data sending terminal.

8. The method according to any one of claims 1 to 3, characterized in that, When the random S-box is generated by a data sending terminal, the data terminal is a data receiving terminal, and the method comprises: The random S-box is sent to the data receiving end together with a key.

9. The method of claim 8, wherein, The method further comprises: The random S-box is used to replace the target S-box, and data processing based on the target cryptographic algorithm is performed on the to-be-processed data, to obtain a data processing result of the to-be-processed data.

10. A data processing apparatus, characterized by, The device comprises a generating unit, a determining unit and a sending unit: The generating unit is configured to generate, for a target finite field of a target S-box in a target cryptographic algorithm, a random irreducible polynomial corresponding to the target finite field; The determining unit is configured to randomly extract a plurality of candidate elements based on each element in the target finite field; If the plurality of candidate elements are detected to be linearly dependent, the randomly extracting a plurality of candidate elements based on each element in the target finite field is re-executed until the plurality of candidate elements are detected to be linearly independent; The plurality of candidate elements detected to be linearly independent are determined as a plurality of target elements linearly independent; and a random basis corresponding to the target finite field is formed according to the plurality of target elements; The generating unit is further configured to jointly generate a random S-box based on the random irreducible polynomial and the random basis, the random S-box being different from the target S-box; The sending unit is configured to send the random S-box to a data terminal.

11. The apparatus of claim 10, wherein, The generating unit is configured to: randomly generate a candidate polynomial based on the target finite field; if the candidate polynomial is detected to be a reducible polynomial, the randomly generating a candidate polynomial based on the target finite field is re-executed until the candidate polynomial is detected to be an irreducible polynomial; the candidate polynomial detected to be an irreducible polynomial is determined as the random irreducible polynomial.

12. The apparatus of claim 10, wherein, The generating unit is configured to: perform multiplicative inverse operation on each element based on the random irreducible polynomial and the random basis, to obtain a multiplicative inverse element of each element; perform affine operation on the multiplicative inverse element based on a target constant matrix and a target constant vector to generate the random S-box; the target constant matrix and the target constant vector are determined through the target S-box.

13. The apparatus of any of claims 10-12, wherein, The generating unit is configured to: generate a random inverse S-box corresponding to the random S-box based on the random irreducible polynomial and the random basis; the random inverse S-box is different from a target inverse S-box corresponding to the target S-box; The sending unit is configured to: send the random inverse S-box to the data terminal.

14. The apparatus of claim 13, wherein, The generating unit is further configured to: perform affine operation on each element based on a target constant matrix and a target constant vector to obtain an affine element of each element; the target constant matrix and the target constant vector are determined through the target S-box; perform multiplicative inverse operation on the affine element based on the random irreducible polynomial and the random basis to generate the random inverse S-box.

15. The apparatus of any one of claims 10-12, wherein, The device further comprises an updating unit configured to update the random S-box at intervals of a preset time.

16. The apparatus of any one of claims 10-12, wherein, When the random S-box is generated by a key management center, the data terminal is a data sending end, and the sending unit is configured to: send the random S-box together with a key to the data sending end according to an S-box request sent by the data sending end.

17. The apparatus of any one of claims 10-12, wherein, When the random S-box is generated by a data sending terminal, the data terminal is a data receiving terminal, the sending unit is configured to: send the random S-box to the data receiving terminal together with a key.

18. The apparatus of claim 17, wherein, The device further includes an obtaining unit configured to replace the target S-box with the random S-box, perform data processing on to-be-processed data based on the target cryptographic algorithm, and obtain a data processing result of the to-be-processed data.

19. A computer device, comprising: The device includes a processor and a memory: The memory is configured to store program code and transmit the program code to the processor; The processor is configured to execute the data processing method according to the instructions in the program code.

20. A computer-readable storage medium, characterized in that, The computer readable storage medium is configured to store a computer program, and the computer program is configured to execute the data processing method.

21. A computer program product, characterised in that, The computer program or instructions are executed by the processor to execute the data processing method.

Citation Information

Patent Citations

  • Method of diversification of a round function of an encryption algorithm

    US20120170739A1