A Color Image Encryption Method Based on a Four-Dimensional Memristive Hyperchaotic System
Through the color image encryption method based on the four-dimensional memristor superchaotic system, the traditional algorithm has solved the shortcomings in digital image encryption efficiency, and achieved high security and high efficiency image encryption effect.
Patent Information
- Application Number
- CN202111680373.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-12-30
AI Technical Summary
Traditional text encryption algorithms are not efficient when processing digital images, and due to the large amount of data and high pixel redundancy, it is difficult to meet the needs of information security.
A color image encryption method based on the four-dimensional memristor superchaotic system is adopted. By constructing the four-dimensional memristor superchaotic system and discretizing it, the initial value is generated by combining the SHA-512 algorithm, and the image permutation and diffusion operation is used to design a new encryption algorithm.
Improves the security and efficiency of image encryption, reduces the correlation of adjacent pixels, and enhances the ability to resist statistical and differential attacks.
Smart Images

Figure CN114529440B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a color image encryption method, and specifically to a color image encryption method based on a memristive hyperchaotic system. Background Art
[0002] With the development of mobile Internet and 5G technology, society has entered the big data era. The efficiency of information exchange has been greatly improved, and at the same time, information security is facing great challenges. Digital images have been widely used on the Internet due to their characteristics such as easy storage and vivid information expression. Therefore, the encryption processing and secure communication of images have attracted the attention and research of scholars.
[0003] Although traditional text encryption algorithms have sufficient security, due to the large data volume of digital images, high pixel redundancy, and high correlation between adjacent pixels, traditional algorithms perform poorly in image encryption efficiency. Chaotic systems are extremely sensitive to initial values and parameters. The chaotic sequences generated by them are non-periodic signals and have good pseudo-randomness, which can be used to design pseudo-random number generators. In addition, chaotic sequences can be used as the key stream of image encryption algorithms to improve the efficiency and security of information encryption. Summary of the Invention
[0004] In view of the deficiencies of the prior art, the present invention provides a color image encryption method based on a four-dimensional memristive hyperchaotic system. The encryption process includes the following steps:
[0005] S1: Construct a four-dimensional memristive hyperchaotic system and discretize the system. Among them, the expression of the chaotic system is:
[0006]
[0007] Among them, G(w) is the memductance value of a three-valued memristor, and the expression is:
[0008]
[0009] Among them, x, y, z, and w are system state variables, and a, b, c, d, a0, b0, c0, and d0 are system parameters. Using the Euler method to discretize it, we can get:
[0010]
[0011] S2: Read the color plaintext image information, split the color image to be encrypted into three primary color component matrices, and group them according to R, G, and B to obtain three M*N matrices. Where M represents the number of rows of the matrix, and N is the number of columns of the matrix.
[0012] S3: The initial value [x0, y0, z0, w0] containing the plaintext information is obtained through the SHA-512 algorithm; the initial value is combined with the discrete memristor hyperchaotic system for iteration to obtain the hyperchaotic sequence [X, Y, Z, W].
[0013] S4: Preprocess the hyperchaotic sequence, including amplification, rounding and remainder operations, so that the chaotic sequence can be applied to image data. Sequences X and Z are processed using formula (4) to obtain the key sequence S r 、S c and S z .
[0014]
[0015] S5: Use the key sequence to encrypt the three channels of the color plaintext image R, G, and B respectively. First, use the key sequence S r The index sequence is obtained through the Hash table structure, and the rows in the pixel matrix of the image are permuted at the pixel level through the index sequence, and then the bit level is permuted, and the key sequence S is used. z The diffusion method based on the Hilbert curve continues to diffuse the row until every row is traversed. Then, the key sequence S is used c The index sequence is obtained through the Hash table structure, and the columns in the pixel matrix of the image are permuted at the pixel level through the index sequence, and then the bit level is permuted, and the key sequence S is used. z The diffusion method based on the Hilbert curve continues to diffuse the column until every column is traversed. The operations for rows and columns are similar.
[0016] Taking R channel operation as an example, the specific steps are as follows:
[0017] (1) First, the initial value [x0, y0, z0, w0] containing the plaintext information is obtained by the SHA-512 algorithm, and the hyperchaotic sequence is obtained by combining the discrete hyperchaotic system, and the hyperchaotic sequence that matches the image data scale is extracted from it. The key sequence S is obtained after preprocessing the chaotic sequence. r 、S c and S z .
[0018] (2) Secondly, design the replacement operation. Process S r and S c Repeated values, get the Hash table index sequence x r and x c , used for row and column operations respectively. Using index sequence x r The first row of the image is permuted at the pixel level, followed by the bit level permutation.
[0019] (3) Again, design the diffusion operation. Use the ergodic matrix of the Hilbert curve to calculate the sequence S z Rearrange and get sequence S h Using sequence S h Perform diffusion operation on the rows in the matrix, traversing each row of the image in turn.
[0020] (4) After pixel-level permutation, bit-level permutation, and diffusion operations are performed on each row of the image matrix, column operations are performed, and the process is similar to row operations.
[0021] This paper designs a new image encryption algorithm using a hyperchaotic system based on ternary memristors. Multi-valued memristors have strong nonlinearity, and using them to construct a new hyperchaotic system will produce sequences with higher randomness, which is beneficial for improving the security of chaotic encryption algorithms. Furthermore, during the algorithm design, the initial key contains the hash value of the original image. By introducing a hash table structure and Hilbert curve, image permutation and diffusion operations are performed, making the relationship between plaintext, ciphertext, and key more complex. Using fractal proof, the algorithm achieves both high security and high efficiency. Therefore, this algorithm has high theoretical and practical value. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 Schematic diagram of the encryption process in an embodiment of the present invention;
[0023] Figure 2 is a phase diagram of a memristive hyperchaotic system in an embodiment of the present invention;
[0024] Figure 3 is a phase diagram of a discretized memristive hyperchaotic system in an embodiment of the present invention;
[0025] Figure 4 This is a Hash representation in the embodiment of the present invention;
[0026] Figure 5 is a schematic diagram of a Hlibert curve in an embodiment of the present invention;
[0027] Figure 6 are the color image to be encrypted, the encrypted image, and the decrypted image in the embodiment of the present invention;
[0028] Figure 7 is the histogram of the encrypted image and the original image;
[0029] Figure 8 is the adjacent pixel correlation between the original image and the encrypted image;
[0030] Figure 9 are the NPCR and UACI indicators of the algorithm; Detailed implementation manners
[0031] In order to make the technical solutions and advantages of the present invention clearer and more understandable, the present invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0032] As Figure 1 shown, the present invention proposes a color image encryption method based on a memristive hyperchaotic system. The encryption process includes the following steps:
[0033] S1: Construct a four-dimensional hyperchaotic system, and its expression is:
[0034]
[0035] wherein, G(w) is the memductance value of a three-valued memristor, and the expression is:
[0036]
[0037] wherein, x, y, z, and w are system state variables, and a, b, c, d, a0, b0, c0, and d0 are system parameters. The system phase diagram in the x-y plane is as Figure 2 shown in a of Figure 2 the phase diagram in the x-z plane is as Figure 2 shown in b of
[0038] The discretized hyperchaotic system is easier to implement on a digital software platform. The Euler method is used to discretize the system. The Euler algorithm is implemented according to the definition of the derivative. When Δt→0 or a smaller value is taken, the definition of the derivative can be approximately expressed as shown in Equation (7).
[0039]
[0040] Substituting Equation (7) into Equation (5), the expression of the discretized system can be obtained as shown in Equation (8).
[0041]
[0042] wherein, Δt is the sampling interval, and in this paper, Δt = 0.001 is taken. Other parameters remain unchanged. The phase diagram of the discretized system in the x-y plane is as Figure 3 shown in a of Figure 3 the phase diagram in the x-z plane is as Figure 3 shown in b of
[0043] S2: Read the information of the color plaintext image, split the color image to be encrypted into three primary color component matrices, and group them according to RGB to obtain three matrices with M rows and N columns.
[0044] Specifically, in this embodiment, the image used is a 256*256 color Lena image as the test image, as shown in Figure 6 a shown.
[0045] S3: Obtain the initial value [x0, y0, z0, w0] containing the plaintext information through the SHA-512 algorithm. Combine the initial value with the discrete memristive hyperchaotic system for iteration to obtain a hyperchaotic sequence.
[0046] Specifically, use the SHA-512 algorithm to obtain 64 8-bit integer Hash values H of the plaintext image, as shown in Equation (9).
[0047]
[0048] The processing of matrix H is as follows:
[0049] Take out the first row [h1, h2, h3, h4] of the matrix. If the first element of the next row is even, directly perform an exclusive OR operation with the corresponding elements of the next row; if the first element of the next row is odd, first flip the next row left and right, and then perform an exclusive OR operation with the corresponding elements to obtain the scrambled values k1, k2, k3, and k4. Then, determine the initial value [x0, y0, z0, w0] of the discrete system through Equation (10).
[0050]
[0051] Substitute [x0, y0, z0, w0] into Equation (8), and set the number of iterations to M*N*O + L to obtain the hyperchaotic sequence [X, Y, Z, W]. Among them, M is the number of rows of the image pixel matrix, N is the number of columns of the matrix, O is the number of channels of the matrix, L is the number of iterations to be discarded, and L = 60000. The selection of M, N, and O makes the length of the hyperchaotic sequence match the scale of the image data.
[0052] S4: Preprocess the hyperchaotic sequence, including amplification, rounding, and taking the remainder operations, so that the chaotic sequence can be applied to image data to obtain a key sequence.
[0053] Specifically, process sequences X and Z using Equation (11) to obtain the key sequences S r 、S c and S z .
[0054]
[0055] S5: Encrypt the three channels of the color plaintext image R, G, and B respectively using the key sequence. For each channel, perform row operations and column operations on the image matrix. The operations on the three channels are similar, and the row and column operations are similar.
[0056] Specifically, the operation method for encryption is as follows:
[0057] (1) Hash table data structure. Its structure is implemented based on three components, namely the keyword k, the Hash function f, and the storage table M, as Figure 4 shown in a. Among them, a1, a2,..., a n are the values of k, and 1, 2,..., n are the storage indices of the table M. The specific implementation process is as follows: Given any keyword k and substitute it into the function f(k) to obtain the index value of k in the table M, and finally store k in the corresponding index position. To prevent the phenomenon of duplicate index values in M, the closed column algorithm is used for deduplication. Specifically, as Figure 4 shown in b, for an integer sequence x of length 15, the ultimate goal is to place the integers from 1 to 15 in 15 positions so that there are no duplicate values in the sequence. First, find the duplicate values in the sequence x and set them to -1, indicating free positions, as Figure 4 shown in c; secondly, create a sequence N of the same size as x. If the index value i of N appears in x, fill the corresponding position in N with the number 1, otherwise fill it with 0, as Figure 4 shown in d; finally, find the missing index values in x and fill them into the sequence p, and then fill p into x to obtain the index sequence x H without duplicate values, as Figure 4 shown in e.
[0058] (2) Hilbert curve. This curve can continuously traverse all the points in a square grid, as Figure 5 shown in a. By controlling the position and direction of the starting point of the curve for combination, its subsequent direction can be determined, and at the same time, the order of traversing the space points is determined. Through this method, eight initial curves are obtained, that is, eight first-order Hilbert curves, as Figure 5 shown in b. Taking the two initial curves ① and ⑤ shown in Figure 5 b as an example and using the Hilbert curve generation algorithm based on matrix operations, two 5th-order Hilbert curves (32×32) are obtained, as Figure 5 shown in c and Figure 5 shown in d.
[0059] Specifically in implementation, the preprocessed hyperchaotic sequences S r , S c and S z are used. S rWill be used for the permutation operation of image row pixels, S c For the permutation operation of column pixels, S z For the diffusion operation of pixels.
[0060] Furthermore, taking the R-channel row operation as an example, the specific operation method is as follows:
[0061] (1) Pixel-level permutation operation. According to the scale of the image data, the key sequence S in Equation (11) r is block-processed, that is The permutation operation corresponding to each row. Secondly, use the Hash table data structure to process the block-processed key sequence to obtain a non-repeating index sequence Use the new index value to perform pixel-level permutation on each row of pixels. As shown in Equation (12).
[0062]
[0063] Among them, j = 1, 2, 3, …, M×N×O, representing the j-th row sequence, i = 1, 2, 3, …, N, representing the i-th element of this sequence. In addition, k is the new index value, P is the plaintext image sequence, and A is the permuted sequence.
[0064] (2) Bit-level permutation operation. After the pixel-level permutation of each row is completed, the bit-level permutation of that row is immediately performed. For the first row of pixels, first take the modulo of the first number of the row index sequence x r 1 by 8 to obtain the number of bits for circular shift, and then perform bit-level circular shift on each pixel of that row, as shown in Equation (13).
[0065]
[0066] Among them, t represents the number of bits for circular shift, A 1 is the sequence after pixel-level permutation, B 1 is the sequence after bit-level permutation, circshift(·) is the circular shift function, used to circularly shift the bits of each element in the sequence A 1 to the right by t bits.
[0067] For the j-th row of pixels other than the first row, first take the modulo of the first index value of its index sequence x r j by 256; secondly, perform an exclusive OR operation with the pixel point corresponding to this index value in the previous row; then, take the modulo of the result by 8 to obtain the number of bits for circular shift; finally, perform bit-level circular shift. The algorithm flow is shown in Equation (14), where s represents the intermediate data.
[0068]
[0069] (3) Diffusion operation. Use the traversal matrix of the Hilbert curve as the index sequence to reorder the key sequence S in Equation (11) z and use the new sequence for the diffusion operation.
[0070] First, determine the order of the Hilbert curve according to the scale of the image data. If the image size is M×N×O, the order of the required Hilbert curve can be calculated by Equation (15).
[0071]
[0072] where s represents intermediate data, ceil(·) represents rounding up, and e is the order of the required Hilbert curve.
[0073] Secondly, select an initial curve from Figure 5 . The selection method is as follows: Take the modulo operation of the first number S of the key sequence S z with 8 and add 1 to the result to obtain an integer from 1 to 8, corresponding to z (1) the eight initial curves in Figure 8 .
[0074] Thirdly, obtain the e-order Hilbert curve from the initial curve and convert the traversal matrix of the curve into a sequence H with a size of 1×4 e . Discard the elements in the sequence H that are greater than M×N×O to obtain the index sequence, and use the index sequence to reorder the key sequence S z to obtain a new sequence S h for the diffusion operation.
[0075] Finally, perform the diffusion operation. Since the row operation and column operation of diffusion encryption are similar, only the row operation is taken as an example here. Before the diffusion operation, the key sequence S h should be block-processed, that is Let the image sequence of the j-th row be P j , and its corresponding key sequence be S h j . If it is the first row of pixels, directly perform exclusive OR with the sequence S h 1 to obtain the ciphertext sequence C1 of the first row; if it is the pixels of the j-th row other than the first row, first perform exclusive OR with the ciphertext sequence of the previous row, and then perform exclusive OR with the sequence S h j to obtain the ciphertext sequence C j of the j-th row. This process is shown in Equation (16).
[0076]
[0077] It should be noted that after the pixel-level permutation of the first row of the image pixel matrix, the bit-level permutation is immediately performed, and the diffusion operation continues, and then the operation of the next row is performed until each row of the matrix is traversed. After the row operation is completed, the column operation is performed, and the column operation is similar to the row operation. After the operation of the R channel is completed, the operations of the G and B channels are performed. The operation methods of the R, G, and B channels are similar. In addition, the decryption process of the image is the inverse operation of the encryption process.
[0078] In the embodiment of the present invention, a 256*256 color Lena image is selected as the test image, where Figure 6 a in it is the image to be encrypted, Figure 6 b in it is the encrypted image, Figure 6 c in it is the decrypted image. Figure 7 This is the histogram analysis result of the present encryption method, where Figure 7 a in it is the histogram of the R channel of the original image, Figure 7 b in it is the histogram of the G channel of the original image, Figure 7 c in it is the histogram of the B channel of the original image, Figure 7 d in it is the histogram of the R channel of the encrypted image, Figure 7 e in it is the histogram of the G channel of the encrypted image, Figure 7 f in it is the histogram of the B channel of the original image. Obviously, it can be seen from the figure that the pixels of the encrypted image are messy and have no rules, and the decrypted image is exactly the same as the original image, indicating that the present invention has a good effect.
[0079] In order to prevent attackers from cracking the ciphertext image using statistical means, the encryption algorithm needs to reduce the correlation between adjacent pixels in the digital image. The correlation between adjacent pixels of the original image and the ciphertext image in the horizontal, vertical, and diagonal directions is calculated by Equation (17), where 10,000 adjacent pixel pairs are randomly selected each time the calculation is performed.
[0080]
[0081] Among them, x and y represent adjacent pixel pairs, N = 10,000, representing the number of randomly selected pixel pairs, and ρ xy is the correlation coefficient. Among them, Figure 8 a in it is the pixel distribution result of the original image in the horizontal direction, Figure 8 b in it is the pixel distribution result of the original image in the vertical direction, Figure 8 c in it is the pixel distribution result of the original image in the diagonal direction, Figure 8 d in it is the pixel distribution result of the encrypted image in the horizontal direction, Figure 8 e in it is the pixel distribution result of the encrypted image in the vertical direction,Figure 8 Among them, f is the result of the pixel distribution in the diagonal direction of the encrypted image. The pixel values of adjacent pixels in the encrypted image are uniformly and densely distributed on the entire plane, showing random characteristics and almost no correlation. Therefore, the present invention has good anti-statistical attack performance.
[0082] To resist differential attacks, the sensitivity of the encryption algorithm to the plaintext needs to be high enough. Two indicators, namely the number of pixel change rate (NPCR) and the normalized average change intensity (UACI), are used to test the performance of the present invention in differential attacks. NPCR represents the change rate of pixel points in its ciphertext image, and the ideal value is 99.6049%, while UACI represents the change intensity of pixel values in the ciphertext image, and the ideal value is 33.4635%. Their calculation methods are shown in Equation (18):
[0083]
[0084] Where C1(i,j,k) and C2(i,j,k) respectively represent the pixel values of two ciphertext images at the coordinate (i,j,k). 100 pixel points are randomly selected in the original image, and only the pixel value of one pixel point is changed each time, and the NPCR and UACI of the corresponding ciphertext image are calculated. The 100 groups of test results obtained are plotted into a curve graph. As Figure 9 shown in a, the value of NPCR fluctuates around 99.6%, and as Figure 9 shown in b, the value of UACI fluctuates around 33.46%, which is very close to their ideal values. Therefore, the test results show that the encryption algorithm has strong anti-differential attack ability.
[0085] It can be seen from the above embodiments that the new encryption algorithm proposed by the present invention has high security for the encryption effect of color images and has broad application prospects in information security technology.
[0086] The above is a detailed description of the preferred specific embodiments and examples of the present invention in combination with the accompanying drawings. Those of ordinary skill in the art should recognize that the above embodiments are only used to verify the present invention, rather than as a limitation to the present invention. As long as it is within the scope of the present invention, changes and deformations of the above embodiments will fall within the protection scope of the present invention.
Claims
1. A color image encryption method based on a four-dimensional memristive hyperchaotic system, characterized in that The method includes the following steps: S1: Construct a four-dimensional memristive hyperchaotic system and discretize the system; where the expression of the chaotic system is: where G(w) is the memductance value of the three-valued memristor, and the expression is: G(w) = a0 + b0sgn(w + c0) - d0sgn(w - c0) where x, y, z, and w are system state variables, and a, b, c, d, a0, b0, c0, and d0 are system parameters; S2: Read the color plaintext image information, split the color image to be encrypted into three primary color component matrices, and group them according to RGB to obtain three M*N matrices; where M represents the number of rows of the matrix and N is the number of columns of the matrix; S3: Obtain the initial value [x0, y0, z0, w0] containing the plaintext information through the SHA-512 algorithm; combine the initial value with the discrete memristive hyperchaotic system for iteration to obtain a hyperchaotic sequence; S4: Preprocess the hyperchaotic sequence, including amplification, rounding, and taking the remainder operations, so that the chaotic sequence is applicable to image data to obtain a key sequence; S5: Use the key sequence to perform encryption operations on the rows and columns of the R, G, and B channels of the color plaintext image respectively; Taking the operation of the R channel as an example, specifically: (1) First, the initial value [x0, y0, z0, w0] containing the plaintext information is obtained by the SHA-512 algorithm. The hyperchaotic sequence is obtained by combining the discrete hyperchaotic system, and the hyperchaotic sequence that matches the image data scale is extracted from it. The key sequence S is obtained after preprocessing the chaotic sequence. r 、S c and S z ; (2) Secondly, design the permutation operation; process S r and S c 's repeated values to obtain the Hash table index sequence x r and x c , which are used for row operations and column operations respectively; use the index sequence x r to perform pixel-level permutation on the first row of the image, and then perform bit-level permutation; (3) Thirdly, design the diffusion operation; use the traversal matrix of the Hilbert curve to reorder the sequence S z to obtain the sequence S h ; use the sequence S h to perform a diffusion operation on the rows in the matrix, and traverse each row of the image in turn; (4) After sequentially performing pixel-level permutation, bit-level permutation, and diffusion operations on each row of the image matrix, then perform column operations.
Citation Information
Patent Citations
Color image encryption method based on memristor hyper-chaotic system
CN111756518A