Color image encryption method

By combining the Hamiltonian conservative chaotic system and dynamic DNA coding, the correlation problem between pixel values ​​that the DNA image encryption algorithm cannot handle in color images is solved, the encryption effect of color images is improved, the technical problems of color images are solved, and efficient color image encryption and decryption are achieved.

CN120730004APending Publication Date: 2025-09-30HARBIN UNIV OF COMMERCE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511091123.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-05
Publication Date
2025-09-30

AI Technical Summary

Technical Problem

Existing DNA image encryption algorithms fail to effectively break the correlation between different bits of pixel values ​​when processing color images, resulting in poor encryption effect.

Method used

A Hamiltonian conservative chaotic system is used to generate multiple initial chaotic sequences. Combining the chaotic game algorithm with dynamic DNA coding, a multi-level collaborative confusion mechanism of scrambling matrix and pseudo-DNA sequence is used to break the correlation between pixel space and value range, thus realizing the encryption of color images.

Benefits of technology

It improves the encryption efficiency and security of color images, enhances the ability to resist statistical analysis and differential attacks, effectively destroys the bit correlation within/between pixels, and forms a multi-level nonlinear obfuscation mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120730004A_ABST
    Figure CN120730004A_ABST
Patent Text Reader

Abstract

The invention discloses a color image encryption method, and relates to the technical field of image encryption. Comprising the following steps: reading color images according to three channels, and combining the color images into a first two-dimensional matrix; generating a plurality of encrypted chaotic sequences according to the hash value of the color image; carrying out multiple iterations on the expanded chaotic game algorithm by taking the first encrypted chaotic sequence as a selection rule to obtain a scrambling matrix; rearranging pixels in the first two-dimensional matrix to obtain a second two-dimensional matrix; performing dynamic DNA coding on the second two-dimensional matrix to obtain a first pseudo DNA sequence; setting four base points of the expanded chaos game algorithm as four basic groups and carrying out iteration to obtain a second pseudo DNA sequence; taking the fourth encrypted chaotic sequence as a mutation rule of a second pseudo DNA sequence to obtain a third two-dimensional matrix; and converting the third two-dimensional matrix into a fourth two-dimensional matrix to obtain a ciphertext image. According to the invention, the encryption efficiency of the color image can be improved, and the encryption security is enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image encryption, and in particular to a color image encryption method. Background Art

[0002] With the rapid development of network technology and the widespread use of mobile devices, the world's level of informatization continues to increase. Currently, data volumes are surging worldwide, and users are rapidly disseminating and sharing data. Among the vast amount of everyday data and information, images, with their unique intuitiveness and rich information content, have become an extremely important information carrier. The ubiquity of digital images, especially in today's visually oriented social environment, has made them an indispensable part of people's daily lives and work. As early as the mid-19th century, Shannon proposed two core principles for encryption algorithm design: diffusion and scrambling. Since Fridrich's application of chaotic systems to image encryption in 1997, the generated ciphertext images have achieved superior statistical properties. Since then, the application of chaos theory in image encryption has become increasingly widespread.

[0003] Due to the high sensitivity and complexity of chaotic dynamical systems to initial values, the chaotic sequences they generate exhibit good pseudo-randomness, making them commonly used as keys in encryption algorithms. Currently, chaotic systems can be divided into two categories based on their divergence: dissipative chaotic systems and conservative chaotic systems. Dissipative systems generate attractors, such as limit cycles, sinks (also known as point attractors), and chaotic attractors. The attractors of dissipative systems can be reconstructed using methods such as time-delay embedding. This makes such systems vulnerable to attacks in information security applications, thereby reducing their security. If the divergence is zero, the system is considered conservative chaotic. Conservative chaotic systems possess several interesting properties, such as a conservative phase volume, zero divergence, and a zero sum of Lyapunov exponents. More importantly, such systems do not generate attractors, thus avoiding reconstruction attacks and significantly increasing security. DNA image encoding has also seen widespread use in recent years due to its parallelism, large storage space, and fast computational speed. DNA coding utilizes the complementary principle of DNA. First, the color image is divided into three channels: R, G, and B. All pixels of the color image are then encoded into a DNA sequence consisting of A (adenine), T (thymine), C (cytosine), and G (guanine). After the DNA sequence is operated on and recombined, the resulting image is the coded image.

[0004] However, the DNA encryption algorithm treats a single pixel value as a whole for calculation, and it fails to effectively break the correlation between different bits of pixel values, resulting in poor color image encryption effect. Summary of the Invention

[0005] Based on this, it is necessary to provide a color image encryption method to address the above technical problems.

[0006] An embodiment of the present invention provides a color image encryption method, comprising: Read the color image according to the three channels of R, G and B, and combine the read three-channel images into a first two-dimensional matrix; Obtaining a hash value of the color image and generating multiple initial chaotic sequences according to the hash value; limiting the range of the multiple initial chaotic sequences by using a mod function to obtain multiple encrypted chaotic sequences, the multiple encrypted chaotic sequences including: a first encrypted chaotic sequence, a second encrypted chaotic sequence, a third encrypted chaotic sequence, a fourth encrypted chaotic sequence, and a fifth encrypted chaotic sequence; The chaotic game algorithm is extended from a triangle to a rectangle to obtain an extended chaotic game algorithm; the first encrypted chaotic sequence is used as a selection rule, and the extended chaotic game algorithm is iterated multiple times to obtain a scrambled matrix of the color image; the pixels in the first two-dimensional matrix are rearranged according to the scrambled matrix to obtain a second two-dimensional matrix; Using the second encrypted chaotic sequence as an encoding rule, dynamic DNA encoding is performed on each pixel in the second two-dimensional matrix to obtain a first pseudo-DNA sequence composed of four bases; the four base points of the extended chaotic game algorithm are set to the four bases to update the base points, and the updated base points are iterated using the third encrypted chaotic sequence as a selection rule to obtain a second pseudo-DNA sequence; and using the fourth encrypted chaotic sequence as a mutation rule for the second pseudo-DNA sequence, the first pseudo-DNA sequence is operated using a selective DNA operation method to obtain a third two-dimensional matrix; The third two-dimensional matrix is ​​transformed into a fourth two-dimensional matrix, and the fifth encrypted chaotic sequence is used as a decoding rule for dynamic decoding to obtain a ciphertext image.

[0007] Optionally, the color image is read according to three channels of R, G, and B, and the read three-channel images are combined into a first two-dimensional matrix, specifically including: The color image of size M×N×3 is read as three channels of R, G, and B based on the following formula: in, is the image after reading, Represents the three components of RGB respectively; The read three-channel images are combined into a first two-dimensional matrix, and the size of the first two-dimensional matrix is ​​M×N×3.

[0008] Optionally, a hash value of the color image is obtained, and multiple initial chaotic sequences are generated according to the hash value, specifically including: Convert hash value into multi-bit binary data , the initial value of the Hamiltonian conservative chaotic system is generated by different number combinations of binary data based on the following formula: The initial parameters of the Hamiltonian conservative chaotic system are generated based on the following formula: ; in, is the binary value converted from the image hash value. ; is the initial value of the generated Hamiltonian conservative chaotic system, ; and are the initial parameters of the Hamiltonian conservative chaotic system, mod For the mod function; A plurality of initial chaotic sequences are generated according to the initial values ​​and initial parameters of the Hamiltonian conservative chaotic system.

[0009] Optionally, multiple initial chaotic sequences are range-restricted by a mod function to obtain multiple encrypted chaotic sequences, specifically including: ; ; ; ; ; in, is the first initial chaotic sequence, is the second initial chaotic sequence, is the third initial chaotic sequence, is the fourth initial chaotic sequence, is the fifth initial chaotic sequence, is the first encrypted chaotic sequence, is the second encrypted chaotic sequence, is the third encrypted chaotic sequence, For the fourth encrypted chaos sequence, For the fifth encrypted chaos sequence, mod For the mod function.

[0010] Optionally, the chaotic game algorithm is extended from a triangle to a rectangle to obtain an extended chaotic game algorithm, which specifically includes: The three vertices of a triangle are used as the base points of the chaotic game algorithm; Expanding the three base points to the four vertices of a rectangle, where the four vertices of the rectangle correspond to the four DNA bases; A starting point is selected inside the rectangle, and a vertex of the rectangle is randomly selected. The starting point is connected to the selected vertex, and the midpoint of the connecting line is taken to update the starting point. The update of the starting point is iterated and the iteration is stopped after reaching a predetermined number of iterations, thereby obtaining the expanded chaotic game algorithm.

[0011] Optionally, the fifth encrypted chaotic sequence is used as a decoding rule for dynamic decoding, specifically including: The ciphertext image is read according to the three channels of R, G and B, and the read three-channel images are combined into a first decryption two-dimensional matrix; Using the fifth encrypted chaotic sequence as a coding rule to dynamically encode the first decrypted two-dimensional matrix to obtain a second decrypted two-dimensional matrix; The second decryption two-dimensional matrix is ​​iterated using the third encrypted chaotic sequence as a selection rule to obtain the first decryption pseudo-DNA sequence; the third decryption two-dimensional matrix is ​​obtained by using the fourth encrypted chaotic sequence as a mutation rule to select the DNA operation method; Using the second encrypted chaotic sequence as a decoding rule, dynamic DNA decoding is performed on each pixel in the third decrypted two-dimensional matrix to obtain a second decrypted pseudo-DNA sequence; using the first encrypted chaotic sequence as a selection rule, the second decrypted pseudo-DNA sequence is iterated multiple times to obtain the inverse scrambled matrix of the ciphertext image; The pixels in the third decryption two-dimensional matrix are rearranged according to the inverse scrambling matrix to obtain a fourth decryption two-dimensional matrix; and the fourth decryption two-dimensional matrix is ​​converted according to the size of the color image to complete the decryption operation of the ciphertext image and obtain the color image.

[0012] Compared with the prior art, the color image encryption method provided by the embodiment of the present invention has the following beneficial effects: The present invention effectively destroys the pixel space and value range correlation through chaotic sequences and scrambling matrices, and combines dynamic DNA coding with lightweight pseudo-DNA sequence operations. Because chaotic scrambling and DNA coding form a multi-level collaborative confusion mechanism at the pixel level, it can decouple pixel associations from the spatial and value range dimensions and realize nonlinear confusion at the bit level. While effectively interrupting the bit correlation within / between pixels and enhancing the ability to resist statistical analysis and differential attacks, it overcomes the shortcomings of traditional DNA encryption, such as low efficiency and insufficient processing of bit correlation within pixels, improves the encryption efficiency of color images, and enhances the security of encryption. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 A flowchart of a color image encryption method provided in one embodiment; Figure 2A schematic diagram of a three-dimensional phase space trajectory of a color image encryption method provided in one embodiment; Figure 3 A schematic diagram of a two-dimensional phase space trajectory of a color image encryption method provided in one embodiment; Figure 4 is a bifurcation diagram of a color image encryption method provided in one embodiment, Figure 4 The a in is the bifurcation diagram of parameter a in [-10,0], Figure 4 The b in is the bifurcation diagram of parameter b in [0,10]; Figure 5 A Lyapunov exponent graph of a color image encryption method provided in one embodiment; Figure 6 This is an effect diagram of an original image, encrypted image, and decrypted image of a color image encryption method provided in one embodiment. Figure 6 The a in is the original image, Figure 6 The b in is the encrypted image, Figure 6 c in it is the decrypted image; Figure 7 A histogram of an original image and an encrypted image in a color image encryption method provided in one embodiment; Figure 7 The a in is the original image histogram, Figure 7 Where b is the encrypted image histogram; Figure 8 A schematic diagram of three-channel correlation of a color image encryption method provided in one embodiment; Figure 8 a is a schematic diagram of the correlation between the R channels of the original image. Figure 8 b is a schematic diagram of the correlation between the original image G channel. Figure 8 c is a schematic diagram of the correlation between the B channel of the original image. Figure 8 d is a schematic diagram of the correlation between the encrypted image R channels. Figure 8 e is a schematic diagram of the correlation between the encrypted image G channels. Figure 8 f is a schematic diagram of the correlation of the encrypted image B channel.

[0014] Figure 9 This is a diagram showing the decryption effect of a noise attack on a color image encryption method provided in one embodiment; Figure 9 (a) is the decryption effect diagram of Gaussian noise 0.01 attack. Figure 9 (b) shows the decryption effect of the salt and pepper noise 0.05 attack; Figure 10 This is a diagram showing the decryption effect of a 50% cropping attack on a color image encryption method provided in one embodiment. DETAILED DESCRIPTION

[0015] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0016] However, the DNA encryption algorithm is relatively complex. If encryption is performed using actual DNA coding, the encryption time will be greatly extended while the final encryption effect will not be significantly improved.

[0017] An embodiment of the present invention provides a color image encryption method, the method comprising: The color image is read according to the three channels of R, G and B, and the read three-channel images are combined into a first two-dimensional matrix.

[0018] A hash value of a color image is obtained, and multiple initial chaotic sequences are generated based on the hash value. The multiple initial chaotic sequences are respectively range-limited using a mod function to obtain multiple encrypted chaotic sequences. The multiple encrypted chaotic sequences include: a first encrypted chaotic sequence, a second encrypted chaotic sequence, a third encrypted chaotic sequence, a fourth encrypted chaotic sequence, and a fifth encrypted chaotic sequence.

[0019] The chaotic game algorithm is extended from a triangle to a rectangle to obtain an extended chaotic game algorithm. The first encrypted chaotic sequence is used as a selection rule, and the extended chaotic game algorithm is iterated multiple times to obtain a scrambled matrix for the color image. The pixels in the first two-dimensional matrix are rearranged according to the scrambled matrix to obtain a second two-dimensional matrix.

[0020] The second encrypted chaotic sequence is used as the encoding rule to dynamically perform DNA encoding on each pixel in the second two-dimensional matrix, resulting in a first pseudo-DNA sequence consisting of four bases. The four bases of the extended chaotic game algorithm are set to the four bases to update the bases, and the updated bases are iterated using the third encrypted chaotic sequence as the selection rule to obtain the second pseudo-DNA sequence. Furthermore, the fourth encrypted chaotic sequence is used as the mutation rule for the second pseudo-DNA sequence, and the first pseudo-DNA sequence is operated on using the selective DNA operation method to obtain the third two-dimensional matrix.

[0021] The third two-dimensional matrix is ​​transformed into a fourth two-dimensional matrix, and the fifth encrypted chaotic sequence is used as a decoding rule for dynamic decoding to obtain a ciphertext image.

[0022] Specific implementation includes: 1. Hamiltonian conservative chaotic system.

[0023] The Hamiltonian conservative chaotic system equation proposed in this embodiment 1 is: The structural matrix of the system is: in, is the system parameter, is the system state variable, Figure 1 — Figure 5 The parameter values ​​selected are ,exist Figure 2 — Figure 5 The initial value selected is .

[0024] in, Figure 2 The schematic diagram of the three-dimensional phase space trajectory of the Hamiltonian conservative chaotic system constructed by the present invention is shown ( trajectories in three-dimensional phase space), Figure 3 The two-dimensional phase space trajectory diagrams of the Hamiltonian conservative chaotic system constructed by the present invention (part of the trajectory diagrams in the two-dimensional phase space) are shown, all of which show relatively complex trajectory states.

[0025] Furthermore, to demonstrate the good randomness of the sequences generated by this system, the NIST test was performed on the sequences generated by this system. Table 1 shows the NIST test parameter settings used during the test, and Table 2 shows the test results. The test results show that the sequences generated by the chaotic system proposed in this invention successfully passed the NIST randomness test, exhibiting good randomness and suitable for image encryption.

[0026] Table 1 NIST test parameter settings Table 2 NIST test results Figure 4 The parameters of the Hamiltonian conservative chaotic system constructed by the present invention are shown. and parameters From the bifurcation diagram, we can see that the parameters and Both have a large parameter space, which is conducive to the application of the system in image encryption methods.

[0027] Figure 5 The Lyapunov index diagram of the Hamiltonian conservative chaotic system constructed by the present invention is drawn, wherein the hollow circle solid line is the Lyapunov index of the Hamiltonian conservative chaotic system equation. The changing trend of the Lyapunov exponent, the square dotted line is the Hamiltonian conservative chaotic system equation The changing trend of the Lyapunov exponent, the triangle dotted line is the Hamiltonian conservative chaotic system equation The changing trend of the Lyapunov exponent, the dotted line is the Hamiltonian conservative chaotic system equation The changing trend of the Lyapunov exponent, the solid circular curve is the Hamiltonian conservative chaotic system equation The straight line is the change trend of the Lyapunov exponent, and the straight line is the sum of the Lyapunov exponents of all terms in the Hamiltonian conservative chaotic system equation. It can be seen that the system has multiple positive Lyapunov exponents, which proves that the system is in a hyperchaotic state, and the sum of its Lyapunov exponents is zero, which proves that the phase space volume of the system is conserved, which is consistent with the conservative chaotic system.

[0028] 2. Chaos game algorithm.

[0029] Description of the main rules of chaos game: 2.1 Set three points on the paper as base points (the three points are the vertices of a triangle); 2.2 basis points are marked with numbers 1, 2, and 3; 2.3 Choose a starting point inside the triangle (outside is also acceptable, as it will always be inside the triangle as the number of iterations increases). 2.4 Randomly select a base point; 2.5 Connect the current point to the selected base point and take the midpoint as the new starting point (select the position of the new starting point on the connecting line based on the ratio, here the midpoint is selected).

[0030] 2.6 After obtaining a new starting point, repeat steps 4-6.

[0031] The two-dimensional mathematical description of chaotic game is as follows: in, is the starting point position, B is the selected base point coordinate matrix, is the rule for selecting the base point coordinates, It is an important parameter in chaos game, which represents the proportion of new starting points selected during the game.

[0032] The chaotic game algorithm is extended from triangle to rectangle to obtain the extended chaotic game algorithm, which specifically includes: The three vertices of a triangle are used as the base points of the chaotic game algorithm. These base points are then extended to the four vertices of a rectangle, where the four vertices correspond to the four DNA bases. A starting point is selected within the rectangle, and a vertex of the rectangle is randomly selected. The starting point is connected to the selected vertex, and the midpoint of the connecting line is used to update the starting point. The update of the starting point is iterated until a predetermined number of iterations are reached, resulting in the expanded chaotic game algorithm.

[0033] 3. DNA coding and computing.

[0034] DNA is composed of four base molecules: A (adenine), T (thymine), C (cytosine), and G (guanine). According to the DNA base pairing principle, A and T, and C and G are complementary. In binary, 0 and 1 are also complementary, so 00 and 11, and 10 and 01 are also complementary. Table 3 lists all complex encoding methods.

[0035] Table 3 DNA encoding DNA operations are performed according to the rule that every two binary digits correspond to one DNA base. Because there are eight different DNA encoding methods, there are eight different algorithms for each common algorithm. Table 4 lists the corresponding DNA algorithms for each encoding method.

[0036] Table 4 DNA operation rules Next, we will use the house image (512×512×3) and describe the image encryption steps in Example 1 in detail.

[0037] Step 1: Read the color image P of size M×N×3 according to the three channels of R, G, and B.

[0038] in, The image after reading Represents the three components of RGB respectively.

[0039] Step 2: Combine the read three-channel images into a first two-dimensional matrix P1 with a size of M×N×3.

[0040] Step 3: Generate the initial chaotic sequence S1-S5 using the constructed Hamiltonian conservative chaotic system.

[0041] (3a) Use the SHA-256 algorithm to obtain the hash value of the original color image. In this example, the 64-bit hexadecimal hash value obtained is: 8C9D7C28409B90B31EADD1E3C4359ED0E0A8857087B6598F01A33E2A94AD55F (3b) Convert the generated hash value into 256-bit binary data , use different combinations to generate the initial values ​​and initial parameters of the constructed system respectively, the generation method is as follows: Generate initial values: Generate initial parameters ( ): in, is the binary value converted from the image hash value. is the initial value of the generated Hamiltonian conservative chaotic system, are the initial parameters of the Hamiltonian conservative chaotic system, mod For the mod function.

[0042] (3c) Generate multiple initial chaotic sequences based on the initial values ​​and initial parameters of the Hamiltonian conservative chaotic system , through the mod function, the range of multiple initial chaotic sequences is restricted to obtain multiple encrypted chaotic sequences .

[0043] ; ; ; ; ; in, is the first initial chaotic sequence, is the second initial chaotic sequence, is the third initial chaotic sequence, is the fourth initial chaotic sequence, is the fifth initial chaotic sequence, is the first encrypted chaotic sequence, is the second encrypted chaotic sequence, is the third encrypted chaotic sequence, For the fourth encrypted chaos sequence, It is the fifth encrypted chaos sequence.

[0044] Step 4: Expand the chaotic game algorithm from triangle to rectangle. Since the image used for encryption is operated in the form of a pixel value matrix, the chaotic game algorithm in the original triangular area cannot be directly applied to the matrix. Therefore, the present invention expands the chaotic game algorithm from triangle to rectangle so that it can be applied to matrix operations.

[0045] Using the first encrypted chaotic sequence As a selection rule, the extended chaotic game algorithm is iterated M×N×3 times to obtain a scrambled matrix of the color image. The pixels in the first two-dimensional matrix P1 are rearranged according to the generated scrambled matrix to obtain a second two-dimensional matrix P2 after scrambling.

[0046] Step 5: Use the second encrypted chaotic sequence S 2 As the encoding rule, dynamic DNA encoding is performed on each pixel in the second two-dimensional matrix P2 to obtain a first pseudo-DNA sequence P3 of length M×N×3 consisting of four bases (A, G, C, T).

[0047] Step 6: Set the four base points of the chaotic game after expansion to the rectangle to 4 bases (A, G, C, T) to update the base points and use the third encrypted chaotic sequence S 3 As the selection rule, the updated base point is iterated to obtain the second pseudo DNA sequence E1 with a length of M×N×3×4, and the fourth encrypted chaotic sequence is selected. S 4 As the mutation rule of the second pseudo-DNA sequence, it is used to select a DNA operation method to operate the first pseudo-DNA sequence to obtain a third two-dimensional matrix P4.

[0048] Step 7: Convert the third two-dimensional matrix P4 into a fourth two-dimensional matrix of M×N×3 , and using the fifth encrypted chaotic sequence S 5 Dynamic decoding is performed as a decoding rule to complete the encryption operation of the color image and obtain the ciphertext image .

[0049] The fifth encrypted chaotic sequence is used as a decoding rule for dynamic decoding, specifically including: The ciphertext image is read according to the three channels of R, G and B, and the read three-channel images are combined into a first decryption two-dimensional matrix.

[0050] The fifth encrypted chaotic sequence S 5 The first decrypted two-dimensional matrix is ​​dynamically encoded as an encoding rule to obtain a second decrypted two-dimensional matrix.

[0051] The third encrypted chaotic sequence S 3 As the selection rule, the second decryption two-dimensional matrix is ​​iterated to obtain the first decryption pseudo-DNA sequence. S 4 As the mutation rule, a DNA operation method is selected to obtain the third decryption two-dimensional matrix.

[0052] The second encrypted chaotic sequence S 2 As a decoding rule, dynamic DNA decoding is performed on each pixel in the third decrypted two-dimensional matrix to obtain the second decrypted pseudo DNA sequence. The second decrypted pseudo-DNA sequence is iterated multiple times as a selection rule to obtain the inverse scrambling matrix of the ciphertext image.

[0053] The pixels in the third decryption two-dimensional matrix are rearranged according to the inverse scrambling matrix to obtain a fourth decryption two-dimensional matrix. The fourth decryption two-dimensional matrix is ​​then converted according to the size of the color image to complete the decryption operation of the ciphertext image and obtain the color image.

[0054] Specific implementation includes: The third two-dimensional matrix P4 is restored to three RGB channels based on the following formula, and then the three channels are merged into a three-dimensional matrix: in, They are the R, G, and B channel components of the encrypted image respectively.

[0055] Similarly, the detailed steps of the decryption process in Example 1 based on the house image are as follows: Step 1: Transform the ciphertext image into a size of M×N×3 Read according to the three channels of R, G, and B.

[0056] in, The image after reading Represents the three components of RGB respectively.

[0057] Step 2: Combine the read three-channel images into a first decrypted two-dimensional matrix P1 , its dimensions are M×N×3.

[0058] Step 3: Generate chaotic sequences S1-S5 using the constructed Hamiltonian conservative chaotic system.

[0059] (3a) Use the SHA-256 algorithm to obtain the hash value of the original plaintext image. In this example, the 64-bit hexadecimal hash value obtained is: 8C9D7C28409B90B31EADD1E3C4359ED0E0A8857087B6598F01A33E2A94AD55F (3b) Convert the generated hash value into 256-bit binary data , use different combinations to generate the initial values ​​and initial parameters of the constructed system respectively, the generation method is as follows: Generate initial values: Generate initial parameters ( ): (3c) Generate multiple initial chaotic sequences based on the initial values ​​and initial parameters of the Hamiltonian conservative chaotic system , through the mod function to limit the range of multiple initial chaotic sequences, to obtain multiple encrypted chaotic sequences .

[0060] Step 4: Use the fifth encryption chaos sequence S 5 As the encoding rule, the first decrypted two-dimensional matrix is ​​dynamically encoded to obtain the second decrypted two-dimensional matrix P2 .

[0061] Step 5: Set the four base points of the expanded chaotic game to A, G, C, and T, and use the third encrypted chaotic sequence S 3 As a selection rule, the second decryption two-dimensional matrix P2 Iterate to generate the first decrypted pseudo-DNA sequence of length M×N×3×4, and select the fourth encrypted chaotic sequence S 4 As a mutation rule, it is used to select the DNA operation method. After the operation is completed, the third decryption two-dimensional matrix P3 is obtained. .

[0062] Step 6: Use the second encrypted chaotic sequence S 2 As a decoding rule, the third decryption two-dimensional matrix P3 Dynamic DNA decoding is performed on each pixel in to obtain the second decrypted pseudo-DNA sequence.

[0063] Step 7: Extend the chaotic game algorithm to the rectangle and use the first encrypted chaotic sequence generated by the chaotic system As a selection rule, the second decrypted pseudo-DNA sequence is iterated M×N×3 times to obtain the inverse scrambling matrix of the ciphertext image. According to the inverse scrambling matrix, the third decrypted two-dimensional matrix P3 Rearrange the pixels in to get the fourth decrypted two-dimensional matrix P4 The fourth decryption two-dimensional matrix is ​​converted into an M×N×3 matrix according to the size of the color image to complete the decryption operation of the ciphertext image and obtain the color image.

[0064] Next, the security of the image encryption algorithm proposed in this invention will be analyzed: 1. Information entropy analysis: Information entropy refers to the average amount of information contained in each received message. For images, a good encrypted image should have good randomness and its information entropy should be maintained at a high level. The information entropy formula is: Indicates the ratio of the grayscale pixel distribution of the image. Therefore, theoretically, the more evenly the pixel distribution of the image is, the closer its information entropy should be to 8. Therefore, the information entropy of the encrypted image should be as close to 8 as possible, proving that its pixel distribution is evenly distributed and its information is chaotic. In this example, house(512 )The information entropy of the encrypted image reaches 7.9998, which can be considered to have good randomness.

[0065] 2. Encryption effect analysis: Figure 6 The encryption and decryption effect diagrams are displayed. After the image is encrypted using this method, no relevant information of the original image can be obtained from the ciphertext image with the naked eye, which proves the effectiveness of the encryption method. At the same time, the decrypted image maintains a high degree of consistency with the original plaintext image, confirming the reversibility of the encryption method.

[0066] 3. Histogram analysis: A histogram describes the distribution of pixel values ​​within an image. The more uniformly the pixel values ​​of an image are distributed, the more difficult it is to perform statistical analysis. Figure 7 As can be seen from the figure, the pixel values ​​of the three channels in the original image are unevenly distributed, exhibiting a specific distribution pattern. In contrast, the pixel values ​​of the encrypted image are more evenly distributed, ranging from 0 to 255. This indicates that the encrypted image hides any statistical features in the image, demonstrating the algorithm's resistance to statistical analysis attacks.

[0067] 4. Correlation analysis: Statistical attacks are a common attack method in information transmission. A good image encryption algorithm must have a low correlation between adjacent pixels to resist statistical attacks. The correlation coefficient objectively shows the correlation level between adjacent pixels in the image horizontally, vertically, and diagonally. The formula for calculating the correlation coefficient is as follows:

[0068] Correlation coefficient The closer the value is to 1, the higher the correlation level between adjacent pixels. For encrypted images, the correlation coefficients in the horizontal, vertical, and horizontal directions should be close to 0 to indicate that there is no correlation between adjacent pixels. Figure 8 The results of the correlation analysis of the images before and after encryption are presented. As can be seen from the figure, the plaintext image pixels in the three directions are concentrated near the diagonal, indicating high correlation between adjacent pixels. In contrast, the encrypted image pixels in the three directions are randomly distributed throughout the entire area, indicating low correlation between adjacent pixels. This demonstrates that the encrypted image generated by this method is effectively resistant to statistical attacks. Table 5 shows the pixel correlations for each channel in the horizontal, vertical, and diagonal directions before and after encryption.

[0069] Table 5 Correlation comparison between original image and ciphertext image 5. Anti-noise attack analysis Environmental interference is a major cause of information loss during image data transmission, and communication noise is a particularly common type of interference. When an encrypted image is corrupted by noise, some information is lost, and the image may even be unable to be correctly decrypted. Figure 9 The decryption effect of the encrypted image of this scheme after being subjected to noise attack is demonstrated. Taking the house image as an example, salt and pepper noise with a variance of 0.05 and Gaussian noise with a variance of 0.01 are added to it for interference. It can be seen that most of the important information of the decrypted image can still be recognized. Table 4 shows the PSNR value of the decrypted image after the noise attack, which can confirm the excellent performance of this scheme in resisting noise attacks.

[0070] 6. Analysis of Anti-cropping Attacks During the image transmission process, network congestion, packet loss, or data transmission protocol defects may occur, resulting in incomplete data received by the terminal. Figure 10 The decryption effect after cropping 50% of the encrypted ciphertext image is shown. The decrypted image does not affect normal reading. Table 6 shows the PSNR value of the cropped decrypted image, which proves that this encryption scheme has good robustness.

[0071] Table 6 PSNR of decrypted images after attack 7. Analysis of Anti-Differential Attack Capabilities One method for cracking ciphertext images is a differential attack, in which the attacker compares the relationship between a pair of ciphertext and plaintext and exploits this relationship and patterns to crack the ciphertext image. A differential attack is a type of chosen-plaintext attack. In image encryption, two important variables for measuring the difference between two images are the null pixel change rate (NPCR) and the unified average change intensity (UACI). The NPCR reflects the ratio of the number of unequal pixels in the same position between the two images to the total number of pixels in the image. The UACI represents the overall average change density, indicating the average change intensity of a planar image. It primarily reflects the average change strength of the difference between plaintext digital image data and encrypted ciphertext digital image data. The ideal values ​​for the NPCR and UACI are 99.6094% and 33.4635%, respectively. However, in practice, these values ​​depend on the image format and size and are not static. For a 512×512 image, the NPCR should be greater than 99.5893%, and the UACI should be between (33.3730% and 33.5541%). Table 7 shows the NPCR and UACI values ​​for the example images.

[0072] Table 7 NPCR and UACI From the above tests, it can be found that the color image encryption algorithm based on the Hamiltonian conservative chaotic system and chaotic game proposed in the present invention has good encryption performance. The proposed Hamiltonian conservative chaotic system has a large chaotic parameter range, and after the image is encrypted using the chaotic game method, the image grayscale value distribution is relatively uniform. The information entropy of the encrypted image is stabilized at a high level and has good robustness under various attacks, which can prove that the encryption algorithm has strong security.

[0073] The above-described embodiments merely illustrate several implementations of the present invention. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, and all such variations and improvements fall within the scope of protection of the present invention.

Claims

1. A color image encryption method, characterized in that: include: Read the color image according to the three channels of R, G and B, and combine the read three-channel images into a first two-dimensional matrix; Obtain the hash value of the color image and generate multiple initial chaotic sequences according to the hash value; Using a mod function to limit the range of multiple initial chaotic sequences respectively, a plurality of encrypted chaotic sequences are obtained, wherein the plurality of encrypted chaotic sequences include: a first encrypted chaotic sequence, a second encrypted chaotic sequence, a third encrypted chaotic sequence, a fourth encrypted chaotic sequence, and a fifth encrypted chaotic sequence; The chaotic game algorithm is extended from a triangle to a rectangle to obtain an extended chaotic game algorithm; the first encrypted chaotic sequence is used as a selection rule, and the extended chaotic game algorithm is iterated multiple times to obtain a scrambled matrix of the color image; the pixels in the first two-dimensional matrix are rearranged according to the scrambled matrix to obtain a second two-dimensional matrix; Using the second encrypted chaotic sequence as an encoding rule, dynamic DNA encoding is performed on each pixel in the second two-dimensional matrix to obtain a first pseudo-DNA sequence composed of four bases; the four base points of the extended chaotic game algorithm are set to the four bases to update the base points, and the updated base points are iterated using the third encrypted chaotic sequence as a selection rule to obtain a second pseudo-DNA sequence; and using the fourth encrypted chaotic sequence as a mutation rule for the second pseudo-DNA sequence, the first pseudo-DNA sequence is operated using a selective DNA operation method to obtain a third two-dimensional matrix; The third two-dimensional matrix is ​​transformed into a fourth two-dimensional matrix, and the fifth encrypted chaotic sequence is used as a decoding rule for dynamic decoding to obtain a ciphertext image.

2. A color image encryption method according to claim 1, characterized in that: The step of reading the color image according to the three channels of R, G, and B and combining the read three-channel images into a first two-dimensional matrix specifically includes: The color image of size M×N×3 is read as three channels of R, G, and B based on the following formula:

3. Among them, is the image after reading, Represents the three components of RGB respectively; The read three-channel images are combined into a first two-dimensional matrix, and the size of the first two-dimensional matrix is ​​M×N×3.

4. A color image encryption method as claimed in claim 1, characterized in that: The step of obtaining a hash value of the color image and generating a plurality of initial chaotic sequences according to the hash value specifically includes: Convert hash value into multi-bit binary data , the initial value of the Hamiltonian conservative chaotic system is generated by different number combinations of binary data based on the following formula:

5. Generate the initial parameters of the Hamiltonian conservative chaotic system based on the following formula: ; in, is the binary value converted from the image hash value. ; is the initial value of the generated Hamiltonian conservative chaotic system, ; and are the initial parameters of the Hamiltonian conservative chaotic system, mod For the mod function; A plurality of initial chaotic sequences are generated according to the initial values ​​and initial parameters of the Hamiltonian conservative chaotic system.

6. A color image encryption method as claimed in claim 3, characterized in that: The method of limiting the range of multiple initial chaotic sequences by using the mod function to obtain multiple encrypted chaotic sequences specifically includes: ; ; ; ; ; in, is the first initial chaotic sequence, is the second initial chaotic sequence, is the third initial chaotic sequence, is the fourth initial chaotic sequence, is the fifth initial chaotic sequence, is the first encrypted chaotic sequence, is the second encrypted chaotic sequence, is the third encrypted chaotic sequence, For the fourth encrypted chaos sequence, For the fifth encrypted chaos sequence, mod For the mod function.

7. A color image encryption method as claimed in claim 1, characterized in that: The method of extending the chaotic game algorithm from a triangle to a rectangle to obtain the extended chaotic game algorithm specifically includes: The three vertices of a triangle are used as the base points of the chaotic game algorithm; Expanding the three base points to the four vertices of a rectangle, where the four vertices of the rectangle correspond to the four DNA bases; A starting point is selected inside the rectangle, and a vertex of the rectangle is randomly selected. The starting point is connected to the selected vertex, and the midpoint of the connecting line is taken to update the starting point. The update of the starting point is iterated and the iteration is stopped after reaching a predetermined number of iterations, thereby obtaining the expanded chaotic game algorithm.

8. A color image encryption method as claimed in claim 1, characterized in that: The dynamic decoding using the fifth encrypted chaotic sequence as a decoding rule specifically includes: The ciphertext image is read according to the three channels of R, G and B, and the read three-channel images are combined into a first decryption two-dimensional matrix; Using the fifth encrypted chaotic sequence as a coding rule to dynamically encode the first decrypted two-dimensional matrix to obtain a second decrypted two-dimensional matrix; The second decryption two-dimensional matrix is ​​iterated using the third encrypted chaotic sequence as a selection rule to obtain the first decryption pseudo-DNA sequence; the third decryption two-dimensional matrix is ​​obtained by using the fourth encrypted chaotic sequence as a mutation rule to select the DNA operation method; Using the second encrypted chaotic sequence as a decoding rule, dynamic DNA decoding is performed on each pixel in the third decrypted two-dimensional matrix to obtain a second decrypted pseudo-DNA sequence; using the first encrypted chaotic sequence as a selection rule, the second decrypted pseudo-DNA sequence is iterated multiple times to obtain the inverse scrambled matrix of the ciphertext image; The pixels in the third decryption two-dimensional matrix are rearranged according to the inverse scrambling matrix to obtain a fourth decryption two-dimensional matrix; and the fourth decryption two-dimensional matrix is ​​converted according to the size of the color image to complete the decryption operation of the ciphertext image and obtain the color image.