Chaotic Digital Image Encryption Algorithm (1)

Source: Internet
Author: User

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

 
 
  1. clear all  
  2. clc  
  3. m(1)=0.632;  
  4. N=196601;  
  5. m1=[];  
  6. for u1=2.6:0.02:4  
  7.     for i=1:N-1  
  8.         m(i+1)=u1*m(i)*(1-m(i));  
  9.     end  
  10.     m1=[m1 m];  
  11. end  
  12. 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

 
 
  1. function e=jiami(x,data)  
  2. m(1)=data(1);  
  3. m1(1)=data(2);  
  4. m2(1)=data(3);  
  5. [a,b]=size(x);  
  6. N=a*b;  
  7. u1=data(4);  
  8. %u=4;  
  9. for i=1:N-1  
  10.     m(i+1)=u1*m(i)*(1-m(i));  
  11. end  
  12. m=mode(255*m,256);  
  13. m=uint8(m);  
  14. u2=data(5);  
  15. for i=1:N-1  
  16.     m1(i+1)=u2*m1(i)*(1-m1(i));  
  17. end  
  18. m1=mode(255*m1,256);  
  19. m1=uint8(m1);  
  20. u3=data(6);  
  21. for i=1:N-1  
  22.     m2(i+1)=u3*m2(i)*(1-m2(i));  
  23. end  
  24. sigma=data(7);  
  25. m2=mode(255*m2,256);  
  26. m2=uint8(m2);  
  27. %n=1;  
  28. n=data(8);  
  29. x=double(x);  
  30. m=double(m);  
  31. m1=double(m1);  
  32. m2=double(m2);  
  33. for i=1:a  
  34.     for j=1:b  
  35.        e(i,j)=m(n)+m1(n);  
  36.        e(i,j)=bitxor(e(i,j),m2(n));  
  37.        e(i,j)=e(i,j)+x(i,j);  
  38.        e(i,j)=mod(e(i,j),255);  
  39.        nn=n+1;  
  40.     end  
  41. end 

Main. m

 
 
  1. Xforwarimread('lena.png ');
  2. X = double (x (:,:, 1 ));
  3. R = input ('Enter the encryption key key1 :');
  4. E = jiami (x, r );
  5. Subplot (121 );
  6. Imshow (x, []);
  7. Title ('original image ');
  8. Subplot (122 );
  9. Imshow (e, []);
  10. Title ('encrypted image ');

Key: [0.343 0.432 0.63 3.769 3.82 3.85 0.1 1] eight bits


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.