Color image encryption and decryption method based on chaotic system and DNA coding
By combining a modified Chua's chaotic circuit and Lorenz chaotic system in an image encryption method, along with DNA encoding technology, the problems of homogenization and insufficient security of chaotic systems in existing technologies are solved, achieving highly secure and robust image encryption.
Patent Information
- Application Number
- CN202511671917.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-02-06
AI Technical Summary
Existing image encryption methods based on chaotic systems suffer from problems such as homogeneity of chaotic systems, limited key space, and insufficient security, making it difficult to meet the requirements of high-strength encryption.
By combining a modified Chua's chaotic circuit with the Lorenz chaotic system, a double scrambling and double diffusion are achieved through pseudo-random sequences. Combined with DNA encoding technology, the key space and anti-attack capabilities are improved.
Through multi-level scrambling and diffusion operations, the security and robustness of image encryption are significantly enhanced, effectively resisting statistical attacks and brute-force cracking.
Smart Images

Figure CN121485899A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of information security, and in particular relates to a color image encryption and decryption method based on chaotic systems and DNA encoding. Background Technology
[0002] In today's digital age, personal data, trade secrets, and even national security face unprecedented threats. The core objective of information security is to protect this data from unauthorized access and malicious use. Image encryption is one of the key technologies for information security. It ensures data security during transmission by converting raw data (plaintext) into a difficult-to-interpret format (ciphertext).
[0003] Chaotic systems possess characteristics such as initial value sensitivity and pseudo-randomness, which meet the basic requirements of cryptography. Therefore, encryption methods based on chaotic systems are widely used in image encryption. According to the system's dimensionality, chaotic systems can be divided into one-dimensional and multi-dimensional chaotic systems. One-dimensional chaotic systems have simple structures, but their key spaces are limited and their dynamic characteristics are relatively simple, making them difficult to meet the requirements of high-strength encryption. In contrast, multi-dimensional chaotic systems have more complex dynamic behaviors and larger key spaces, offering greater security advantages. However, most existing image encryption methods based on chaotic systems employ similar chaotic models, lacking diversity. Therefore, how to select one or more suitable chaotic systems for combination to effectively expand the key space and improve resistance to attacks is an urgent problem to be solved. Simultaneously, existing technologies still have shortcomings in other security indicators (such as robustness), necessitating a novel and high-performance image encryption method. Summary of the Invention
[0004] To address the issues of homogeneity and insufficient security of chaotic systems in existing image encryption methods, this invention proposes an image encryption method based on deep coupling of chaotic systems and DNA encoding technology. This invention follows the scrambling-diffusion criterion, utilizing a modified Chua's chaotic circuit and a Lorenz chaotic system to scramble the original image, and then uses chaotic sequences to control DNA encoding / decoding and computation to achieve diffusion operations.
[0005] The main objective of this invention is to: introduce a modified Chua's chaotic system to avoid the homogenization problem of chaotic systems; combine it with the Lorenz chaotic system to expand the key space; achieve double scrambling through pseudo-random numbers generated by chaotic sequences, thereby disrupting the correlation between adjacent pixels and making the pixel distribution more uniform; and achieve double diffusion operations through deep coupling of chaotic sequences with DNA encoding technology, thus improving the robustness of the encryption method. In summary, this invention proposes a more secure image encryption method by introducing the less commonly used Chua's chaotic circuit and combining it with double scrambling and double diffusion mechanisms.
[0006] To achieve the above objectives, this invention provides a color image encryption and decryption method based on chaotic systems and DNA encoding, comprising: The initial parameters of the Lorenz chaotic system are generated based on the pixel statistical features of the original image. Based on the initial parameters, the Lorenz chaotic system is driven to generate a first pseudo-random sequence; The original image is scrambled according to the first pseudo-random sequence to obtain a scrambled image; The initial parameters of the variant Chua's chaotic circuit are generated based on the hash value and random perturbation of the scrambled image. Based on the initial parameters of the modified Chua's chaotic circuit, the modified Chua's chaotic circuit is driven to generate a second pseudo-random sequence. Construct a chaotic mask matrix based on the second pseudo-random sequence; Based on the chaotic mask matrix and the scrambled image, DNA encoding and computation are performed to obtain the diffusion image; Based on the diffusion image, DNA decoding and recombination are performed to obtain an encrypted image; Based on the encrypted image and the same initial parameters, repeat the reverse process of the above steps to obtain the decrypted image.
[0007] Preferably, the process of generating the initial parameters of the Lorenz chaotic system based on the pixel statistical features of the original image includes: Extract the RGB three-channel pixel matrix from the original image; Calculate the sum of the pixel values for each channel separately; The average grayscale value is calculated pairwise based on the sum of the pixel values of each channel, and then normalized to obtain three normalized results, which are used as the initial parameters of the Lorenz chaotic system.
[0008] Preferably, the process of obtaining the scrambled image includes: The original image's RGB three channels are subjected to inverse Zigzag scanning to obtain a one-dimensional vector; Based on the first pseudo-random sequence, sort the one-dimensional vectors of each channel in descending order to obtain the sorting index; Based on the sorting index, the one-dimensional vectors of each channel are rearranged to obtain the scrambled vectors. The scrambled vectors are reconstructed into a two-dimensional matrix to obtain the scrambled image.
[0009] Preferably, the process of generating the initial parameters of the variant Chua's chaotic circuit includes: Calculate the SHA-256 hash value of the scrambled image and convert it into binary key bytes; Randomly extract several pixel values from the scrambled image as perturbation values; The key byte and the perturbation value are XORed to obtain the intermediate value; The intermediate values are grouped, averaged, and linearly mapped to a specified interval to obtain the initial parameters of the variant Chua's chaotic circuit.
[0010] Preferably, the process of constructing the chaotic mask matrix based on the second pseudo-random sequence includes: By coupling the Lorenz chaotic system with the pseudo-random sequence generated by the modified Chua's chaotic circuit, a third pseudo-random sequence is obtained. The third pseudo-random sequence is quantized and moduloed to obtain a two-dimensional chaotic mask matrix.
[0011] Preferably, the process of obtaining the diffusion image includes: The chaotic mask matrix and the scrambled image are processed in blocks; Based on the second pseudo-random sequence, the DNA encoding rules are dynamically selected to encode the image blocks and mask blocks; Based on the second pseudo-random sequence, the DNA operation method is dynamically selected to operate on the encoded image block and mask block to obtain the initial diffusion block; Perform DNA operation again on the current diffusion block and the previous diffusion block to obtain a secondary diffusion block; Repeat the above process to complete the diffusion operation for all image blocks and obtain the diffused image.
[0012] Preferably, the process of obtaining an encrypted image includes: Based on the second pseudo-random sequence, the DNA decoding rules are dynamically selected to decode the diffusion image; The decoded image blocks are reassembled into an RGB three-channel matrix and then merged to obtain an encrypted image.
[0013] Preferably, the process of obtaining the decrypted image includes: Based on the same initial parameters, pseudo-random sequences of Lorenz chaotic systems and variant Chua's chaotic circuits are repeatedly generated. Based on the pseudo-random sequence, the encrypted image is subjected to DNA inverse operation and inverse diffusion processing to obtain an inverse diffusion image; Based on the first pseudo-random sequence, the inverse diffusion image is reverse-scrambled to obtain the decrypted image.
[0014] Preferably, the process of performing DNA inverse operation and dediffusion processing on the encrypted image based on the pseudo-random sequence includes: Based on the second pseudo-random sequence, the DNA decoding rule is dynamically selected to decode the encrypted image; Based on the second pseudo-random sequence, the DNA inverse operation method is dynamically selected, and the secondary diffusion and primary diffusion are performed in reverse order to obtain the inverse diffusion image patch. The inverse diffusion image blocks are recombined into an RGB three-channel matrix to obtain the inverse diffusion image.
[0015] Preferably, the process of reversing the scrambling of the de-diffusion image based on the first pseudo-random sequence includes: Based on the first pseudo-random sequence, generate a sorted index and its inverse index; Based on the inverse index, the RGB three channels of the inverse diffusion image are inversely rearranged respectively; The decrypted image is reconstructed by performing an inverse Zigzag scan on the inverse rearranged image.
[0016] Compared with the prior art, the present invention has the following advantages and technical effects: This invention provides a color image encryption and decryption method based on a modified Chua's chaotic circuit and DNA encoding. By introducing a Chua's chaotic circuit and deeply coupling it with a Lorenz chaotic system and DNA encoding / decoding technology, and combining Zigzag scrambling, chaotic sequence-based index scrambling, image segmentation, and various DNA operations, multi-level image encryption is achieved. During the encryption process, multi-level scrambling effectively hides the original structure of the image and significantly enhances its resistance to statistical attacks; the coupling of multiple chaotic systems expands the key space, thereby improving its resistance to brute-force attacks; multi-level diffusion processing further weakens the correlation between pixels, effectively resisting statistical analysis attacks. Through the above complex scrambling-diffusion operations, this invention significantly improves the robustness of the algorithm while maintaining high security. Attached Figure Description
[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 2 The images shown are decryption effect diagrams of Pepper images with different keys according to an embodiment of the present invention; wherein, (a) is the decryption image of the correct key; (b) is the decryption image of the correct key σ after perturbation; (c) is the decryption image of the correct key ρ after perturbation; and (d) is the decryption image of the correct key β. L(e) is the decrypted image of a single correct key x0 after perturbation; (f) is the decrypted image of a single correct key y0 after perturbation; (g) is the decrypted image of a single correct key z0 after perturbation; (h) is the decrypted image of a single correct key α after perturbation; (i) is the decrypted image of a single correct key β after perturbation; (j) is the decrypted image of a single correct key η after perturbation; (k) is the decrypted image of a single correct key X0 after perturbation; (l) is the decrypted image of a single correct key Y0 after perturbation; (m) is the decrypted image of a single correct key Z0 after perturbation; (n) is the decrypted image of a single correct key α after perturbation. Decrypted image after 0 disturbance; Figure 3 Here are histograms of Pepper images according to embodiments of the present invention; wherein, (a) is a histogram of the plaintext image; and (b) is a histogram of the ciphertext image. Figure 4 The images shown are correlation point maps of adjacent pixels in a Pepper image according to an embodiment of the present invention; wherein, (a) is a correlation point map of adjacent elements in the horizontal direction of the plaintext image; (b) is a correlation point map of adjacent elements in the vertical direction of the plaintext image; (c) is a correlation point map of adjacent elements in the diagonal direction of the plaintext image; (d) is a correlation point map of adjacent elements in the horizontal direction of the ciphertext image; (e) is a correlation point map of adjacent elements in the vertical direction of the ciphertext image; and (f) is a correlation point map of adjacent elements in the diagonal direction of the ciphertext image. Figure 5 The images shown are test images for noise and cropping attacks on Pepper ciphertext images according to embodiments of the present invention; wherein, (a) is the decrypted image with salt-and-pepper noise intensity of 0.01; (b) is the decrypted image with salt-and-pepper noise intensity of 0.001; (c) is the decrypted image with salt-and-pepper noise intensity of 0.0001; and (d) is the decrypted image with Gaussian noise intensity of 1×10⁻⁶. -2 The decrypted image; (e) is the Gaussian noise intensity of 1×10 -4 The decrypted image; (f) is the Gaussian noise intensity of 1×10 -6 (g) is a decrypted image with 50% cropped; (h) is a decrypted image with 25% cropped; (i) is a decrypted image with 12.5% cropped. Detailed Implementation
[0018] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0019] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0020] like Figure 1 As shown, this embodiment provides a color image encryption and decryption method based on chaotic systems and DNA encoding, including: The initial parameters of the Lorenz chaotic system are generated based on the pixel statistical features of the original image. Based on the initial parameters, the Lorenz chaotic system is driven to generate the first pseudo-random sequence. The original image is scrambled according to the first pseudo-random sequence to obtain a scrambled image; The initial parameters of the variant Chua's chaotic circuit are generated based on the hash value of the scrambled image and random perturbation. Based on the initial parameters of the modified Chua's chaotic circuit, drive the modified Chua's chaotic circuit to generate a second pseudo-random sequence. Construct a chaotic mask matrix based on the second pseudo-random sequence; Based on the chaotic mask matrix and the scrambled image, DNA encoding and operations are performed to obtain the diffusion image; Based on the diffusion image, DNA decoding and recombination are performed to obtain an encrypted image; Using the encrypted image and the same initial parameters, repeat the reverse process of the above steps to obtain the decrypted image.
[0021] Furthermore, the process of generating the initial parameters of the Lorenz chaotic system based on the pixel statistical features of the original image includes: Extract the RGB three-channel pixel matrix from the original image; Calculate the sum of the pixel values for each channel separately; The average grayscale value is calculated pairwise based on the sum of the pixel values of each channel, and then normalized to obtain three normalized results, which are used as the initial parameters of the Lorenz chaotic system.
[0022] Furthermore, the process of obtaining the scrambled image includes: The original image's RGB three channels are subjected to inverse Zigzag scanning to obtain a one-dimensional vector; Based on the first pseudo-random sequence, sort the one-dimensional vectors of each channel in descending order to obtain the sorting index; Based on the sorting index, rearrange the one-dimensional vectors of each channel to obtain the scrambled vectors; The scrambled vectors are reconstructed into a two-dimensional matrix to obtain the scrambled image.
[0023] Furthermore, the process of generating the initial parameters of the variant Chua's chaotic circuit includes: Calculate the SHA-256 hash value of the scrambled image and convert it into binary key bytes; Randomly extract several pixel values from the scrambled image as perturbation values; The key byte and the perturbation value are XORed to obtain the intermediate value; The intermediate values are grouped, the mean is calculated, and then linearly mapped to a specified interval to obtain the initial parameters of the variant Chua's chaotic circuit.
[0024] Furthermore, the process of constructing the chaotic mask matrix based on the second pseudo-random sequence includes: By coupling the Lorenz chaotic system with the pseudo-random sequence generated by the modified Chua's chaotic circuit, a third pseudo-random sequence is obtained. The third pseudo-random sequence is quantized and moduloed to obtain a two-dimensional chaotic mask matrix.
[0025] Furthermore, the process of obtaining a diffusion image includes: The chaotic mask matrix and the scrambled image are processed in blocks; Based on the second pseudo-random sequence, the DNA encoding rules are dynamically selected to encode the image blocks and mask blocks; Based on the second pseudo-random sequence, the DNA operation method is dynamically selected to operate on the encoded image block and mask block to obtain the initial diffusion block; Perform DNA operation again on the current diffusion block and the previous diffusion block to obtain a secondary diffusion block; Repeat the above process to complete the diffusion operation for all image blocks and obtain the diffused image.
[0026] Furthermore, the process of obtaining an encrypted image includes: The diffusion image is decoded by dynamically selecting DNA decoding rules based on the second pseudo-random sequence. The decoded image blocks are reassembled into an RGB three-channel matrix and then merged to obtain an encrypted image.
[0027] Furthermore, the process of obtaining the decrypted image includes: Based on the same initial parameters, pseudo-random sequences of Lorenz chaotic systems and variant Chua's chaotic circuits are repeatedly generated. Based on the pseudo-random sequence, DNA inverse operation and inverse diffusion processing are performed on the encrypted image to obtain an inverse diffusion image; Based on the first pseudo-random sequence, the inverse diffusion image is reverse-scrambled to obtain the decrypted image.
[0028] Furthermore, based on the pseudo-random sequence, the process of performing DNA inverse operation and de-diffusion processing on the encrypted image includes: The encrypted image is decoded by dynamically selecting DNA decoding rules based on the second pseudo-random sequence. Based on the second pseudo-random sequence, the DNA inverse operation method is dynamically selected, and the secondary diffusion and primary diffusion are performed in reverse order to obtain the inverse diffusion image patch. The inverse diffusion image blocks are recombined into an RGB three-channel matrix to obtain the inverse diffusion image.
[0029] Furthermore, the process of reversing the scrambling of the de-diffusion image based on the first pseudo-random sequence includes: Generate a sorted index and its inverse index based on the first pseudo-random sequence; Based on the inverse index, the RGB three channels of the inverse diffusion image are inversely rearranged respectively; The decrypted image is reconstructed by performing an inverse Zigzag scan on the inverse rearranged image.
[0030] As an additional implementation method, the image encryption method proposed in this embodiment specifically includes the following steps: Step 1: Read the plaintext image I of size M×N, and divide the plaintext image into three two-dimensional matrices R, G and B according to the layering method, and name them I1, I2 and I3 respectively.
[0031] Step 2: Based on the read image I, calculate the initial values of the Lorenz chaotic system according to the following process, and solve for the chaotic sequence.
[0032] Step 2.1: Set the system parameters for the Lorenz mapping: σ=10, ρ=28, β L =8 / 3 and initial values x0, y0, z0, obtain the pseudo-random sequence {X_L}. i}, {Y_L i}, {Z_L i The initial values x0, y0, and z0 are obtained by summing the data from all positions in each channel of the original image and calculating the average grayscale value pairwise.
[0033] The initial values x0, y0, and z0 are given by the following formula: (1) Step 2.2: To eliminate transient reactions, the random sequence {X_L} i}, {Y_L i}, {Z_L i The value is taken from 2001 to the end and is used for image scrambling.
[0034] Step 3: To disrupt the relationships between image elements, this embodiment first scrambles the image. The three two-dimensional matrices I1, I2, and I3 are then zigzag scanned to form one-dimensional vectors.
[0035] Step 4: To further disrupt the relationships between image elements, this embodiment performs a second scrambling of the image. The pseudo-random sequence {X_L} is then... i}, {Y_L i}, {Z_L i The elements are sorted in descending order to obtain sorted index vectors idx1, idx2, and idx3. Based on the correspondence between the pseudo-random sequence and vectors I1, I2, and I3, the index vectors are used to rearrange vectors I1, I2, and I3 respectively, thus obtaining the scrambled encrypted sequence vectors. The scrambled one-dimensional sequences are then reconstructed into two-dimensional matrices I1, I2, and I3 of size M×N in column-major order, thus forming the three channels of the encrypted image.
[0036] Step 5: Considering encryption efficiency, this embodiment divides the two-dimensional matrix I1, I2, and I3 into blocks. This embodiment divides the two-dimensional matrix I... i (i=1, 2, 3) is divided into blocks of fixed size, each block being t. 2 If any row or column of a two-dimensional matrix I1, I2, I3 is not divisible by t, to ensure the consistency of the size of each block, the boundaries of the two-dimensional matrices I1, I2, I3 are expanded by padding with "0" to ensure that the two-dimensional matrices I1, I2, I3 can be divided into blocks of size t. 2 The block.
[0037] Step 6: Although the Lorenz system has been shown to generate complex chaotic sequences, its relatively simple dynamic characteristics may lead to insufficient randomness in the encrypted sequence. Therefore, it is necessary to introduce other systems to improve security. To this end, this embodiment introduces a modified Chua's chaotic circuit. The initial values of the modified Chua's chaotic circuit are calculated according to the following steps, and the chaotic sequence of Chua's equations is obtained.
[0038] Step 6.1: Calculate the hash value of the scrambled image I. The hash value of image I is a 64-bit hexadecimal number. Expand the hash character bit by bit into a 256-bit binary number, then cut it into 32 8-bit blocks, resulting in 32 key bytes K = [k1, k2, ..., kk]. 32 ].
[0039] Step 6.2: Randomly select 9 pixel values C=[c1, c2, ..., c9] from the scrambling matrices I1, I2, I3, and expand them into 8-bit binary numbers as perturbations.
[0040] Step 6.3: Perform an XOR operation on the key byte and the perturbation value in different combinations to obtain the intermediate transition value.
[0041] (2) Here, ⨁ represents the binary bitwise XOR operation.
[0042] After converting the transition value to decimal, the mean is calculated in groups of three elements, and then the mean is linearly mapped to a specified interval to obtain the initial state value of the variant Chua's circuit.
[0043] (3) Step 6.4: The dimensionless equations of the variant Chua's chaotic circuit are shown in equation (4), with system parameters α=3, β=0.71, η=0.01; and X0, Y0, Z0, The initial value of the modified Chua's chaotic circuit is set to 0, and iterative steps are performed to generate four pseudo-random sequences. To eliminate transient effects, the first 2000 points are discarded, ultimately obtaining the sequence {X}. i}, {Y i}, {Z i},{H i Couple the pseudo-random sequences of two chaotic systems to generate a chaotic sequence {R} of length M×N. i};For {R i Multiply by 10 element by element 4 After rounding, perform a 256 modulo operation on it and reshape it into an M×N two-dimensional matrix R for subsequent DNA operations.
[0044] (4) Step 7: Based on the aforementioned image data and chaotic sequence, this step completes the diffusion operation through DNA encoding / decoding and DNA computation.
[0045] Step 7.1: For convenience I i DNA encoding of (i=1, 2, 3) and I i DNA operations between (i=1, 2, 3) and a two-dimensional matrix R. In this embodiment, the chaotic sequence {X} i}, {Y i},{H i} is mapped to the integer interval [1, 8], corresponding to 8 DNA coding rules. Then the chaotic sequence {Z} is... i Mapping to [0, 3] corresponds to four types of operations between DNAs: Among them, it is stipulated that when equal to 0, it is an addition operation; when equal to 1, it is a subtraction operation; when equal to 2, it is an XOR operation; and when equal to 3, it is a XNOR operation.
[0046] Step 7.2: To improve encryption efficiency, it is stipulated that {X} i The elements in} determine the two-dimensional matrix I i (i=1, 2, 3) Sub-blocks at the same position use the same encoding method. It is stipulated that {Y} i The elements in {Z} determine that sub-blocks at the same position in the two-dimensional matrix R use the same encoding method. It also specifies that the sequence {Z}...i Control 2D matrix I i DNA operation rules between (i=1, 2, 3) and two-dimensional matrix R.
[0047] Step 7.3: To achieve better diffusion and fully conceal the original information, this embodiment performs a second diffusion. Except for the first sub-block, the encryption result of the current sub-block is compared with the previous sub-block using a DNA operation. The algorithm used is based on the sequence {Z}. i}Decide.
[0048] Step 8: After scrambling-diffusion is complete, this step uses the sequence {H} i The two-dimensional matrix obtained after step 7 is decoded. Then, the decoded matrices are merged into a three-dimensional matrix, which is the encrypted image.
[0049] As another possible implementation, this embodiment also provides an image decryption method based on chaotic systems and DNA encoding for restoring the encrypted image. Specifically, it includes the following steps: Step 1: Read the encrypted image I of size M×N e The plaintext image is divided into three two-dimensional matrices, R, G, and B, according to a layered approach, and named I, G, and B respectively. e1 I e2 I e3 Then I e1 I e2 I e3 Divide into sizes t 2 The blocks (the block division method is the same as the encryption process).
[0050] Step 2: Drive the Lorenz system with encryption parameters and initial values x0, y0, z0 to iterate and obtain a pseudo-random sequence. Discard the first 2000 terms to obtain the sequence {X_L}. i}, {Y_L i}, {Z_L i}; and then with X0, Y0, Z0, 0 drives a modified Chua's chaotic circuit, similarly discarding the first 2000 terms to obtain the sequence {X}. i}, {Y i}, {Z i},{H i Couple the pseudo-random sequences of two chaotic systems to generate a chaotic sequence {R} of length M×N. i};For {R i Multiply by 10 element by element 4 After rounding, perform a 256 modulo operation on it and reshape it into an M×N two-dimensional matrix R for subsequent DNA operations.
[0051] Step 3: For I e1 I e2 I e3 Each sub-block undergoes DNA encoding / decoding and reverse diffusion.
[0052] Step 3.1: Before decryption, first process the chaotic sequence {X} i}, {Y i},{H i Mapping {Z} to the integer interval [1, 8] corresponds to 8 DNA coding rules; the chaotic sequence {Z} is mapped to the integer interval [1, 8], corresponding to 8 DNA coding rules; i} is mapped to [0, 3], corresponding to the four types of operations between DNA. {X i}: Controls the DNA decoding rules for each sub-block; {Y i}: Controls the encoding rules for each sub-block of the R matrix; {H i} is used for I e1 I e2 I e3 Each sub-block is initially encoded with DNA; {Z i}: Controls the DNA operation mode, with values [0, 3], representing addition, subtraction, XOR, and XNOR respectively.
[0053] During decryption, the DNA operation rules need to be "inversely mapped" to restore the DNA operation results at the time of encryption. For example, addition becomes subtraction, and subtraction becomes addition; XOR and XNOR remain unchanged because they are inverse.
[0054] Step 3.2: Process in reverse order, starting from the last sub-block.
[0055] This embodiment uses the same decryption process for each color channel of the image. Specifically, firstly, for I... e1 I e2 I e3 The current sub-block is encoded with DNA, and the encoding is performed using {H}. i The encoding method for control. Then, the current sub-block and the previous sub-block are subjected to DNA inverse operation (i.e., reverse de-diffusion of secondary diffusion).
[0056] Since the current sub-block and the previous sub-block have already been diffused through DNA operations during the encryption process, it is necessary to base this on {Z}. i The inverse operation rules of} are used to achieve reverse restoration. By iterating through this process block by block, the entire image before the secondary diffusion can be completely restored.
[0057] After the above operations, the resulting image sub-block contains only the result of DNA operations with the R matrix. Further, by performing the inverse DNA operation on this image sub-block and the corresponding sub-block of the R matrix, the DNA encoding before diffusion can be restored. Finally, based on {X... iThe specified decoding method decodes the DNA code into pixel values and restores the corresponding image block to its original position.
[0058] Step 3.3: Process the first sub-block.
[0059] Since the first sub-block was not subjected to secondary diffusion during encryption, it only requires the inverse of the DNA operation with the R matrix, and then {X} is used. i The specified decoding method is used to decode and restore the pixel values. This yields the decryption matrix I obtained through DNA inverse operation. e1 I e2 I e3 .
[0060] Step 4: Remove the zeros from the matrix padding of the three channels from Step 3, and then merge them into a three-dimensional matrix to obtain the decrypted color image.
[0061] Step 5: Process the initially decrypted matrix I e1 I e2 I e3 Perform reverse scrambling.
[0062] Step 5.1: First, obtain the sorting index. Then, sort the Lorenz chaotic sequence {X_L}. i}, {Y_L i}, {Z_L i Sort the pixels in descending order to obtain the corresponding sorting indices: idx1, idx2, idx3, which correspond to the shuffled order of the pixels in the RGB channels during encryption. Then calculate the inverse index. Reverse sort the above sorting indices to obtain inv-idx1, inv-idx2, inv-idx3, which represent the indices required to restore the pixels from their shuffled positions to their original positions.
[0063] Step 5.2: Decrypt the channel image I e1 I e2 I e3 Unfold into a one-dimensional sequence, restore the original pixel order based on the inverse index, and complete the reverse scrambling.
[0064] Step 6: Perform an inverse Zigzag scan on the descrambled one-dimensional pixel sequence to rearrange it into an M×N two-dimensional matrix, obtaining the decrypted R, G, and B channels I. e1 I e2 I e3 Complete the color image reconstruction.
[0065] A comprehensive security assessment and verification were also conducted on the image encryption method for enhancing the coupling between chaotic systems and DNA coding proposed in this embodiment. Effective encryption methods require strong key sensitivity, which acts as a security amplifier to amplify minute key differences into globally random differences.
[0066] First, set the correct key: σ=10, ρ=28, βL=8 / 3, x0=1, y0=1, z0=1, α=3, β=0.71, η=0.01, X0=1, Y0=1, Z0=1. 0 = 1.
[0067] Then, the key is adjusted by adding a small perturbation. This embodiment uses the original image Pepper as an example, decrypting the ciphertext Pepper as the correctly decrypted image. For example, perturbing σ=10 to σ=10+10-5 yields the following result: Figure 2 As shown in (b).
[0068] It is obvious that Pepper's decrypted image is still messy and, like the encrypted image, cannot provide any useful information.
[0069] Therefore, in this embodiment, a small perturbation is applied to each key, set as σ=10+10-5, ρ=28+10-5, and β respectively. L =8 / 3+10-5, x0=1+10-5, y0=1+10-5, z0=1+10-5, α=3+10-5, β=0.71+10-5, η=0.01+10-5, 0 = 1 + 10 - 5. The decryption result is as follows: Figure 2 As shown, it is clear that slight adjustments to each key cannot decrypt the valid information of the plaintext image. Therefore, the algorithm proposed in this embodiment is extremely sensitive to the key and can effectively resist brute-force attacks.
[0070] An image histogram can accurately display the distribution of pixel values and is often used to evaluate whether an encryption method has successfully erased statistical features. Therefore, this embodiment was tested on a 512×512 Pepper color image, and the results are as follows. Figure 3 As shown in the figure, the original image has a wide variety of pixel frequencies, with distinct feature distribution. Attackers can easily obtain general information about the image from the pixel distribution. However, the encrypted image has a uniform histogram distribution, masking the feature information of the original image. The frequency of each pixel is nearly consistent, providing good security and resisting some attacks.
[0071] Neighbor-to-pixel correlation analysis measures the strong correlation between adjacent pixels in an image. Its goal is to verify whether the encrypted output has completely destroyed the spatial statistical dependencies of the original image, preventing attackers from using the remaining correlations to make valid inferences. A systematic examination is performed on the R, G, and B channels of both the original and encrypted Pepper images. The neighbor-to-pixel correlation assessment is conducted along three directions: horizontal, vertical, and diagonal. The neighbor-to-pixel correlation analysis dot plot is saved to... Figure 4 The calculated data is saved to Table 1. From Figure 4 It can be seen that the original Pepper image exhibits strong correlation between adjacent pixels in all directions across all channels, while the pixels in the ciphertext image processed by the algorithm described above are evenly distributed throughout the pixel intervals. Table 1 shows that the experiments on the original plaintext image demonstrate exceptionally strong inter-pixel correlation, almost reaching 1. However, in all three channels, the correlation value of the ciphertext image decreases significantly in all directions, approaching 0. Therefore, the improved scheme minimizes the correlation between pixels, proving its strong defense against statistical attacks.
[0072] Table 1
[0073] Information entropy here specifically refers to the pixel grayscale distribution entropy of the ciphertext image. A higher information entropy value indicates a more disordered distribution of pixel statistics, increasing the difficulty for attackers to decode using statistical residues. Therefore, encryption methods should scramble the pixel distribution of the original image as much as possible. This embodiment uses plaintext and ciphertext Pepper images with grayscale levels L=256 as examples, and the results are shown in Table 2. As shown in Table 2, the information entropy value of the plaintext image is relatively small. However, the information entropy of the ciphertext image is significantly increased, almost reaching the theoretical value. This proves that the method in this embodiment has high security.
[0074] Table 2
[0075] During the transmission of ciphertext, digital images are not only inevitably subjected to random interference from noise of varying intensities, but may also face intentional perturbations and information loss by attackers. Therefore, the designed algorithm must still be able to successfully decrypt even when some ciphertext information is lost or altered. This is achieved through a systematic evaluation of its anti-interference and fault-tolerance capabilities via a "noise addition / cropping-decryption-recovery" experiment. This embodiment conducts an anti-interference experiment on Pepper ciphertext images: salt-and-pepper noise with densities of 0.01, 0.001, and 0.0001 is applied sequentially, with a variance of 1×10⁻⁶. -2 1×10 -4 1×10 -6 Gaussian noise, and 50%, 25%, and 12.5% pruning attacks, the recovery results are shown in... Figure 5 .from Figure 5 As can be seen, the image can still be restored to a visual level when faced with disturbances, loss or alteration of information, thus this embodiment has strong robustness.
[0076] This embodiment provides an image encryption method based on the coupling of chaotic systems and DNA dynamic coding. First, the three-dimensional digital matrix of the color image is extracted, and the pixel values of each channel are summed. Then, the average grayscale value is calculated by combining the values pairwise and normalized. The three normalized results are used as the initial parameters of the Lorenz system. Subsequently, the hash value of the scrambled image is calculated and random perturbations are introduced. Through a series of operations, the initial parameters of a modified Chua's chaotic circuit are obtained. This method not only improves the randomness of the initial values of the modified Chua's chaotic circuit but also allows for the limitation of effective digits through precision control using MATLAB, thereby further enhancing the encryption effect.
[0077] To completely destroy the correlation between image pixels, this embodiment uses a pseudo-random sequence obtained through Lorenz mapping for image scrambling. First, the extracted three-dimensional digital matrix is subjected to inverse Zigzag scrambling, then rearranged column-wise to obtain a pre-scrambled image. Next, three chaotic sequences are generated and mapped one-to-one with the three RGB channels after dimensionality reduction. Elements in each channel are arranged in descending order, and their corresponding position indices are recorded. Finally, the RGB vectors are scrambled a second time based on these position indices, thereby completely disrupting the correlation between image pixels. Before diffusion, this embodiment first rearranges the scrambled image pixels column-wise and then divides them into two-dimensional pixel blocks for subsequent encoding / decoding and computation.
[0078] In the diffusion phase, this embodiment couples three pseudo-random sequences from the Lorenz system with four pseudo-random sequences obtained by mapping a modified Chua's circuit, resulting in a new chaotic sequence {Ri}. The chaotic sequence {Ri} is then transformed into an M×N matrix R. Of the four pseudo-random sequences obtained by mapping the modified Chua's circuit, two sequences map the elements of the two-dimensional RGB channels and matrix R to base sequences conforming to eight encoding rules, respectively; the other sequence controls the operations between the RGB channels and matrix R, and further controls the block operations between channels after the operations are completed. Through this diffusion method, this embodiment not only simplifies the computation process but also achieves deep coupling between different chaotic systems and DNA encoding technology.
[0079] After completing the scrambling-diffusion operation of the image, this embodiment uses the last Chua pseudo-random sequence to control the block decoding of each channel, and reassembles the decoded RGB channels into a new image, which is the final encrypted image.
[0080] This embodiment also proposes a corresponding decryption scheme. During decryption, the RGB channels of the encrypted image are first read, and the same initial values as in the encryption process are input to generate the same chaotic sequence and construct matrix R. Subsequently, the system uses this chaotic sequence to encode each channel and matrix R, and then performs DNA inverse operations on the block data sequentially. After completing the block operations, an inverse scrambling operation is performed, that is, the original order of pixels in each channel is restored using the inverse index of the Lorenz sequence, and the RGB channels are reconstructed through an inverse Zigzag transform. Finally, the three reconstructed channels are merged to obtain the decrypted image and saved, thus completing the decryption. The entire process, through the synchronous generation of chaotic sequences and DNA inverse operations, achieves effective recovery of the encrypted image.
[0081] The above are merely preferred embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A color image encryption and decryption method based on chaotic systems and DNA encoding, characterized in that, include: The initial parameters of the Lorenz chaotic system are generated based on the pixel statistical features of the original image. Based on the initial parameters, the Lorenz chaotic system is driven to generate a first pseudo-random sequence; The original image is scrambled according to the first pseudo-random sequence to obtain a scrambled image; The initial parameters of the variant Chua's chaotic circuit are generated based on the hash value and random perturbation of the scrambled image. Based on the initial parameters of the modified Chua's chaotic circuit, the modified Chua's chaotic circuit is driven to generate a second pseudo-random sequence. Construct a chaotic mask matrix based on the second pseudo-random sequence; Based on the chaotic mask matrix and the scrambled image, DNA encoding and computation are performed to obtain the diffusion image; Based on the diffusion image, DNA decoding and recombination are performed to obtain an encrypted image; Based on the encrypted image and the same initial parameters, repeat the reverse process of the above steps to obtain the decrypted image.
2. The method according to claim 1, characterized in that, The process of generating the initial parameters of the Lorenz chaotic system based on the pixel statistical features of the original image includes: Extract the RGB three-channel pixel matrix from the original image; Calculate the sum of the pixel values for each channel separately; The average grayscale value is calculated pairwise based on the sum of the pixel values of each channel, and then normalized to obtain three normalized results, which are used as the initial parameters of the Lorenz chaotic system.
3. The method according to claim 1, characterized in that, The process of obtaining a scrambled image includes: The original image's RGB three channels are subjected to inverse Zigzag scanning to obtain a one-dimensional vector; Based on the first pseudo-random sequence, sort the one-dimensional vectors of each channel in descending order to obtain the sorting index; Based on the sorting index, the one-dimensional vectors of each channel are rearranged to obtain the scrambled vectors. The scrambled vectors are reconstructed into a two-dimensional matrix to obtain the scrambled image.
4. The method according to claim 1, characterized in that, The process of generating the initial parameters of the variant Chua's chaotic circuit includes: Calculate the SHA-256 hash value of the scrambled image and convert it into binary key bytes; Randomly extract several pixel values from the scrambled image as perturbation values; The key byte and the perturbation value are XORed to obtain the intermediate value; The intermediate values are grouped, averaged, and linearly mapped to a specified interval to obtain the initial parameters of the variant Chua's chaotic circuit.
5. The method according to claim 1, characterized in that, The process of constructing the chaotic mask matrix based on the second pseudo-random sequence includes: By coupling the Lorenz chaotic system with the pseudo-random sequence generated by the modified Chua's chaotic circuit, a third pseudo-random sequence is obtained. The third pseudo-random sequence is quantized and moduloed to obtain a two-dimensional chaotic mask matrix.
6. The method according to claim 1, characterized in that, The process of obtaining a diffusion image includes: The chaotic mask matrix and the scrambled image are processed in blocks; Based on the second pseudo-random sequence, the DNA encoding rules are dynamically selected to encode the image blocks and mask blocks; Based on the second pseudo-random sequence, the DNA operation method is dynamically selected to operate on the encoded image block and mask block to obtain the initial diffusion block; Perform DNA operation again on the current diffusion block and the previous diffusion block to obtain a secondary diffusion block; Repeat the above process to complete the diffusion operation for all image blocks and obtain the diffused image.
7. The method according to claim 1, characterized in that, The process of obtaining an encrypted image includes: Based on the second pseudo-random sequence, the DNA decoding rules are dynamically selected to decode the diffusion image; The decoded image blocks are reassembled into an RGB three-channel matrix and then merged to obtain an encrypted image.
8. The method according to claim 1, characterized in that, The process of obtaining the decrypted image includes: Based on the same initial parameters, pseudo-random sequences of Lorenz chaotic systems and variant Chua's chaotic circuits are repeatedly generated. Based on the pseudo-random sequence, the encrypted image is subjected to DNA inverse operation and inverse diffusion processing to obtain an inverse diffusion image; Based on the first pseudo-random sequence, the inverse diffusion image is reverse-scrambled to obtain the decrypted image.
9. The method according to claim 8, characterized in that, The process of performing DNA inverse operation and dediffusion processing on the encrypted image based on the pseudo-random sequence includes: Based on the second pseudo-random sequence, the DNA decoding rule is dynamically selected to decode the encrypted image; Based on the second pseudo-random sequence, the DNA inverse operation method is dynamically selected, and the secondary diffusion and primary diffusion are performed in reverse order to obtain the inverse diffusion image patch. The inverse diffusion image blocks are recombined into an RGB three-channel matrix to obtain the inverse diffusion image.
10. The method according to claim 8, characterized in that, The process of reversing the scrambling of the inverse diffusion image based on the first pseudo-random sequence includes: Based on the first pseudo-random sequence, generate a sorted index and its inverse index; Based on the inverse index, the RGB three channels of the inverse diffusion image are inversely rearranged respectively; The decrypted image is reconstructed by performing an inverse Zigzag scan on the inverse rearranged image.