Color image encryption method and device based on coupled map lattice system
By adopting a method based on a coupled image grid system in image encryption, chaotic sequences are generated and image chaotic and diffusion are performed, the problems of low security and vulnerability in the prior art are solved, and high-security image encryption is achieved.
Patent Information
- Application Number
- CN202510272986.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-06-06
AI Technical Summary
The existing image encryption algorithm based on the coupled image grid (CML) model has problems such as low security and susceptibility to select plaintext attacks, and insufficient use of chaotic sequences, resulting in insufficient key space and short periods.
A color image encryption method based on a coupled image lattice system is adopted, and the initial value of the coupled image lattice system is generated by using the hash value of the color plaintext image and an external key, and the chaotic sequence is iteratively generated, and the images are chaotic and diffused through the index matrix to generate an encrypted color image.
It enhances the randomness of chaotic sequences during the iteration process, reduces the periodicity of chaotic systems, improves the security of encryption methods, resists selection plaintext attacks, and has sufficient key space and high key sensitivity.
Smart Images

Figure CN120111152A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image encryption technology, and in particular to a color image encryption method and device based on a coupled image lattice system. Background Art
[0002] With the advancement of network communication technology, a large amount of image data is widely disseminated in the network. The transmission of some confidential images (such as pathological images for remote diagnosis in medicine, military images involving military secrets, and commercial secrets) is threatened by tampering, illegal theft, and malicious attacks. Therefore, it is particularly important to ensure the security of image transmission. Image encryption is an important means to protect image security. The image itself has the characteristics of large data volume, high redundancy, and high correlation between pixels. This requires that the permutation and diffusion algorithms of image encryption are more effective than text encryption. In recent years, the chaotic encryption algorithm that relies on dynamics is a nonlinear system with characteristics such as ergodicity, pseudo-randomness, unpredictability, and high sensitivity to initial values. It is more suitable for image encryption.
[0003] However, the f(x) function of many existing image encryption algorithms based on the coupled map lattice (CML) model mostly adopts a one-dimensional Logistic function. However, the Logistic chaotic system has disadvantages such as short period and insufficient key space. For example, Wang et al. proposed a block image encryption algorithm based on CML (XY Wang, XM Bao. A novel block cryptosystem based on the coupled chaotic map lattice. Nonlinear Dynamics, 2013, 72 (4): 707-715), Wang et al. also proposed a color image encryption algorithm using CML and DNA operations (XY Wang, HL Zhang, XM Bao. Color image encryption scheme using CML and DNA sequence operations, Biosystems (2016) 19-26), Wu et al. proposed a color image DNA encryption algorithm based on CML (XJ. Wu, KS Wang, XY Wang, et al. Color image DNA encryption using NCA map-based CML and one-time keys, Signal Processing 148 (2018) 272-287). In addition, in the process of generating CML chaotic sequence X, it is necessary to bring in the f(x) chaotic system to generate intermediate sequences. These intermediate sequences are also a kind of chaotic sequence. It also takes a certain amount of time to calculate f(x). However, in the traditional encryption algorithm based on CML chaotic system, only the X sequence is used, resulting in the lack of chaotic sequence, making the security of the original encryption algorithm not very high. There are also some algorithms that are only related to the key during the encryption process, making the encryption algorithm vulnerable to chosen plaintext attacks and unable to meet the requirements of high security. Summary of the invention
[0004] In view of the problem that traditional encryption methods have low security and are susceptible to chosen plaintext attacks, the present invention provides a color image encryption method and device based on a coupled image lattice system.
[0005] In a first aspect, the present invention provides a color image encryption method based on a coupled image grid system, comprising:
[0006] Step 1: Generate the initial value of the coupled image lattice system using the hash value of the color plaintext image P and the external key;
[0007] Step 2: Iterating the coupled image lattice system based on given control parameters and initial values to generate a chaotic sequence F corresponding to the chaotic system f(x) and a chaotic sequence X corresponding to the coupled image lattice system;
[0008] Step 3: Sort the chaotic sequence F and the chaotic sequence X and generate the corresponding index matrix findex and index matrix xindex;
[0009] Step 4: Reduce the dimension of the color plaintext image P to generate a reduced-dimensional image P 1 ;
[0010] Step 5: Use the index matrix findex and the index matrix xindex to reduce the dimension of the image P 1 Perform scrambling to generate the permuted image P b ;
[0011] Step 6: Transform the chaotic sequence F and the chaotic sequence X to generate two images P that are identical to the replacement image P. b Diffusion matrices with the same size and channel separation were performed separately;
[0012] Step 7: Use the two diffusion matrices after channel separation to transform the permuted image P b Diffusion is performed to generate an encrypted color image.
[0013] Furthermore, step 1 specifically includes:
[0014]
[0015] Where H represents the hash value of the color plaintext image P, H bin Represents the binary sequence corresponding to H, Str2Bin(*) means converting the hash value into the corresponding binary sequence, Reshape(H bin ,10,40) means H bin The elements of are divided into 10 groups of 40 bits to form a two-dimensional sequence matrix. ks represents the converted two-dimensional sequence matrix with a size of 10×40. ks(i) represents a key sequence with a length of 40. i, j, and k represent the index of ks, 1≤i≤8, 2≤j≤9, and 3≤k≤10. All combinations of the three indexes i, j, and k are traversed. Each combination generates a Q value. All Q values are sequentially composed into a sequence Q(index), 1≤index≤512. bin2dec(*) represents the representation of binary numbers as decimal numbers. X 0 (q) represents the initial value of the qth grid, F 0 (q) represents the initial value of the chaotic system f(x), q = 1, 2, ..., L, L is the number of grids.
[0016] Furthermore, in step 2, the coupled image lattice system is represented by the following formula:
[0017]
[0018] Among them, x n+1 (i) represents the state of the i-th grid at time n+1, ε is the composite coupling parameter, f(*) is the chaotic mapping function, i, j, k, a, b are spatial subscripts, i, j, k, a, b = 1, 2, ..., L, L is the number of grids, and j, k, a, b are generated according to the grid index i according to the following formula:
[0019]
[0020] affine(*) represents affine transformation.
[0021] Furthermore, step 3 specifically includes:
[0022] Sort the chaotic sequence F in ascending order by column to generate the sorting result SF 1 And the corresponding index matrix findex; sort the chaotic sequence in ascending order by row to generate the sorting result SX 1 And the corresponding index matrix xindex.
[0023] Furthermore, step 4 specifically includes:
[0024] Separate the channels of the color plaintext image P to generate an image matrix P with three channels R , P G and P B ;
[0025] The three-channel image matrix P R , P G and P B The three converted one-dimensional sequences are combined vertically to obtain the reduced-dimensional image P. 1 .
[0026] Furthermore, step 5 specifically includes:
[0027]
[0028] Among them, i∈(0,3),j∈(0,MN), P′ represents the image P after dimensionality reduction using the index matrix findex 1 The permuted image obtained after row permutation; P b represents the permuted image obtained by permuting the permuted image P′ by using the index matrix xindex; P′[i][findex[j]] represents the element of the i-th findex[j] column in P′, Pb [xindex[i]][j] represents P b The element at row xindex[i] and column j in .
[0029] Furthermore, step 6 specifically includes:
[0030] Convert the chaotic sequence F and chaotic sequence X into integer sequences F of 0 to 255 respectively. p and X p ;
[0031] The integer sequence F p Transformed into the replacement image P b Diffusion matrix Fph with the same size, and channel separation is performed on it to obtain three matrices with the same size as the color plaintext image and
[0032] The integer sequence X p Transformed into the replacement image P b Diffusion matrix Xph with the same size is used to separate channels, and three matrices with the same size as the color plaintext image are obtained. and
[0033] Furthermore, step 7 specifically includes:
[0034] The replacement image P b Perform channel separation to generate an image matrix R of three channels 1 , G 1 and B 1 ;
[0035] The two diffusion matrices after channel separation are used to calculate the image matrix R of the three channels according to the following formula: 1 , G 1 and B 1 Diffusion is performed to generate the corresponding three diffusion matrices R 2 , G 2 and B 2 ;
[0036]
[0037] Among them, ⊕ represents the XOR operation. When Fph is Xph When P represents R 1 , C represents R 2 ; When Fph is Xph When P represents G 1 , C represents G 2 ; When Fph is Xph When P represents B 1 , C represents B 2 ;
[0038] For the three diffusion matrices R 2 , G 2 and B 2 Merge them to get the encrypted color image.
[0039] In a second aspect, the present invention provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method described in the first aspect when executing the program.
[0040] In a third aspect, the present invention provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the first aspect.
[0041] The beneficial effects of the present invention are:
[0042] (1) The present invention utilizes the chaotic sequence generated by the coupled image lattice system. In the encryption process, the affine transformation is used to randomly select non-adjacent coupled image lattices, thereby enhancing the randomness of the chaotic sequence generated during the iteration process. The use of multi-image lattice coupling to generate the chaotic sequence further reduces the periodicity of the chaotic system, effectively enhancing the security of the encryption method of the present invention.
[0043] (2) In the image encryption method of the present invention, the color image is reduced in dimension, which improves the scrambling efficiency of the encryption process and effectively improves the security of the encryption method of the present invention.
[0044] (3) In the encryption method of the present invention, the initial value and control parameters of the chaotic system are related to the plaintext image, so that the key is not only related to the plaintext image, but also to the external key, which enhances the ability of the encryption method of the present invention to resist chosen plaintext attacks.
[0045] (4) Experiments have shown that the encryption method of the present invention has sufficient key space and high key sensitivity, and has high security and applicability. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of a flow chart of an image encryption method based on a coupled image grid system provided by an embodiment of the present invention;
[0047] Figure 2 The encryption and decryption effect diagrams of the method of the present invention provided in the embodiment of the present invention are as follows: (a) is a plaintext image; (b) is a ciphertext image; (c) is a decrypted image;
[0048] Figure 3 Figure 1 shows the key sensitivity test result provided by the embodiment of the present invention: (a) is a plaintext image; (b) is a ciphertext image; (c) is a decrypted image using a correct key; (d) is a decrypted image using an incorrect key;
[0049] Figure 4 Correlation distribution diagram of adjacent pixels of plaintext image and ciphertext image provided by the embodiment of the present invention: (a)-(c) are the horizontal correlation of three pixel channels of plaintext image (left) and ciphertext image (right); (d)-(f) are the vertical correlation of three pixel channels of plaintext image (left) and ciphertext image (right); (g)-(i) are the diagonal correlation of three pixel channels of plaintext image (left) and ciphertext image (right);
[0050] Figure 5 Histograms of plaintext images, ciphertext images, and decrypted images provided in the embodiments of the present invention: (a) is a plaintext image histogram; (b) is a ciphertext image histogram;
[0051] Figure 6 The shearing attack test result diagram provided by the embodiment of the present invention: (a) is the image after shearing 1 / 16 at the upper left corner of the ciphertext image; (b) is the image after shearing 1 / 8 at the center of the ciphertext image; (c) is the image after shearing 1 / 4 at the lower right corner of the ciphertext image; (d) is the decrypted image corresponding to (a); (e) is the decrypted image corresponding to (b); (f) is the decrypted image corresponding to (c);
[0052] Figure 7 A structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0054] like Figure 1 As shown, the embodiment of the present invention provides a color image encryption method based on a coupled image lattice system. Assuming that the size of the color plaintext image P in this embodiment is M×N×3, M is the number of rows, N is the number of columns, and 3 is the number of channels, the encryption method includes the following steps:
[0055] S101: Generate the initial value of the coupled image lattice system using the hash value of the color plaintext image P and the external key;
[0056] Specifically, in this embodiment, the following formula is used to generate the initial value of the coupled image lattice system:
[0057]
[0058] Wherein, H represents the hash value of the color plaintext image P (in this embodiment, the hash function SHA-512 is used to generate the 512-bit hash value of the plaintext image), H bin Represents the binary sequence corresponding to H, Str2Bin(*) means converting the hash value into the corresponding binary sequence, Reshape(H bin ,10,40) means H bin The elements of are divided into 10 groups of 40 bits to form a two-dimensional sequence matrix. ks represents the converted two-dimensional sequence matrix with a size of 10×40, which can be written as ks=[ks 1 ,ks 2 ,ks 3 ,…ks 10 ], ks(i) represents a key sequence with a length of 40, i, j, k represent the index of ks, 1≤i≤8, 2≤j≤9, 3≤k≤10, traverse all combinations of the three indexes i, j, k, each combination generates a corresponding Q value, and all Q values are sequentially composed of a sequence Q(index), 1≤index≤512, bin2dec(*) represents the representation of binary numbers as decimal numbers, X 0 (q) represents the initial value of the qth grid, F 0 (q) represents the initial value of the chaotic system f(x), q = 1, 2, ..., l, l is the number of grids.
[0059] As an example, when traversing all combinations of three indexes i, j, and k, you can first fix the values of two of the indexes and traverse only the other index. For example, among the three groups of sequences, when i is 1, j is 2, and k is 3, a group of sequences Q(1) is generated; when i is 1, j is 2, and k is 4, a group of sequences Q(2) is generated; and so on, i takes values 1-8, j takes values 2-9, and k takes values 3-10, and all sequences Q(index) are generated, with an index range of 1-512.
[0060] S102: iterating the coupled image lattice system based on given control parameters and initial values to generate a chaotic sequence F corresponding to the chaotic system f(x) and a chaotic sequence X corresponding to the coupled image lattice system; wherein the sizes of the sequence F and the sequence X are 3M×N;
[0061] Specifically, the coupled image lattice system in this embodiment is expressed by the following formula:
[0062]
[0063] Among them, x n+1 (i) represents the state of the i-th grid at time n+1, ε is the composite coupling parameter, f(*) is the chaotic mapping function, i, j, k, a, b = 1, 2, ..., L, L is the number of grids. In this embodiment, L = 100. i, j, k, a, b are spatial subscripts, j, k, a, b are generated from the grid index i according to the following formula, where affine(*) represents affine transformation.
[0064]
[0065] From this, it can be seen that for a certain grid, this embodiment uses affine transformation to select non-adjacent grid points, and then uses the values of non-adjacent grids that are not adjacent to it at the same moment to generate the value of the grid at the next moment, which makes the generated chaotic sequence more random, and makes the subsequent encryption process based on the chaotic sequence more difficult to crack.
[0066] It can be understood that when f(*) is a chaotic system, the coupled image lattice system shows its chaotic characteristics, so the mapping function f(*) can be an arbitrary chaotic mapping.
[0067] In this embodiment, the chaotic mapping function f(*) adopts Logistic mapping, and the formula is as follows:
[0068] f(x)=μx(1-x)
[0069] Among them, the independent variable x∈[0,1], and the control parameter μ∈(3.5,4).
[0070] Taking the calculation of space subscripts j and k as an example, the formula for affine transformation is as follows:
[0071]
[0072] Among them, c 1 、c 2 、c 3 、c 4 、c 5 、c 6 is the parameter of the affine transformation. In this example, the parameter value selected is c 1 、c 2 、c 3 、c 4 、c 5 、c 6 =3.237,2.891,1.256,4.023,5.374,7.129.
[0073] In this embodiment, in order to eliminate the transient effect, in the process of iterating the coupled image lattice system, the first l 0 The chaotic sequence is iterated for 3M×N times to obtain the f(x) chaotic sequence F and the coupled image lattice chaotic sequence X. In this embodiment, the size of the chaotic sequences F and X are both 3M×N. 0 The size can be specified as required.
[0074] S103: sorting the chaotic sequence F and the chaotic sequence X and generating corresponding index matrices findex and xindex;
[0075] Specifically, the chaotic sequence F is sorted in ascending order by column to generate the sorting result SF 1 And the corresponding index matrix findex; sort the chaotic sequence in ascending order by row to generate the sorting result SX 1 And the corresponding index matrix xindex. The process can be expressed by the following formula:
[0076]
[0077] Among them, sort(F,0) means sorting the sequence F in ascending order by column, sort(X,1) means sorting the sequence X in ascending order by row, SF 1 Indicates the ascending sorting result of sequence F; SX 1 Indicates the result of sorting sequence X in ascending order.
[0078] S104: Perform dimensionality reduction on the color plaintext image P to generate a dimensionality-reduced image P 1 ;
[0079] Specifically, the color plaintext image P is channel-separated to generate an image matrix P of three channels: R , P G and P B , as shown below:
[0080] P R ,P G ,P B =split(P)
[0081] Among them, split(*) means separating the three channels of the color image into independent image matrices.
[0082] The three-channel image matrix P R , P G and P B All are converted into one-dimensional sequence R 1 , G 1 and B 1 , and transform the three one-dimensional sequences R 1 , G1 and B 1 Combine in the vertical direction to get the reduced-dimensional image P 1 The above process can be expressed by the following formula:
[0083]
[0084] Among them, flatten(*) means converting a two-dimensional matrix into a one-dimensional sequence, and vstack(*) means reorganizing multiple matrices in the vertical direction. 1 The size is 3M×N.
[0085] S105: Use the index matrix findex and the index matrix xindex to perform dimension reduction on the image P 1 Perform scrambling to generate the permuted image P b ;
[0086] Specifically, the scrambling process is expressed by the following formula:
[0087]
[0088] Among them, i∈(0,3),j∈(0,MN), P′ represents the image P after dimensionality reduction using the index matrix findex 1 The permuted image obtained after row permutation; P b represents the permuted image obtained by permuting the permuted image P′ by using the index matrix xindex; P′[i][findex[j]] represents the element of the i-th findex[j] column in P′, P b [xindex[i]][j] represents P b The element at row xindex[i] and column j in .
[0089] S106: Convert the chaotic sequence F and the chaotic sequence X to generate two images P b Diffusion matrices with the same size and channel separation were performed separately;
[0090] Specifically, the integer sequence F p Transformed into the replacement image P b Diffusion matrix Fph with the same size, and channel separation is performed on it to obtain three matrices with the same size as the color plaintext image and
[0091] The integer sequence X p Transformed into the replacement image P b Diffusion matrix Xph with the same size is used to separate channels, and three matrices with the same size as the color plaintext image are obtained. and
[0092] In this embodiment, the sequence F and the sequence X are converted into an integer sequence F of 0 to 255 according to the following formula: p and X p :
[0093]
[0094] Among them, floor(*) represents the floor function, mod represents the modulo operation, and i=1,2,3…,3MN.
[0095] S107: Using the two diffusion matrices after channel separation to transform the replacement image P b Diffusion is performed to generate an encrypted color image.
[0096] Specifically, the replacement image P is first b Convert to a matrix with 3M rows and N columns Then replace the image Separate the image matrix R into three channels 1 , G 1 and B 1 ;
[0097]
[0098] The image matrix R of the three channels is transformed into the following formula using two diffusion matrices Fph and Xph: 1 , G 1 and B 1 Diffusion is performed to generate the corresponding three diffusion matrices R 2 , G 2 , B 2 ;
[0099]
[0100] Among them, ⊕ represents the XOR operation. When Fph is Xph When P represents R 1 , C represents R 2 Similarly, when Fph is Xph When P represents G 1 , C represents G 2 ; When Fph is Xph When P represents B 1 , C represents B 2 .
[0101] The three diffused matrices are merged to obtain an encrypted color image, as shown in the following formula:
[0102] Cb=stack(R 2 ,G 2 ,B 2 )
[0103] The decryption method is the inverse operation of the encryption method and will not be described in detail here.
[0104] In order to verify the effectiveness of the image encryption method provided by the present invention, the present invention also provides the following experimental data.
[0105] The hardware environment of this verification experiment is shown in Table 1:
[0106] Table 1 Hardware and software environment
[0107]
[0108] The parameter values set in this verification experiment are shown in Table 2:
[0109] Table 2 Algorithm input parameters
[0110] type value CML Control Parameters ε=0.203 CML Control Parameters μ=4 CML grid number L=100
[0111] Figure 2 The encryption and decryption effect diagram of the method of the present invention is shown below: Figure 2 (a) is a plain text color image, Figure 2 (b) is the encrypted color image, Figure 2 (c) is the decrypted image. Figure 2 (b) It can be seen that the obtained ciphertext image is similar to noise, and no information of the original image can be obtained from the encrypted image; Figure 2 (c) It can be seen that the decrypted image is exactly the same as the original image.
[0112] Figure 3 is the key sensitivity analysis diagram, where Figure 3 (a) is the plaintext image, Figure 3 (b) is the ciphertext image, Figure 3 (c) is the image decrypted using the correct key. 0 Modified to ε 0 +10 -14 , other parameters remain unchanged, and the original ciphertext image is decrypted. The decryption effect is as follows Figure 3 As shown in (d), it can be seen that when the key value changes slightly, the decrypted image is in a completely chaotic state, indicating that the method of the present invention has a strong key sensitivity.
[0113] In the horizontal, vertical and diagonal directions of the three pixel channels of the Lena plaintext image and the ciphertext image, 5000 pairs of adjacent pixels are randomly selected for testing. The correlation relationship between the three channels of the plaintext and ciphertext images in the three directions is as follows: Figure 4 As shown. Figure 4 (a)~ Figure 4 In (i), the left side shows the correlation of the three channels of the plaintext image in three directions, and the right side shows the correlation of the three channels of the ciphertext image in three directions. Figure 4 It can be seen that the correlation between adjacent pixels in the three directions of the original Lena image is relatively strong, while there is almost no relationship between adjacent points in the ciphertext image.
[0114] Figure 5 Figure 2 is the three-channel statistical histogram of the Lena plaintext image and the ciphertext image. (a) is the three-channel statistical histogram of the original image, and (b) is the three-channel statistical histogram of the encrypted image. It can be seen intuitively and at the same time that the pixel values of the ciphertext image are almost evenly distributed compared to the original image, indicating that the method of the present invention can effectively resist statistical attacks.
[0115] The Lena ciphertext image is cut at different positions and in different proportions, and then decrypted to test the anti-cutting ability of the method of the present invention. The test results are shown in Figure 6 As shown. Among them, Figure 6 (a), (b) and (c) are the images corresponding to the upper left corner, center and lower right corner of the ciphertext image cut by 1 / 16, 1 / 8 and 1 / 4 respectively. Figure 6 (d), (e) and (f) are the corresponding decrypted images. Figure 6 It can be seen that the method of the present invention can effectively resist shear attack.
[0116] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702 and the memory 703 communicate with each other through the communication bus 704. The processor 701 may call the logic instructions in the memory 703 to execute a color image encryption method based on a coupled image lattice system, the method comprising: step 1: using the hash value of the color plaintext image P and an external key to generate an initial value of the coupled image lattice system; step 2: iterating the coupled image lattice system based on given control parameters and initial values to generate a chaotic sequence F corresponding to the chaotic system f(x) and a chaotic sequence X corresponding to the coupled image lattice system; step 3: sorting the chaotic sequence F and the chaotic sequence X and generating corresponding index matrices findex and xindex; step 4: reducing the dimension of the color plaintext image P to generate a reduced-dimensional image P 1 ; Step 5: Use the index matrix findex and the index matrix xindex to reduce the dimension of the image P 1 Perform scrambling to generate the permuted image P b ; Step 6: Transform the chaotic sequence F and the chaotic sequence X to generate three diffusion matrices with the same size as the color plaintext image; Step 7: Use the three diffusion matrices to transform the permuted image P b Diffusion is performed to generate an encrypted color image.
[0117] In addition, when the logic instructions in the above-mentioned memory 703 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0118] An embodiment of the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the color image encryption method based on the coupled image lattice system provided by the above-mentioned method embodiments.
[0119] An embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the color image encryption method based on the coupled image lattice system provided by the above-mentioned method embodiments is implemented.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A color image encryption method based on a coupled image lattice system, characterized in that: include: Step 1: Generate the initial value of the coupled image lattice system using the hash value of the color plaintext image P and the external key; Step 2: Iterating the coupled image lattice system based on given control parameters and initial values to generate a chaotic sequence F corresponding to the chaotic system f(x) and a chaotic sequence X corresponding to the coupled image lattice system; Step 3: Sort the chaotic sequence F and the chaotic sequence X and generate the corresponding index matrix findex and index matrix xindex; Step 4: Reduce the dimension of the color plaintext image P to generate a reduced-dimensional image P1; Step 5: Use the index matrix findex and the index matrix xindex to scramble the reduced-dimensional image P1 to generate a replacement image P b ; Step 6: Transform the chaotic sequence F and the chaotic sequence X to generate two images P that are identical to the replacement image P. b Diffusion matrices with the same size and channel separation were performed separately; Step 7: Use the two diffusion matrices after channel separation to transform the permuted image P b Diffusion is performed to generate an encrypted color image.
2. The color image encryption method based on coupled image lattice system according to claim 1 is characterized in that: Step 1 specifically includes: Where H represents the hash value of the color plaintext image P, H bin Represents the binary sequence corresponding to H, Str2Bin(*) means converting the hash value into the corresponding binary sequence, Reshape(H bin , 10,40) means that H bin The elements of are divided into 10 groups of 40 bits to form a two-dimensional sequence matrix. ks represents the converted two-dimensional sequence matrix with a size of 10×40. ks(i) represents a key sequence with a length of 40. i, j, k represent the index of ks, 1≤i≤8, 2≤j≤9, 3≤k≤10. All combinations of the three indexes i, j, k are traversed. Each combination generates a Q value. All Q values are sequentially composed of a sequence Q(index), 1≤index≤512. bin2dec(*) represents the representation of binary numbers as decimal numbers. X0(q) represents the initial value of the qth grid. F0(q) represents the initial value of the chaotic system f(x). q=1,2,...,L,L is the number of grids.
3. The color image encryption method based on coupled image lattice system according to claim 1 is characterized in that: In step 2, the coupled image lattice system is represented by the following formula: Among them, x n+1 (i) represents the state of the i-th grid at time n+1, ε is the composite coupling parameter, f(*) is the chaos mapping function, i, j, k, a, b are spatial subscripts, i, j, k, a, b = 1, 2, ..., L, L is the number of grids, and j, k, a, b are generated according to the grid index i according to the following formula: affine(*) represents affine transformation.
4. The color image encryption method based on coupled image lattice system according to claim 1 is characterized in that: Step 3 specifically includes: The chaotic sequence F is sorted in ascending order by column to generate a sorting result SF1 and a corresponding index matrix findex; the chaotic sequence is sorted in ascending order by row to generate a sorting result SX1 and a corresponding index matrix xindex.
5. The color image encryption method based on coupled image lattice system according to claim 1 is characterized in that: Step 4 specifically includes: Separate the channels of the color plaintext image P to generate an image matrix P with three channels R , P G and P B ; The three-channel image matrix P R , P G and P B They are all converted into one-dimensional sequences, and the three converted one-dimensional sequences are combined in the vertical direction to obtain the reduced-dimensional image P1.
6. The color image encryption method based on coupled image lattice system according to claim 1 is characterized in that: Step 5 specifically includes: Wherein, i∈(0,3), j∈(0,MN), P′ represents the permuted image obtained by permuting the rows of the reduced-dimensional image P1 using the index matrix findex; P b represents the permuted image obtained by permuting the permuted image P′ by using the index matrix xindex; P′[i][findex[j]] represents the element of the i-th findex[j] column in P′, P b [xindex[i]][j] represents P b The element at row xindex[i] and column j in .
7. The color image encryption method based on coupled image lattice system according to claim 1 is characterized in that: Step 6 specifically includes: Convert the chaotic sequence F and chaotic sequence X into integer sequences F of 0 to 255 respectively. p and X p ; The integer sequence F p Transformed into the replacement image P b Diffusion matrix Fph with the same size, and channel separation is performed on it to obtain three matrices with the same size as the color plaintext image and The integer sequence X p Transformed into the replacement image P b Diffusion matrix Xph with the same size is used to separate channels, and three matrices with the same size as the color plaintext image are obtained. and 8. The color image encryption method based on coupled image lattice system according to claim 7 is characterized in that: Step 7 specifically includes: The replacement image P b Perform channel separation to generate three-channel image matrices R1, G1 and B1; The two diffusion matrices after channel separation are used to diffuse the image matrices R1, G1 and B1 of the three channels according to the following formula to generate the corresponding three diffusion matrices R2, G2 and B2; in, Indicates XOR operation. When Fph is Xph When P represents R1, C represents R2; when Fph is Xph When P represents G1, C represents G2; when Fph is Xph When , P represents B1 and C represents B2; The three diffused matrices R2, G2 and B2 are combined to obtain an encrypted color image.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.