IMAGE ENCRYPTION ALGORITHM BASED ON S-BOXES SUBSTITUTION AND CHAOS RANDOM SEQUENCE
DE WANG
YUAN-BIAO ZHANG
Department of Computer Science JiNan University ; Mathematical Modeling Innovative Practice Base of Zhuhai College Jinan University Guangzhou 510632, P.R.China
[email protected]
Mathematical Modeling Innovative Practice Base of Zhuhai College Jinan University Zhuhai 519070, China
[email protected]
Abstract—The purpose of this paper is to improve the security and the anti-errors-proliferation character of image encryption. Based on the theory of S-box in AES, we put forward a new standard algorithm. After that, by introducing the chaos random sequence, two improved image encryption algorithms were created. The method used by the first one was that a variety of S-boxes were selected for the substitution of each byte. The method used by the second one was that the encryption included multiple rounds of S-boxes substitution. In addition, the sequences of S-boxes in two algorithms were both decided by the chaos random sequence. Afterwards, we applied the three algorithms to the specific examples in order to testify the strength and the anti-errors-proliferation character of the encryption. Consequently, we have a conclusion that the new improved image encryption algorithms could effectively improve the inefficiency and the anti-errors-proliferation character of image encryption algorithm and be easy to implement. Keywords-component; S-box; chaos random sequence; image encryption.
I.
INTRODUCTION
In this paper, we mainly implement the image encryption based on two theories. One is the S-boxes and the other is Chaos Theory. The reasons that we choose them are as follows. Firstly, S-box is the nonlinear component that often used in block cipher encryption. Through the substitution of gray value in each pixel of the image, it gains the great effect of encryption. Moreover, S-box is generated based on the AES algorithm. Therefore, it has the excellent character of resisting the differential cryptanalysis and linear cryptanalysis, which let an opponent unable to decipher and protect the information of images. Secondly, because of the Chaos Theory’s randomness and strong safety, it is also frequently used in the encryption. Furthermore, it is easy to implement and easy to operate. Therefore, we studied the algorithms using the two theories. Concerning the structure of this paper, we first briefly introduce S-boxes and related concepts. Then a standard algorithm is proposed. After that, two improved algorithms are put forward. Afterwards the experiments concerning the
anti-errors-proliferation character are done. Finally, we discuss the advantages and disadvantages of the algorithms. II.
THE BASIC THEORY OF S-BOXES
To begin with, we introduce the basic theory of S-boxes. S-boxes are structured by 30 different irreducible polynomials in the finite field GF(28). Each element in the S-boxes is the number which is from 0 to 255, and is one to one mapping, 30 irreducible polynomials are shown in the Table 1.[1,2] 8
TABLE I.
THE IRREDUCIBLE POLYNOMIALS IN
NO
GF (2 )
Irreducible Polynomials 8
4
3
1
x + x + x + x +1
2
x + x + x + x +1
8
8
4
5
3
2
3
3
x + x + x + x +1
4
x + x + x + x +1
8
5
3
2
8
5
4
3
5
x + x + x + x +1
6
x + x + x + x + x + x +1
8
5
4
3
2
x8 + x 6 + x 3 + x 2 + 1
7 8
6
4
3
2
8
x + x + x + x + x + x +1
9
x + x + x + x +1
10
8
6
5
x + x + x + x +1
2
11
x + x + x + x +1
8
6
5
3
8
6
5
4
8
6
5
12
x + x + x + x +1
13
x + x + x + x + x + x +1
14
x + x + x + x + x + x +1
8 8
6
5
4
2
6
5
4
3
8
7
2
15
x + x + x + x +1
16
x + x + x + x +1
17
8
x + x + x + x +1
18
x + x + x + x + x + x +1
8
8
7
4
3
3
7
4
3
8
7
5
2
2
19
x + x + x + x +1
20
x + x + x + x +1
7
5
3
8
7
5
4
7
5
4
3
x + x + x + x +1
21 22
8
8
2
x + x + x + x + x + x +1
x8 + x 7 + x 6 + x + 1
23 8
7
6
3
2
24
x + x + x + x + x + x +1
25
x + x + x + x + x + x +1
8
8
7
7
6
6
4
4
2
3
2
26
x + x + x + x + x + x +1
27
x + x + x + x + x + x +1
28
x + x + x + x + x + x +1
8 8
7 7
6 6
5 5
2 4
8
7
6
5
4
2
8
7
6
5
4
3
29
x + x + x + x + x + x +1
30
x + x + x + x + x + x +1
According to the irreducible polynomials presented by table 1, we constructed 30 8 × 8 S-box using MATLAB[3]. III.
S-BOX SUBSTITUTION ENCRYPTION ALGORITHM AND EXPERIMENTAL ANALYSIS
The standard algorithm is very simple, and it only needs two steps as follows. Firstly, we select one of 30 S-boxes which are constructed above. Secondly, we choose the objects of the experiment. If the image is gray-scale image, then we can directly do the substitution for each byte; If the image is RGB image, then we can convert them to the three-tier image, then take the substitutions respectively and finally combine them.
c. the histogram of encryption Lena image
d. the Lena image encryption
Figure 2. the results of experiment NO.1 concerning the S-box substitution encryption of the gray-scale Lena image
Compared with other encryption algorithms, the advantages of this algorithm are as follows. The inherent characteristics of S-boxes make this algorithm can resist the differential cryptanalysis and linear cryptanalysis. This algorithm can use different parameters in choosing the S-boxes and the effects don’t change. This shows that it is more flexible to choose the algorithm parameters. Because the S-boxes are constructed in preprocess stage, we just need to identify the serial number in the S-boxes sequence. So the speed of this algorithm is faster than others and the time and space complexity of this algorithm are lower than others. IV.
THE IMPROVEMENT ONE: SELECTING DIFFERENT SBOXES FOR EACH BYTE
a. the original image of Lena
b. the gray-scale image of Lena
Figure 1. the original image of Lena and the gray-scale image of Lena
Selecting the S-box, we take the S-box substitution to the gray image of Lena, the results as Figure 2. .
a. the histogram of the gray-scale Lena image
b. the gray-scale Lena image
A. Logistic chaos system "ChongKou Model", the most basic model of Chaos, Logistic mapping is as follows: Xn+1=µXn(1-Xn) (1) Where, Xn, the variable of mapping, 0≤Xn≤1. μ, the variable of system, 0﹤μ﹤4. However, the system can create the Chaos real number sequence only when 3.5699456≤μ≤4[4]. Logistic mapping is a nonlinear iteration equations which is very simple but of great significance. In addition, the form of it is defined and the system doesn’t contain any random factor. However, the system can create approximately random and be sensitive to the dynamic change of parameter µ and the initial value. B. Algorithm Analysis Based on the standard algorithm, the improvement algorithm is as follows: Firstly, for each byte, we select the S-box using the serial number sequence which is created by the method of random chaos and the numbers in it are from 1 to 30, Secondly, we traverse the entire image and make the substitution encryption according to the standard algorithm. Using the gray-scale images of Lena to do the S-box substitution, the results are shown as Figure 3. .
a. the histogram of the gray-scale Lena image
b. the gray-scale Lena image
c. the histogram of encryption Lena image
d. the Lena image encryption
Figure 3. the results of the experiment two concerning the S-boxes substitution of the gray-scale image of Lena.
As a result of this improvement, their time complexity and space complexity will be increase as the size becoming larger. When we process the large image file, the speed of encryption and decryption is too slow. Therefore, although it is not advisable for the area of high-speed encryption and decryption, it is desirable for small-size images. V.
THE IMPROVEMENT TWO: USING MULTIPLE ROUNDS OF S-BOXES SUBSTITUTION ENCRYPTION
The single round of S-boxes substitution encryption has two constant points: 0 and 1, and the key is so less that the encryption can be decoded in a accepted time. So here we choose the Chaos random sequence to create the serial number in the range of 1 to 30. Using different S-boxes to make the N rounds of substitution encryption, here N=16. The steps of the algorithm are as follows: Step one: we construct the S-boxes sequence; Step two: Assigning X0=x0 andμ=3.7, then we can get the Chaos random sequence from X0 to X29 which is in the range of 0 to 1; Step three: Let Y0 = X 0 *30 , Y1 = X 1 * 30 …, then we can get the integer sequence which is in the range of 0 to 29. Step four: According to the numbers in the sequence created by the step three, we choose the numbers as the index of the S-boxes sequence. And then we make the substitution encryption. The key of the algorithm is the combination of the X0, μ and the number of rounds. Using the Lena image as the example, the results are shown as Figure 4. .
a. the histogram of the gray-scale Lena image
b. the gray-scale Lena image
c. the histogram of encryption Lena image
d, the Lena image encryption
Figure 4. the results of the experiment two concerning the S-boxes substitution of the gray-scale image of Lena.
Compared with the improvement one, the encryption and decryption of this algorithm need more time. However, it has additional security. The reasons are as follows: Multiple rounds using different S-boxes. The number of rounds and the S-boxes used by each round are too difficult to decode. The Chaos theory has guaranteed that the key is hard to decode. This algorithm is more flexible than the improvement one. Because the number of rounds and the initial value can be changed according to the requirement. The next section, we have the experiment of the antierrors-proliferation character test for three algorithms. VI.
THE ANTI-ERRORS-PROLIFERATION CHARACTER TEST
In order to do the experiment, we assign the value of 0 to the pixels of the initial image in the center area of 50×50. The results of the experiment are as follows:
a. Anti-errorsproliferation test one
b. Decryption of antierrors-proliferation test one
Figure 5. the results of the anti-errors-proliferation test one
VII. . CONCLUSIONS
a. Anti-errorsproliferation test two
b. Decryption of antierrors-proliferation test two
Figure 6. the results of the anti-errors-proliferation test two
From the above discussion, the conclusion can be reached that S-box substitution encryption has its advantages and disadvantages compared with other algorithm. There are four advantages: The fast speed of encryption; high-security; accurate image restoration; anti-errorsproliferation. Moreover, there are two disadvantages: low anti-shear ability; the theoretical analysis about S-boxes still needs to be improved. Thus, further in the future we could try to use a variety of hybrid encryption based on the S-boxes theory, with a view to achieve better encryption effect and improve the performance of the algorithm. We believe that the S-box image encryption algorithm can be more suited to a Noise transmission channel[5,6]. ACKNOWLEDGMENT This paper is supported by the Department of Computer Science, JiNan University and Mathematical Modeling Innovative Practice Base of Zhuhai College Jinan University. REFERENCES
a. Anti-errorsproliferation test three
b. Decryption of antierrors-proliferation test three
Figure 7. the results of the anti-errors-proliferation test three
From the experiment, we can see that the three methods all don’t have the anti-shear character. Through in an unsafe channel the transmission possibly makes loss of important information in images, it can be seen that the errors in images can’t proliferate. So the loss of information can be avoided. Therefore, the image encryption using S-boxes has high-sensitivity and it is applicable for the well-quality channels and the environment which requires the highsecurity.
[1] [2] [3] [4]
[5]
[6]
mathworld.wolfram.com, Finite field http://mathworld.wolfram.com/FiniteField.html.) mathworld.wolfram.com, Irreducible Polynomial http://mathworld.wolfram.com/IrreduciblePolynomial.html Jo¨rg J. Buchholz . Matlab Implementation of the Advanced Encryption Standard.(2001-12-19) http://buchholz.hs-bremen.de. Kai-XiangYI, Xin Shun, Jiao-Ying Shi, A images encryption algorithm based on Chaos sequence Journal of computer-aided design and graphics, 2000, (09). (in Chinese) WANG De, SUN Shi-liang. Research on Optimum Test of S-boxes in Rijndael Information Security and Communications Privacy, 2008.2:84-85 (in Chinese) WANG De,ZHANG Yuan-biao. Image encryption arithmetic based on S-boxes scrambling and chaos theory ,Computer Engineering and Applications,2008,44(19):50-52 (in Chinese)