Keywords

1 Introduction

With the rapid development of multimedia and internet technology, the security and confidentiality of information are becoming more and more important. Digital images are widely used in communication because of their intuitive and large capacity, so the security of digital images is particularly significant. Many encryption algorithms have been proposed to protect the privacy of digital images transmitted over a public network. As the huge amount of data, redundancy, highly relevant adjacent pixels of image, traditional encryption algorithms, such as DES or AES, are insufficient to satisfy high security levels.

With the emergence of chaos [1], chaotic system has characteristics such as unpredictable, non-periodic, nonlinear, sensitivity to initial condition and parameters, which make chaos widely use in various fields and also in image encryption. The earliest chaotic cryptography scheme was proposed by Matthews [2]. In terms of chaos system, image encryption based on chaotic system can be generally classified into three categories: single chaotic system, multi-chaotic system, and hyper chaotic system. For single chaotic system, Logistic map was used to encrypt images [3]. A hybrid domain selective image encryption technique was presented [4], which used Orthogonal Polynomial Transformation and spatial domain bit shuffling based Tent map. The hybrid domain combined frequency domain and spatial domain, and provided a good performance as well as less encryption and decryption time. But general chaos system has relatively small key space and non uniform distribution sequences which may bring the risk to encryption. Liu [5] proposed an encryption algorithm based on Logistic chaotic map with varying parameter. Parameter-varied Logistic map can cure the weakness of Logistic map and resist the phase space reconstruction attack.

Many researches show that encryption combined with multi-chaotic system is more security than only using single chaos system [6, 7]. Combination of Logistic map and Lozi map to generate key sequence was presented, and results achieved better image security and resistance to attacks than single Logistic or Lozi map [8]. Combination of Arnold cat map and Logistic map was proposed [6], original image firstly shuffled by Logistic map and then shuffled by iteratively using Arnold cat map operations to improve the security.

Hyper chaotic system has several characteristics such as at least two positive Lyapunov exponents, more randomness. Ye proposed encryption based time-delay and hyper chaotic system [9], integrated time-delay into hyper chaotic system, and presented a permutation function for shuffling the position index together with double direction diffusion operations. A scheme based on Cat map and hyper chaotic Lorenz system was proposed [10]. A hyper chaos system based on Hénon and Logistic maps was presented [11].

However, low dimensional systems, whether single or multi chaotic systems, are insecure key sources and small key space. To solve these problems, in this paper, key sequence for image encryption and decryption is generated based on \( 7 \times 5 \times 3 \) multi-scrolls and Logistic map. The generation of multi-scrolls chaotic system is based on double-scrolls system. Common double-scrolls system is Jerk system [12] or Chua system [13]. Compared to traditional chaotic system, multi-scrolls chaotic system can generate multi direction hyper chaotic attractors, particularly, its dynamic trajectory can be extended to higher dimensional space and complex phase trajectory corresponds to more key parameters. We encrypt image with different hyper chaotic sequences to enhance encryption performance. In conclusion, our contribution in this paper can be summarized as follows: (1) we propose for the first time an image encryption algorithm based on multi chaotic system, including multi-scrolls chaotic system and Logistic map, to enhance the security of key source; (2) we propose an algorithm combined with permutation and diffusion to improve the robustness of the encrypted image.

The rest of this paper is organized as follows. In Sect. 2, multi-scrolls chaotic system is described. The proposed algorithm is discussed in Sect. 3. Experimental results are shown in Sect. 4. We conclude the work in Sect. 5.

2 Multi-scrolls Chaotic System

The high-order Chua’s circuit with multi-directional and multi-scroll chaotic attractors was discussed [14, 15]. We use four-order grid multi-scrolls based on Chua system. This system is described as Eq. (1). Here, \( x_{0} ,y_{0} ,z_{0} ,w_{0} \) are four initial values. As stated [15], the function \( f_{m} \left( x \right) \) is defined as Eq. (2), \( f_{m} \left( y \right) \) and \( f_{m} \left( w \right) \) are similar. Five control parameters are chosen as \( a = 15,\,b = 2.5,\,c = 16,\,d = 2.5,\,e = 4 \). \( A_{m} \) controls the width and height of \( f_{m} \left( x \right) \) respectively, thus the relative positions between the equilibrium points and size of scrolls are controlled. \( M_{m} \) is for odd scroll and \( N_{m} \) is for even scroll in Eq. (2), hence it should be \( (2M_{1} + 1) \times (2M_{2} + 1) \times (2M_{3} + 1) \) for odd grid multi-scrolls. In order to generate multi-scroll chaotic attractors conveniently, typical parameters are selected. Therefore \( A_{1} = 0.5,\,M_{1} = 3 \) in \( f_{1} \left( x \right) \), \( A_{2} = 0.25,M_{2} = 2 \) in \( f_{2} \left( y \right) \), \( A_{3} = 0.25,M_{3} = 1 \) in \( f_{3} \left( w \right) \) are chosen to generate \( 7 \times 5 \times 3 \) grid multi-scrolls. Figure 1(a),(b) shows the phase diagram of grid multi-scroll chaotic attractors in x-y and x-w plane respectively.

Fig. 1.
figure 1

\( 7 \times 5 \times 3 \) grid multi-scrolls system in x-y plane (left) and x-w plane (right)

Detecting the presence of chaos in a dynamical system is an important problem that is solved by measuring the largest Lyapunov exponent. Lyapunov exponents quantify the exponential divergence of initially close state-space trajectories and estimate the amount of chaos in a system. We use the definition method to compute Lyapunov exponents of Eq. (1) and then obtain four Lyapunov exponents: \( LE_{1} \, = \,8.1906,\,LE_{2} \, = \,1.4977,\,LE_{3} \, = \,0.2599,\,LE_{4} \, = \, - 12.3637. \) According to the results, we can see that not only the sum of four exponents is negative, but also three of them are positive, which can demonstrate the high degree of chaos in the system.

$$ \left\{ \begin{aligned} & \frac{{d{\kern 1pt} x}}{{d{\kern 1pt} t}} = a\left( {y - f_{2} \left( y \right)} \right) - b\left( {x - f_{1} \left( x \right) - \left( {w - f_{3} \left( w \right)} \right)} \right) \\ & \frac{{d{\kern 1pt} y}}{{d{\kern 1pt} t}} = x - y + z\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \\ & \frac{{d{\kern 1pt} z}}{{d{\kern 1pt} t}} = - c\left( {y - f_{2} \left( y \right)} \right)\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \\ & \frac{{d{\kern 1pt} w}}{{d{\kern 1pt} t}} = d\left( {x - f_{1} \left( x \right)} \right) - e\left( {w - f_{3} \left( w \right)} \right)\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, \\ \end{aligned} \right. $$
(1)
$$ f_{m} \left( x \right) = A_{m} \times \left\{ \begin{aligned} - \text{s} {\kern 1pt} g{\kern 1pt} n\left( x \right) + \sum\limits_{i = 1}^{{N_{m} }} {\text{s} {\kern 1pt} g{\kern 1pt} n\left( {x + 2{\kern 1pt} {\kern 1pt} iA_{m} } \right)} + \sum\limits_{i = 1}^{{N_{m} }} {\text{s} {\kern 1pt} g{\kern 1pt} n\left( {x - 2{\kern 1pt} i{\kern 1pt} A_{m} } \right),N \ge 0} \hfill \\ \sum\limits_{i = 1}^{{M_{m} }} {\text{s} {\kern 1pt} g{\kern 1pt} n\left( {x + (2i - 1)A_{m} } \right)} + \sum\limits_{i = 1}^{{M_{m} }} {\text{s} {\kern 1pt} g{\kern 1pt} n\left( {x - (2i - 1)A_{m} } \right),M \ge 1} \hfill \\ \end{aligned} \right. $$
(2)

Here, \( \text{sgn} \left( x \right) \) is defined as:

$$ \text{sgn} \left( x \right) = \left\{ \begin{aligned} & 1,x > 0\,\,\,\, \\ & 0,x = 0\,\,\, \\ & - 1,x < 0 \\ \end{aligned} \right. $$
(3)

3 Proposed Image Encryption Scheme

The proposed algorithm uses multi-scroll chaotic sequence and logistic map as key sequences. Then permutation operations to image are performed by key sequences, and double direction diffusions are employed to diffuse permuted image to obtain the cipher image. The proposed hybrid chaotic system not only enhances the security of key source but enlarges key space. Hence the two level encryption of permutation and diffusion improve the security of the algorithm.

3.1 Pretreatment

From Sect. 2, four chaotic sequences \( x,y,z,w \) are obtained. We make pretreatment to \( x,y,z,w \) to get new sequences \( \dot{x}_{i} ,\dot{y}_{i} ,\dot{z}_{i} ,\dot{w}_{i} \) by Eq. (4):

$$ \dot{s}_{i} = \bmod \left( {round\left( {\left| {s_{i} \times 10^{14} - round\left( {s_{i} \times 10^{14} } \right)} \right| \times 255} \right),256} \right) $$
(4)

where the function \( round\,\left( s \right) \) rounds to the nearest integer, and \( \left| s \right| \) obtains the absolute value of \( s \) while \( \bmod \left( {x,y} \right) \) returns the remainder after division.

Then, we apply classical Logistic map to generate random number sequence \( h \):

$$ h_{i + 1} = \mu h_{i} \left( {1 - h_{i} } \right),i = 1,2,3, \ldots ,\mu \in \left( {3.5699456,\left. 4 \right]} \right. $$
(5)

3.2 Encryption Algorithm

The process of image permutation algorithm is discussed step by step as follows:

  1. 1.

    Resize 2-D 8-bit gray scale image pixels of size \( m \times n \) to 1-D image pixels \( \left\{ {c_{i} } \right\} = \left\{ {c_{1} ,c_{2} , \ldots c_{m \times n} } \right\} \).

  2. 2.

    Key sequence is obtained by following equation:

$$ k_{i} = bitxor\left( {\dot{x}_{i} + \dot{y}_{i} ,h{}_{i}} \right) $$
(6)

where \( \dot{x}_{i} ,\dot{y}_{i} \) are the sequences generated by Eq. (1) and pretreatment by Eq. (4), \( h_{i} \) is generated by Logistic system Eq. (5), and \( bitxor\left( {x,y} \right) \) returns the result after bitwise XOR operation.

  1. 3.

    Permutated image pixels \( \left\{ {p_{i} } \right\} = \left\{ {p_{1} ,p_{2} , \ldots p_{m \times n} } \right\} \) are obtained by Eq. (7):

$$ p_{i} = \bmod \left( {bitxor\left( {c_{i} ,k_{i} } \right),256} \right) $$
(7)
  1. 4.

    Improved forward diffusion is performed as Eq. (8):

$$ d_{i} = d_{i - 2} + d_{i - 1} + p_{i} + \lambda_{1} \dot{z}_{i - 1} + \theta_{1} \dot{z}_{i} ,i = 1,2,3, \ldots ,m \times n $$
(8)

here, we let \( d_{0} \) be a constant which is the first pixel of \( p_{i} \) and \( d_{ - 1} \) be the last pixel of \( p_{i} \). \( \dot{z}_{i} \) is the chaotic sequence generated by Eq. (1). \( \lambda_{1} ,\theta_{1} \) are two additional control parameters.

  1. 5.

    Reverse diffusion is performed as Eq. (9) to enhance the encryption performance:

$$ e_{i} = e_{i + 1} + d_{i} + \lambda_{2} \dot{w}_{i - 1} + \theta_{2} w_{i} ,i = m \times n - 1,m \times n - 1, \ldots ,2,1 $$
(9)

here, \( \lambda_{2} ,\theta_{2} \) are control parameters, \( \dot{w}_{i} \) is the chaotic sequence after inversion. Then, we resize \( e_{i} \) to 2-D, the encrypted image will be obtained.

3.3 Decryption

The decryption algorithm process is the inversion of encryption process. Back-diffusion process performs by Eqs. (10) and (11). After obtaining permuted image pixels \( p_{i} \), reverse the permutation steps, the plain image pixels will be got.

$$ d_{i} = e_{i} - e_{i + 1} - \lambda_{2} \dot{w}_{i - 1} - \theta_{2} w_{i} ,i = m \times n - 1,m \times n - 1, \ldots ,2,1 $$
(10)
$$ p_{i} = d_{i} - d_{i - 1} - d_{i - 2} - \lambda_{1} \dot{z}_{i - 1} - \theta_{1} \dot{z}_{i} ,i = 1,2,3, \ldots ,m \times n $$
(11)

4 Experimental Results and Analysis

The experiments are implemented by MATLAB R2016a on a computer equipped with AMD A6-3400 M, 1.40 GHz CPU, 6 GB RAM, windows 7 system. Initial conditions \( x_{0} ,y_{0} ,z_{0} ,w_{0} \) in Eq. (1) are randomly selected, and \( \mu = 3.82,h_{1} = 0.343 \) in Eq. (5) and \( \lambda_{1} = 1,\theta_{1} = 5,\lambda_{2} = 2,\theta_{2} = 4 \) in Eqs. (8) and (9). Three \( 256 \times 256 \) gray scale images of Lena, Cameraman, and Peppers respectively are chosen as test images. Then we use visual effect, histogram, information entropy, correlation, differential and key space for experimental analysis. We also compare our results to single Logistic map, single multi-scrolls, and other reference’s methods. Figure 2 shows the visual effect of proposed scheme encrypting and decrypting image.

Fig. 2.
figure 2

(a) Lena image (b) Encrypted image (c) Decrypted image with correct key (d) Decrypted image with wrong key

4.1 Histogram Analysis

First of all, histograms of the plain image and encrypted image are analyzed. Histogram represents the number of times each gray level appears of image. Figure 3 shows histogram of plain image and cipher image. From the figure, we can see that the distribution of cipher image by our algorithm is relatively flat, so the proposed algorithm can effectively resist the statistical attacks.

Fig. 3.
figure 3

Histogram of plain image (left) and cipher image (right)

4.2 Information Entropy Analysis

We analyze information entropy of encrypted image with our proposed algorithm in the second experiment. Information entropy is used to measure uncertainty, unpredictability of information. It is defined as Eq. (12):

$$ H(x) = - \sum\limits_{1}^{M} {p(x_{i} )\log_{2} p(x_{i} )} $$
(12)

here, for an image with 256 gray levels, \( M = 256 \), and \( p(x_{i} ) \) is the probability of symbol \( x_{i} \). So, the ideal information entropy is 8.

Table 1 shows the entropy of different image by using our proposed method, single Logistic map, single multi-scrolls and other algorithms. The results demonstrate that our method is very close to the ideal value, which means that the encrypted image is high uncertainty and close to random source.

Table 1. Entropy values with different algorithm

4.3 Correlation Analysis

In the third experiment, we analyze the correlation of plain image and encrypted image. Correlation analysis is to measure the similarities between adjacent pixels. In original image, correlations of adjacent pixels usually very high, while encrypted image will be very low for an effective encryption scheme. The correlation coefficients are calculated by Eq. (13). In our experiments, 2048 pairs of adjacent pixels are randomly selected in horizontal, vertical and diagonal directions.

$$ \rho_{xy} = \frac{{\text{cov} (x,y)}}{{\sqrt {D(x)} \sqrt {D(y)} }} $$
(13)

here, \( x_{i} \), \( y_{i} \) represent the gray scale values of adjacent pixels of the image. \( \text{cov} (x,y) \) is covariance of \( x \), \( y \), \( D(x) \) is variance and \( {\rm E}(x) \) is expectation of \( x \).

Table 2 shows the results of proposed scheme’s correlation of adjacent pixels of plain image and cipher images with different algorithms. The results show that the correlation coefficients are closer to 0, which means that proposed algorithm effectively removes the correlation of adjacent pixels.

Table 2. Correlation coefficients with different algorithm

4.4 Differential Analysis

In the fourth experiment, differential analysis is applied to test the performance of encrypted image to resist differential attacks. Differential analysis usually measured by the number of pixels change rate (NPCR) and the unified average changing intensity (UACI). NPCR and UACI are defined as follows:

$$ NPCR = \frac{1}{m \times n}\sum\nolimits_{ij} {D(i,j)} $$
(14)
$$ UACI = \frac{1}{m \times n}\sum\nolimits_{ij} {\frac{{\left| {C_{1} (i,j) - C_{2} (i,j)} \right|}}{255}} $$
(15)

here, \( D(i,j) = 0 \) if \( C_{1} (i,j) = C_{2} (i,j) \), or \( D(i,j) = 1 \). The ideal value of NPCR and UACI is 0.9960940… and 0.3346350… for a gray image.

We randomly select 100 groups and each group of the original image only change 1 bit. Then we calculate NPCR and UACI of the cipher image respectively. Table 3 shows the result of the comparison with single Logistic, single multi-scrolls system, and reference [4, 16] in the same experimental conditions. According to the table, we know that proposed scheme has better performance than other algorithms and can effectively resist the known-plaintext attacks and chosen-plaintext attacks.

Table 3. NPCR and UACI using different original image

4.5 Complexity and Key Space Analysis

Finally, we analyze the complexity and key space of proposed algorithm. As shown in Sect. 3, the total encryption calculating operations only have \( 2 \cdot m \cdot n \) bitwise XOR operations in Eqs. (6) and (7), \( 4 \cdot m \cdot n \) addition operations and \( 2 \cdot m \cdot n \) multiplication operations in Eq. (8), which are increasing linearly with image size. A large key space is essential to resist attacks. The key space of proposed scheme contains initial values \( x_{0} ,y_{0} ,z_{0} ,w_{0} \) in Eq. (1) and \( h_{1} \) in Eq. (5). The parameters such as \( a,b,c,d, \) \( e,\mu ,\lambda_{1} ,\theta_{1} ,\lambda_{2} ,\theta_{2} \) are not counted. We compute the initial values in the accuracy of \( 10^{ - 14} \). Therefore, for five security keys \( x_{0} ,y_{0} ,z_{0} ,w_{0} ,h_{1} \), the total key space is about \( \left( {10^{14} } \right)^{5} = 10^{70} \), which has been larger enough to resist all kinds of brute-force attacks.

5 Conclusion

A novel encryption algorithm combined multi-scrolls chaotic system with logistic map is proposed. We employ \( 7 \times 5 \times 3 \) grid multi-scrolls system and logistic chaotic system to generate key sequence, and shuffle the image according to the sequences. Then double direction diffusion is used to diffuse the permuted image. Experimental results show the performance of image encryption by proposed algorithm. The results demonstrate that our scheme is with high security which is safe to be used in encryption. For further work, we’ll optimize the time efficiency of the method.