S-box optimization method and device based on moss growth optimization algorithm
By optimizing the pseudo-random number generation and differential uniformity of the S-box based on a two-dimensional hyperchaotic system and a moss growth optimization algorithm, the problem of poor performance of the S-box in the prior art is solved, and an S-box with higher security and efficiency is generated.
Patent Information
- Application Number
- CN202411675434.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-28
AI Technical Summary
Existing S-box generation methods suffer from poor performance in pseudo-random number mapping and chaotic behavior, slow mapping separation speed, and poor overall performance due to optimization methods being based on a single objective.
We employ a two-dimensional hyperchaotic system to generate pseudo-random numbers, construct a Boolean function and optimize its nonlinearity, and combine it with a moss growth optimization algorithm to optimize the differential uniformity and overall performance of the S-box. A high-performance S-box is generated through a multi-objective optimization method.
The generated S-box has stronger resistance to linear and differential attacks, improving the security and computational efficiency of cryptographic algorithms.
Smart Images

Figure CN119728074A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to an S-box optimization method and device based on a moss growth optimization algorithm. Background Art
[0002] The applications of S-box mainly include the following aspects:
[0003] Cryptography application: The S-box is the only nonlinear component in many block cipher algorithms, and its cryptographic strength determines the security strength of the entire block cipher algorithm. Optimizing the performance of the S-box can improve the overall security of the cryptographic algorithm and prevent it from being cracked.
[0004] Image encryption: The optimized S-box can be applied to the image encryption algorithm. Pseudo-random numbers are generated through chaotic iteration and the sorting structure of the S-box is changed, thereby enhancing the complexity and security of image encryption.
[0005] Parallel computing: Optimizing S-boxes using parallel computing technology can improve computing efficiency. For example, using a master-slave parallel genetic algorithm framework to improve the traditional serial genetic algorithm can optimize high-order S-boxes and increase computing speed.
[0006] Distributed computing: The distributed S-box optimization algorithm based on membrane computing can handle multiple group searches, is suitable for distributed computing environments, and can effectively resist linear cryptanalysis and differential cryptanalysis.
[0007] These applications demonstrate the important role of S-box optimization in improving cryptographic security and computational efficiency.
[0008] The performance of the S-box plays a decisive role in the security strength of the cryptographic algorithm. The essence of the S-box is a substitution table composed of non-repeating numbers. The S-box with simple random order is often weak in resisting linear attacks, differential attacks, and statistical attacks, so it is necessary to design an algorithm to generate a high-performance S-box. The S-box can be generated by algebraic methods, random methods, and hybrid methods. Since the generation of S-boxes requires the pre-generation of pseudo-random numbers, the existing pseudo-random number generation methods have the disadvantages of poor chaotic performance of the mapping and slow mapping separation speed. In addition, the existing S-box optimization method is based on a single goal, which makes the overall performance of the S-box poor. Summary of the invention
[0009] In view of the problems in the prior art, the embodiments of the present invention provide an S-box optimization method and device based on a moss growth optimization algorithm, which can at least partially solve the problems in the prior art.
[0010] On the one hand, the present invention proposes an S-box optimization method based on a moss growth optimization algorithm, comprising:
[0011] Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box;
[0012] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0013] Wherein, the generating of pseudo-random numbers based on a two-dimensional hyperchaotic system comprises:
[0014] The pseudo-random number is generated according to the following formula:
[0015]
[0016] Among them, x n and n is the two-dimensional variable before iteration, and c is the control parameter.
[0017] The overall performance of the initial optimized S-box is optimized based on the moss growth optimization algorithm to obtain the final optimized S-box, including:
[0018] The initial optimized S box is taken as a moss individual, the total number of positions of the initial optimized S box is taken as the quantity dimension of the spores of the moss individual, and the value at the position of the initial optimized S box is taken as the spore;
[0019] According to the spores of the moss individuals, a target moss individual set is calculated;
[0020] Calculating the wind direction according to the optimal moss individual and each moss individual in the target moss individual set;
[0021] According to the comparison result of the first random number and the first preset constant, the preset step length parameter and the wind direction, a spore diffusion search is performed on each moss individual to obtain an updated moss individual;
[0022] Preprocessing the updated moss individuals according to a preset threshold and the updated moss individuals, and using the preprocessed updated moss individuals as the first independent variable of the S-box function;
[0023] If it is determined that a second independent variable that meets the constraint condition of the preset fitness function is found, the function values of the S-box function with the first independent variable as the independent variable and the S-box function with the second independent variable as the independent variable are exchanged to generate a new S-box;
[0024] If it is determined that the pseudo-random number used as the current iteration number is less than a preset value, double propagation search is performed on the new S-box to obtain a moss individual that has been updated again, the moss individual that has been updated again is used to generate the latest S-box, the fitness value of the latest S-box is calculated, and the S-box historical record value is updated;
[0025] If it is determined that the S-box historical record value reaches the preset maximum historical record number, the S-box with the smallest fitness function in the S-box historical record is used as the final optimized S-box.
[0026] Wherein, the S-box optimization method based on the moss growth optimization algorithm also includes:
[0027] If it is determined that the second independent variable that meets the constraint condition of the preset fitness function is not found, a new S-box is generated according to the S-box function with the first independent variable as the independent variable.
[0028] Wherein, the S-box optimization method based on the moss growth optimization algorithm also includes:
[0029] If it is determined that the pseudo-random number serving as the current iteration number is greater than or equal to the preset value, the new S-box is used as the latest S-box, the fitness value of the latest S-box is calculated, and the S-box history record value is updated.
[0030] Wherein, the S-box optimization method based on the moss growth optimization algorithm also includes:
[0031] If it is determined that the S-box historical record value has not reached the preset maximum historical record number, continue to execute the calculation of the wind direction and subsequent steps based on the optimal moss individual and each moss individual in the target moss individual set until the S-box historical record value reaches the preset maximum historical record number.
[0032] Among them, the preset fitness function is constructed according to the inter-bit nonlinearity of the S-box, the linear approximation probability, the strict avalanche offset value and the inter-bit strict avalanche offset value; accordingly, the constraint conditions include a first constraint condition corresponding to the nonlinearity of the Boolean function, and a second constraint condition corresponding to the maximum differential uniformity of the S-box.
[0033] On the one hand, the present invention proposes an S-box optimization device based on a moss growth optimization algorithm, comprising:
[0034] A generating unit, used for generating pseudo-random numbers based on a two-dimensional hyperchaotic system, constructing a Boolean function according to the pseudo-random numbers, optimizing the nonlinearity of the Boolean function, and generating an S-box;
[0035] The optimization unit is used to optimize the differential uniformity of the S box to obtain an initial optimized S box, and optimize the overall performance of the initial optimized S box based on a moss growth optimization algorithm to obtain a final optimized S box.
[0036] In another aspect, an embodiment of the present invention provides an electronic device, including: a processor, a memory, and a bus, wherein:
[0037] The processor and the memory communicate with each other via the bus;
[0038] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:
[0039] Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box;
[0040] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0041] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:
[0042] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:
[0043] Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box;
[0044] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0045] The S-box optimization method and device based on the moss growth optimization algorithm provided by the embodiment of the present invention generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box; optimize the differential uniformity of the S-box to obtain an initial optimized S-box, optimize the overall performance of the initial optimized S-box based on the moss growth optimization algorithm to obtain a final optimized S-box, which can reasonably and efficiently generate pseudo-random numbers and improve the overall performance of the S-box through a multi-objective optimization method. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0047] Figure 1 It is a flow chart of an S-box optimization method based on a moss growth optimization algorithm provided by an embodiment of the present invention.
[0048] FIG. 2( a ) is a logistic mapping bifurcation diagram provided by an embodiment of the present invention.
[0049] FIG. 2( b ) is a Gompertz mapping bifurcation diagram provided by an embodiment of the present invention.
[0050] FIG. 2( c ) is an x-variable bifurcation diagram of the LCGTDCS provided in an embodiment of the present invention.
[0051] FIG2( d ) is a y-variable bifurcation diagram of the LCGTDCS provided in an embodiment of the present invention.
[0052] FIG3( a ) is a logistic mapping LE diagram provided by an embodiment of the present invention.
[0053] FIG3( b ) is a Gompertz mapping LE graph provided by an embodiment of the present invention.
[0054] FIG3( c ) is a mapping LE diagram of LCGTDCS provided in an embodiment of the present invention.
[0055] FIG. 4( a ) is a graph showing the variables x and x+10 provided in an embodiment of the present invention. -14 Comparison of trajectory changes over time.
[0056] FIG. 4( b ) is a graph showing the variables y and y+10 provided in an embodiment of the present invention. -14 Comparison of trajectory changes over time.
[0057] Figure 5 It is a flow chart of an S-box optimization method based on a moss growth optimization algorithm provided by another embodiment of the present invention.
[0058] Figure 6 It is a structural schematic diagram of an S-box optimization device based on a moss growth optimization algorithm provided by an embodiment of the present invention.
[0059] Figure 7 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily.
[0061] Figure 1 is a flow chart of an S-box optimization method based on a moss growth optimization algorithm provided by an embodiment of the present invention, such as Figure 1 As shown, the S-box optimization method based on the moss growth optimization algorithm provided by the embodiment of the present invention includes:
[0062] Step S1: Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box.
[0063] Step S2: Optimizing the differential uniformity of the S-box to obtain an initial optimized S-box, optimizing the overall performance of the initial optimized S-box based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0064] In the above step S1, the device generates pseudo-random numbers based on a two-dimensional hyperchaotic system, constructs a Boolean function based on the pseudo-random numbers, and optimizes the nonlinearity of the Boolean function to generate an S-box. The device may be a computer device that executes the method. It should be noted that the acquisition and analysis of data involved in the embodiment of the present invention is authorized by the user. The generation of pseudo-random numbers based on a two-dimensional hyperchaotic system includes:
[0065] The pseudo-random number is generated according to the following formula:
[0066]
[0067] Among them, x n and n is the two-dimensional variable before iteration, and c is the control parameter.
[0068] The two-dimensional hyperchaotic system of the present invention is recorded as (Logistic Combined Gompertz Two-Dimensional Chaotic System, LCGTDCS), based on the Logistic map and the Gompertz map, and the Logistic map is described as follows:
[0069] The Logistic mapping is a quadratic function that exhibits chaotic characteristics and is one of the most typical chaotic structures. Its mathematical expression is shown in formula (1). The value range of the variable x is (0,1), and the value range of the control parameter a is [0,4]. However, the chaotic performance of this mapping is not good enough.
[0070] x n+1 =ax n (1-x n )(1)
[0071] The Gompertz mapping is described as follows:
[0072] The Gompertz map is a logarithmic function with base e. Its mathematical expression is shown in formula (2). The variable
[0073] The value range of x is (0,1), and the value range of the control parameter b is [0,e], but this mapping has disadvantages such as slow separation speed.
[0074] x n+1 =-bx n log e x n (2)
[0075] The two-dimensional hyperchaotic system of the method of the present invention is based on the Logistic map and the Gompertz map, and a new two-dimensional chaotic map LCGTDCS is designed. Its mathematical expression is shown in formula (3). The value range of variables x and y is [-1,1], and x and y are not 0 at the same time. The value range of the control parameter c is (-∞,-1]∪[1,+∞).
[0076] Right now
[0077] The bifurcation diagram is a two-dimensional image of the variables changing with the parameters, showing the distribution, upper and lower bounds, and separation of the system variables. Figure 2(a) is the logistic mapping bifurcation diagram, Figure 2(b) is the Gompertz mapping bifurcation diagram, Figure 2(c) is the x variable bifurcation diagram of LCGTDCS, and Figure 2(d) is the y variable bifurcation diagram of LCGTDCS. It can be seen that the points of LCGTDCS are uniformly distributed and show a chaotic state when c∈(0,256].
[0078] Lyapunov index, LE, is a parameter used to determine whether a system is a chaotic system. The larger its value, the more complex the chaotic behavior of the system. Figure 3 (a) is the LE diagram of logistic mapping, Figure 3 (b) is the LE diagram of Gompertz mapping, and Figure 3 (c) is the mapping LE diagram of LCGTDCS. LCGTDCS has two LE values greater than 0, which has hyperchaotic characteristics. When the control parameter c = 256, the two LE values reach 8.2448 and 4.0035, that is, LCGTDCS has more complex chaotic behavior than Logistic mapping and Gompertz mapping.
[0079] Initial value sensitivity is one of the main characteristics of chaotic systems. Figure 4(a) shows the initial value sensitivity of variables x and x+10. -14 The comparison of trajectory changes over time. Figure 4(b) shows the variables y and y+10. -14 The comparison of the trajectory changes over time shows that the variables x and y of the two-dimensional hyperchaotic system change after five iterations, that is, the variables have good initial value sensitivity.
[0080] In summary, LCGTDCS has the characteristics of quasi-randomness and initial value sensitivity, which are suitable for constructing high-performance S-boxes. It also has a large control parameter range and a high Lyapunov exponent.
[0081] like Figure 5 As shown, the above content corresponds to “initialization of two-dimensional hyperchaotic system”.
[0082] A Boolean function is constructed according to the pseudo-random number, and the nonlinearity of the Boolean function is optimized to generate an S-box, as described below:
[0083] Reference Figure 5 In the “Generate and optimize the nonlinearity of the S-box”, since the S-box plays a decisive role in whether many cryptographic algorithms can resist linear attacks, and the nonlinearity of the S-box is mutually balanced with the balance and bijectivity of the S-box, the nonlinearity of the S-box is optimized using Theorems 1 and Theorem 2 of the prior art in the process of generating the eight Boolean functions that constitute the S-box.
[0084] First, input the initial values x0, y0 and control parameter c of LCGTDCS, and then generate a pseudo-random number x according to formula (3): n ,y n , n = 1024. According to formula (4), the pseudo-random number x n ,y n Integerization, generating zx n ,zy n , zx n ,zy n Arrange in order u, where u = 2048. Then, eight Boolean functions are constructed one by one using the 2048 numbers generated by LCGTDCS.
[0085]
[0086] First, determine whether the number of 0s or 1s in the Boolean function fi(x) reaches the maximum. If not, determine r u Is it greater than or equal to 128? If so, assign 0 to the corresponding position of fi(x), otherwise assign 1. Repeat this process to construct a fi(x), i∈Z8. Then, under the premise of ensuring the balance and bijectivity of the S-box, optimize the nonlinearity of the Boolean function according to Theorem 1 and Theorem 2. Continue to construct the remaining Boolean functions according to the above steps until the S-box is generated.
[0087] In the above step S2, the device optimizes the differential uniformity of the S-box to obtain an initial optimized S-box, and optimizes the overall performance of the initial optimized S-box based on the moss growth optimization algorithm to obtain a final optimized S-box.
[0088] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, as described below:
[0089] Reference Figure 5 In "Optimizing the differential uniformity of the S-box", 255 differential values are calculated for the entire S-box, and the maximum differential value is taken as the differential uniformity of the S-box. Differential uniformity is not a property of Boolean functions, so the entire S-box is optimized at this stage.
[0090] Based on Theorem 2, ensure that the nonlinearity of each Boolean function of the S-box does not decrease. Then, according to Theorem 3 of the prior art, select an x1 that satisfies the conditions of Theorem 3 from the x that constitutes the maximum differential value of the S-box S, and find x2 that satisfies the corresponding conditions, update S(x1) and S(x2), until all the maximum differential values of S are traversed, and then determine whether the differential uniformity of S is reduced. If it is reduced, it proves that the differential uniformity of the S-box is optimized and repeat the above steps. Otherwise, end the differential uniformity optimization process to obtain the initial optimized S-box.
[0091] The overall performance of the initial optimized S-box is optimized based on the moss growth optimization algorithm to obtain the final optimized S-box, including:
[0092] The initial optimized S box is taken as a moss individual, the total number of positions of the initial optimized S box is taken as the quantity dimension of the spores of the moss individual, and the value at the position of the initial optimized S box is taken as the spore;
[0093] According to the spores of the moss individuals, a target moss individual set is calculated;
[0094] Calculating the wind direction according to the optimal moss individual and each moss individual in the target moss individual set;
[0095] According to the comparison result of the first random number and the first preset constant, the preset step length parameter and the wind direction, a spore diffusion search is performed on each moss individual to obtain an updated moss individual;
[0096] Preprocessing the updated moss individuals according to a preset threshold and the updated moss individuals, and using the preprocessed updated moss individuals as the first independent variable of the S-box function;
[0097] If it is determined that a second independent variable that meets the constraint condition of the preset fitness function is found, the function values of the S-box function with the first independent variable as the independent variable and the S-box function with the second independent variable as the independent variable are exchanged to generate a new S-box;
[0098] If it is determined that the pseudo-random number used as the current iteration number is less than a preset value, double propagation search is performed on the new S-box to obtain a moss individual that has been updated again, the moss individual that has been updated again is used to generate the latest S-box, the fitness value of the latest S-box is calculated, and the S-box historical record value is updated;
[0099] If it is determined that the S-box historical record value reaches the preset maximum historical record number, the S-box with the smallest fitness function in the S-box historical record is used as the final optimized S-box.
[0100] The S-box optimization method based on the moss growth optimization algorithm also includes:
[0101] If it is determined that the second independent variable that meets the constraint condition of the preset fitness function is not found, a new S-box is generated according to the S-box function with the first independent variable as the independent variable.
[0102] The S-box optimization method based on the moss growth optimization algorithm also includes:
[0103] If it is determined that the pseudo-random number serving as the current iteration number is greater than or equal to the preset value, the new S-box is used as the latest S-box, the fitness value of the latest S-box is calculated, and the S-box history record value is updated.
[0104] The S-box optimization method based on the moss growth optimization algorithm also includes:
[0105] If it is determined that the S-box historical record value has not reached the preset maximum historical record number, continue to execute the calculation of the wind direction and subsequent steps based on the optimal moss individual and each moss individual in the target moss individual set until the S-box historical record value reaches the preset maximum historical record number.
[0106] The preset fitness function is constructed according to the inter-bit nonlinearity of the S-box, the linear approximation probability, the strict avalanche offset value and the inter-bit strict avalanche offset value; accordingly, the constraint conditions include a first constraint condition corresponding to the nonlinearity of the Boolean function and a second constraint condition corresponding to the maximum differential uniformity of the S-box.
[0107] Reference Figure 5 The "S-box overall performance optimization" in the paper is based on the moss growth optimization algorithm. The algorithm is based on the growth of moss and three reproduction methods. Combined with the actual optimization process, it proposes to use the initially determined wind direction as the optimization direction, and a search method based on spore diffusion and double propagation as the auxiliary. It also combines the cryptobiological mechanism to update individuals, so as to avoid falling into the local optimal solution and strive to find the global optimal solution.
[0108] According to formulas (5) and (6), the jth spore M of moss i,j and the jth spore M of the optimal moss individual best,j The size relationship between them is used as the classification standard, and then according to formula (7), the spore set divX with a large number is selected. j .
[0109] DX j1 ={M i =(M i,1 ,M i,2 ,...,M i,dim )|M i,j ≥M best,j ,M i ∈X}(5)
[0110] DX j2 ={M i =(M i,1 ,M i,2 ,...,M i,dim )|M i,j <M best,j ,M i ∈X}(6)
[0111]
[0112] According to formula (8), randomly select d n A collection of divX j , and take the intersection of these sets, select the common moss individuals to form a new set divX, where {P j}, j∈Z dn It is a set of non-repeating integers in the range [1, dim], and divX is the target moss individual set.
[0113]
[0114] According to formula (9) and formula (10), the optimal moss individual M best Subtract the average value from the moss individuals in divX to get the wind direction D_wind.
[0115]
[0116] dirX={M best -M i |M i ∈divX}(10)
[0117] The spore diffusion search method is shown in formulas (11), (12), and (13). r1, r2, and r3 are random numbers between (0, 1), and d1 is a constant of 0.2. E is the wind intensity, and w is a constant parameter with a value of 2, which decreases with the increase of the number of iterations. Its calculation method is shown in formula (14), which represents the proportion of the number of moss individuals in divX to the total number.
[0118]
[0119] step1=w·(r2-0.5)·E (12)
[0120]
[0121] Among them, r1~r5 are the first random number to the fifth random number respectively, d1 is the first preset constant, d2 is the second preset constant, the preset step parameters include the first preset step parameter step1 and the second preset step parameter step2, FEs is the current number of iterations, and MaxFEs is the maximum number of iterations.
[0122] The double propagation search is shown in formulas (16), (17) and (18), where r4 and r5 are random numbers between (0,1) and d2 is a constant 0.5.
[0123]
[0124] step3=0.1·(r6-0.5)·E (18)
[0125] step3 is the third preset step parameter, and r6 is the sixth random number.
[0126] The cryptobiotic mechanism means that each moss has a certain number of historical records. If the maximum number of records, rec_num, is reached, the current moss individual is replaced by the optimal individual in history, which helps to avoid falling into a local optimal solution.
[0127] The goal of this round of optimization is to optimize the performance of the S-box based on Theorem 2 and Theorem 4 of the prior art while ensuring that the nonlinearity of the S-box does not decrease and the differential uniformity does not increase. Therefore, the fitness function Fitness(S) is composed of the inter-bit nonlinearity BIC-NL of the S-box, the linear approximation probability LAP, the strict avalanche offset value SAC-offset and the inter-bit strict avalanche offset value BIC-SAC-offset, as shown in formula (19).
[0128] Fitness(S)=-BIC-NL+30×LAP+60×[SAC-offset+BIC-SAC-offset] (19)
[0129] The constraints are expressed as follows:
[0130]
[0131] is the nonlinearity of the Boolean function after iteration, is the nonlinearity of the Boolean function before iteration, DU' max is the maximum differential uniformity of the iterated S-box, DU max is the maximum differential uniformity of the S-box before iteration.
[0132] The initial optimized S-box is regarded as a moss individual, and the 256 positions of the initial optimized S-box are regarded as the dimension dim, that is, dim = 256, and the value at the corresponding position is the spore M i,dim According to Theorem 2 and Theorem 4, the constraints are executed and popsize S boxes {S popsize}, where popsize≤30, and the fitness of each S-box is calculated according to formula (19) id ), and select the final optimized S box S best .
[0133] Let the maximum number of iterations MaxFEs be 10, the historical record data rec_num be 5, FEs be the current number of iterations, and each S-box Si be compared with the optimal S-box S best The average value of different locations is taken as M i The value of dr is generated according to the two-dimensional chaotic system LCGTDCS in each iteration. FES .
[0134] First, the set divX is calculated based on the value in the S-box, and then the wind direction D_wind is calculated according to formula (9). Spore diffusion search is performed according to formula (11) to obtain the updated (Updated moss individual).
[0135] Will The result of preprocessing according to formula (20) is regarded as x1 (the first independent variable), and x2 (the second independent variable) that meets the condition is found according to the constraint condition, and S(x1) and S(x2) are exchanged to generate a new S-box. If x2 does not exist, the new S-box is obtained without exchanging the value. If dr FES <0.8 (preset value), then double propagation search is performed on the new S-box according to formula (16) to obtain M i new , and also generate a newest S-box. Update the history record of S-box Si with the newest S-box.
[0136]
[0137] Update the latest S-box and calculate the fitness value of each latest S-box. Determine whether the maximum number of historical records rec_num has been reached. If reached, trigger the hidden generation mechanism and update Si with the S-box with the smallest fitness function in the S-box historical records to obtain the final optimized S-box.
[0138] The numerical value of the final optimized S-box S1 is illustrated as shown in Table 1:
[0139] Table 1
[0140]
[0141]
[0142] Analysis and comparison of box performance:
[0143] 1) Bijectivity:
[0144] From the generation process of the S-box to the three-step optimization process of the S-box, the S-box is always guaranteed to be bijective, and the eight Boolean functions that constitute the S-box remain balanced.
[0145] (2) Analysis of anti-linear attack:
[0146] The present invention uses the nonlinearity and linear approximation probability of the S-box to digitally evaluate the ability of the S-box to resist linear attacks. The nonlinearities of the eight Boolean functions of are 114, 114, 112, 114, 112, 114, 112, 112, respectively, the average nonlinearity is 113, and the linear approximation probability is 0.1328, that is, the ability of resisting linear attacks is strong.
[0147] (3) Analysis of anti-differential attack:
[0148] The maximum value among 255 differential values is used to digitally evaluate the ability of the S-box to resist differential attacks. As shown in Table 2, the differential uniformity is 8, which can resist differential attacks.
[0149] The differences of S1 are shown in Table 2:
[0150] Table 2
[0151]
[0152]
[0153] Rigorous avalanche analysis:
[0154] The strict avalanche criterion is used to analyze the relationship between the input variables and the output variables of the S-box. The SAC correlation matrix of S1 is calculated as shown in Table 3. As shown in Table 3, after the eight input bits are reversed, the probability of whether the eight output bits are transformed is around 0.5, and after calculation, the absolute value of the difference between the 64 values in Table 3 and 0.5 is 0.0256, which is very close to 0, that is, S1 has good strict avalanche properties.
[0155] Table 3
[0156]
[0157] Analysis of bit independence:
[0158] The independence between bits is evaluated by the nonlinearity and strict avalanche property of different Boolean functions after XOR in the S-box. As shown in Table 4, the nonlinearity of 56 Boolean functions is calculated, and the average nonlinearity is 103.86.
[0159] Table 4
[0160]
[0161]
[0162] As shown in Table 5, the probability values of the 56 Boolean function output variables being reversed when the input variables are reversed, and the average offset value is calculated to be 0.0112. Therefore, the bit independence of S1 is better.
[0163] Table 5
[0164]
[0165] Periodic analysis:
[0166] As shown in Table 6, there are four values of 5, 16, 85 and 160 for the iteration period of S1, that is, the values in the S-box need to go through a certain number of iterations to return to the original value, that is, the iteration period of the S-box is better.
[0167] Table 6
[0168]
[0169] S box performance comparison:
[0170] As shown in Table 7, the nonlinearity, differential uniformity, strict avalanche and bit independence of S1 are all excellent, that is, the S-box generated by the method of the present invention has better performance.
[0171] Table 7
[0172]
[0173] The steps of executing the method of the present invention are further described as follows:
[0174] The first step is to initialize the two-dimensional chaotic system. According to formula (3), the two initial values x0, y0 and the control parameter c of the two-dimensional hyperchaotic system are input.
[0175] The second step is the generation of S-box and optimization of nonlinearity. According to formula (4), the 2048 numbers generated by discretizing LCGTDCS are used to construct eight Boolean functions one by one, and the nonlinearity of the Boolean functions is optimized according to Theorem 1 and Theorem 2 during the generation process, and finally the S-box S is obtained.
[0176] The third step is to optimize the differential uniformity of the S-box. According to Theorem 2 and Theorem 3, appropriate x1 and x2 are selected, and the values of S(x1) and S(x2) are exchanged to optimize the differential uniformity of the S-box, and finally the S-box S is obtained.
[0177] The fourth step is to initialize the S-box population. According to Theorem 2 and Theorem 4, the constraints are iterated to generate popsize S-boxes {S popsize}, where popsize≤30, and the fitness of each S-box is calculated according to formula (19) id ), and select the final optimized S box S best . According to the two-dimensional chaotic system LCGTDCS, sixty pseudo-random numbers dr are generated. FES .
[0178] Step 5: Calculation of wind direction D_wind. Calculate the wind direction determined by the population.
[0179] Step 6: Spore diffusion search. Generate x1 according to the spore diffusion search, constraints and formula (20), and select a suitable x2 to generate a new S-box.
[0180] Step 7: Double propagation search. Determine the pseudo-random number dr FES Is it less than 0.8? If so, double propagation search is performed on the S-box to obtain the updated Generate an S-box Otherwise, no double propagation search is performed.
[0181] Step 8: Update the S-box history record. To update S box S i of historical records.
[0182] Step 9: Hidden generation mechanism. Determine whether the number of historical records of each S-box reaches the maximum number of records rec_num. If so, update S with the S-box with the smallest fitness function in the S-box historical records. i .
[0183] Step 10: Determine the number of iterations. Determine whether the maximum number of iterations has been reached. If so, end the S-box overall performance optimization process. Otherwise, return to step 5.
[0184] Step 11: End the optimization and output the optimized S-box.
[0185] The S-box optimization method based on the moss growth optimization algorithm provided by the embodiment of the present invention generates pseudo-random numbers based on a two-dimensional hyperchaotic system, constructs a Boolean function according to the pseudo-random numbers, and optimizes the nonlinearity of the Boolean function to generate an S-box; the differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on the moss growth optimization algorithm to obtain a final optimized S-box. The method can reasonably and efficiently generate pseudo-random numbers, and improve the overall performance of the S-box through a multi-objective optimization method.
[0186] Furthermore, the generating of pseudo-random numbers based on the two-dimensional hyperchaotic system comprises:
[0187] The pseudo-random number is generated according to the following formula:
[0188]
[0189] Among them, x n and n is the two-dimensional variable before iteration, and c is the control parameter. The above description can be referred to, and no further details will be given.
[0190] Furthermore, the overall performance of the initial optimized S-box is optimized based on the moss growth optimization algorithm to obtain the final optimized S-box, including:
[0191] The initial optimized S box is taken as a moss individual, the total number of positions of the initial optimized S box is taken as the quantity dimension of the spores of the moss individual, and the value at the position of the initial optimized S box is taken as the spore; the description can be made with reference to the above embodiment and will not be repeated here.
[0192] According to the spores of the moss individuals, a target moss individual set is calculated; the description may refer to the above embodiment and will not be repeated here.
[0193] The wind direction is calculated according to the optimal moss individual and each moss individual in the target moss individual set; the description may refer to the above embodiment and will not be repeated here.
[0194] According to the comparison result of the first random number and the first preset constant, the preset step size parameter and the wind direction, a spore diffusion search is performed on each moss individual to obtain an updated moss individual; the description may refer to the above embodiment and will not be repeated here.
[0195] According to the preset threshold and the updated moss individual, the updated moss individual is preprocessed, and the preprocessed updated moss individual is used as the first independent variable of the S-box function; the description can be made with reference to the above embodiment, which will not be repeated here.
[0196] If it is determined that a second independent variable that meets the constraint conditions of the preset fitness function is found, the function values of the S-box function with the first independent variable as the independent variable and the S-box function with the second independent variable as the independent variable are exchanged to generate a new S-box; the above-mentioned embodiment can be referred to for description and will not be repeated here.
[0197] If it is determined that the pseudo-random number used as the current iteration number is less than a preset value, a double propagation search is performed on the new S box to obtain a moss individual that has been updated again. The latest S box is generated using the moss individual that has been updated again, the fitness value of the latest S box is calculated, and the S box history record value is updated. Please refer to the above-mentioned embodiment for description and no further details will be given.
[0198] If it is determined that the S-box historical record value reaches the preset maximum historical record number, the S-box with the smallest fitness function in the S-box historical record is used as the final optimized S-box. The above-mentioned embodiment can be referred to for explanation, which will not be repeated here.
[0199] Furthermore, the S-box optimization method based on the moss growth optimization algorithm also includes:
[0200] If it is determined that the second independent variable that meets the constraint condition of the preset fitness function is not found, a new S-box is generated according to the S-box function with the first independent variable as the independent variable. The above description can be referred to and will not be repeated.
[0201] Furthermore, the S-box optimization method based on the moss growth optimization algorithm also includes:
[0202] If it is determined that the pseudo-random number as the current iteration number is greater than or equal to the preset value, the new S-box is used as the latest S-box, the fitness value of the latest S-box is calculated and the S-box history record value is updated.
[0203] Furthermore, the S-box optimization method based on the moss growth optimization algorithm also includes:
[0204] If it is determined that the S-box historical record value does not reach the preset maximum historical record number, the step of calculating the wind direction and subsequent steps according to the optimal moss individual and each moss individual in the target moss individual set is continued until the S-box historical record value reaches the preset maximum historical record number. The above-mentioned embodiments can be referred to for explanation and will not be repeated here.
[0205] Further, the preset fitness function is constructed according to the inter-bit nonlinearity of the S-box, the linear approximation probability, the strict avalanche offset value and the inter-bit strict avalanche offset value; accordingly, the constraint condition includes a first constraint condition corresponding to the nonlinearity of the Boolean function and a second constraint condition corresponding to the maximum differential uniformity of the S-box. The above-mentioned embodiment can be referred to for explanation and will not be repeated here.
[0206] Figure 6 is a schematic diagram of the structure of an S-box optimization device based on a moss growth optimization algorithm provided by an embodiment of the present invention, such as Figure 6 As shown, the S-box optimization device based on the moss growth optimization algorithm provided by the embodiment of the present invention includes a generation unit 601 and an optimization unit 602, wherein:
[0207] The generation unit 601 is used to generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function based on the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box; the optimization unit 602 is used to optimize the differential uniformity of the S-box to obtain an initial optimized S-box, and optimize the overall performance of the initial optimized S-box based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0208] Specifically, the generation unit 601 in the device is used to generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function based on the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box; the optimization unit 602 is used to optimize the differential uniformity of the S-box to obtain an initial optimized S-box, and optimize the overall performance of the initial optimized S-box based on the moss growth optimization algorithm to obtain a final optimized S-box.
[0209] The S-box optimization device based on the moss growth optimization algorithm provided by the embodiment of the present invention generates pseudo-random numbers based on a two-dimensional hyperchaotic system, constructs a Boolean function according to the pseudo-random numbers, and optimizes the nonlinearity of the Boolean function to generate an S-box; optimizes the differential uniformity of the S-box to obtain an initial optimized S-box, optimizes the overall performance of the initial optimized S-box based on the moss growth optimization algorithm to obtain a final optimized S-box, which can reasonably and efficiently generate pseudo-random numbers and improve the overall performance of the S-box through a multi-objective optimization method.
[0210] The embodiment of the present invention provides an S-box optimization device based on the moss growth optimization algorithm, which can be specifically used to execute the processing flow of the above-mentioned method embodiments. Its functions are not repeated here, and reference can be made to the detailed description of the above-mentioned method embodiments.
[0211] Figure 7 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 7 As shown, the electronic device includes: a processor (processor) 701, a memory (memory) 702 and a bus 703;
[0212] The processor 701 and the memory 702 communicate with each other via a bus 703;
[0213] The processor 701 is used to call the program instructions in the memory 702 to execute the methods provided by the above method embodiments, for example, including:
[0214] Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box;
[0215] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0216] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided by the above method embodiments, for example, including:
[0217] Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box;
[0218] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0219] This embodiment provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program enables the computer to execute the methods provided by the above method embodiments, for example, including:
[0220] Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box;
[0221] The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
[0222] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0223] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0224] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0225] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0226] In the description of this specification, the description with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0227] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An S-box optimization method based on moss growth optimization algorithm, characterized in that: include: Generate pseudo-random numbers based on a two-dimensional hyperchaotic system, construct a Boolean function according to the pseudo-random numbers, and optimize the nonlinearity of the Boolean function to generate an S-box; The differential uniformity of the S-box is optimized to obtain an initial optimized S-box, and the overall performance of the initial optimized S-box is optimized based on a moss growth optimization algorithm to obtain a final optimized S-box.
2. The S-box optimization method based on the moss growth optimization algorithm according to claim 1, characterized in that: The method of generating pseudo-random numbers based on a two-dimensional hyperchaotic system comprises: The pseudo-random number is generated according to the following formula: Among them, x n and n is the two-dimensional variable before iteration, and c is the control parameter.
3. The S-box optimization method based on the moss growth optimization algorithm according to claim 1, characterized in that: The overall performance of the initial optimized S-box is optimized based on the moss growth optimization algorithm to obtain the final optimized S-box, including: The initial optimized S box is taken as a moss individual, the total number of positions of the initial optimized S box is taken as the quantity dimension of the spores of the moss individual, and the value at the position of the initial optimized S box is taken as the spore; According to the spores of the moss individuals, a target moss individual set is calculated; Calculating the wind direction according to the optimal moss individual and each moss individual in the target moss individual set; According to the comparison result of the first random number and the first preset constant, the preset step length parameter and the wind direction, a spore diffusion search is performed on each moss individual to obtain an updated moss individual; Preprocessing the updated moss individuals according to a preset threshold and the updated moss individuals, and using the preprocessed updated moss individuals as the first independent variable of the S-box function; If it is determined that a second independent variable that meets the constraint condition of the preset fitness function is found, the function values of the S-box function with the first independent variable as the independent variable and the S-box function with the second independent variable as the independent variable are exchanged to generate a new S-box; If it is determined that the pseudo-random number used as the current iteration number is less than a preset value, double propagation search is performed on the new S-box to obtain a moss individual that has been updated again, the moss individual that has been updated again is used to generate the latest S-box, the fitness value of the latest S-box is calculated, and the S-box historical record value is updated; If it is determined that the S-box historical record value reaches the preset maximum historical record number, the S-box with the smallest fitness function in the S-box historical record is used as the final optimized S-box.
4. The S-box optimization method based on the moss growth optimization algorithm according to claim 3, characterized in that: The S-box optimization method based on the moss growth optimization algorithm also includes: If it is determined that the second independent variable that meets the constraint condition of the preset fitness function is not found, a new S-box is generated according to the S-box function with the first independent variable as the independent variable.
5. The S-box optimization method based on the moss growth optimization algorithm according to claim 3, characterized in that: The S-box optimization method based on the moss growth optimization algorithm also includes: If it is determined that the pseudo-random number serving as the current iteration number is greater than or equal to the preset value, the new S-box is used as the latest S-box, the fitness value of the latest S-box is calculated, and the S-box history record value is updated.
6. The S-box optimization method based on the moss growth optimization algorithm according to claim 3, characterized in that: The S-box optimization method based on the moss growth optimization algorithm also includes: If it is determined that the S-box historical record value has not reached the preset maximum historical record number, continue to execute the calculation of the wind direction and subsequent steps based on the optimal moss individual and each moss individual in the target moss individual set until the S-box historical record value reaches the preset maximum historical record number.
7. The S-box optimization method based on the moss growth optimization algorithm according to claim 3, characterized in that: The preset fitness function is constructed according to the inter-bit nonlinearity of the S-box, the linear approximation probability, the strict avalanche offset value and the inter-bit strict avalanche offset value; accordingly, the constraint conditions include a first constraint condition corresponding to the nonlinearity of the Boolean function and a second constraint condition corresponding to the maximum differential uniformity of the S-box.
8. An S-box optimization device based on moss growth optimization algorithm, characterized in that: include: A generating unit, used for generating pseudo-random numbers based on a two-dimensional hyperchaotic system, constructing a Boolean function according to the pseudo-random numbers, optimizing the nonlinearity of the Boolean function, and generating an S-box; The optimization unit is used to optimize the differential uniformity of the S box to obtain an initial optimized S box, and optimize the overall performance of the initial optimized S box based on a moss growth optimization algorithm to obtain a final optimized S box.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Multi-modal fusion composite laminated structure low-speed impact positioning method
CN120277549A