8-bit S box construction method based on improved genetic algorithm

By improving the genetic algorithm, using the composite chaotic system to initialize populations, design multi-property fitness functions and cross-operations, and perform 2N rounds of search variation operations, the problems of poor and insufficient optimization of the initial population of S-box in the prior art are solved, and the cryptographic properties of S-box are significantly improved.

CN119696758AActive Publication Date: 2025-03-25GUILIN UNIV OF ELECTRONIC TECH

Patent Information

Application Number
CN202411866044.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-18
Publication Date
2025-03-25
Estimated Expiration
2044-12-18

AI Technical Summary

Technical Problem

The existing method of constructing S-box based on genetic algorithms has problems such as poor initial population properties, fewer fitness function indicators and insufficient properties optimization.

Method used

The composite chaotic system composed of Logistic chaotic mapping and Tent chaotic mapping is used to initialize the population, design the fitness function of multi-properties, design cross-operations to ensure the bi-radioability of the S box, and optimize the cryptographic properties of the S box through 2N rounds of search variation operations.

Benefits of technology

The cryptographic properties of the S box are improved, ensuring that the nonlinearity, differential uniformity and strict avalanche standards of the S box are excellent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119696758A_ABST
    Figure CN119696758A_ABST
Patent Text Reader

Abstract

The invention discloses an 8-bit S box construction method based on an improved genetic algorithm, and the method comprises the following steps: (1) forming a composite chaotic system through Logistic chaotic mapping and Tent chaotic mapping, and generating an initialized population; (2) designing a fitness function by combining the nonlinearity, the difference uniformity and the strict avalanche criterion of the S box; (3) designing crossover operation for ensuring bijection of the S box; (4) designing a reverse search method to search variation points, combining a hill climbing algorithm and a random search method, designing variation operation based on 2N rounds of search, carrying out two-point variation point search in the first N rounds, adopting three-point variation point search in the last N rounds, and designing a table look-up statistical method to further evaluate and optimize the property of the S box; and (5) constructing an 8-bit password S box based on an improved genetic algorithm. The method is based on the improved genetic algorithm, and the 8-bit S box with excellent cryptographic properties can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of information security, and in particular to an 8-bit S-box construction method based on an improved genetic algorithm. Background Art

[0002] The obfuscation characteristics of block cipher algorithms are mainly provided by the nonlinear transformation S-box. The security of the S-box determines the security strength of the overall cryptographic algorithm. The evaluation indicators of the S-box security mainly include nonlinearity, differential uniformity, algebraic order, signal-to-noise ratio, etc. The common construction methods of S-box include mathematical construction, random generation, generation using cryptographic structure, and construction using intelligent optimization algorithms.

[0003] Intelligent optimization algorithms are often used to solve classic NP-C problems. Using intelligent optimization algorithms to search for S-boxes can efficiently search for optimal solutions in a larger solution space and improve the efficiency of global optimization. Commonly used intelligent optimization algorithms include genetic algorithms (GA), cellular automata, neural networks, etc. Genetic algorithms mainly simulate the genetic optimization of organisms at the chromosome level, and pass high-quality chromosomes to offspring through selection, crossover and mutation operations. Using genetic algorithms to construct S-boxes can search for the optimal solution of S-boxes in a global scope and stably generate S-boxes with excellent cryptographic properties. However, existing methods for constructing S-boxes based on genetic algorithms face some problems: (1) When initializing the S-box population, random generation is used, which makes the generated initial population of S-boxes have poor cryptographic properties, affecting the final results; (2) In the calculation of the fitness function, fewer cryptographic indicators of the S-box are considered; (3) Crossover and mutation operations are rarely optimized according to the cryptographic properties of the S-box. Summary of the invention

[0004] Aiming at the problems that the initial population properties are poor, the fitness function indicators are few, the properties are insufficiently optimized, etc. when constructing S-boxes using genetic algorithms, the present invention proposes an 8-bit S-box construction method based on an improved genetic algorithm. The method initializes the population through a composite chaotic system composed of a Logistic chaotic map and a Tent chaotic map, designs the fitness function in combination with the nonlinearity, differential uniformity and strict avalanche criterion of the S-box, designs a crossover operation to ensure the bijectivity of the S-box, and designs a mutation operation of 2N rounds of search to optimize the cryptographic properties of the S-box, thereby completing the improvement of the genetic algorithm. Finally, an 8-bit cryptographic S-box is constructed based on the improved genetic algorithm.

[0005] The technical solution for achieving the purpose of the present invention is:

[0006] A method for constructing an 8-bit S-box based on an improved genetic algorithm comprises the following steps:

[0007] (1) Initialize the population based on the composite chaotic system;

[0008] The Logistic map and the Tent map are compounded by exponential multiplication to establish a composite chaotic system to initialize the S-box population.

[0009] (2) Design a fitness function that combines multiple properties;

[0010] Based on nonlinearity, differential uniformity and strict avalanche criterion, a multi-objective piecewise weighted function is designed to comprehensively evaluate the properties of the S-box. The smaller the fitness function value of the S-box, the better its cryptographic properties.

[0011] (3) Design a crossover operation that ensures the bijectivity of the S-box;

[0012] Design a crossover operation that maintains the bijectivity of the S-box, retain the excellent properties of the parent S-box as much as possible, and increase the diversity of the offspring population;

[0013] (4) Design a mutation operation based on 2N rounds of search;

[0014] First, a reverse search method is designed to search for mutation points. Then, a mutation operation based on 2N rounds of search is designed by combining 2-point mutation point search and 3-point mutation point search. In the first N rounds, 2-point mutation point search is performed, and in the last N rounds, 3-point mutation point search is performed to speed up the execution efficiency of mutation operation. A table lookup statistical method is designed to further evaluate the properties of the optimized S-box.

[0015] (5) Constructing 8-bit S-box based on improved genetic algorithm;

[0016] Based on the improved genetic algorithm, an 8-bit S-box with excellent cryptographic properties is constructed through iteration.

[0017] In the 8-bit S-box construction method based on the improved genetic algorithm of the present invention, step (1) is to initialize the population based on the composite chaotic system, and the specific steps are as follows:

[0018] (1.1) In order to increase the chance of searching for the global optimal solution and cover a larger search space, a chaotic system is used to generate the initial population. Since both Tent mapping and Logistic mapping have problems such as small chaotic range, uneven sequence distribution, and easy periodicity in the iterative process, the Tent mapping and Logistic mapping are combined to form a composite chaotic system mapping formula as shown below:

[0019]

[0020] Among them, x n is the input sample state variable, parameters u∈(0,0.1], w∈[0,1];

[0021] (1.2) Initialize the S-box population through the composite chaotic system to generate the initial S-box with good cryptographic properties as much as possible, enrich the diversity of the genetic algorithm population, and increase the possibility of searching for the optimal solution. The process of generating the initial S-box using the composite chaotic system is as follows:

[0022] (1.2.1) Define an array S with a length of 256 and set the initial value of the chaotic map x0 = 0.32456;

[0023] (1.2.2) To eliminate the transient effects of the chaotic system, the idling system does not output chaotic values ​​for 50 times;

[0024] (1.2.3) The state value x of each round of the composite chaotic system n Generate an integer Z as follows:

[0025]

[0026] (1.2.4) To ensure the bijectivity of the S-box, determine whether Z has been added to the array S. If not, put Z into S; if it has been added, go to (1.2.5);

[0027] (1.2.5) If the number of elements in S is less than 256, go to (1.2.3) to regenerate Z, otherwise go to (1.2.6);

[0028] (1.2.6) Output array S and generate the initial S-box sample population.

[0029] In the 8-bit S-box construction method based on the improved genetic algorithm of the present invention, the fitness function of designing multiple properties combined in step (2) is specifically comprised of the following steps:

[0030] (2.1) Combining differential uniformity, nonlinearity, and strict avalanche criterion, a multi-objective weighted fitness function is designed. The formula is as follows:

[0031] G(t)=a×NL s +b×δ S +c×|SAC-0.5| (3)

[0032] Where t is a single individual S-box, NL s is the nonlinearity of the S-box t, δ S is the differential uniformity of S-box t; SAC is the strict avalanche criterion; a, b, c are the weights of S-box nonlinearity, differential uniformity and strict avalanche criterion respectively;

[0033] (2.2) Since the fitness function must satisfy the characteristics of single value and continuity, and based on the optimization test of the cryptographic properties of the S-box, the corresponding weights are set according to the different cryptographic properties, and the above fitness function G(t) is converted into a multi-objective piecewise weighted fitness function as follows:

[0034]

[0035] (2.3) Differential uniformity of S-box δ S The calculation formula is as follows:

[0036]

[0037] Among them, α and β are the input differential and output differential of the S-box, respectively, which are called differential pairs; represents the set of n-tuple elements in the field F2, where F2 is a binary finite field containing 2 elements; DDT F (α, β) is the difference value of the difference pair (α, β), and its calculation formula is as follows:

[0038]

[0039] Where x is the input of the S-box, F(x) is the vector Boolean function representation of the S-box, that is, F(x): is the addition operation on a binary finite field, # indicates calculating the number of elements in a set that satisfy the condition;

[0040] (2.4) Nonlinearity NL of the S-box s The calculation formula is as follows:

[0041]

[0042] Where a and b are the input mask and output mask of the S-box, respectively, and are called a mask pair; n = 8, indicating an 8-bit S-box; W F (a, b) is the Walsh transform of the S-box, and its calculation formula is:

[0043]

[0044] In the formula, “·” represents the vector inner product operation over a binary finite field, such as

[0045] In the 8-bit S-box construction method based on the improved genetic algorithm of the present invention, step (3) is to design a crossover operation to ensure the bijectivity of the S-box, and the specific steps are as follows:

[0046] In order to preserve the excellent properties of the parent S-box as much as possible in the crossover operation, increase the diversity of the offspring population, and maintain the bijectivity of the S-box, the specific process of the improved crossover operation is as follows:

[0047] (3.1) Let the S-boxes before crossing be B1, B2, and the S-boxes after crossing be C1, C2;

[0048] (3.2) Generate a random number R in the range [0,255];

[0049] (3.3) Copy the first R elements in B1 to C1;

[0050] (3.4) Traverse the elements in B2 from the beginning. If the element is not in C1 and the number of elements in C1 is less than 256, add it to C1. Otherwise, skip the element and continue traversing until C1 is full.

[0051] (3.5) Add the remaining elements in B2 to C2 in order, and then add the remaining elements in B1 to complete C2 in order to reach 256 elements;

[0052] (3.6) Output S-boxes C1, C2.

[0053] In the 8-bit S-box construction method based on the improved genetic algorithm of the present invention, step (4) is to design a mutation operation based on 2N rounds of search, and the specific steps are as follows:

[0054] (4.1) In order to better optimize the nonlinearity and differential uniformity of the S-box, a reverse search method is designed to search for variation points according to the linear distribution and differential distribution of the S-box. First, the variation points are searched to optimize the nonlinearity of the S-box, and then the variation points are searched according to the differential distribution of the S-box to optimize the differential uniformity of the S-box.

[0055] (4.1.1) To improve the nonlinearity of the S-box, the linearity of the S-box needs to be reduced. Therefore, the search for the variation point in the reverse search method will first calculate the linearity Line of the S-box, and then traverse the input / output mask pairs of the S-box to find all the inputs x of the S-box that satisfy equation (9), where θ and ω are the input mask and output mask of the S-box respectively:

[0056]

[0057] Put x into the corresponding set, randomly select two different values ​​from the set as the element subscripts of the S-box to exchange elements, calculate the linearity of the S-box after the element exchange; and evaluate whether the linearity of the S-box after the mutation is better than the result before the mutation;

[0058] (4.1.2) To optimize the differential uniformity of the S-box, search for mutation points according to the differential distribution of the S-box. First, calculate the differential uniformity of the S-box, traverse all input / output differential pairs of the S-box, find x that satisfies formula (6) and put it into the corresponding set; randomly select two different values ​​from the set as the element subscripts of the S-box to exchange elements, and calculate the differential uniformity of the S-box after the element exchange; and evaluate whether the differential uniformity of the S-box after the mutation is better than the result before the mutation;

[0059] (4.2) In order to speed up the execution efficiency of the mutation operation and optimize the properties of the S-box, a 2N-round search method is designed based on hill climbing search, random search, 2-point mutation point search and 3-point mutation point search using the reverse search method. In the first N rounds, the 2-point mutation point search using the three methods is used, and in the next N rounds, the 3-point mutation point search using the three methods is used.

[0060] (4.3) The specific steps of the 2-point mutation search method in the first N rounds are as follows:

[0061] (4.3.1) In the first N rounds of 2-point mutation point search, nonlinear optimization mutation point search is first performed, and the ratios of the search rounds of 2-point hill climbing search, random search, and reverse search in N rounds are set to f1, f2, and f3 respectively, and f1+f2+f3=1. Among them, the 2-point random search is to generate two different numbers in the interval [0,255] as the element subscripts of the S-box to exchange two elements through a random function;

[0062] (4.3.2) Using hill climbing search, random search, and reverse search methods, a two-point mutation search method with two points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the nonlinearity of the S-boxes before and after the mutation in each round is evaluated, and the S-box with better nonlinearity is retained, and finally N results are obtained;

[0063] (4.3.3) Secondly, the variation point search of differential uniformity optimization is performed. Since the computational overhead of hill climbing search is too large, only random search and reverse search are used here, and the ratio of the number of rounds of the two in N rounds is set to c1 and c2, and c1+c2=1;

[0064] (4.3.4) Using random search and reverse search methods, a two-point mutation search method with two points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the S-boxes before and after the mutation in each round are evaluated for differential uniformity, and the S-boxes with better differential uniformity are retained, and finally N results are obtained;

[0065] (4.4) In the next N rounds of 3-point mutation search, the 3-point hill climbing algorithm is used to replace the 2-point hill climbing algorithm. The random search uses a random function to generate 3 different numbers in the interval [0, 255] as the element subscripts of the S-box and then swap the 3 elements in pairs. The reverse search rule is to randomly select 3 different numbers from the set that meets the conditions as the element subscripts of the S-box and then swap the elements in pairs. The specific method is as follows;

[0066] (4.4.1) First, perform a three-point mutation point search for nonlinear optimization, and set the ratio of the number of rounds of hill climbing search, random search, and reverse search in N rounds to ff1, ff2, and ff3 respectively, and ff1+ff2+ff3=1;

[0067] (4.4.2) Using hill climbing search, random search, and reverse search methods, a three-point mutation search method with three points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the nonlinearity of the S-boxes before and after the mutation in each round is evaluated, and the S-box with better nonlinearity is retained, and finally N results are obtained;

[0068] (4.4.3) Secondly, perform a three-point mutation point search for differential uniformity optimization. Similarly, only set the ratio of the number of rounds of random search and reverse search in N rounds to cc1 and cc2 respectively, and cc1+cc2=1. Here, the ratio of the number of rounds of random search can be increased to facilitate searching for effective mutation points in a larger solution space.

[0069] (4.4.4) Using random search and reverse search methods, a three-point mutation search method with three points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the S-boxes before and after the mutation in each round are evaluated for differential uniformity, and the S-boxes with better differential uniformity are retained, and finally N results are obtained;

[0070] (4.5) Regarding the evaluation of the mutated S-box, the traditional mutation operation is to determine whether the nonlinearity or differential uniformity can be improved. If the property is better, it is retained, and if it is worse, it is discarded. This cannot complete the evaluation of the S-box whose properties remain unchanged before and after the mutation. Here, for the case where the nonlinearity and differential uniformity of the S-box before and after the mutation remain unchanged, a table lookup statistical method is designed to count and evaluate the changes in the number of times the elements appear in the linear distribution table and the differential distribution table of the S-box. If the frequency of the same element in the linear distribution table and the differential distribution table is smaller, the maximum linear path or the maximum differential path will be less, and the property is better. The specific method is as follows:

[0071] (4.5.1) If the nonlinearity of the S-box remains unchanged before and after the mutation, calculate the linear distribution tables of the two S-boxes, take the absolute value of each element in the linear distribution table and count its occurrence times; compare the number of times the maximum value element appears in the linear distribution tables of the two S-boxes. The S-box with a smaller number of occurrences has fewer maximum linear paths and better linear properties; if the number of times the maximum value element appears is the same, compare the number of times the second largest value element appears, and so on until an S-box with a smaller number of occurrences of the same element value in the linear distribution tables of the S-boxes before and after the mutation is found, and replace the original S-box with it;

[0072] (4.5.2) If the differential uniformity of the S-box before and after the mutation remains unchanged, then calculate the differential distribution table of the two S-boxes, take the absolute value of each element in the differential distribution table and count its number of occurrences; the S-box with a smaller number of occurrences has fewer maximum differential paths and better differential properties; if the number of occurrences of the maximum value element is the same, then compare the number of occurrences of the second largest value element, and so on until an S-box with fewer occurrences of the same element value in the differential distribution table of the S-box before and after the mutation is found, and replace the original S-box with it.

[0073] In the 8-bit S-box construction method based on the improved genetic algorithm of the present invention, step (5) is to construct the 8-bit S-box based on the improved genetic algorithm, and the specific steps are as follows:

[0074] (5.1) Generate the initial population through the composite chaotic system composed of Logistic mapping and Tent mapping;

[0075] (5.2) Calculate the fitness function of each population;

[0076] (5.3) Perform a crossover operation on each population and ensure the bijectivity of the S-box;

[0077] (5.4) Perform 2N rounds of search mutation operations on each population to optimize the nonlinearity and differential uniformity of the S-box;

[0078] (5.5) Through iteration of the population, the optimal S-box is output.

[0079] The beneficial effects of the present invention are:

[0080] (1) The method of the present invention improves the fitness function, crossover operation and mutation operation of the genetic algorithm, and constructs an 8-bit S-box using the improved genetic algorithm to improve the cryptographic properties of the generated S-box;

[0081] (2) In the improvement of the genetic algorithm, the method of the present invention designs a multi-objective weighted fitness function, combines the strict avalanche criterion on the basis of considering the differential uniformity and nonlinearity, and evaluates the S-box from multiple cryptographic indicators; in the crossover operation, by ensuring the bijectivity of the S-box, the properties of the S-box after the crossover operation are improved;

[0082] (3) In the improvement of the genetic algorithm, the method of the present invention designs a reverse search method to search for mutation points, and designs a 2N-round search method based on hill climbing search, random search, 2-point mutation point search and 3-point mutation point search of the reverse search method. In the first N rounds, the 2-point mutation point search of the three methods is respectively used, and in the next N rounds, the 3-point mutation point search of the three methods is respectively used. A table lookup statistical method is designed to evaluate and optimize the mutated S-box, thereby effectively improving the cryptographic properties of the generated S-box. BRIEF DESCRIPTION OF THE DRAWINGS

[0083] Figure 1 It is a flow chart of the 8-bit S-box construction method based on the improved genetic algorithm of the present invention. DETAILED DESCRIPTION

[0084] The present invention is further described below with reference to the embodiments and drawings, but is not intended to limit the present invention.

[0085] Example

[0086] Reference Figure 1 , a method for constructing an 8-bit S-box based on an improved genetic algorithm, comprising the following steps:

[0087] (1) Initialize the population based on the composite chaotic system;

[0088] (2) Design a fitness function that combines multiple properties;

[0089] (3) Design a crossover operation that ensures the bijectivity of the S-box;

[0090] (4) Design a mutation operation based on 2N rounds of search;

[0091] (5) Construct an 8-bit S-box based on an improved genetic algorithm.

[0092] The specific steps of initializing the population based on the composite chaotic system in step (1) are as follows:

[0093] (1.1) The mapping formula of the composite chaotic system formed by combining Tent mapping and Logistic mapping is as follows:

[0094]

[0095] Among them, x n is the input sample variable, parameter u∈(0,0.1], w∈[0,1];

[0096] (1.2) The process of generating the initial S-box using a composite chaotic system is as follows:

[0097] (1.2.1) Define an array S with a length of 256 and set the initial value of the chaotic map x0 = 0.32456;

[0098] (1.2.2) To eliminate the transient effects of the chaotic system, the idling system does not output chaotic values ​​for 50 times;

[0099] (1.2.3) The state value x of each round of the composite chaotic system n Generate an integer Z as follows:

[0100]

[0101] (1.2.4) To ensure the bijectivity of the S-box, determine whether Z has been added to the array S. If not, put Z into S; if it has been added, go to (1.2.5);

[0102] (1.2.5) If the number of elements in S is less than 256, go to (1.2.3) to regenerate Z, otherwise go to (1.2.6);

[0103] (1.2.6) Output array S and generate the initial S-box sample population.

[0104] The step (2) of designing a fitness function combining multiple properties comprises the following specific steps:

[0105] (2.1) Combining differential uniformity, nonlinearity, and strict avalanche criterion, a multi-objective weighted fitness function is designed. The formula is as follows:

[0106] G(t)=a×NL s +b×δ S +c×|SAC-0.5| (3)

[0107] Where t is a single individual S-box, NL s is the nonlinearity of the S-box t, δ S is the differential uniformity of S-box t; SAC is the strict avalanche criterion; a, b, c are the weights of S-box nonlinearity, differential uniformity and strict avalanche criterion respectively;

[0108] (2.2) According to the different cryptographic properties, the corresponding weights are set, and the above fitness function G(t) is converted into a multi-objective piecewise weighted fitness function as follows:

[0109]

[0110] (2.3) Differential uniformity of S-box δ S The calculation formula is as follows:

[0111]

[0112] Among them, α and β are the input differential and output differential of the S-box, respectively, which are called differential pairs; represents the set of n-tuple elements in the field F2, where F2 is a binary finite field containing 2 elements; DDT F (α, β) is the difference value of the difference pair (α, β), and its calculation formula is as follows:

[0113]

[0114] Where x is the input of the S-box, F(x) is the vector Boolean function representation of the S-box, that is, F(x): is the addition operation on a binary finite field, # indicates calculating the number of elements in a set that satisfy the condition;

[0115] (2.4) Nonlinearity NL of the S-box s The calculation formula is as follows:

[0116]

[0117] Where a and b are the input mask and output mask of the S-box, respectively, and are called a mask pair; n = 8, indicating an 8-bit S-box; W F (a, b) is the Walsh transform of the S-box, and its calculation formula is:

[0118]

[0119] In the formula, “·” represents the vector inner product operation over a binary finite field, such as

[0120] Step (3) is designed to ensure the crossover operation of the S-box bijectivity, and the specific steps are as follows:

[0121] (3.1) Let the S-boxes before crossing be B1, B2, and the S-boxes after crossing be C1, C2;

[0122] (3.2) Generate a random number R in the range [0,255];

[0123] (3.3) Copy the first R elements in B1 to C1;

[0124] (3.4) Traverse the elements in B2 from the beginning. If the element is not in C1 and the number of elements in C1 is less than 256, add it to C1. Otherwise, skip the element and continue traversing until C1 is full.

[0125] (3.5) Add the remaining elements in B2 to C2 in order, and then add the remaining elements in B1 to complete C2 in order to reach 256 elements;

[0126] (3.6) Output S-boxes C1, C2.

[0127] The design in step (4) is based on a mutation operation of 2N rounds of search, and the specific steps are as follows:

[0128] (4.1) In order to better optimize the nonlinearity and differential uniformity of the S-box, a reverse search method is designed to search for variation points according to the linear distribution and differential distribution of the S-box. First, the variation points are searched to optimize the nonlinearity of the S-box, and then the variation points are searched according to the differential distribution of the S-box to optimize the differential uniformity of the S-box.

[0129] (4.1.1) To improve the nonlinearity of the S-box, the linearity of the S-box needs to be reduced. Therefore, the variation point search of the reverse search method will first calculate the linearity Line of the S-box, and then traverse the input / output mask pairs of the S-box to find all the inputs x of the S-box that satisfy the following formula, where θ and ω are the input mask and output mask of the S-box respectively:

[0130]

[0131] Put x into the corresponding set, randomly select two different values ​​from the set as the element subscripts of the S-box to exchange elements, calculate the linearity of the S-box after the element exchange; and evaluate whether the linearity of the S-box after the mutation is better than the result before the mutation;

[0132] (4.1.2) To optimize the differential uniformity of the S-box, search for mutation points according to the differential distribution of the S-box. First, calculate the differential uniformity of the S-box, traverse all input / output differential pairs of the S-box, find x that satisfies formula (6) and put it into the corresponding set; randomly select two different values ​​from the set as the element subscripts of the S-box to exchange elements, and calculate the differential uniformity of the S-box after the element exchange; and evaluate whether the differential uniformity of the S-box after the mutation is better than the result before the mutation;

[0133] (4.2) In order to speed up the execution efficiency of the mutation operation and optimize the properties of the S-box, a 2N-round search method is designed based on hill climbing search, random search, 2-point mutation point search and 3-point mutation point search using the reverse search method. In the first N rounds, the 2-point mutation point search using the three methods is used, and in the next N rounds, the 3-point mutation point search using the three methods is used.

[0134] (4.3) The specific steps of the 2-point mutation search method in the first N rounds are as follows:

[0135] (4.3.1) In the first N rounds of 2-point mutation point search, nonlinear optimization mutation point search is first performed, and the ratios of the search rounds of 2-point hill climbing search, random search, and reverse search in N rounds are set to f1, f2, and f3 respectively, and f1+f2+f3=1. Among them, the 2-point random search is to generate two different numbers in the interval [0,255] as the element subscripts of the S-box to exchange two elements through a random function;

[0136] (4.3.2) Using hill climbing search, random search, and reverse search methods, a two-point mutation search method with two points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the nonlinearity of the S-boxes before and after the mutation in each round is evaluated, and the S-box with better nonlinearity is retained, and finally N results are obtained;

[0137] (4.3.3) Secondly, the variation point search of differential uniformity optimization is performed. Since the computational overhead of hill climbing search is too large, only random search and reverse search are used here, and the ratio of the number of rounds of the two in N rounds is set to c1 and c2, and c1+c2=1;

[0138] (4.3.4) Using random search and reverse search methods, a two-point mutation search method with two points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the S-boxes before and after the mutation in each round are evaluated for differential uniformity, and the S-boxes with better differential uniformity are retained, and finally N results are obtained;

[0139] (4.4) In the next N rounds of 3-point mutation search, the 3-point hill climbing algorithm is used to replace the 2-point hill climbing algorithm. The random search uses a random function to generate 3 different numbers in the interval [0, 255] as the element subscripts of the S-box and then swap the 3 elements in pairs. The reverse search rule is to randomly select 3 different numbers from the set that meets the conditions as the element subscripts of the S-box and then swap the elements in pairs. The specific method is as follows;

[0140] (4.4.1) First, perform a three-point mutation point search for nonlinear optimization, and set the ratio of the number of rounds of hill climbing search, random search, and reverse search in N rounds to ff1, ff2, and ff3 respectively, and ff1+ff2+ff3=1;

[0141] (4.4.2) Using hill climbing search, random search, and reverse search methods, a three-point mutation search method with three points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the nonlinearity of the S-boxes before and after the mutation in each round is evaluated, and the S-box with better nonlinearity is retained, and finally N results are obtained;

[0142] (4.4.3) Secondly, perform a three-point mutation point search for differential uniformity optimization. Similarly, only set the ratio of the number of rounds of random search and reverse search in N rounds to cc1 and cc2 respectively, and cc1+cc2=1. Here, the ratio of the number of rounds of random search can be increased to facilitate searching for effective mutation points in a larger solution space.

[0143] (4.4.4) Using random search and reverse search methods, a three-point mutation search method with three points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the S-boxes before and after the mutation in each round are evaluated for differential uniformity, and the S-boxes with better differential uniformity are retained, and finally N results are obtained;

[0144] (4.5) In view of the fact that the nonlinearity and differential uniformity of the S-box remain unchanged before and after mutation, a table lookup statistical method is designed to count and evaluate the changes in the number of occurrences of elements in the linear distribution table and the differential distribution table of the S-box. If the frequency of occurrence of the same element in the linear distribution table and the differential distribution table is smaller, the maximum linear path or the maximum differential path will be less, and the property will be better. The specific method is as follows:

[0145] (4.5.1) If the nonlinearity of the S-box remains unchanged before and after the mutation, calculate the linear distribution tables of the two S-boxes, take the absolute value of each element in the linear distribution table and count its occurrence times; compare the number of times the maximum value element appears in the linear distribution tables of the two S-boxes. The S-box with a smaller number of occurrences has fewer maximum linear paths and better linear properties; if the number of times the maximum value element appears is the same, compare the number of times the second largest value element appears, and so on until an S-box with a smaller number of occurrences of the same element value in the linear distribution tables of the S-boxes before and after the mutation is found, and replace the original S-box with it;

[0146] (4.5.2) If the differential uniformity of the S-box before and after the mutation remains unchanged, then calculate the differential distribution table of the two S-boxes, take the absolute value of each element in the differential distribution table and count its number of occurrences; the S-box with a smaller number of occurrences has fewer maximum differential paths and better differential properties; if the number of occurrences of the maximum value element is the same, then compare the number of occurrences of the second largest value element, and so on until an S-box with fewer occurrences of the same element value in the differential distribution table of the S-box before and after the mutation is found, and replace the original S-box with it.

[0147] Step (5) The design is based on an improved genetic algorithm to construct an 8-bit S-box, and the specific steps are as follows:

[0148] (5.1) Generate the initial population through the composite chaotic system composed of Logistic mapping and Tent mapping;

[0149] (5.2) Calculate the fitness function of each population;

[0150] (5.3) Perform a crossover operation on each population and ensure the bijectivity of the S-box;

[0151] (5.4) Perform 2N rounds of search mutation operations on each population to optimize the nonlinearity and differential uniformity of the S-box;

[0152] (5.5) Through iteration of the population, the optimal S-box is output.

Claims

1. A method for constructing an 8-bit S-box based on an improved genetic algorithm, comprising the following steps: (1) Initialize the population based on the composite chaotic system; The Logistic map and the Tent map are compounded by exponential multiplication to establish a composite chaotic system to initialize the S-box population. (2) Design a fitness function that combines multiple properties; Based on nonlinearity, differential uniformity and strict avalanche criterion, a multi-objective piecewise weighted function is designed to comprehensively evaluate the properties of the S-box. The smaller the fitness function value of the S-box, the better its cryptographic properties. (3) Design a crossover operation that ensures the bijectivity of the S-box; Design a crossover operation that maintains the bijectivity of the S-box, retain the excellent properties of the parent S-box as much as possible, and increase the diversity of the offspring population; (4) Design a mutation operation based on 2N rounds of search; First, a reverse search method is designed to search for mutation points. Then, a mutation operation based on 2N rounds of search is designed by combining 2-point mutation point search and 3-point mutation point search. In the first N rounds, 2-point mutation point search is performed, and in the last N rounds, 3-point mutation point search is performed to speed up the execution efficiency of mutation operation. A table lookup statistical method is designed to further evaluate the properties of the optimized S-box. (5) Constructing 8-bit S-box based on improved genetic algorithm; Based on the improved genetic algorithm, an 8-bit S-box with excellent cryptographic properties is constructed through iteration.

2. The 8-bit S-box construction method based on improved genetic algorithm according to claim 1, characterized in that: The specific steps of initializing the population based on the composite chaotic system in step (1) are as follows: (1.1) In order to increase the chance of searching for the global optimal solution and cover a larger search space, a chaotic system is used to generate the initial population. Since both Tent mapping and Logistic mapping have problems such as small chaotic range, uneven sequence distribution, and easy periodicity in the iterative process, the Tent mapping and Logistic mapping are combined to form a composite chaotic system mapping formula as shown below: Among them, x n is the input sample state variable, parameters u∈(0,0.1], w∈[0,1]; (1.2) Initialize the S-box population through the composite chaotic system to generate the initial S-box with good cryptographic properties as much as possible, enrich the diversity of the genetic algorithm population, and increase the possibility of searching for the optimal solution. The process of generating the initial S-box using the composite chaotic system is as follows: (1.2.1) Define an array S with a length of 256 and set the initial value of the chaotic map x0 = 0.32456; (1.2.2) To eliminate the transient effects of the chaotic system, the idling system does not output chaotic values ​​for 50 times; (1.2.3) The state value x of each round of the composite chaotic system n Generate an integer Z as follows: (1.2.4) To ensure the bijectivity of the S-box, determine whether Z has been added to the array S. If not, put Z into S; if it has been added, go to (1.2.5); (1.2.5) If the number of elements in S is less than 256, go to (1.2.3) to regenerate Z, otherwise go to (1.2.6); (1.2.6) Output array S to generate the initial S-box sample population.

3. The 8-bit S-box construction method based on improved genetic algorithm according to claim 2, characterized in that: The specific method of designing the fitness function combining multiple properties in step (2) is as follows: (2.1) Combining differential uniformity, nonlinearity, and strict avalanche criterion, a multi-objective weighted fitness function is designed. The formula is as follows: G(t)=a×NL s +b×δ S +c×|SAC-0.5| (3) Among them, t is a single individual S box, Nl s is the nonlinearity of the S-box t, δ S is the differential uniformity of S-box t; SAC is the strict avalanche criterion; a, b, c are the weights of S-box nonlinearity, differential uniformity and strict avalanche criterion respectively; (2.2) Since the fitness function must satisfy the characteristics of single value and continuity, and based on the optimization test of the cryptographic properties of the S-box, the corresponding weights are set according to the different cryptographic properties, and the above fitness function G(t) is converted into a multi-objective piecewise weighted fitness function as follows: (2.3) Differential uniformity of S-box δ S The calculation formula is as follows: Among them, α and β are the input differential and output differential of the S-box, respectively, which are called differential pairs; represents the set of n-tuple elements in the field F2, where F2 is a binary finite field containing 2 elements; DDT F (α, β) is the difference value of the difference pair (α, β), and its calculation formula is as follows: Where x is the input of the S-box, F(x) is the vector Boolean function representation of the S-box, that is is the addition operation on a binary finite field, # indicates calculating the number of elements in a set that satisfy the condition; (2.4) Nonlinearity NL of the S-box s The calculation formula is as follows: Where a and b are the input mask and output mask of the S-box, respectively, and are called a mask pair; n = 8, indicating an 8-bit S-box; W F (a, b) is the Walsh transform of the S-box, and its calculation formula is: Where "·" represents the vector inner product operation on a binary finite field, such as 4. The 8-bit S-box construction method based on improved genetic algorithm according to claim 3, characterized in that: The design described in step (3) ensures the crossover operation of the S-box bijectivity. The specific steps are as follows: (3.1) Let the S-boxes before crossing be B1, B2, and the S-boxes after crossing be C1, C2; (3.2) Generate a random number R in the range [0,255]; (3.3) Copy the first R elements in B1 to C1; (3.4) Traverse the elements in B2 from the beginning. If the element is not in C1 and the number of elements in C1 is less than 256, add it to C1. Otherwise, skip the element and continue traversing until C1 is full. (3.5) Add the remaining elements in B2 to C2 in order, and then add the remaining elements in B1 to complete C2 in order to reach 256 elements; (3.6) Output S-boxes C1, C2.

5. The 8-bit S-box construction method based on improved genetic algorithm according to claim 4, characterized in that: The design described in step (4) is based on a mutation operation of 2N rounds of search, and the specific steps are as follows: (4.1) Design a reverse search method to search for variation points. First, search for variation points to optimize the nonlinearity of the S-box. Then, search for variation points to optimize the differential uniformity of the S-box according to the differential distribution of the S-box. (4.1.1) To improve the nonlinearity of the S-box, the linearity of the S-box needs to be reduced. Therefore, the search for the variation point in the reverse search method will first calculate the linearity Line of the S-box, and then traverse the input / output mask pairs of the S-box to find all the inputs x of the S-box that satisfy equation (9), where θ and ω are the input mask and output mask of the S-box respectively: Put x into the corresponding set, randomly select two different values ​​from the set as the element subscripts of the S-box to exchange elements, calculate the linearity of the S-box after the element exchange; and evaluate whether the linearity of the S-box after the mutation is better than the result before the mutation; (4.1.2) To optimize the differential uniformity of the S-box, search for mutation points according to the differential distribution of the S-box. First, calculate the differential uniformity of the S-box, traverse all input / output differential pairs of the S-box, find x that satisfies formula (6) and put it into the corresponding set; randomly select two different values ​​from the set as the element subscripts of the S-box to exchange elements, and calculate the differential uniformity of the S-box after the element exchange; and evaluate whether the differential uniformity of the S-box after the mutation is better than the result before the mutation; (4.2) In order to speed up the execution efficiency of the mutation operation and optimize the properties of the S-box, a 2N-round search method is designed based on hill climbing search, random search, 2-point mutation point search and 3-point mutation point search using the reverse search method. In the first N rounds, the 2-point mutation point search using the three methods is used, and in the next N rounds, the 3-point mutation point search using the three methods is used. (4.3) The specific steps of the 2-point mutation search method in the first N rounds are as follows: (4.3.1) In the first N rounds of 2-point mutation point search, nonlinear optimization mutation point search is first performed, and the ratios of the search rounds of 2-point hill climbing search, random search, and reverse search in N rounds are set to f1, f2, and f3 respectively, and f1+f2+f3=1. Among them, the 2-point random search is to generate two different numbers in the interval [0,255] as the element subscripts of the S-box to exchange two elements through a random function; (4.3.2) Using hill climbing search, random search, and reverse search methods, a two-point mutation search method with two points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the nonlinearity of the S-boxes before and after the mutation in each round is evaluated, and the S-box with better nonlinearity is retained, and finally N results are obtained; (4.3.3) Secondly, the variation point search of differential uniformity optimization is performed. Since the computational overhead of hill climbing search is too large, only random search and reverse search are used here, and the ratio of the number of rounds of the two in N rounds is set to c1 and c2, and c1+c2=1; (4.3.4) Using random search and reverse search methods, a two-point mutation search method with two points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the S-boxes before and after the mutation in each round are evaluated for differential uniformity, and the S-boxes with better differential uniformity are retained, and finally N results are obtained; (4.4) In the next N rounds of 3-point mutation search, the 3-point hill climbing algorithm is used to replace the 2-point hill climbing algorithm. The random search uses a random function to generate 3 different numbers in the interval [0, 255] as the element subscripts of the S-box and then swap the 3 elements in pairs. The reverse search rule is to randomly select 3 different numbers from the set that meets the conditions as the element subscripts of the S-box and then swap the elements in pairs. The specific method is as follows; (4.4.1) First, perform a three-point mutation point search for nonlinear optimization, and set the ratio of the number of rounds of hill climbing search, random search, and reverse search in N rounds to ff1, ff2, and ff3 respectively, and ff1+ff2+ff3=1; (4.4.2) Using hill climbing search, random search, and reverse search methods, a three-point mutation search method with three points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the nonlinearity of the S-boxes before and after the mutation in each round is evaluated, and the S-box with better nonlinearity is retained, and finally N results are obtained; (4.4.3) Secondly, perform a three-point mutation point search for differential uniformity optimization. Similarly, only set the ratio of the number of rounds of random search and reverse search in N rounds to cc1 and cc2 respectively, and cc1+cc2=1. Here, the ratio of the number of rounds of random search can be increased to facilitate searching for effective mutation points in a larger solution space. (4.4.4) Using random search and reverse search methods, a three-point mutation search method with three points for mutation is used to perform corresponding rounds of search. If a mutation point is found, the S-boxes before and after the mutation in each round are evaluated for differential uniformity, and the S-boxes with better differential uniformity are retained, and finally N results are obtained; (4.5) In view of the fact that the nonlinearity and differential uniformity of the S-box remain unchanged before and after mutation, a table lookup statistical method is designed to count and evaluate the changes in the number of occurrences of elements in the linear distribution table and the differential distribution table of the S-box. If the frequency of occurrence of the same element in the linear distribution table and the differential distribution table is smaller, the maximum linear path or the maximum differential path will be less, and the property will be better. The specific method is as follows: (4.5.1) If the nonlinearity of the S-box remains unchanged before and after the mutation, calculate the linear distribution tables of the two S-boxes, take the absolute value of each element in the linear distribution table and count its occurrence times; compare the number of times the maximum value element appears in the linear distribution tables of the two S-boxes. The S-box with a smaller number of occurrences has fewer maximum linear paths and better linear properties; if the number of times the maximum value element appears is the same, compare the number of times the second largest value element appears, and so on until an S-box with a smaller number of occurrences of the same element value in the linear distribution tables of the S-boxes before and after the mutation is found, and replace the original S-box with it; (4.5.2) If the differential uniformity of the S-box before and after the mutation remains unchanged, then calculate the differential distribution table of the two S-boxes, take the absolute value of each element in the differential distribution table and count its number of occurrences; the S-box with a smaller number of occurrences has fewer maximum differential paths and better differential properties; if the number of occurrences of the maximum value element is the same, then compare the number of occurrences of the second largest value element, and so on until an S-box with fewer occurrences of the same element value in the differential distribution table of the S-box before and after the mutation is found, and replace the original S-box with it.

6. The 8-bit S-box construction method based on improved genetic algorithm according to claim 5, characterized in that: The specific steps of constructing an 8-bit S-box based on an improved genetic algorithm in step (5) are as follows: (5.1) Generate the initial population through the composite chaotic system composed of Logistic mapping and Tent mapping; (5.2) Calculate the fitness function of each population; (5.3) Perform a crossover operation on each population and ensure the bijectivity of the S-box; (5.4) Perform 2N rounds of search mutation operations on each population to optimize the nonlinearity and differential uniformity of the S-box; (5.5) Through iteration of the population, the optimal S-box is output.

Citation Information

Patent Citations

  • Asymmetric negative correlation search method

    CN110263906A

  • S-box optimization method based on improved genetic algorithm

    CN111783989A

  • S-box optimization method based on immune genetic algorithm

    CN111786770A

  • S box design method based on hyper-chaotic system and genetic particle swarm optimization

    CN114912614A

  • 8-bit S box construction and optimization method based on composite chaotic mapping

    CN117938357A

Cited By

  • Discrete space global optimization method based on neighborhood mapping and multi-path parallel search

    CN121940123A

  • Discrete space global optimization method based on neighborhood mapping and multi-path parallel search

    CN121940123B