Cross-layer uniform shuffling color image encryption algorithm based on chaos theory

Through the combination of 2D-Sinsinger chaotic function and shuffle algorithm, uniform shuffle and bit diffusion of color images across layers is achieved, solving the problem of easy-to-crack color image encryption caused by excessive single channel information, and improving encryption efficiency and security , able to withstand differential attacks and noise effects.

CN119276999APending Publication Date: 2025-01-07SHENYANG INST OF COMPUTING TECH CO LTD THE CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411400793.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-09
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

The existing chaos-based color image encryption method has the problem of excessive single channel information causing easy cracking, and attackers can obtain regional location and pixel statistics of color images by cracking the information of one channel, resulting in insecure encryption.

Method used

Using a cross-layer uniform shuffle color image encryption algorithm based on 2D-Sinsinger chaotic function, the initial key is generated by constructing the 2D-Sinsinger chaotic function, the shuffle algorithm is designed to shuffle the bit plane and region of the R, G, and B channels, and The color image is encrypted using the bit diffusion formula to ensure that the information of the three-layer channel is evenly mixed and preventing information from being exposed.

Benefits of technology

It realizes efficient encryption of large-size color images, reduces calculation costs and time costs, and improves security performance, can withstand differential attacks and noise effects, and provides stronger robustness and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119276999A_ABST
    Figure CN119276999A_ABST
Patent Text Reader

Abstract

The invention relates to a cross-layer uniform shuffling color image encryption method based on a chaos theory. The cross-layer uniform shuffling color image encryption method comprises the following steps: constructing a 2D-Singer chaos function by using a one-dimensional Singer chaos function; an initial secret key is generated by using a 2D-Singer chaotic function; a shuffling algorithm is designed by using a 2D-Singer; r, G and B pixel shuffling based on the bit plane is carried out by using a shuffling algorithm; performing R, G and B region shuffling by using a shuffling algorithm; and according to the initial secret key generated by the 2D-Singer chaotic function, bit diffusion is carried out, and encryption of the color image is completed. According to the invention, a brand new encryption algorithm (SinsingerIE) for color image encryption is developed on the basis of 2D-Sinsinger. In order to solve the problem that an encrypted image is easy to crack due to excessive correct information of a single channel, the encryption algorithm in the invention can be used for almost uniformly mixing information among three layers of channels, so that each channel does not expose the correct information of the original channel; and almost correct information is not exposed because a large amount of correct information is gathered together.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the field of color image chaos encryption, in particular to a cross-layer uniform shuffling color image encryption algorithm based on chaos theory. Background Art

[0002] Some of the existing image encryption methods include bit-plane-based image encryption, data stream-based image encryption, DNA coding and S-box-based image encryption, wavelet-based image encryption, androd transform-based image encryption, among which chaos-based image encryption methods often have lower computational costs, and because chaotic mapping is very sensitive to the selection of initial points and parameter values ​​and has strong unpredictability, image encryption algorithms based on chaotic mapping also have good security.

[0003] In terms of encryption algorithms, the previous implementation of chaos-based color image encryption algorithms is based on a single-channel encryption method, which achieves the encryption of the entire color image by independently and repeatedly performing single-channel encryption on the three channels R, G, and B. However, this method has certain hidden dangers. Since the three channels are encrypted independently and finally spliced ​​together, the attacker does not need to completely crack the information of the three channels R, G, and B. He only needs to analyze and crack the encryption method of one channel to obtain the correct single-channel image. Even if the same color image as the original cannot be obtained, the cracked single-channel image also exposes the correct regional position information and pixel statistical information of the original color image, which is a significant loss for the encryptor. Summary of the invention

[0004] In view of the above technical deficiencies, the present invention proposes a cross-layer uniform shuffling color image encryption algorithm based on chaos theory, which requires less time cost for encrypting large-size color images, and in terms of security verification, SinsingerIE has better security performance than other encryption methods.

[0005] The technical solution adopted by the present invention to achieve the above-mentioned purpose is: a cross-layer uniform shuffling color image encryption method based on chaos theory, comprising the following steps:

[0006] Use one-dimensional Singer chaotic function to construct 2D-Sinsinger chaotic function;

[0007] Generate the initial key using 2D-Sinsinger chaotic function;

[0008] Design a shuffling algorithm using 2D-Sinsinger;

[0009] Use the shuffle algorithm to shuffle R, G, and B pixels based on the bit plane;

[0010] Use the shuffling algorithm to shuffle the R, G, and B regions;

[0011] According to the initial secret key generated by the 2D-Sinsinger chaotic function, bit diffusion is performed to complete the encryption of the color image.

[0012] The 2D-Sinsinger chaos function is as follows:

[0013]

[0014] Among them, a is a hyperparameter, x n ,y n is the input sequence value, x n+1 ,y n+1 is the output sequence value.

[0015] The 2D-Sinsinger chaotic function is evaluated by randomness test, specifically:

[0016]

[0017] Among them, x i It uses the chaotic function x n+1 =f(x n ) is the sequence value generated by, i = 1, 2, 3, ..., n; x0 is the starting point, LE(x0) is the value of the Lyapunov exponent at x0;

[0018] When the Lyapunov exponent is positive, the chaotic function is unpredictable; otherwise, it is predictable.

[0019] The method of generating an initial key by using a 2D-Sinsinger chaotic function comprises the following steps:

[0020] The original color image is converted into a byte stream as input, and SHA-512 is used to obtain 512 bits. The first 240 bits are divided into groups of 20 bits, {x0, y0} and {x1, y1} use 5 groups, and {a} uses 2 groups; each group of 20 bits is {k1, k2, k3, ..., k 20 Generate decimal parameters according to the IEEE 754 standard: Generate a 240-bit security key, get 12 groups of keys in groups of 20, and generate the initial conditions {x0, y0, x1, y1, a} of the 2D-Sinsinger:

[0021]

[0022] Among them, {x0, y0} and {x1, y1} represent two different initial input values ​​of the 2D-Sinsinger chaotic function, and a is a hyperparameter.

[0023] The shuffling algorithm designed by using 2D-Sinsinger includes the following steps:

[0024] Set the number of cards to be a multiple of 3 C, and get the corresponding size of the card array Lsend;

[0025] Divide the array into three equal parts in order [R1, R2, R3], where the number of R1, R2, and R3 is C / 3, which is the subarray of Lsend. At this time, there are equal numbers of 1, 2, and 3 in the subarrays R1, R2, and R3; the difference between the numbers of 1, 2, and 3 in each subarray is no more than 2, to ensure that the number of cards distributed at the end is uniform and equal;

[0026] At the same time, the order of dealing cards is determined by an Order array of size C, wherein the Order array is filled with C chaotic sequences generated by a 2D-Sinsinger chaotic function according to initial conditions {x0, y0, a}, and the Order array is also divided into three equal parts [F1, F2, F3] in order, and finally, the F1, F2, F3 arrays are arranged from small to large according to the size order in the F1, F2, F3 sub-arrays to obtain indexed card dealing sub-arrays Q1, Q2, Q3, and R1, R2, R3 are rearranged according to Q1, Q2, Q3 to obtain P1, P2, P3 to form a card dealing array Lsend; cards are dealt according to the numbers in the P1, P2, P3 sub-arrays in the Lsend array, and 1, 2, 3 correspond to receiver No. 1, receiver No. 2, receiver No. 3, respectively.

[0027] The method of using the shuffling algorithm to shuffle R, G, and B pixels based on the bit plane comprises the following steps:

[0028] For a color image with a dimension of m×n×3, the last dimension is composed of three channels: R, G, and B. Each of the three channels is converted into an array of 8-bit binary bits, and the dimension of the color image becomes m×n×24. At this time, taking the third channel as the reference, 24 bit planes are obtained, which is equivalent to obtaining 24 m×n×1 cards;

[0029] At this time, the three channels R, G, and B are regarded as card receivers, and the chaotic sequence generated by the 2D-Sinsinger chaotic function and the initial values ​​x0, y0 generated by the key is used to obtain the Lsend array of size 24. At this time, 8 m×n×1 cards are redistributed to each channel of R, G, and B according to the Lsend array; finally, each channel is combined to obtain an image with different pixel values ​​from the original color image.

[0030] The method of shuffling the R, G, and B regions using a shuffling algorithm comprises the following steps:

[0031] For a color image with a dimension of m×n×3, taking the second dimension as the basis, it is equivalent to a channel having n columns of m*1 pixel strips, and the three channels of R, G, and B have a total of 3n pixel strips. The 3n pixel strips are regarded as cards, and the shuffle algorithm is used to assign the 3n pixel strips to the three channels of R, G, and B according to the Lsend array generated by the shuffle algorithm, and a three-channel color image E with three layers of pixel areas mixed in a shuffled manner is obtained;

[0032] The color image E is rotated 90 degrees and then distributed according to the Lsend array. The rotation and distribution steps are repeated multiple times to obtain a three-layer mixed encrypted image P that hides pixel information and region information.

[0033] The initial key generated according to the 2D-Sinsinger chaotic function is subjected to bit diffusion, comprising the following steps:

[0034] For the color image P with a dimension of m×n×3 obtained after shuffling, the {x1, y1, a} generated by the key group is used as the initial value, and the matrices C1 and C2 of the same size as the three-dimensional color image P are generated through the 2D-Sinsinger chaotic function. Each channel of the color image P is diffused using the following diffusion formula:

[0035]

[0036] The initial values ​​{x1, y1} are substituted into the 2D-Sinsinger chaotic function to obtain the chaotic matrices X and Y; C1 is the array after the chaotic matrix X is transformed into one dimension, and C2 is the array after the chaotic matrix Y is transformed into one dimension; P(i) is the array after the image to be diffused is transformed into one dimension, and D(i) is the image after diffusion; i represents the i-th sequence value after the transformation into a one-dimensional array; floor represents rounding down, bitxor represents exclusive OR operation, and mod represents modulus calculation.

[0037] Verify the encryption process, including the following steps:

[0038] Select N pairs of adjacent pixels from the horizontal, vertical, and diagonal directions of the plaintext image, draw a graph, and use the formula Calculate the correlation, where X and Y are two input vectors, representing the chaotic matrices X and Y, respectively, and μ X is the mean of the x vector, μ Y is the mean of y, σ X is the standard deviation of vector X, σ Y is the standard deviation of vector Y;

[0039] Randomly select n non-overlapping regions T, each with e pixel blocks, calculate the Shannon entropy of each region Ti, and finally take the mean value H of the sum of the Shannon entropies of all regions n,e (T):

[0040]

[0041] Where n represents the number of randomly selected blocks, H(T i ) represents the information entropy of the i-th block, T i There are e pixel values ​​in the block. The number of times each pixel value appears is counted and divided by e to get the frequency estimation probability P(t k ), t k Represents the pixel value of the current pixel block;

[0042] When the correlation I XY With the mean H n,e (T) are all within the set range, indicating that the color image encryption method can be adopted.

[0043] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the cross-layer uniform shuffling color image encryption method based on chaos theory is implemented.

[0044] The present invention has the following beneficial effects and advantages:

[0045] 1. The present invention adopts a new chaotic function (2D-Sinsinger), which has good ergodicity and high sensitivity to initial values ​​and parameters.

[0046] 2. The present invention develops a new encryption algorithm (SinsingerIE) for color image encryption based on 2D-Sinsinger.

[0047] 3. In order to solve the problem that the encrypted image is easy to crack due to too much correct information in a single channel, the encryption algorithm in the present invention can mix the information between the three channels almost evenly, so that each channel will not expose the correct information of the original channel, nor will it expose almost correct information because a large amount of correct information is gathered together.

[0048] 4. SinsingerIE has high encryption efficiency and security performance, can resist differential attacks, and has strong robustness to resist certain data missing and noise influences. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 SinsingerIE encryption algorithm flow chart.

[0050] Figure 2R, G, B area shuffling algorithm.

[0051] Figure 3 Initial key security analysis diagram.

[0052] Figure 4 The encrypted image is added with a: 1% Gaussian noise b: 2% Gaussian noise c: 5% missing d: 15% missing e: 15% random position missing analysis chart.

[0053] Figure 5 Attractor analysis diagram.

[0054] Figure 6 LE value analysis chart. DETAILED DESCRIPTION

[0055] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0056] Compared with single-channel images, the color images of the present invention carry more sensitive information, and encryption of large-size color images requires more computing resources and a greater time cost, so it is very necessary to design a color image encryption algorithm with good security performance and high encryption efficiency. Chaotic functions in chaos theory are sensitive to initial values ​​and unpredictable, and are widely used in fields such as security encryption and communication transmission. This paper proposes a new two-dimensional chaotic function (2D-Sinsinger) for the Singer chaotic function. Compared with traditional chaotic functions, 2D-Sinsinger has better ergodicity, hyperchaos and unpredictability. Based on 2D-Sinsinger, this paper proposes a cross-layer uniform shuffling color image encryption algorithm (SinsingerIE) based on chaos theory. SinsingerIE is divided into two processes: R, G, B cross-layer shuffling and diffusion. The R, G, B cross-layer shuffling process is further divided into two processes: R, G, B simple pixel shuffling based on bit plane and R, G, B cross-layer region shuffling, which can achieve the goal of uniform shuffling. Experimental results show that SinsingerIE takes less time to encrypt large-size color images, and has better security performance than other encryption algorithms in security verification.

[0057] The present invention uses R, G, B cross-layer shuffling to replace the original obfuscation process.

[0058] The pixel statistics of the original image are hidden by cross-layer pixel shuffling of R, G, and B based on bit planes.

[0059] The R, G, B cross-layer area shuffle is used to achieve the mixed chaos of the R, G, B three-layer areas, making it almost impossible for an attacker to obtain any valid statistical information or regional information by cracking a single channel.

[0060] Resist differential attacks through XOR diffusion.

[0061] Subsequent security analysis shows that SinsingerIE has faster encryption speed and higher security level than some existing chaos-based encryption algorithms.

[0062] like Figure 1 As shown, a cross-layer uniform shuffling color image encryption method based on chaos theory includes the following steps:

[0063] Using the one-dimensional Singer chaotic function, the 2D-Sinsinger chaotic function is designed and constructed, and the attractor of the chaotic function is analyzed and subjected to the NIST randomness test.

[0064] Perform initial key generation;

[0065] Design a shuffling algorithm using 2D-Sinsinger;

[0066] Use the shuffle algorithm to shuffle R, G, B pixels based on the bit plane;

[0067] Use the shuffling algorithm to shuffle the R, G, and B regions;

[0068] Design diffusion formula and perform bit diffusion;

[0069] The security, robustness, correlation and local Shannon entropy of the initial key of the encryption process of SinsingerIE are verified and analyzed.

[0070] The 2D-Sinsinger chaos function is:

[0071]

[0072] Where a is a hyperparameter, x n ,y n is the input value, x n+1 ,y n+1 is the output value.

[0073] The designed chaotic function should have good ergodicity and be able to generate unpredictable sequences. The frequency, block frequency, cumulative sums, and FFT index of the NIST randomness test prove that it has good randomness. The Lyapunov index:

[0074] Among them, x i It is to use the chaotic function x n+1 =f(x n) is the sequence value generated by i = 1, 2, 3, ..., n. x0 is the starting point, LE(x0) is the value of the Lyapunov index at x0. When the Lyapunov index is positive, the chaotic function is unpredictable; otherwise, it is predictable. The Lyapunov index is used to characterize whether a dynamic system has chaotic characteristics. Different separation directions of the initial separation vector may have different separation rates. If a system has a positive Lyapunov index, then the system is considered to be chaotic. If there is more than one positive Lyapunov index, then the system is hyperchaotic and has strong unpredictability.

[0075] In the subsequent tests of attractor trajectories and Lyapunov exponents, the 2D-Sinsinger chaotic function showed excellent chaotic performance.

[0076] Having passed the NIST randomness test, 2D-Sinsinger has strong complexity and unpredictability.

[0077] The initial key generation of the encryption method is defined as follows:

[0078] Convert the original color image into a byte stream as input, use SHA-512 to get 512 bits, use the first 240 bits as the security key, this security key will generate the initial conditions of 2D-Sinsinger, the initial conditions include {x0, y0, x1, y1, a}, divide the 240-bit security key into groups of 20 bits, {x0, y0} will use 5 groups, {x1, y1} will use 5 groups, {a} will use 2 groups. The 20 bits in each group are assumed to be {k1, k2, k3, ..., k 20} will generate decimal parameters according to the IEEE 754 standard: After generating a 240-bit security key, we can get 12 groups of keys by dividing them into groups of 20 bits, and use them to generate the required initial conditions.

[0079] The design, steps and definitions of the shuffling algorithm are as follows: Shuffling algorithm: Assume that there are a total of C cards (a multiple of three), then there will be a card dealing array Send of the corresponding size. Divide the array into three equal parts in order, assuming it is divided into [R1, R2, R3]. The number of R1, R2, and R3 is C / 3, which is the subarray of Send. At this time, there are almost equal numbers of 1, 2, 3, ( Figure 2The content of Lsend is 1, 2, 3. The number 1 represents sending the subarray to the R layer of the color image, 2 represents sending the subarray to the G layer of the color image, and 3 represents sending the subarray to the B layer of the color image. The number difference of each subarray 1, 2, and 3 does not exceed 2, which can ensure that the number of cards distributed to each person is almost uniform and equal. At the same time, there will be an Order array of size C to determine the order of dealing cards. This Order array is filled with C chaotic sequence values ​​generated by 2D-Sinsinger. The Order array is also divided into three equal parts [F1, F2, F3] in order. Finally, according to the size order of the F1, F2, F3 subarrays, the F1, F2, F3 arrays are arranged from small to large to obtain the index card dealing subarrays Q1, Q2, Q3, and according to Q1, Q2, Q3, R1, R2, R3 are rearranged to obtain P1, P2, P3 to form the card dealing array Lsend. At this time, the number of 1, 2, and 3 in the sub-arrays P1, P2, and P3 in Lsend is still almost equal, but the order is disrupted, so uniformity can be guaranteed. The cards will be dealt according to the numbers in the sub-arrays P1, P2, and P3 in the Lsend array as shown in the figure _, 1 corresponds to receiver No. 1, and 2 corresponds to receiver No. 2.

[0080] The shuffle algorithm is used to shuffle the R, G, B pixels based on the bit plane. The steps and definitions are as follows: the dimension of the color image is m×n×3, and the last dimension is composed of the three channels of R, G, and B. Each of the three channels of R, G, and B is converted into an array composed of 8 binary bits. At this time, the dimension of the color image becomes m×n×24. At this time, based on the third channel, 24 bit planes are obtained, which is equivalent to obtaining 24 m×n×1 "cards". At this time, the three channels of R, G, and B are regarded as receivers. The chaotic sequence generated by the shuffle algorithm and the initial values ​​x0 and y0 generated by the key can be used to obtain a Lsend array of size 24. At this time, 8 m×n×1 "cards" are redistributed to each channel of R, G, and B according to the Lsend array. Finally, each channel is combined to obtain an image with different pixel values ​​from the original color image. As shown in the figure, the cards are dealt in order from left to right. At this time, the pixel layers of the original three channels are shuffled and mixed together, and it can be seen that each channel is a uniform combination of pixel cards. This means that if you want to restore the original image, you need the cooperation of three single-channel images of R, G, and B. Even if you crack the single-layer image, you cannot get the correct pixel statistics. Therefore, the R, G, B pixel shuffle undoubtedly increases the difficulty for crackers to crack the chaotic encryption system. Compared with the previous encryption process, SinsingerIE can provide more secure encryption protection.

[0081] The shuffling algorithm is used to shuffle the R, G, and B regions. The steps and definitions are as follows: the statistical information of the pixel values ​​is hidden, but the attacker can still obtain the correct region contour information from the image, so the R, G, and B region shuffle is designed to shuffle the three layers of regions. Assuming that the dimension of the color image is m×n×3, taking the second dimension as the basis, it is equivalent to a channel having n columns of m*1 pixel strips. There are 3n pixel strips in total for the three channels of R, G, and B. These 3n pixel strips are regarded as "cards". The shuffling algorithm is used to assign the 3n pixel strips to the three channels of R, G, and B according to the Lsend array generated by the shuffling algorithm. In this way, a three-channel color image E with three layers of pixel regions mixed together is obtained. The obtained color image E is rotated 90 degrees and then assigned according to the Lsend array. The rotation shuffle is performed about twenty times to achieve the same effect as the original classic obfuscation process.

[0082] A diffusion formula is designed to perform bit diffusion. The steps and definitions are as follows: After cross-layer shuffling of R, G, and B, a three-layer mixed encrypted image with hidden pixel information and regional information is obtained. Although the pixel statistics of the encrypted image obtained at this time are wrong compared with the original image, its pixel statistics are uniform to resist the differential attack mentioned later. Therefore, a diffusion process is introduced. Assuming that the dimension of the color image P obtained after shuffling is m×n×3, the {x1, y1, a} generated by the key group is used as the initial value of 2D-Sinsinger to generate matrices C1 and C2 of the same size as the image. The diffusion formula is used to diffuse each channel of P. Although the three channels are diffused separately here, because each channel of P obtained after the previous shuffling process is composed of a mixture of elements of the three channels of the original image, it is equivalent to diffusing the three channels mixed at this time. Therefore, the attacker cannot obtain any useful pixel statistics by breaking a single channel. The three channels must be cracked to obtain the original shuffled P.

[0083] The security, robustness, correlation and local Shannon entropy analysis of SinsingerIE are characterized in that the steps and definitions are as follows: For the sensitivity of key changes, for the encryption algorithm, the two images encrypted using the original key and the slightly changed key should be very different. For the decryption algorithm, the correct image can be obtained by decrypting with the correct key, but if the slightly changed key is used, a completely wrong image should be obtained. The image encryption and decryption algorithm should have a certain ability to resist noise and image loss. The stronger this ability is, the stronger the robustness of the encryption algorithm is. Gaussian noise is added to verify the analysis. The pixel histogram of the image after SinsingerIE diffusion is uniform. To prove this, the chi-square test is used to verify this. The actual distribution is the actual statistical value obtained from the pixel histogram, the expected distribution is uniform distribution, the null hypothesis (H0) is that the two distributions are not related, the alternative hypothesis (H1) is that the two distributions are strongly related, the larger the chi-square value, the greater the difference between the two distributions, the smaller the chi-square value, the smaller the difference between the two distributions, and if P-Value<0.05, then the null hypothesis is rejected, otherwise the null hypothesis is accepted. In order to test the correlation of the ciphertext image encrypted by SinsingerIE, 3000 pairs of adjacent pixel values ​​are selected from the horizontal, vertical, and diagonal directions of the plaintext image, and the graph is plotted and the formula is used Calculate the correlation, where X, Y are two input vectors, μ X is the mean of the x vector, μ Y is the mean of y, σ X is the standard deviation of vector X, σ Y is the standard deviation of vector Y. Entropy is a measure of the degree of information disorder. The greater the randomness of the information, the greater the entropy. Local Shannon entropy (LSE) is often used to evaluate the randomness of a ciphertext image obtained by an encryption algorithm. The specific method is to randomly select n non-overlapping regions T, each with e pixel blocks, calculate the Shannon entropy of each region Ti, and finally take the mean of the sum of the Shannon entropies of all regions.

[0084]

[0085] Where n represents the number of randomly selected area blocks, each area is represented by T, e represents the number of pixel blocks contained in an area block, H(T i ) represents the information entropy of the i-th block, T i There are e pixel values ​​in the block. Count the number of times each pixel value appears and divide it by e. The probability is estimated by frequency to get P(t k ), t k Represents the pixel value of the current pixel block.

[0086] The one-dimensional Singer chaotic map is defined as follows:

[0087]

[0088] where μ is a hyperparameter, x k is the input value, x k+1 is the output value. The Singer chaotic map has good randomness and ergodicity. Based on the one-dimensional Singer chaotic map, the 2D-Sinsinger chaotic map is constructed:

[0089]

[0090] 2D-Sinsinger Chaos Performance Analysis

[0091] Attractor analysis: Attractor refers to a system tending to a certain steady state, which is called an attractor. Since chaotic functions are easily affected by the value of the initial point, they have the characteristic of great uncertainty.

[0092] For two-dimensional chaotic functions, we can study them intuitively through their two-dimensional scatter plots. Figure 5 The scatter plots of six two-dimensional chaotic functions, each consisting of 40,000 points, show that a good chaotic function should have good ergodicity, and the designed 2D-sinsinger chaotic function ( Figure 5 (f)) can cover the entire range from -1 to 1 very well, has good traversability, and can generate unpredictable sequences.

[0093] NIST randomness test, using 2D-Sinsinger chaotic function at the starting point, generate chaotic sequences x and y with 4000000 elements, set the element value greater than 0 to 1, and the element value less than 0 to 1 to obtain two 3907KB txt files consisting of 01 sequences. These sequences are subjected to NIST test. As can be seen in Table 1, the p-value of all test items is greater than 0.01, and 2D-Sinsinger has passed the NIST randomness test.

[0094] The Lyapunov exponent (LE) is a value that characterizes the separation rate between infinitely close trajectories in a dynamic system. It is used to evaluate whether a system has chaotic characteristics. Different separation directions of the initial separation vector may have different separation rates.

[0095] If a system has a positive Lyapunov exponent, then the system is considered chaotic. If there is more than one positive Lyapunov exponent, then the system is hyperchaotic and has strong unpredictability.

[0096] from Figure 6 It can be seen that the 2D-Sinsinger chaotic function has two positive Lyapunov exponents, so the function is hyperchaotic. This means that the 2D-Sinsinger function has strong unpredictability and is suitable for generating chaotic sequences. This was also proven by the NIST test later.

[0097] Color image encryption and decryption algorithm based on 2D-Sinsinger

[0098] Initial key generation

[0099] Convert the original color image into a byte stream as input, use SHA-512 to get 512 bits, use the first 240 bits as the security key, this security key will generate the initial conditions of 2D-Sinsinger, the initial conditions include {x0, y0, x1, y1, a}, divide the 240-bit security key into groups of 20 bits, {x0, y0} will use 5 groups, {x1, y1} will use 5 groups, {a} will use 2 groups.

[0100] The 20 bits in each group are assumed to be {k1, k2, k3, ..., k 20} will generate decimal parameters according to the IEEE 754 standard:

[0101]

[0102] Since a 240-bit security key is generated, 12 groups of keys will be obtained in groups of 20 bits. Use them to generate the required initial conditions:

[0103]

[0104] like Figure 3 As shown, three keys K1, K2, and K3 are used, where K2 differs from K1 by only one bit, K3 differs from K1 by only one bit, and K2 and K3 are different. The original image is set to image a, and the following operations are performed: Encrypt with K1 to obtain image b, encrypt with K2 to obtain image c, and subtract b from c to obtain image d. Use K1's key to decrypt image b encrypted by K1 to obtain image e, use K2 to decrypt image b encrypted by K1 to obtain image f, use K3 to decrypt image b encrypted by K1 to obtain image g, and subtract image f decrypted by K2 from image g decrypted by K3 to obtain image h.

[0105] It can be seen that the image c obtained by subtracting the image encrypted with a security key with a one-bit difference shows that the two encrypted images are completely different. From image d, we can see that the correct image is obtained by decrypting with the correct key, and from e, we can see that a completely wrong image is obtained by decrypting with an incorrect key with a one-bit difference. And from image g obtained by subtracting the image decrypted with two incorrect keys K2 and K3, we can also see that the two are completely different.

[0106] Shuffling Algorithm

[0107] Algorithm 1: Shuffling Algorithm

[0108] Input: number C (a multiple of three), chaotic matrices X, Y whose number of elements is greater than C.

[0109] Output: Lsend array.

[0110] The Send array of size C is divided into three equal parts to obtain sub-arrays R1, R2, and R3. The sub-arrays are initialized according to the formula ().

[0111] Get the CXY matrix, CXY = X × Y, convert CXY into a one-dimensional matrix, and take the first C elements to get the Order array,

[0112] Divide the Order array into three equal parts to get sub-arrays F1, F2, and F3. Arrange F1, F2, and F3 in ascending order to get index matrices Q1, Q2, and Q3.

[0113] R1, R2, R3 are rearranged according to the Q1, Q2, Q3 arrays respectively and the rearranged R1, R2, R3 are combined to obtain the Lsend array.

[0114]

[0115] Among them, the number of cards is C, R i,j It means that i represents the i-th sub-array. The sub-arrays are R1, R2, R3, j is the serial number inside the sub-array, [C / 9] refers to the rounded value of C / 9, and % is the remainder symbol.

[0116] R, G, B pixel shuffling based on bit plane

[0117] Convert each of the three channels R, G, and B into an array of 8-bit binary bits. The dimension of the color image then becomes m×n×24. Taking the third channel as the basis, we get 24 bit planes, which is equivalent to getting 24 m×n×1 "cards".

[0118] At this time, the three channels R, G, and B are regarded as card receivers. We can use the chaotic sequence generated by the shuffling algorithm and the initial values ​​x0 and y0 generated by the key to obtain an Lsend array of size 24. At this time, 8 m×n×1 "cards" are redistributed to the three channels R, G, and B according to the Lsend array. Finally, by combining each channel, we can get an image with different pixel values ​​from the original color image.

[0119] R,G,B area shuffle

[0120] Algorithm 2: Region Shuffle Algorithm

[0121] Input: image E, confusion matrices X and Y generated by x0 and y0. The size of image E is n×n×3. The size of confusion matrices X and Y is the same and the number of elements is greater than 3×n.

[0122] Output: Image F.

[0123] Using the shuffling algorithm (Algorithm 1), the input is 3×n and the chaotic matrix X, Y to obtain the card distribution array Lsend of size 3×n.

[0124] In the order of channels, we use each column (the second dimension) as the basis to stitch the three channels together. This is equivalent to having a matrix D consisting of 3×n n×1 arrays with a size of n×3×n×1.

[0125] Based on the columns of D (the second dimension), D is reallocated according to the order in the Lsend array. If the element at the current position in Lsend is 1, it means that the n×1 array at the current position will be sent to the R channel. Similarly, if the current value in Lsend is 2 or 3, it means that the current column will be sent to the G or B channel. Finally, the matrix F is obtained by recombining the three layers of R, G, and B columns, with a size of n×n×3.

[0126] According to the Q1, Q2, Q3 arrays, R1, R2, R3 are rearranged respectively and the rearranged R1, R2, R3 are combined to obtain the Lsend array.

[0127] Using the shuffle algorithm, we get a three-channel color image E with three layers of pixel areas mixed together. After rotating the obtained color image E by 90 degrees, we distribute it according to the Lsend array. Repeating the shuffle rotation process twenty times can achieve the same effect as the original classic obfuscation process. Figure 2 This is a schematic diagram of regional shuffling.

[0128] Diffusion process:

[0129] Diffusion formula (6): 2D-Sinsinger can generate two chaotic matrices X and Y of corresponding image sizes at one time. C1 is the chaotic matrix X transformed into a one-dimensional array by substituting the initial value {x1, y1} into 2D-Sinsinger. When C1 is used, Y is transformed into a one-dimensional array. P(i) is the image to be diffused, which is transformed into a one-dimensional array. Finally, the dimension of the generated D(i) is transformed back into the dimension of the color image to obtain the diffused image:

[0130]

[0131] like Figure 4 As shown, the encrypted image is added with a: 1% Gaussian noise b: 2% Gaussian noise c: 5% missing d: 15% missing e: 15% random position missing analysis.

Claims

1. A cross-layer uniform shuffling color image encryption method based on chaos theory, characterized in that: The following steps are involved: Use one-dimensional Singer chaotic function to construct 2D-Sinsinger chaotic function; Generate the initial key using 2D-Sinsinger chaotic function; Design a shuffling algorithm using 2D-Sinsinger; Use the shuffle algorithm to shuffle R, G, and B pixels based on the bit plane; Use the shuffling algorithm to shuffle the R, G, and B areas; According to the initial secret key generated by the 2D-Sinsinger chaotic function, bit diffusion is performed to complete the encryption of the color image.

2. According to the chaos theory-based cross-layer uniform shuffling color image encryption method of claim 1, it is characterized in that: The 2D-Sinsinger chaos function is as follows: Among them, a is a hyperparameter, x n ,y n is the input sequence value, x n+1 ,y n+1 is the output sequence value.

3. According to the chaos theory-based cross-layer uniform shuffling color image encryption method of claim 1, it is characterized in that: The 2D-Sinsinger chaotic function is evaluated by randomness test, specifically: Among them, x i It uses the chaotic function x n+1 =f(x n ) is the sequence value generated by, i = 1, 2, 3, ..., n; x0 is the starting point, LE(x0) is the value of the Lyapunov exponent at x0; When the Lyapunov exponent is positive, the chaotic function is unpredictable; otherwise, it is predictable.

4. According to the chaos theory-based cross-layer uniform shuffling color image encryption method of claim 1, it is characterized in that: The method of generating an initial key by using a 2D-Sinsinger chaotic function comprises the following steps: The original color image is converted into a byte stream as input, and SHA-512 is used to obtain 512 bits. The first 240 bits are divided into groups of 20 bits, {x0, y0} and {x1, y1} use 5 groups, and {a} uses 2 groups; each group of 20 bits is {k1, k2, k3, ..., k 20 Generate decimal parameters according to the IEEE 754 standard: Generate a 240-bit security key, get 12 groups of keys in groups of 20, and generate the initial conditions {x0, y0, x1, y1, a} of the 2D-Sinsinger: Among them, {x0, y0} and {x1, y1} represent two different initial input values ​​of the 2D-Sinsinger chaotic function, and a is a hyperparameter.

5. According to the chaos theory-based cross-layer uniform shuffling color image encryption method of claim 1, it is characterized in that: The shuffling algorithm designed by using 2D-Sinsinger includes the following steps: Set the number of cards to be a multiple of 3 C, and get the corresponding size of the card array Lsend; Divide the array into three equal parts in order [R1, R2, R3], where the number of R1, R2, and R3 is C / 3, which is the subarray of Lsend. At this time, there are equal numbers of 1, 2, and 3 in the subarrays R1, R2, and R3; the difference between the numbers of 1, 2, and 3 in each subarray is no more than 2, to ensure that the number of cards distributed at the end is uniform and equal; At the same time, the order of dealing cards is determined by an Order array of size C, wherein the Order array is filled with C chaotic sequences generated by a 2D-Sinsinger chaotic function according to initial conditions {x0, y0, a}, and the Order array is also divided into three equal parts [F1, F2, F3] in order, and finally, the F1, F2, F3 arrays are arranged from small to large according to the size order in the F1, F2, F3 sub-arrays to obtain indexed card dealing sub-arrays Q1, Q2, Q3, and R1, R2, R3 are rearranged according to Q1, Q2, Q3 to obtain P1, P2, P3 to form a card dealing array Lsend; cards are dealt according to the numbers in the P1, P2, P3 sub-arrays in the Lsend array, and 1, 2, 3 correspond to receiver No. 1, receiver No. 2, receiver No. 3, respectively.

6. The method for cross-layer uniform shuffling color image encryption based on chaos theory according to claim 1 is characterized in that: The method of using the shuffling algorithm to shuffle R, G, and B pixels based on the bit plane comprises the following steps: For a color image with a dimension of m×n×3, the last dimension is composed of three channels: R, G, and B. Each of the three channels is converted into an array of 8-bit binary bits, and the dimension of the color image becomes m×n×24. At this time, taking the third channel as the reference, 24 bit planes are obtained, which is equivalent to obtaining 24 m×n×1 cards; At this time, the three channels R, G, and B are regarded as card receivers, and the chaotic sequence generated by the 2D-Sinsinger chaotic function and the initial values ​​x0, y0 generated by the key is used to obtain the Lsend array of size 24. At this time, 8 m×n×1 cards are redistributed to each channel of R, G, and B according to the Lsend array; finally, each channel is combined to obtain an image with different pixel values ​​from the original color image.

7. The method for cross-layer uniform shuffling color image encryption based on chaos theory according to claim 6 is characterized in that: The method of shuffling the R, G, and B regions using a shuffling algorithm comprises the following steps: For a color image with a dimension of m×n×3, taking the second dimension as the basis, it is equivalent to a channel having n columns of m*1 pixel strips, and the three channels of R, G, and B have a total of 3n pixel strips. The 3n pixel strips are regarded as cards, and the shuffle algorithm is used to assign the 3n pixel strips to the three channels of R, G, and B according to the Lsend array generated by the shuffle algorithm, and a three-channel color image E with three layers of pixel areas mixed in a shuffled manner is obtained; The color image E is rotated 90 degrees and then distributed according to the Lsend array. The rotation and distribution steps are repeated multiple times to obtain a three-layer mixed encrypted image P that hides pixel information and region information.

8. The method for cross-layer uniform shuffling color image encryption based on chaos theory according to claim 6 is characterized in that: The initial key generated according to the 2D-Sinsinger chaotic function is subjected to bit diffusion, comprising the following steps: For the color image P with a dimension of m×n×3 obtained after shuffling, the {x1, y1, a} generated by the key group is used as the initial value, and the matrices C1 and C2 of the same size as the three-dimensional color image P are generated through the 2D-Sinsinger chaotic function. Each channel of the color image P is diffused using the following diffusion formula: The initial values ​​{x1, y1} are substituted into the 2D-Sinsinger chaotic function to obtain the chaotic matrices X and Y; C1 is the array after the chaotic matrix X is transformed into one dimension, and C2 is the array after the chaotic matrix Y is transformed into one dimension; P(i) is the array after the image to be diffused is transformed into one dimension, and D(i) is the image after diffusion; i represents the i-th sequence value after the transformation into a one-dimensional array; floor represents rounding down, bitxor represents exclusive OR operation, and mod represents modulus calculation.

9. The method for cross-layer uniform shuffling color image encryption based on chaos theory according to claim 1 is characterized in that: Verify the encryption process, including the following steps: Select N pairs of adjacent pixels from the horizontal, vertical, and diagonal directions of the plaintext image, draw a graph, and use the formula Calculate the correlation, where X and Y are two input vectors, representing the chaotic matrices X and Y, respectively, and μ X is the mean of the x vector, μ Y is the mean of y, σ X is the standard deviation of vector X, σ Y is the standard deviation of vector Y; Randomly select n non-overlapping regions T, each with e pixel blocks, calculate the Shannon entropy of each region Ti, and finally take the mean value H of the sum of the Shannon entropies of all regions n,e (T): Where n represents the number of randomly selected blocks, H(T i ) represents the information entropy of the i-th block, T i There are e pixel values ​​in the block. The number of times each pixel value appears is counted and divided by e to get the frequency estimation probability P(t k ), t k Represents the pixel value of the current pixel block; When the correlation I XY With the mean H n,e (T) are all within the set range, indicating that the color image encryption method can be adopted.

10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, a cross-layer uniform shuffling color image encryption method based on chaos theory is implemented.