An S-box design method based on hyperchaotic system and genetic particle swarm optimization algorithm

By combining Chebyshev mapping and ICMIC mapping with two-dimensional cascade modulation coupled chaotic system and genetic particle swarm optimization algorithm, the crossover rate and variance rate are adaptively adjusted, and the S-box performance is optimized, which solves the problem of insufficient nonlinearity and differential uniformity of S-box in the prior art, and improves the security of S-box.

CN114912614BActive Publication Date: 2025-08-26JIANGNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210563082.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-18
Publication Date
2025-08-26
Estimated Expiration
2042-05-18

AI Technical Summary

Technical Problem

The existing S-box construction methods are difficult to take into account both nonlinearity and differential uniformity, and the genetic algorithm and particle swarm algorithm have insufficient optimization, resulting in limited improvement in S-box performance and difficulty in setting parameters of embedded hybrid algorithms.

Method used

A two-dimensional cascaded modulation coupled chaotic system based on Chebyshev mapping and ICMIC mapping is adopted, combined with the genetic particle swarm optimization algorithm, the crossover rate and variance rate are adaptively adjusted, the S-box performance is optimized, the initial S-box is generated using the interval division method, and the particle position update is performed through the improved genetic algorithm.

Benefits of technology

A S box with higher nonlinearity, better differential uniformity, and stronger output bit independence is generated, which enhances the ability to resist linear attacks and is suitable for data and image encryption.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FDA0005377618170000011
    Figure FDA0005377618170000011
  • Figure FDA0005377618170000021
    Figure FDA0005377618170000021
  • Figure FDA0005377618170000022
    Figure FDA0005377618170000022
Patent Text Reader

Abstract

The present invention discloses an S-box design method based on a hyperchaotic system and a genetic particle swarm optimization algorithm, and belongs to the field of chaotic encryption technology. By proposing a two-dimensional cascade modulation coupled chaotic system based on Chebyshev mapping and ICMIC mapping, analysis shows that the chaotic system is hyperchaotic within the parameter range, the generated chaotic sequence has better ergodicity, and its chaotic behavior is more difficult to predict. On the basis of the modified chaotic system, the interval partitioning method and the sequence indexing method are used to generate an S-box with good performance, and finally the genetic particle swarm optimization algorithm is used to optimize the S-box to obtain an S-box with higher nonlinearity. Compared with the existing scheme, the S-box constructed in this application has good performance in terms of nonlinearity, differential uniformity, and independence between output bits, and has a stronger ability to resist linear attacks. It has broad application prospects in the field of data and image encryption.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to an S-box design method based on a hyperchaotic system and a genetic particle swarm algorithm, and belongs to the technical field of chaotic encryption. Background Art

[0002] S-box is a nonlinear component that realizes chaos and diffusion. It plays the role of obfuscation and substitution in block ciphers AES and DES, and is also widely used in the field of image encryption. Initially, the construction method of S-box was mainly algebraic method, but this method could not take into account the multiple cryptographic properties of S-box at the same time. Subsequently, with the development of chaos theory, the method of using the cryptographic properties of chaotic systems such as randomness, nonlinearity and initial value sensitivity to construct secure S-boxes has gradually gained attention. At present, many S-box construction schemes using low-dimensional chaotic systems such as Logistic mapping, Chebyshev mapping, Sine mapping, and Tent mapping have been proposed. However, since the construction of low-dimensional chaotic systems is relatively simple and the iterative sequence is easy to predict, there is a certain risk in directly applying them to the field of encryption. High-dimensional chaotic systems, especially hyperchaotic systems, have more complex chaotic behaviors. Therefore, studying the application of more complex hyperchaotic maps in S-box design has become key.

[0003] Furthermore, using only chaotic systems to construct S-boxes without corresponding optimization schemes will result in the performance of the constructed S-box being overly dependent on the chaotic system used, thus limiting its performance improvement. With the continuous development of intelligent algorithms, S-box construction schemes based on the combination of chaotic systems and intelligent algorithms have received increasing attention. S-box construction schemes based on optimization algorithms such as the Fireworks algorithm, the Genetic Algorithm, and the Jaya algorithm have emerged.

[0004] Among the many optimization algorithms used to optimize S-boxes, genetic algorithms (GAs) offer the best results. GAs possess strong global search capabilities and, through crossover and mutation, can increase population diversity and avoid premature convergence. However, GAs also suffer from the problem of blind search. Furthermore, because GAs cannot dynamically adjust the crossover and mutation rates based on the quality of individual solutions during crossover and mutation, they employ fixed crossover and mutation rates. Consequently, GA-optimized S-boxes still fail to achieve optimal results. Particle swarm optimization (PSO) algorithms, on the other hand, preserve optimal information between particles and the population, sharing this information to influence the movement direction and speed of the population. However, PSOs also suffer from premature convergence and are prone to local errors. Based on the respective strengths and weaknesses of both algorithms, combining GAs with PSOs can effectively improve optimization results.

[0005] Currently, the two algorithms are primarily hybridized in parallel, serial, and embedded ways. Parallel hybridization involves independent operation of the two algorithms during the optimization process, making it difficult for them to collaborate, resulting in the persistence of their respective shortcomings. Serial hybrid optimization involves executing different algorithms sequentially, which also fails to overcome the shortcomings of each algorithm and requires additional processing when switching between them, increasing algorithm complexity. Embedded hybridization involves incorporating the concepts of one algorithm into another. Embedded hybridization, based on genetic algorithms and particle swarm optimization, primarily involves adding selection, crossover, and mutation operations to the genetic algorithm before or after iterative updates of the particle swarm algorithm to improve population diversity. However, this approach also presents the challenge of properly setting parameters such as the crossover and mutation rates. Summary of the Invention

[0006] In order to improve the nonlinear characteristics and differential uniformity of the S-box constructed based on the chaotic system and thus enhance the ability to resist linear attacks, the present invention provides an S-box design method based on a hyperchaotic system and a genetic particle swarm algorithm, the method comprising:

[0007] Step 1: Construct a two-dimensional chaotic system based on Chebyshev mapping and ICMIC mapping, and construct several initial S-boxes based on the two-dimensional chaotic system. Calculate the nonlinearity and differential uniformity of each initial S-box.

[0008] Step 2: Determine the fitness function of the genetic particle swarm optimization algorithm based on the S-box performance evaluation principle;

[0009] Step 3: Encode the particles in the genetic particle swarm optimization algorithm, where each particle represents an initial S-box;

[0010] Step 4: updating the particle position through crossover and mutation operations of the improved genetic algorithm; in the improved genetic algorithm, the particle velocity is used to adaptively control the crossover rate and mutation rate of the genetic algorithm;

[0011] Step 5: Determine whether the updated particle fitness value has degraded. If so, return to step 4, otherwise continue to step 6;

[0012] Step 6: Update the local optimal solution and the global optimal solution, and determine whether the maximum number of iterations has been reached. If so, output the global optimal solution at this time as the final designed S-box; otherwise, return to step 4.

[0013] Optionally, constructing a plurality of initial S-boxes according to the two-dimensional chaotic system includes:

[0014] According to the following formula (1), a two-dimensional chaotic system is constructed;

[0015]

[0016] In formula (1), x(n), y(n), x(n+1), and y(n+1) are the input and output values ​​of the n+1th iteration, respectively, and their value range is [-1, 1]; k is the modulation parameter, and its value range is (0.2, 1); λ is the system parameter, and its value range is λ ≥ 2;

[0017] Assign initial values ​​x(0) and y(0) to the constructed two-dimensional chaotic system; set system parameters k and λ; iterate L times, discard the first 1000 chaotic sequences, and take the remaining chaotic sequences x(n) and y(n);

[0018] Divide the interval [-1,1] into 10,000 equal small intervals, and label each small interval with a serial number i, i = 1, 2, ..., 10,000. Then, take the interval number of the interval where y(n) is located as Y(n), and the interval number of the interval where x(n) is located as X(n).

[0019] Using the obtained Y(n), obtain the value X(Y(n)) at the corresponding position of the X(n) sequence, fill it into the empty array H in sequence, and intercept the fragment of length 256 in the array H to generate the S-box;

[0020] In order to keep the obtained value within the same range as the 8×8 S-box, an integer s in the range of 0 to 255 is obtained using formula (2) and filled into the S-box. If the obtained s value is repeated, a random integer r1 is obtained and then replaced with s' from formula (3):

[0021] s=mod(X(Y(n)),256) Formula (2)

[0022] s'=mod(Y(n+r1),256) Formula (3)

[0023] Finally, different initial S-boxes are obtained by intercepting different fragments in the array H.

[0024] Optionally, the fitness function of the genetic particle swarm optimization algorithm in step 2 is:

[0025] f(j)=γ*NL j +θ*δ j Formula (4)

[0026] For the jth particle, that is, the jth S-box, NL j Indicates the nonlinearity of the S-box, δs j represents the differential uniformity of the S-box, γ and θ are weighting coefficients; the S-box performance evaluation principle is that the greater the nonlinearity and the smaller the differential uniformity, the better the S-box performance;

[0027] Based on the S-box performance evaluation principle, γ and θ are assigned segmented values, and the resulting fitness function is as follows:

[0028]

[0029] Optionally, step 3 includes:

[0030] Encode the particles using decimal integer encoding, and represent each initial S-box obtained in step 1 as a non-repeating full permutation of all integers from 0 to 255;

[0031] Assuming the population size is N and the particle space dimension d is 256, the jth particle is represented by [p1, p2, ..., p d ].

[0032] Optionally, the crossover rate in step 4 refers to the length of the crossover fragment, and the mutation rate refers to the number of mutations.

[0033] Optionally, step 4 includes:

[0034] The particle velocity is updated using the following formula (5):

[0035]

[0036] Among them, the d elements of the j-th particle are compared with the d elements of the local optimal solution by position, and the number and sequence number of different elements at the same position are recorded. The number of different elements is the distance d1 between the particle and the local optimal solution, and the distance between the particle and the global optimal solution is d2;

[0037] r2 and r3 are two random numbers in the range of (0,1), iter represents the current number of iterations, ger represents the maximum number of iterations; c1 is the self-learning factor, c2 is the group learning factor, w is the inertia weight, v(j-1) is the speed of the previous iteration, and v(j) represents the particle speed of this round;

[0038] The obtained particle velocity v(j) is rounded up and the obtained value is used as the length L1(j) of the j-th intersection segment;

[0039] Sort the N local optimal solutions obtained in the previous round by fitness value from large to small, take the top 30%, randomly select one of them as the parent p1 of the crossover operation, and use the jth particle as the parent p2;

[0040] Next, a random integer r4 in the range of (1,256) is selected as the starting position for the crossover. The selected random number must satisfy r4+L1(j)≤256. Then, the positions from r4 to r4+L1(j) in the two parents are swapped.

[0041] Finally, conflict detection is performed and a mapping relationship is established based on the corresponding elements in the exchanged fragments. All conflicting elements are replaced through mapping to ensure that there are no duplicate elements in the resulting offspring.

[0042] Use the following formula (6) to get l2(j), and round it up to get the number of mutations L2(j):

[0043]

[0044] Among them, f(j) is the fitness value of the jth particle, f p (j) is the fitness value corresponding to the local optimal solution, f g is the fitness value corresponding to the global optimal solution; randomly select two unequal integers in the range of (1, 256) and exchange the elements at these two positions, and repeat this operation L2(j) times to obtain the particle with updated position.

[0045] Optionally, step 5 includes:

[0046] Calculate the particle fitness value after the crossover mutation operation. If the obtained particle fitness value is less than the particle fitness value before the crossover mutation operation, it indicates that the particle has degenerated. Then return to step 4 and perform the crossover mutation operation again.

[0047] Optionally, step 6 includes:

[0048] The fitness value f(j) of each particle is calculated by the fitness function, and N local optimal solutions are obtained. The corresponding fitness value is f p (j); Find the particle with the highest fitness value from the local optimal solution as the global optimal solution, whose fitness value is f g The initial S-box represented by the particle with the highest fitness value is the final designed S-box.

[0049] Optionally, the step 1 of constructing a two-dimensional chaotic system based on Chebyshev mapping and ICMIC mapping includes:

[0050] The CMC expression of the cascade modulation coupling model is as follows:

[0051]

[0052] Where F and G are two one-dimensional chaotic maps, f is a linear equation, and the expression is f(t)=t+3;

[0053] Based on the cascade modulation coupling model CMC, a nonlinear equation with a square term is used to replace the original linear part to obtain the cascade modulation coupling model, which is expressed as follows:

[0054]

[0055] Among them, x(n) and y(n) are state variables, k is the modulation parameter, and F and G are two one-dimensional chaotic maps.

[0056] Based on the cascade modulation coupling model, F and G adopt Chebyshev mapping and ICMIC mapping respectively, and a two-dimensional chaotic system is constructed according to formula (1). Its mathematical expression is as follows:

[0057]

[0058] The present application also provides a data and image encryption method, which uses the S-box designed by the above method to perform obfuscation and substitution operations to achieve encryption of data and images.

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

[0060] By proposing a two-dimensional cascade modulation coupled chaotic system based on Chebyshev mapping and ICMIC mapping, analysis shows that the chaotic system is hyperchaotic within the parameter range, the generated chaotic sequence has better ergodicity, and its chaotic behavior is more difficult to predict. Based on this chaotic system, the interval partitioning method and sequence indexing method are used to generate an S-box with good performance. Finally, the genetic particle swarm optimization algorithm is used to optimize the S-box to obtain an S-box with higher nonlinearity. Compared with existing solutions, the S-box constructed in this application has good performance in terms of nonlinearity, differential uniformity, and independence between output bits, and has a stronger ability to resist linear attacks. It has broad application prospects in the fields of data and image encryption. DETAILED DESCRIPTION

[0061] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be described in further detail below.

[0062] Example 1:

[0063] This embodiment provides an S-box design method based on a hyperchaotic system and a genetic particle swarm algorithm, the method comprising:

[0064] Step 1: Construct the initial S-box according to the chaotic sequence generated by the improved two-dimensional chaotic system;

[0065] The improvement process of the improved two-dimensional chaotic system is as follows:

[0066] Design the cascade modulation coupling model CMC, whose expression is as follows:

[0067]

[0068] Where F and G are two one-dimensional chaotic maps, f is a linear equation, and the expression is f(t)=t+3;

[0069] Based on the cascade modulation coupling model CMC, a nonlinear equation with a square term is used to replace the original linear part. Since the value range of y(n) and x(n+1) is between -1 and 1, the use of the square term can expand the difference in the values ​​of y(n) and x(n+1), thereby increasing the disturbance intensity on the input; in addition, using different nonlinear equations for the two output expressions can further increase the complexity of the entire model, making the output chaotic sequence have good unpredictability.

[0070] The cascade modulation coupling model is obtained, and the expression is as follows:

[0071]

[0072] Among them, x(n) and y(n) are state variables, k is the modulation parameter, and F and G are two one-dimensional chaotic maps.

[0073] Based on the cascade modulation coupling model, F and G adopt Chebyshev mapping and ICMIC mapping respectively, and the following formula (1) is used to construct a two-dimensional chaotic system;

[0074]

[0075] In formula (1), x(n), y(n), x(n+1), and y(n+1) are the input and output values ​​of the nth iteration, respectively, and their value ranges are [-1, 1]; k is the modulation parameter, and its value range is (0.2, 1); λ is the system parameter, and its value range is λ ≥ 2.

[0076] Assign initial values ​​x(0) and y(0) to the chaotic system; set system parameters k and λ. Iterate L times, discard the first 1000 chaotic sequences, and take the remaining chaotic sequences x(n) and y(n).

[0077] Divide the interval [-1, 1] into 10,000 equal small intervals and label each small interval with a sequence number i, i = 1, 2, ..., 10,000. Then, the interval number of the interval where y(n) is located is Y(n), and the interval number of the interval where x(n) is located is X(n).

[0078] Use the obtained Y(n) to obtain the value X(Y(n)) at the corresponding position of the X(n) sequence, fill it into the empty array H in sequence, and intercept a fragment of length 256 in the array H to generate an S-box.

[0079] In order to keep the obtained value within the same range as the 8×8 S-box, an integer s in the range of 0 to 255 is obtained using formula (2) and filled into the S-box. If the obtained s value is repeated, a random integer r1 is obtained and then replaced with s' from formula (3).

[0080] s=mod(X(Y(n)),256) Formula (2)

[0081] s'=mod(Y(n+r1),256) Formula (3)

[0082] By intercepting different segments from the array H, different initial S-boxes can be obtained, and the nonlinearity and differential uniformity of each initial S-box can be calculated.

[0083] Step 2: Set the fitness function of the genetic particle swarm optimization algorithm according to the nonlinearity and differential uniformity of the initial S-box;

[0084] The fitness function of the genetic particle swarm optimization algorithm is obtained using the following formula (4):

[0085] f(j)=γ*NL j +θ*δ j Formula (4)

[0086] For the jth particle, that is, the jth S-box, NL j Indicates the nonlinearity of the S-box, δs j It represents the differential uniformity of the S-box, γ and θ are weighted coefficients. The larger the nonlinearity and the smaller the differential uniformity, the better the S-box performance. Based on this principle, γ and θ are assigned piecewise. The fitness function obtained by testing is as follows:

[0087]

[0088] Step 3: Encode the particles in the genetic particle swarm optimization algorithm;

[0089] Use decimal integer encoding to encode particles, namely S-boxes, and regard the bijective S-box as a non-repeating full permutation of all integers from 0 to 255. Suppose the population size is N and the space dimension is d, then the jth particle is [p1, p2, ..., p d ].

[0090] Step 4: Update particle positions through crossover and mutation operations of the improved genetic algorithm;

[0091] The particle velocity is updated using the following formula (5):

[0092]

[0093] Among them, the 256 elements of the j-th particle are compared with the 256 elements of the local optimal solution, and the number and sequence of different elements at the same position are recorded. The number of different elements is the distance d1 between the particle and the local optimal solution, and the distance d2 between the particle and the global optimal solution. r2 and r3 are two random numbers with a value range of (0,1), iter represents the current number of iterations, and ger represents the maximum number of iterations; c1 is the self-learning factor, c2 is the group learning factor, w is the inertia weight, v(j-1) is the speed of the previous round of iteration, and v(j) is the particle speed in this round.

[0094] The obtained particle velocity v(j) is rounded up and the obtained value is used as the length L1(j) of the j-th intersection segment;

[0095] Sort the N local optimal solutions obtained in the previous round by their fitness values ​​from large to small, take the top 30%, randomly select one of them as the parent p1 of the crossover operation, and use the jth particle as the parent p2.

[0096] Next, a random integer r4 in the range of (1,256) is selected as the starting position of the crossover. The selected random number needs to satisfy r4+L1(j)≤256. Then, the positions from r4 to r4+L1(j) in the two parents are swapped. Finally, conflict detection is performed and a mapping relationship is established based on the corresponding elements in the swapped fragments. All conflicting elements will be replaced through the mapping to ensure that there are no duplicate elements in the formed offspring.

[0097] Use the following formula (6) to get l2(j), and round it up to get the number of mutations L2(j):

[0098]

[0099] Among them, f(j) is the fitness value of each particle, f p (j) is the fitness value corresponding to the local optimal solution, f g is the fitness value corresponding to the global optimal solution. Randomly select two unequal integers in the range (1, 256) and swap the elements at these two positions. Repeat this operation L2(j) times.

[0100] Step 5: Determine whether the updated particle fitness value has degraded. If so, return to step 4, otherwise continue to step 6;

[0101] Calculate the particle fitness value after the crossover mutation operation. If the obtained particle fitness value is less than the particle fitness value before the crossover mutation operation, it indicates that the particle has degenerated, so return to step 4 and perform the crossover mutation operation again.

[0102] Step 6: Update the local optimal solution and the global optimal solution, and determine whether the maximum number of iterations has been reached. If so, output the global optimal solution at this time as the final result; otherwise, return to step 4.

[0103] The fitness value f(j) of each particle is calculated by the fitness function, and N local optimal solutions are obtained. The corresponding fitness value is f p (j); Find the particle with the highest fitness value from the local optimal solution as the global optimal solution, whose fitness value is f g .

[0104] In order to make the purpose, technical solutions and advantages of the present invention clearer, some currently proposed S-box construction methods will be compared with the proposed method to demonstrate the performance superiority of the S-box design method based on hyperchaotic system and genetic particle swarm algorithm.

[0105] The schemes used for comparison are:

[0106] Solution 1 (S-box construction based on Sine chaotic map), see Belazi Akram, Ahmed A. Abd El-Latif. A simple yet efficient S-box method based on chaotic sine map [J]. OPTIK, 2017, 130: 1438-1444.

[0107] Solution 2 (constructing S-box based on tent–logistic compound chaotic system), please refer to LU Q, ZHU C, WANGG. A Novel S-Box Design Algorithm Based on a New Compound Chaotic System[J]. Entropy, 2019, 21(10): 1004;

[0108] Scheme 3 (first use Tent chaotic mapping to obtain a pseudo-random sequence and divide it into intervals for storage, then use the pseudo-random sequence as the initial value of Henon mapping, and use the 256 non-repeating values ​​obtained by Henon mapping to construct an S-box), please refer to Han Yanyan, He Yanru, Liu Peihe, et al. A ZUC dynamic S-box construction and application scheme based on chaotic system [J]. Computer Research and Development, 2020, 57(10):11;

[0109] Scheme 4 (first use the Lorenz three-dimensional chaotic system to generate the initial solution, then use the fireworks algorithm to search the chaotic system solution space, integerize the optimal solution after obtaining it, and perform corresponding row and column interchange to construct the S-box), please refer to WANG J, PAN B, TANG C, et al. Construction method and performance analysis of chaotic S-box based on fireworks algorithm[J]. International Journal of Bifurcation and Chaos, 2019, 29(12): 1950158;

[0110] Solution 5 (first use the Logistic Chaos Map to construct the initial S-box, then use the genetic algorithm to optimize the nonlinearity of the initial S-box to obtain an S-box with good nonlinearity), please refer to Guesmi R, Farah MAB, Kachouri A, et al. A novel design of Chaos based S-Boxes using genetic algorithm techniques [C] / / 2014 IEEE / ACS 11th International Conference on Computer Systems and Applications (AICCSA). IEEE, 2014: 678-684;

[0111] Scheme 6 (first use the proposed chaotic system to obtain the initial S-box, then use the chaotic Jaya algorithm to optimize the nonlinearity of the initial S-box to obtain an S-box with good nonlinearity), please refer to Farah MA, Farah A, Farah T. Animage encryption scheme based on a new hybrid chaotic map and optimized substitution box[J]. Nonlinear Dynamics, 2020, 99(4): 3041-3064;

[0112] The experimental results are shown in Tables 1, 2, 3, and 4. According to the experimental results, the S-box design method based on hyperchaotic system and genetic particle swarm algorithm proposed in this application exhibits good nonlinearity, differential uniformity, and bit independence with strict avalanche criterion.

[0113] Table 1 shows the comparison results of the nonlinearity of the S-box generated by the present invention when x(0)=0.5, y(0)=0.5, k=0.7, λ=8, L=11000, N=30, d=256, ger=50, c1=0.5, c2=0.5, w=0.8, and vlimit=[10,65], as shown below:

[0114] Table 1: Comparison of the nonlinearity of each solution and the S-box designed in this application

[0115]

[0116]

[0117] Nonlinearity is usually used to measure the ability of the S-box to resist linear attacks, and the size of the nonlinearity determines the security of a cryptographic system. If there is a linear structure or a linear-like structure in the S-box, the attacker can use the linear structure to attack in order to obtain the key or even decipher the entire cryptographic system. The results of the nonlinearity calculation of the Boolean function using the Walsh spectrum are shown in Table 1. The greater the nonlinearity of the designed S-box, the higher its ability to resist linear attacks and the higher the security. After calculation, the calculation result of the initial S-box constructed by the chaotic system of this application is 106.50; the calculation result of the S-box after optimization by the scheme of this application is 108.25. Compared with other schemes, the nonlinearity of the S-box constructed based on the present invention is greater than that of other literatures, and its ability to resist linear attacks is stronger.

[0118] Table 2 is a comparison result of the average values ​​of the S-box correlation matrix elements generated by the present invention when x(0)=0.5, y(0)=0.5, k=0.7, λ=8, L=11000, N=30, d=256, ger=50, c1=0.5, c2=0.5, w=0.8, and vlimit=[10,65], as shown below:

[0119] Table 2: Comparison of the average values ​​of the correlation matrix elements of each solution and the S-box designed in this application

[0120]

[0121] The average value of the elements of the S-box correlation matrix is ​​usually used to measure whether the S-box follows the strict avalanche criterion. The strict avalanche criterion (SAC) can be used to judge the correlation between the sequence input and output changes. The strict avalanche criterion can be tested by calculating the correlation matrix, and the elements in the matrix are regarded as the probability of the output bit changing when the input bit of the S-box changes. Generally, if the probability of each output bit changing is close to 50% when the input changes by 1 bit, it means that the S-box meets the strict avalanche criterion. After calculation, the average value of the S-box correlation matrix constructed based on the present invention is 0.5031, which is close to 0.5, and thus meets the strict avalanche criterion.

[0122] Table 3 shows the comparison results of the maximum difference values ​​of the S-boxes generated by the present invention when x(0)=0.5, y(0)=0.5, k=0.7, λ=8, L=11000, N=30, d=256, ger=50, c1=0.5, c2=0.5, w=0.8, and vlimit=[10,65], as shown below:

[0123] Table 3: Comparison of the maximum difference between each solution and the S-box designed in this application

[0124]

[0125]

[0126] Differential cryptanalysis is one of the methods for conducting cryptographic attacks, and differential uniformity was introduced to address this. The differential uniformity of an S-box is an important indicator of its resistance to differential cryptanalysis. The smaller the maximum differential value of an S-box, the better its differential uniformity. As shown in the table, the maximum differential value of the S-box designed in this application is 10, which is better than or equal to that of other solutions.

[0127] Table 4 shows the comparison results of the bit independence of the strict avalanche criterion of the S-box generated by the present invention when x(0)=0.5, y(0)=0.5, k=0.7, λ=8, L=11000, N=30, d=256, ger=50, c1=0.5, c2=0.5, w=0.8, and vlimit=[10,65], as shown below:

[0128] Table 4: Comparison of the bit independence of each solution and the strict avalanche criterion of the S-box designed in this application

[0129]

[0130] Table 4 shows the comparison results of the bit independence of the strict avalanche criterion of the S-box. According to the output bit independence criterion, the output value is independent of the bit change of the input value, that is, when the t-th bit of the input changes, the m-th and n-th bits of the output will change independently. In this application, the bit independence criterion of the strict avalanche criterion (BIC-SAC) is used to verify the output bit independence of the constructed S-box. BIC-SAC is used to determine the output bit s of the S-box. m ⊕s j (s m and s n The results show that the average value of the strict avalanche criterion for the S-box generated by this application is only 0.0003 lower than the theoretical value of 0.5, which is lower than that of other solutions. This indicates that the designed S-box has strong independence between output bits.

[0131] In summary, the S-box designed by the method of the present application has good performance in nonlinearity, differential uniformity, and independence between output bits. It has a stronger ability to resist linear attacks, and data and image encryption based on the S-box has higher security.

[0132] Some steps in the embodiments of the present invention may be implemented using software, and the corresponding software program may be stored in a readable storage medium, such as a CD or a hard disk.

[0133] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. An S-box design method based on hyperchaotic system and genetic particle swarm algorithm, characterized in that: The method comprises: Step 1: Construct a two-dimensional chaotic system based on Chebyshev mapping and ICMIC mapping, and construct several initial S-boxes based on the two-dimensional chaotic system. Calculate the nonlinearity and differential uniformity of each initial S-box. Step 2: Determine the fitness function of the genetic particle swarm optimization algorithm based on the S-box performance evaluation principle; Step 3: Encode the particles in the genetic particle swarm optimization algorithm, where each particle represents an initial S-box; Step 4: updating the particle position through crossover and mutation operations of the improved genetic algorithm; in the improved genetic algorithm, the particle velocity is used to adaptively control the crossover rate and mutation rate of the genetic algorithm; Step 5: Determine whether the updated particle fitness value has degraded. If so, return to step 4, otherwise continue to step 6; Step 6: Update the local optimal solution and the global optimal solution, and determine whether the maximum number of iterations has been reached. If so, output the global optimal solution at this time as the final designed S-box. Otherwise, return to step 4. The step of constructing a plurality of initial S-boxes according to the two-dimensional chaotic system comprises: According to the following formula (1), a two-dimensional chaotic system is constructed; In formula (1), x(n) and y(n) are the state variables of the nth iteration, x(n+1) and y(n+1) are the state variables of the n+1th iteration, and their value range is [-1, 1]; k is the modulation parameter, and its value range is (0.2, 1); λ is the system parameter, and its value range is λ ≥ 2; Assign initial values ​​x(0) and y(0) to the constructed two-dimensional chaotic system; set system parameters k and λ; iterate L times, discard the first 1000 chaotic sequences, and take the remaining chaotic sequences x(n) and y(n); Divide the interval [-1,1] into 10,000 equal small intervals, and label each small interval with a serial number i, i = 1, 2, ..., 10,000. Then, take the interval number of the interval where y(n) is located as Y(n), and the interval number of the interval where x(n) is located as X(n). Using the obtained Y(n), obtain the value X(Y(n)) at the corresponding position of the X(n) sequence, fill it into the empty array H in sequence, and intercept the fragment of length 256 in the array H to generate the S-box; In order to keep the obtained value within the same range as the 8×8 S-box, an integer s in the range of 0 to 255 is obtained using formula (2) and filled into the S-box. If the obtained s value is repeated, a random integer r1 is obtained and then replaced with s' from formula (3): s=mod(X(Y(n)),256) Formula (2) s'=mod(Y(n+r1),256) Formula (3) Finally, different initial S-boxes are obtained by intercepting different fragments in the array H; The fitness function of the genetic particle swarm optimization algorithm in step 2 is: f(j)=γ*NL j +θ*δ j expression(4) For the jth particle, that is, the jth S-box, NL j represents the nonlinearity of the S-box, δ j represents the differential uniformity of the S-box, γ and θ are weighting coefficients; the S-box performance evaluation principle is that the greater the nonlinearity and the smaller the differential uniformity, the better the S-box performance; Based on the S-box performance evaluation principle, γ and θ are assigned segmented values, and the resulting fitness function is as follows: In step 4, the crossover rate refers to the length of the crossover fragment, and the mutation rate refers to the number of mutations; The step 4 comprises: The particle velocity is updated using the following formula (5): Among them, the d elements of the j-th particle are compared with the d elements of the local optimal solution by position, and the number and sequence number of different elements at the same position are recorded. The number of different elements is the distance d1 between the particle and the local optimal solution, and the distance between the particle and the global optimal solution is d2; r2 and r3 are two random numbers in the range of (0,1), iter represents the current number of iterations, ger represents the maximum number of iterations; c1 is the self-learning factor, c2 is the group learning factor, w is the inertia weight, v(j-1) is the speed of the previous iteration, and v(j) represents the particle speed of this round; The obtained particle velocity v(j) is rounded up and the obtained value is used as the length L1(j) of the j-th intersection segment; Sort the N local optimal solutions obtained in the previous round by their fitness values ​​from large to small, take the top 30%, randomly select one of them as the parent p1 of the crossover operation, and use the jth particle as the parent p2; Next, a random integer r4 in the range of (1,256) is selected as the starting position for the crossover. The selected random number must satisfy r4+L1(j)≤256. Then, the positions from r4 to r4+L1(j) in the two parents are swapped. Finally, conflict detection is performed and a mapping relationship is established based on the corresponding elements in the exchanged fragments. All conflicting elements are replaced through mapping to ensure that there are no duplicate elements in the resulting offspring. Use the following formula (6) to get l2(j), and round it up to get the number of mutations L2(j): Among them, f(j) is the fitness value of the jth particle, f p (j) is the fitness value corresponding to the local optimal solution, f g is the fitness value corresponding to the global optimal solution; randomly select two unequal integers in the range of (1, 256) and exchange the elements at these two positions, and repeat this operation L2(j) times to obtain the particle with updated position.

2. The method according to claim 1, characterized in that The step 3 includes: Encode the particles using decimal integer encoding, and represent each initial S-box obtained in step 1 as a non-repeating full permutation of all integers from 0 to 255; Assuming the population size is N and the particle space dimension d is 256, the jth particle is represented by [p1, p2, ..., p d ].

3. The method according to claim 2, characterized in that The step 5 comprises: Calculate the particle fitness value after the crossover mutation operation. If the obtained particle fitness value is less than the particle fitness value before the crossover mutation operation, it indicates that the particle has degenerated. Then return to step 4 and perform the crossover mutation operation again.

4. The method according to claim 3, characterized in that The step 6 comprises: The fitness value f(j) of each particle is calculated by the fitness function, and N local optimal solutions are obtained. The corresponding fitness value is f p (j); Find the particle with the highest fitness value from the local optimal solution as the global optimal solution, whose fitness value is f g The initial S-box represented by the particle with the highest fitness value is the final designed S-box.

5. A data and image encryption method, characterized in that: The method uses the S-box designed by any one of the methods described in claims 1-4 to perform obfuscation and substitution operations to achieve encryption of data and images.

Citation Information

Patent Citations

  • A compression-diffusion-permutation strategy for big image data

    AU2018100382A4

  • Wireless sensor network task scheduling optimization method based on set particle swarm algorithm

    CN108200587A