2010 International Workshop on Chaos-Fractal Theory and its Applications
An Image Encryption Algorithm Utilizing Mandelbrot Set
Yuan-yuan Sun, Rui-qing Kong, Xing-yuan Wang
Lian-cheng Bi
College of Computer Science and Technology DaLian University of Technology Dalian, China e-mail:
[email protected]
The People's Procuratorate of Dalian Dalian, China e-mail:
[email protected]
Abstract—As an important field in information security, image encryption algorithm has been a research focus. At the same time there are few works on fractal set as the encryption key among various encryption algorithms. In the paper, Mandelbrot set (abbreviated as M set) and the Hilbert transformation are utilized to generate the random key. Since M set can be iterated from only a few parameters, it can reduce the storage space greatly. In addition, the infinite boundaries of the M set and the Hilbert transformation enhance the randomness of the key. Experimental results show that even the slight disturbance of the parameters can change the key dramatically. Moreover, the algorithm needs small space for key storage and the real-time encryption can be achieved.
Rozourvan’s algorithm and discusses an encryption algorithm combining the M set and the Hilbert transformation. II.
A. Mandelbrot Set The M set, named after Benoît Mandelbrot, is a set of points in the complex plane, the boundary of which forms a fractal. The M set is used in the paper for the reason that it has complicated structures arising from a simple definition and a small change of the parameter can implement the shape of the M set. A typically M set can be defined as follows
Keywords- Mandlebrot Set; Hilbert Transformation; Image Encryption
I.
f : z ← z2 + c .
INTRODUCTION
(1)
The M set has many extended form. In this paper, the M set is given by
Nowadays the multimedia technology is widely used and the image encryption is an effective technique for image protection. Most of the conventional encryption algorithms are used for text data or binary data, and they have high computational complexity. Since the multimedia images have special coding structures and massive volumes of data, the traditional encryption algorithm is difficult to meet the real-time requirements, and, they may change the data format. In recent years, the methods of image encryption include image scrambling, combining with other digital processing technology and encrypting utilizing the keys. Gao brought forward an algorithm which generated an matrix based on chaotic map for image scrambling [1]. Wu proposed an image encryption method combining with Huffman coding [2]. Chen presented an algorithm which generates the key based on three-dimensional chaotic map and encrypts the image by operator XOR [3]. On the basis of the algorithm, Liao proposed a symmetric image encryption [4]. Wang analyzed Liao’s encryption algorithm and proposed an improved algorithm based on Logistic map [5]. Rozourvan presented an algorithm utilizing the M set as the key [6]. Encrypting an image with the M set provides a novel way for the application of fractal. The M set can be drawn by several parameters, which makes it easier to store the key parameters. Meanwhile the M set has infinite boundaries, which can provide large key space. Therefore, the M set is very appropriate for generating the key. This paper improves 978-0-7695-4247-8/10 $26.00 © 2010 IEEE DOI 10.1109/IWCFTA.2010.70
THE ALGORITHM
f : z ← z α + c, α ∈ Ν .
(2)
In the iteration process of the M set, there are four parameters. If one of them changes, the M set will be different. B. Hilbert Curve A Hilbert curve is a continuous fractal space-filling curve which was described firstly by the German mathematician David Hilbert in 1891. Nowadays the Hilbert curve is widely used in image processing [7, 8]. The Hilbert curve is a way of mapping the multidimensional space into the one-dimensional space. Through the coordinate mapping, a pixel in the twodimension coordinate marked as (x, y) can be transformed into one-dimensional marked as i. We can get the Hilbert curve by the following step. Firstly, the edge of the square by the continuous division of the original square is divided into 2n square units. Then curve along the unit square weave, per unit square at least once. Thus one point for each original image in the corresponding Hilbert curve has a unique coordinate, otherwise the same. The main factor which impacts of Hilbert curve is the coordinates of the starting point. In one picture, one of the four corner points can be the starting point of the curve. 170
C. Encryption and Decryption As we all know, every color image is a component of three layers, therefore we can process each layer independently. The value range of each pixel in one layer is [0, 255]. We suppose the size of the image is n × n , where n is a power of 2. Each pixel in the origin picture is marked as O(x, y), whose value is the color of the pixel. We use the symbol K to represent the key and T represents the image after encryption. The encryption function is as follows: T ( x, y ) = (O ( x, y ) + K ( x, y )) mod 256 .
(3)
The decryption function is as follows: Figure 1. Peppers.
T '( x, y ) = (O ( x, y ) − K ( x, y )) mod 256 .
(4)
To make the key more sensitive, we use the Hilbert curve to transform the M set as the key. Firstly, the M set which has three layers is considered as a matrix. Each point i(x, y) in the matrix can be treated as a two-dimension coordinate and i(0, 0) corresponds to the left-top pixel. Utilizing the Hilbert curve, we can transform each pixel to the onedimension coordinate. Secondly, we use the integer r, which is the interval distance from one point to another by traveling the curve, to calculate the value of the pixel again. If the distance on the Hilbert curve between the pixels H(xh, yh) and i(x, y) is the integer multiples of r, then the value of H(xh, yh) multiplied by the real distance between H and i will be added to the value of i(x, y). The equations are as follows. ^
^
Figure 2. Mandrill.
^
∀D ∈ R key , B key , G key , ∃Dx , y : ∀x ∈ [1, n], ∀y ∈ [1, n] p
K ( x, y ) = ∑ H ( xh , yh ) × d ( H , i ) ,
(5)
TABLE I.
t =0
where p = ⎢ n × n ⎥ , d ( H , i ) = ( xh − x)2 × ( yh − y )2 . ⎢⎣ r ⎥⎦ From the above process we can get a key with a high sensitivity. If we select a suitable value of the interval r on the Hilbert curve, the speed of the encryption can be fast.
ARAMETERS OF THE M SET FOR TWO KEYS
Xcenter
Ycenter
a
scale
Key 1
0.716
0.836
4
0.000001:1
Key 2
0.42
-0.20
2
0.00001:1
III.
SIMULATION AND ANALYSIS In order to verify the feasibility of the experiment, there are multiple tests on different images. A total of four tests were performed. Each of the encrypted images is compared to the decrypted images by the means of a PSNR test. We select Peppers and Mandrill images as shown in Fig. 1 and 2. They are in the same dimensions (256×256). We select two different M sets as the keys, which are shown in Fig. 3 and 4. The parameters of the M sets are given in Table 1. To show the role of r, the PSNR values are calculated in the four experiments with different r. Figure 3.
171
Key 1.
30
Peppers Mandrill
25 PSNR
20 15 10 5 0 0
40
Figure 7. Figure 4.
r
160
200
240
280
The PSNR values for encrypted images using key 1 by the method in [6].
30
Peppers Mandrill
25
PSNR
20 15 10 5 0 0
40
Figure 8.
Peppers
25
120
Key 2.
The charts of the PSNR values in the experiments are shown in Fig. 5 and 6. The range of the interval distance r is [1, 65025]. In addition, we made the same experiments by the method proposed by Rozouvan [6]. The PSNR charts are given in Fig. 7 and 8. The range of the r is [0, 254]. From the Figs we can see, the PSNR value goes up rapidly when r is bigger than a critical value. In the experiments by Rozouvan’s method, the critical value is 150. In the experiments by our method, the critical value is 40000. Therefore the interval value r in our method can be selected in a much larger range than Rozouvan’s method. 30
80
Mandrill
20
80
120
r
160
200
240
280
The PSNR values for encrypted images using key 2 by the method in [6].
PSNR
Table 2 lists the lowest PSNR values and the corresponding r. L represents the lowest PSNR value by our method and L′ by Rozouvan’s method. Table 2 shows that our method has a better encryption effect than Rozouvan’s method.
15 10 5 0 0
Figure 5.
10000
20000
30000
r
40000
50000
60000
TABLE II.
70000
Peppers
The PSNR values for encrypted images using key 1 by our method.
Key 1 Key 2
30
Peppers
25 PSNR
20 15 10 5 0
Figure 6.
10000
20000
30000
r
40000
50000
60000
Mandrill
L=7.98292 r=32448 L′ =8.10085 r=90
L=8.97414 r=32448 L′ =9.06148 r =84
L =8.06581 r =32513 r =96
L′ =9.06148 r =84
L′ =8.111
L =9.03496
r =32450
The simulations were run on the author’s system—an Intel 2GHz Core 2 Duo system. A timepiece is used in the experiment to measure the starting and the ending time of encryption. In our experiments, the process of encryption and decryption can be real-time (given r is larger than 3000 and the image is 256×256). On the author’s system, the entire process (encryption and decryption) takes approximately 1.42s. Therefore, our method can be used in the real-time video encoding. Finally, we made the test on the decryption with the wrong key. The incorrect key is shown in table 3. From table 3 we can see that, when the parameter Xcenter is 10-7 larger
Mandrill
0
MINIMUM VALUES FOR EACH INDIVIDUAL PSNR TEST
70000
The PSNR values for encrypted images using key 2 by our method.
172
than the correct parameter, the origin image can’t be decrypt. The comparison between a correctly decrypted image and the original gave an MSE of 0 (which implies an infinite PSNR value). TABLE III.
Incorrect key
Education of China (No. 20070141014) and the National Natural Science Foundation of Liaoning province (No: 20082165). REFERENCES
THE WRONG PARAMETER OF KEY
Xcenter
Ycenter
a
scale
0.4200001
-0.20
4
0.000001:1
[1]
[2]
IV.
CONCLUSIONS
In this paper, the algorithm utilizing a fractal key is discussed. The experimental results show that our algorithm combining the Hilbert transformation with the M set key improves in the following aspects compared with Rozouvan’s method. Our method makes the encryption more effective and the interval value r can be selected in a larger range. In addition, our method has more key sensitivity (107 ). If we select an appropriate interval of the Hilbert curve, the algorithm can be real-time. In this paper, the M set is chosen as a key, but we can select any fractal set to encrypt the image. In the future work, we can study the influence on the range of the M set parameters in detail.
[3]
[4]
[5]
[6] [7]
[8]
ACKNOWLEDGMENT This research is supported by the National Natural Science Foundation of China (No. 60573172 ,60973152), the Doctoral Program Foundation of Institution of Higher
173
T. Gao and Z. Chen. “Image encryption based on a new total shuffling algorithm,” Chaos Solition. Fract., Vol. 38, Oct. 2008, pp. 213-220. C. P. Wu and C. C. J. Kuo, “Design of integrated multimedia compression and encryption systems,” IEEE T. Multimedia, vol.7, Oct. 2005, pp. 828-839. G. R. Chen, Y. B. Mao, and C. K. Chui, “A symmetric image encryption scheme based on 3D chaotic cat maps,” Chaos Solition. Fract., vol. 21, Jul. 2004, pp.749-761. W. Zhang, X. F. Liao, H. Q. Yang, P. C. Wei and S. Huang, “A modified symmetric image encryption scheme based on chaotic map,” Comput. Sci., Dec. 2007, vol. 34, pp. 248-251. X. Y. Wang and C. H. Yu, “Cryptanalysis and improvement on a cryptosystem based on a chaotic map,” Comput. Math. Appl., vol.57, Feb. 2009, pp. 476-482. V. Rozouvan, “Modulo image encryption with fractal keys,” Opt. Laser. Eng., Jan. 2009, vol. 47, pp. 1-6. M. Joshi, C. Shakher and K. Singh, “Image encryption using radial Hilbert transform filter bank as an additional key in the modified double random fractional Fourier encoding architecture,” Opt. Laser. Eng., May 2010, vol. 48, pp. 605-615. X. M. Li, R. Tao, L. L. Dai and Y. Wang, “Reality-preserving image encryption associated with the generalized Hilbert transform,” Proc. IEEE International Symposium on Industrial Electronics (ISIE 09), IEEE Press, Jul. 2009, pp. 1909-1913.