Chaotic Digital Image Encryption Algorithm (1)
Abstract: At present, the combination of Chaotic Systems and encryption technology is currently the most popular topic. Although a large number of encryption algorithms are available, these encryption algorithms are not mature and need further research. In this paper, a chaotic digital image encryption algorithm is designed based on the encryption concept of pixel position scrambling transformation and pixel value substitution transformation. The inverse affine transformation in the integral number field is introduced. The algorithm combines two-dimensional logistic chaotic ing to generate multiple sets of chaotic sequences, both pixel Scrambling and gray value replacement are controlled by these chaotic sequences. The key space generated by multiple chaotic sequences is larger than the key space generated by a single chaotic sequence. Therefore, the encryption strength of this algorithm is very high.
1. Wormhole model-Logistic chaotic ing.
Logistic ing is a non-linear system that can be generated. Its model is as follows:
Figure 1 Logistic ing branch Image
- clear all
- clc
- m(1)=0.632;
- N=196601;
- m1=[];
- for u1=2.6:0.02:4
- for i=1:N-1
- m(i+1)=u1*m(i)*(1-m(i));
- end
- m1=[m1 m];
- end
- plot(m1,'k.')
2. pixel gray value replacement Design Image Encryption
Set the gray scale value of the image (I, j) to I (I, j), satisfying the conditions of 1 ≤ I ≤ M, 1 ≤ j ≤ N, I '(I, j) the gray value of I (I, j) at (I, j) after replacement. In this article, the replacement transformation of pixel values is carried out in the airspace. We have designed two methods for the replacement of chaotic sequences and pixel values.
The formula for pixel replacement is as follows:
I '(I, j) = (r1 (I, j) 1_ I (I, j) 1_r2 (I, j) + L −r3 (ij ))) modL) mod256
Formula: L indicates the color depth of the image, mod indicates the modulo operation, and percentile indicates the bitwise XOR operation. R1, r2, and r3 represent the chaotic sequence values. The replacement and transformation keys are provided by the chaotic systems corresponding to r1, r2, and r3. The transformation can be performed multiple times, so the encryption effect is better. The number of duplicates is set to n, which is used as the key together with the initial values and parameters of the chaotic model. This increases the space of the key and the encryption strength. If the image is large, we can see that the matrix of r1, r2, and r3 templates needs to increase accordingly, which greatly reduces the encryption efficiency. To this end, we can encrypt the image by means of block processing, which significantly improves the encryption efficiency. Figure 2 shows the original and encrypted images:
Figure 2 original and encrypted Images
Jiami. m
- function e=jiami(x,data)
- m(1)=data(1);
- m1(1)=data(2);
- m2(1)=data(3);
- [a,b]=size(x);
- N=a*b;
- u1=data(4);
- %u=4;
- for i=1:N-1
- m(i+1)=u1*m(i)*(1-m(i));
- end
- m=mode(255*m,256);
- m=uint8(m);
- u2=data(5);
- for i=1:N-1
- m1(i+1)=u2*m1(i)*(1-m1(i));
- end
- m1=mode(255*m1,256);
- m1=uint8(m1);
- u3=data(6);
- for i=1:N-1
- m2(i+1)=u3*m2(i)*(1-m2(i));
- end
- sigma=data(7);
- m2=mode(255*m2,256);
- m2=uint8(m2);
- %n=1;
- n=data(8);
- x=double(x);
- m=double(m);
- m1=double(m1);
- m2=double(m2);
- for i=1:a
- for j=1:b
- e(i,j)=m(n)+m1(n);
- e(i,j)=bitxor(e(i,j),m2(n));
- e(i,j)=e(i,j)+x(i,j);
- e(i,j)=mod(e(i,j),255);
- nn=n+1;
- end
- end
Main. m
- Xforwarimread('lena.png ');
- X = double (x (:,:, 1 ));
- R = input ('Enter the encryption key key1 :');
- E = jiami (x, r );
- Subplot (121 );
- Imshow (x, []);
- Title ('original image ');
- Subplot (122 );
- Imshow (e, []);
- Title ('encrypted image ');
Key: [0.343 0.432 0.63 3.769 3.82 3.85 0.1 1] eight bits