1 Introduction

In recent years, with the rapid popularization and development of information science and technology, a large amount of information transmission has become more and more common in the network. People are concerned about the transmission and preservation of some specific images, which may contain national security and personal privacy, once leaked, it will make the nation or personal interests suffer great losses. Existing techniques for image protection include image watermarking [1, 2], data hiding [3], and image encryption [4,5,6,7,8]. Among them, image encryption is the most straightforward and effective, which encrypts an image into another completely random and meaningless image.

The methods of image encryption include wavelet transform [9], DNA coding [10], quantum image encryption [11, 12], and encryption based on chaos theory [13,14,15,16,17]. In these techniques, the chaos theory plays an important role in image encryption due to its unpredictability, randomness, and sensitivity to initial values [18]. A chaotic map with favorable chaotic properties generally results in a secure encryption scheme and achieves excellent results. For example, based on a logistic tent modular map, Hua et al. [19] proposed an image encryption algorithm that employs cross-plane permutation and non-sequential diffusion to encrypt images, where non-sequential diffusion changes the pixel values according to a secret sequence. Simulation tests show that the encryption scheme has high security. Erkan et al. [20] proposed a new 2D chaotic map by utilizing the diversity of Euler and Pi numbers and used bit reversion operation to change the pixel values to achieve better results. In [21], the author developed a cosine-transform-based chaotic system and based on the proposed chaotic system designed a cryptographic scheme that includes high-efficiency scrambling to randomly distribute pixels and random order substitution to change pixel values in a secret order. Teng et al. [22] proposed a new two-dimensional cross-mode hyperchaotic map based on logistic and sine maps, which has good unpredictability and a wide chaotic range. The author further designed an encryption scheme to encrypt the pixel positions and values simultaneously, which is effective against various attacks; Mansouri et al. [23] developed a one-dimensional sine-powered chaotic system that is highly sensitive and unpredictable. In addition, row-by-row and column-by-column confusion operations are used to change the pixel position, and the bit-level pixel operations are used to change the pixel value. Simulations show that the proposed encryption scheme has good performance. A 2D-LSM is proposed and a CIEA based on the 2D-LSM is designed in [24], which employs the point-to-point permutation and plane-cross-plane diffusion to encrypt the pixels, and it achieves better performance compared with some existing algorithms.

However, some chaotic maps proposed in recent years suffer from shortcomings. Some chaotic maps have discontinuous or limited parameter ranges, and when they are affected by external conditions, their chaotic behaviors would be degraded or even disappear [25, 26]. Some trajectories of the chaotic maps are not uniformly distributed throughout the entire phase space and exhibit specific patterns, which suggests that it is easy for an attacker to predict [27, 28]. When some chaotic maps are applied to platforms with limited accuracy, their chaotic properties may be weakened [29]. In addition, many encryption schemes have deficiencies in security. Some of them process pixels in a specified order, which may lead to a decrease in the security of the algorithms [30, 31]. To overcome the above deficiencies of chaotic maps and improve the security of encryption schemes, we propose the 2D-CLSM. Compared with the existing chaotic maps, the 2D-CLSM has an ultra-wide chaotic range and superior chaotic behaviors in the trajectory, bifurcation diagram, Lyapunov exponent, sample entropy, permutation entropy and TestU01 tests. Meanwhile, a 2D-CLSM-based image encryption algorithm (CLSM-IEA) is proposed, which consists of chaotic efficient permutation and random multi-directional diffusion. The chaotic efficient permutation is different from confusing the pixel positions row by row or column by column, and it changes the positions of pixels according to a secret order, which could greatly increase the randomness of the confusion process and reduce the correlations of the adjacent pixels. The random multi-directional diffusion chooses the diffusion direction based on the chaotic matrix to change the pixel values in multiple directions, which improves the security of the diffusion process. Under the condition of generating only two chaotic sequences, a plain image can be encrypted into another unrecognizable cipher image. The proposed CLSM-IEA shows high security in terms of key sensitivity, information entropy, adjacent pixel correlation, and the ability to resist differential attacks, noise attacks, and cropping attacks.

The innovations and contributions of this paper are summarized as follows:

  1. (1)

    A new two-dimensional chaotic map 2D-CLSM is proposed. Compared with the chaotic maps proposed in recent years, the 2D-CLSM has better ergodicity and unpredictability, and it behaves more complex chaotic behaviors across a large range of control parameters.

  2. (2)

    An image encryption scheme including the chaotic efficient permutation and random multi-directional diffusion is proposed. The chaotic efficient permutation can quickly separate adjacent pixels from horizontal and vertical directions at the same time through the random order. The random multi-directional diffusion chooses the diffusion direction determined by the chaotic matrix to spread changes in multiple directions.

  3. (3)

    Through various simulation experiments and security analysis, the CLSM-IEA provides strong security against diverse security attacks and surpasses some state-of-the-art image encryption algorithms in terms of security.

2 The 2D-CLSM hyperchaotic map

In this paper, the proposed 2D-CLSM firstly combines logistic and improved sine maps, exploiting the diversity of floating-point number π at the same time. Then, the combination result is used to perform the cosine transform. In this way, it can make its output sequence more unpredictable and acquires more complex chaotic behaviors over a wide range of control parameters. The mathematical definition of 2D-CLSM is as follows:

$$ \begin{gathered} x_{i + 1} = {cos}\left( {4ux_{i} \left( {1 - x_{i} } \right){\text{sin}}\left( {\uppi \left( {y_{i} \left( {1 - y_{i} } \right)} \right)} \right)\uppi ^{10} +\uppi ^{2} } \right) \hfill \\ y_{i + 1} = {cos}\left( {4uy_{i} \left( {1 - y_{i} } \right){\text{sin}}\left( {\uppi \left( {x_{i} + y_{i} } \right)} \right)\uppi ^{10} +\uppi ^{2} } \right) \hfill \\ \end{gathered} $$
(1)

where \(u\) is the control parameter and π takes 20 decimal places 3.14159265358979323846. The proposed chaotic map is used to generate sequences with high randomness and initial value sensitivity.

3 Performance evaluation of 2D-CLSM

The chaos properties of chaotic maps occupy a key position in the security evaluation of image encryption algorithms. Chaotic maps with superior chaotic properties often imply secure and reliable encryption schemes. Therefore, we evaluate the 2D-CLSM in various aspects, such as the trajectory, bifurcation diagram, Lyapunov exponent, sample entropy, permutation entropy and TestU01. Compared with the chaotic maps proposed in recent years, such as the 2D sine logistic modulation map(2D-SLMM) [32] and 2D infinite collapse map (2D-ICM) [33], the 2D-CLSM has superior hyperchaotic properties, a larger and continuous parameter range.

3.1 Trajectory and bifurcation diagram

The phase trajectory is a method to evaluate the performance of the chaotic map. The outputs of chaotic maps with superior performance can uniformly distributed on the whole plane. The bifurcation diagrams are plotted for the variable \(x_{i}\) and \(y_{i}\) using the varying control parameters. For the 2D-CLSM, the initial states were set as \(\left( {x_{0} ,y_{0} } \right) = \left( {0.312,0.723} \right)\) and control parameter \(u\) was set as 0.53. For the 2D-ICM, the initial states were set as \(\left( {x_{0} ,y_{0} } \right) = \left( {0.712,0.323} \right)\) and control parameters \(\left( {a,b} \right)\) were set as \(\left( {10,21} \right)\).For the 2D-SLMM, the initial states were set as \(\left( {x_{0} ,y_{0} } \right) = \left( {0.532,0.623} \right)\) and control parameters \(\left( {\alpha ,\beta } \right)\) were set as \(\left( {2,1} \right)\). As shown in Fig. 1, \(x_{i}\) and \(y_{i}\) of the 2D-CLSM can be spread to all data ranges in the whole control parameter range, which demonstrates that the 2D-CLSM has a broad and continuous parameter range, and can effectively resist the influence of external factors. As shown in Fig. 2, compared to the 2D-CIM and the 2D-SLMM, 2D-CLSM has no periodic structure or specific pattern clustering. Meanwhile, the outputs of 2D-CLSM are uniformly distributed over the whole phase plane, which suggests that the 2D-CLSM owns robust chaotic behaviors for a large range of the control parameter and it is particularly sensitive to the initial values and control parameter (Fig. 3).

Fig. 1
figure 1

Bifurcation diagrams of the 2D-CLSM (a) for variable \(x\). (b) for variable \(y\)

Fig. 2
figure 2

Trajectories of the different chaotic maps: (a) 2D-CLSM. (b) 2D-ICM. (c)2D-SLMM

Fig. 3
figure 3

The comparative LE spectrums for (a) LE1. (b) LE2

3.2 Lyapunov exponent (LE)

LE can be used to evaluate the dynamic properties of chaotic maps, which indicates the average rate of convergence or divergence of two trajectories with similar initial states [34]. For a nonlinear dynamic system \(x_{i + 1} = f\left( {x_{i} } \right)\), LE is calculated as follows.

$$ {LE} = \mathop {\lim }\limits_{n \to \infty } \sum\limits_{i = 1}^{n - 1} {\ln \left| {f^{\prime}\left( {x_{i} } \right)} \right|} $$
(2)

A chaotic map with a positive LE indicates its chaotic behavior. A multi-dimensional chaotic map has multiple LE values. Moreover, if the system has multiple positive LEs, it owns the hyperchaotic behaviors, which means that the system is more sensitive to the initial values and control parameters and its trajectory is more difficult to predict.

The 2D-CLSM has two positive LEs in the \(u \in \left[ {0,10} \right]\), showing its hyperchaotic properties. In addition, the 2D-CLSM yields bigger LEs compared with the 2D-ICM and 2D-SLMM, demonstrating its preferable chaotic properties.

3.3 Permutation entropy

Permutation entropy \(\left( {{PE}} \right)\) is a quantitative indicator to measure the randomness of the outputs [35]. For a dynamic system, the closer the PE result is to 1, the better the randomness of the system's output sequences. 2D-ICM and 2D-SLMM are selected as a comparison, and it can be seen from Fig. 4 that the proposed 2D-CLSM has the highest PE score, which demonstrates the better randomness and unpredictability of the 2D-CLSM.

Fig. 4
figure 4

Comparison with different chaotic maps in the aspect of PE

3.4 Sample entropy

Sample entropy \(\left( {{SE}} \right)\) is a criterion used to measure the complexity of a time series. For a chaotic system, a larger SE means that the output sequence is more complex and the chaotic system has a better chaotic behavior [36]. The SE of time series \(\left( {t_{1,} t_{2} , \cdots t_{k} } \right)\) is mathematically defined by

$$ {SE}\left( {n,h,K} \right) = - \log \frac{{N_{1} }}{{N_{2} }}, $$
(3)

where \(N_{1}\) and \(N_{2}\) stand for the numbers of vectors satisfying \(d\left| {T_{n + 1} \left( i \right),T_{n + 1} \left( j \right)} \right| < h\) and \(d\left| {T_{n} \left( i \right),T_{n} \left( j \right)} \right| < h\), respectively. The symbol \(n\) is a given dimension and \(h\) is a given distance. \(d\left| {T_{n} \left( i \right),T_{n} \left( j \right)} \right|\) is the Chebyshev distance between \(T_{n} \left( i \right)\) and \(T_{n} \left( j \right)\).

As shown in Fig. 5, compared to 2D-ICM and 2D-SLMM, the 2D-CLSM owns the largest SE score, indicating that 2D-CLSM owns more complex chaotic behaviors.

Fig. 5
figure 5

Comparison with different chaotic maps in the aspect of SE

3.5 Randomness evaluation

TestU01 is one of the most stringent randomness evaluation methods [37]. We use the three batteries of TestU01 to evaluate the degree of randomness of the sequences by setting different precision gains. As shown in Table 1, compared to the 2D-ICM and 2D-SLMM, the 2D-CLSM passed most of the statistical tests, demonstrating better randomness for 2D-CLSM.

Table 1 TestU01 results of different chaotic maps

4 The proposed image encryption algorithm CSLM-IEA

The proposed 2D-CSLM has an extremely wide chaotic range, better unpredictability, and complex chaotic behaviors, which lays the foundation for creating a secure encryption algorithm. In this paper, based on the 2D-CSLM, we propose a new image encryption algorithm named CSLM-IEA. The flowchart of the CSLM-IEA is shown in Fig. 6, which employs the typical confusion and diffusion structure [38].

Fig. 6
figure 6

The flowchart of the proposed CLSM-IEA

The proposed scheme consists of three phases, (1) key generation related to the plain image, (2) generation of two chaotic sequences with the given initial values and control parameters, and (3) chaotic efficient permutation and random multi-directional diffusion according to the chaotic matrixes. The CSLM-IEA achieves a high security level and high efficiency. It only needs one round of permutation and diffusion with two chaotic sequences to encrypt the plain image into a cipher image in a relatively short time.

4.1 Key generation

Security key is used to determine the initial values and control parameters of the 2D-CSLM. To improve the security of the key, it consists of the internal key (Key) and the external one-time key (us, xs, ys) obtained of sampled natural noise [39]. Firstly, we combine SHA-512 function with plain image \(P\) according to \(K{ = }{SHA}_{{{512}}}{(}P{)}\), then the obtained 128-bit hexadecimal \(K\) is processed by Eq. (4).

$$\begin{aligned} Key(i) =& hex2dec\left( {K\left( {\left( {i - 1} \right) \times 16 + 1:i \times 16} \right)} \right)/2^{49}, \\&\quad i \in \left[ {1,8} \right]\end{aligned} $$
(4)

Based on the performance evaluation of the 2D-CLSM, the 2D-CLSM has a hyperchaotic behavior across \(u = \left[ {0,10} \right]\), so the initial values and control parameter of the 2D-CLSM can be obtained through Eq. (5).

$$ \left\{ \begin{gathered} u{ = }u_{s} { + mod}\left( {\left( {Key\left( 1 \right){ + }Key\left( 2 \right)} \right),10} \right) \hfill \\ x_{0} { = }x_{s} { + mod}\left( {\left( {Key\left( 3 \right){ + }Key\left( 4 \right) + Key\left( 5 \right)} \right),2} \right) \hfill \\ {y}_{0} { = y}_{s} { + mod}\left( {\left( {Key\left( 6 \right){ + }Key\left( 7 \right) + Key\left( 8 \right)} \right),2} \right) \hfill \\ \end{gathered} \right. $$
(5)

Owning to the key is correlated with the plain image, thus, the key generation algorithm has excellent security. Even if only one bit of the plain image is changed, the key is completely different, which can effectively enhance the ability of the CSLM-IEA to resist differential attacks and selected plaintext/ciphertext attacks. At the same time, the sampled value of the noise adds more unpredictability to the key generation, expanding the key space and further improving the security of the key. \(\left( {u_{s} ,x_{s} ,y_{s} } \right)\) is the external one-time key obtained from sampled noise and it was set as \(\left( {u_{s} ,x_{s} ,y_{s} } \right) = \left( {{ 0}{\text{.751833256729493}},{0}{\text{.391475239716349,}}{\kern 1pt} {\kern 1pt} {0}{\text{.153976931726841}}} \right)\) in our experiments.

4.2 Chaotic efficient permutation

Some existing permutation algorithms of image encryption schemes tend to disrupt the pixels in a fixed row-by-row or column-by-column manner, which provides helpful information for attackers and may lead to a decrease in the security. To improve the security level and randomness of the encryption algorithm, a new chaotic efficient permutation (CEP) is proposed, which confuses the pixel positions in a random and secret order. Besides, it can change the positions of the pixels in horizontal and vertical directions at the same time. After the permutation operation, the pixels can be distributed to different positions in the image, which could greatly reduce the correlation of the pixels. The chaotic efficient permutation is described as follows:

Algorithm 1
figure a

Chaotic efficient permutation.

Figure 7 shows the generation of row index matrix \(S1\), column index matrix \(S2\), and position index matrix \(S1^{\prime}\) and \(S2^{\prime}\). The elements of \(S1\) matrix combine with the corresponding elements of \(C1\) to get the position index matrix \(S1^{\prime}\). For instance, the first row of \(S1\) combines with the first element of \(C1\) to get the first row of \(S1^{\prime}\)\(\left( {4,2} \right)\),\(\left( {2,2} \right)\),\(\left( {3,2} \right)\),\(\left( {1,2} \right)\). The elements of \(S2\) matrix combine with the corresponding elements of \(R1\) to get the position index matrix \(S2^{\prime}\). For instance, the first column of \(S2\) combines with the first element in \(R1\) to get the first column of \(S2^{\prime}\)\(\left( {2,4} \right)\),\(\left( {4,4} \right)\),\(\left( {1,4} \right)\),\(\left( {3,4} \right)\).

Fig. 7
figure 7

The generation of the position index matrices

Figure 8 provides an example of plain image confused by CEP, the positions in the plain image \(P\) are 1 to 16 in order. The plain image of size 4 \(\times\) 4 is confused by \(S1^{\prime}\) and \(S2^{\prime}\) matrix, then the disordered matrix \(T\) is obtained. As shown in Fig. 8, just after employing CEP one time, the pixel positions in the plain image are completely changed. The result of permutation is only related to the chaos matrix. Without knowing the chaos matrix, it is difficult for the attacker to crack the scheme, which improves the security of the encryption scheme; besides, only two different chaos matrices are required for CEP, which could improve the efficiency of the algorithm.

Fig. 8
figure 8

An example of the plain image \(P\) shuffled by CEP

The detailed process of the CEP is described in the following steps.

Step 1 Select the pixels in the \(P\) according to the first row of \(S2^{\prime}\), then move these pixels to different locations given to the first row of \(S1^{\prime}\):\(T\left( {4,2} \right) = P\left( {2,4} \right)\),\(T\left( {2,2} \right) = P\left( {1,2} \right)\),\(T\left( {3,2} \right) = P\left( {4,3} \right)\),\(T\left( {1,2} \right) = P\left( {1,1} \right)\), which are shown by the orange elements in the Fig. 9a.

Fig. 9
figure 9

The detailed process of CEP for the numerical example \(P\). (a) the pixels in orange confused by the first row of \(S1^{\prime}\) and \(S2^{\prime}\); (b) the pixels in blue confused by the second row of \(S1^{\prime}\) and \(S2^{\prime}\); (c) the pixels in purple confused by the third row of \(S1^{\prime}\) and \(S2^{\prime}\); (d) the pixels in red confused by the fourth row of \(S1^{\prime}\) and \(S2^{\prime}\)

Step 2 Select the pixels in the \(P\) according to the second row of \(S2^{\prime}\), then move these pixels to different locations given to the row column of \(S1^{\prime}\): \(T\left( {1,4} \right) = P\left( {4,4} \right)\),\(T\left( {2,4} \right) = P\left( {4,2} \right)\),\(T\left( {3,4} \right) = P\left( {1,3} \right)\),\(T\left( {4,4} \right) = P\left( {3,1} \right)\), which are shown by the blue elements in the Fig. 9b.

Step 3 Select the pixels in the \(P\) according to the third row of \(S2^{\prime}\),then move these pixels to different locations given to the third row of \(S1^{\prime}\): \(T\left( {4,1} \right) = P\left( {1,4} \right)\),\(T\left( {2,1} \right) = P\left( {3,2} \right)\),\(T\left( {3,1} \right) = P\left( {2,3} \right)\),\(T\left( {1,1} \right) = P\left( {2,1} \right)\), which are shown in purple elements in the Fig. 9c.

Step 4 Select the pixels in the \(P\) according to the fourth row of \(S2^{\prime}\), then move these pixels to different locations given to the fourth row of \(S1^{\prime}\): \(T\left( {2,3} \right) = P\left( {3,4} \right)\),\(T\left( {1,3} \right) = P\left( {2,2} \right)\),\(T\left( {3,3} \right) = P\left( {3,3} \right)\),\(T\left( {4,3} \right) = P\left( {4,1} \right)\), which are shown as red elements in the Fig. 9d.

4.3 Random multi-directional diffusion

A reliable encryption algorithm should own the diffusion property, which means that a small change in the plain image should be spread to all the positions in the cipher image. However, most existing diffusion algorithms follow some fixed orders to change the pixels, which may reduce the security of the encryption schemes. Moreover, some diffusion algorithms only process image pixels in a single direction, as shown in Fig. 10.

Fig. 10
figure 10

Diagram illustration of the diffusion process for some existing IEAs

In this paper, a new random multi-directional diffusion is proposed, it only relies on the chaos matrix to choose the diffusion direction. Without knowing the specifics of the chaos matrix, it is difficult to predict the order of processing pixels and the diffusion result. In this way, we could add more randomness to the encryption images and improve the safety of the encryption scheme. Besides, the proposed diffusion algorithm changes pixels in the diagonal, horizontal, or vertical directions at the same time, which strengthens the performance of diffusion. The detailed process of the random multi-directional diffusion is described as follows.

First, the diffusion selection matrix \(S3\) is obtained from the \(S\) matrix according to Eq. (6), and the matrix \(V\) is obtained from the \(X\) matrix according to Eq. (7).

$$ S3{\text{ = mod(}}S{2)} $$
(6)
$$ V = {reshape}\left( {X,{\kern 1pt} {\kern 1pt} {\kern 1pt} \left[ {M,N} \right]} \right) $$
(7)

Then, the diffusion operation is described as the Eq. (8).

$$ C_{{i,j}} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {\text{if}{\text{ }}i{\text{ = 1, }}j = {\text{1}}} \hfill \\ {T_{{i,j}} \oplus C_{{i,j - 1}} \oplus V_{{i,j}} } \hfill & {\text{if}{\text{ }}i{\text{ = 1, }}j \ne {\text{1}}} \hfill \\ {T_{{i,j}} \oplus C_{{i - 1,j}} \oplus V_{{i,j}} } \hfill & {\text{if }i \ne {\text{1, }}j = {\text{1}}} \hfill \\ {T_{{i,j}} \oplus C_{{i - 1,j - 1}} \oplus C_{{i - 1,j}} \oplus V_{{i,j}} } \hfill & {\text{if}{\text{ }}i \ne {\text{1, }}j \ne {\text{1, }}S3_{{i,j}} {\text{ = 0}}} \hfill \\ {T_{{i,j}} \oplus C_{{i - 1,j - 1}} \oplus C_{{i,j - 1}} \oplus V_{{i,j}} } \hfill & {\text{if }i \ne {\text{1, }}j \ne {\text{1 , }}S3_{{i,j}} {\text{ = 1}}} \hfill \\ \end{array} } \right. $$
(8)

where symbol \(\oplus\) denotes the bit-level XOR operation.

The random multi-directional diffusion schematic is shown in Fig. 11. Accordingly, the decryption process of random multi-directional diffusion can be described as the Eq. (9).

$$ T_{{i,j}} = \left\{ {\begin{array}{*{20}l} 1 \hfill & {\text{if}{\text{ }}i{\text{ = 1, }}j = {\text{1}}} \hfill \\ {C_{{i,j}} \oplus C_{{i,j - 1}} \oplus V_{{i,j}} } \hfill & {\text{if}{\text{ }}i{\text{ = 1, }}j \ne {\text{1}}} \hfill \\ {C_{{i,j}} \oplus C_{{i - 1,j}} \oplus V_{{i,j}} } \hfill & {\text{if }i \ne {\text{1, }}j = {\text{1}}} \hfill \\ {C_{{i,j}} \oplus C_{{i - 1,j - 1}} \oplus C_{{i - 1,j}} \oplus V_{{i,j}} } \hfill & {\text{if }i \ne {\text{1, }}j \ne {\text{1, }}S3_{{i,j}} {\text{ = 0}}} \hfill \\ {C_{{i,j}} \oplus C_{{i - 1,j - 1}} \oplus C_{{i,j - 1}} \oplus V_{{i,j}} } \hfill & {\text{if }i \ne {\text{1, }}j \ne {\text{1, }}S3_{{i,j}} {\text{ = 1}}} \hfill \\ \end{array} } \right. $$
(9)
Fig. 11
figure 11

The schematic illustration of the random multi-directional diffusion

5 Simulation results and performance analysis

The security of the encryption algorithm is a priority to be considered. In this part, various tests and analyses are adopted to evaluate the security of CSLM-IEA in terms of key space, key sensitivity, histogram, adjacent pixel correlation, information entropy analysis, and the ability to defend against differential attacks, noise attacks, and cropping attacks. A variety of images with different sizes and types are used for testing, which are derived from the USC-SIPI image database.Footnote 1

5.1 Key space analysis

A secure encryption scheme requires a large key space, otherwise, an attacker could potentially crack the scheme through brute force attacks. In theory [40], an encryption scheme with a key space exceeding \(2^{100}\) has the potential to effectively resist brute force cracking attacks. The CLSM-IEA employs SHA-512 in combination with a plaintext image and the external one-time key obtained from sampled natural noise to generate the key. Thus, the key space is \(2^{512} \times 10^{45}\), which is significantly greater than \(2^{100}\) and indicates that CLSM-IEA can effectively prevent brute-force attacks.

5.2 Key sensitivity analysis

A secure encryption scheme is supposed to own the highly sensitive key. Otherwise, the attackers may restore the original image through incorrect keys with tiny changes and the actual key space would be narrowed. An encryption algorithm with key sensitivity means that a small change in the key will result in totally different results and no valuable information about the plain image can be revealed. We test the key sensitivity of CLSM-IEA by making small changes in the encryption and decryption keys. Figure 12 shows that CLSM-IEA performs well in terms of key sensitivity, and the original image can only be retrieved by the correct key.

Fig. 12
figure 12

The key sensitivity analysis

5.3 Histogram analysis

Histograms visually show the distribution of pixels at each intensity level and are a widely used technique for statistical analysis. Most of the pixels in a plain image are distributed at a few intensity pixel levels, as shown by the histograms. However, an efficient encryption algorithm can distribute the pixels uniformly at each intensity pixel level, which also means that an attacker cannot get any information about the plain image.

In Fig. 13, the first column shows the histograms of the plain images, while the second column shows the histograms of the cipher images. As Fig. 13 shows, after the encryption process, the pixels are uniformly distributed across all the intensity levels, demonstrating the excellent encryption performance of CLSM-IEA.

Fig. 13
figure 13

Histogram analysis of different plain images and encrypted images

5.4 Adjacent pixel correlation

Plain images tend to have strong pixel correlations in different directions. The attacker usually obtains information of a plaintext image through analyzing the correlations of adjacent pixels. Therefore, a secure encryption algorithm should reduce the correlations of neighboring pixels in an image as much as possible [40]. The pixel correlation coefficient is calculated as follows:

$$ \left\{ \begin{gathered} r_{xy} = \frac{{{\text{cov}} \left( {x,y} \right)}}{{\sqrt {{D}\left( x \right)} \sqrt {{D}\left( y \right)} }} \hfill \\ {E}\left( x \right) = \frac{1}{N}\sum\limits_{i = 1}^{N} {x_{i} } \hfill \\ {D}\left( x \right) = \frac{1}{N}\sum\limits_{i = 1}^{N} {\left( {x_{i} - {E}\left( x \right)} \right)^{2} } \hfill \\ {\text{cov}} \left( {x,y} \right) = \frac{1}{N}\sum\limits_{i = 1}^{N} {\left( {x_{i} - {E}\left( x \right)} \right)\left( {y_{i} - {E}\left( y \right)} \right)} \hfill \\ \end{gathered} \right. $$
(10)

where \(x_{i}\) and \(y_{i}\) are gray values of the adjacent pixels. We select five color images of different sizes as the test images. Figure 14 shows the pixel correlations of R, G, and B channels for plain images and cipher images in horizontal, vertical, and diagonal directions.

Fig. 14
figure 14

Analysis of adjacent pixel correlation: (a) the color image named Butterfly and corresponding encrypted image; (b) correlation on the R, G and B channels of Butterfly from different directions; (c) correlation of adjacent pixels in the horizontal direction for five color images; (d) correlation of adjacent pixels in the vertical direction for five color images; (e) correlation of adjacent pixels in the diagonal direction for five color images

Table 2 shows the correlation test scores on the R, G, and B channels in the horizontal, vertical, and diagonal directions. The images butterfly and house are \(256 \times 256 \times 3\) size while the rest are \(512 \times 512 \times 3\) size. As Fig. 14 and Table 2 show, the plain images usually own the high correlations of adjacent pixels, while after the encryption operation, pixels of the plain image are uniformly spread to all directions randomly, and the adjacent pixel correlations of the cipher images are very close to 0, which means that the attacker cannot get any information about the plain image from the pixel correlation.

Table 2 The correlation coefficient and information entropy test scores on the R, G, B channels

5.5 Information entropy analysis

Information entropy is an important indicator to measure the amount of information and the degree of randomness for an information source. A secure encryption algorithm should make the image pixels uniformly distributed with high randomness to effectively resist entropy attacks. The formula of information entropy is as follows:

$$ H(g) = \sum\limits_{i = 0}^{{2^{N} - 1}} {p\left( {g_{i} } \right)} \log \frac{1}{{p\left( {g_{i} } \right)}} $$
(11)

where \(p\left( {g_{i} } \right)\) represents the probability of the information source \(g_{i}\), and \(N\) represents the number of bits of \(g_{i}\).

The theoretical value of information entropy of a completely random 8-bit pixel image is 8. The closer the information entropy of the cipher image is to 8, the better the randomness of the encryption algorithm and its ability to resist entropy attack. We select the same images in the adjacent pixel correlation test and calculate the information entropy of the encrypted images in each channel. It can be seen from Table 1 that after the encryption process, the information entropy is very close to 8, demonstrating the CLSM-IEA could distribute the image pixels uniformly with high randomness.

5.6 Analysis of defense against differential attacks

The differential attack is a useful attack in which the attacker studies the relationship between the plain image and the encrypted image to crack the encryption scheme. An encryption scheme with good diffusion properties can effectively resist differential attacks, which means that a small change in the plain image will result in a completely different encrypted image.

Figure 15 demonstrates the ability of CLSM-IEA to defend against differential attacks. As can be seen from Fig. 15, a one-pixel change in the plaintext image could produce a completely different encryption result, demonstrating the good diffusion property of CLSM-IEA.

Fig. 15
figure 15

Analysis of defense against differential attacks: (a) the plain image \(P\); (b) \(P^{\prime}\) is obtained by randomly changing one pixel of \(P\); (c) \(C\) is obtained by encrypting \(P\); (d) \(C^{\prime}\) is obtained by encrypting \(P^{\prime}\) with the same key; (e) the distinction between cipher images \(C\) and \(C^{\prime}\)

The number of pixels change rate \(\left( {{NPCR}} \right)\) and the unified averaged changed intensity \(\left( {{UACI}} \right)\) are used to quantitatively test the characteristics of the CLSM-IEA against differential attacks. Theoretically, if the UACI and the NPCR are all close to the ideal values of 33.4635070% and 99.6094070%, the encryption scheme is considered to perform well against differential attacks [41]. Supposing that \(C_{1}\) and \(C_{2}\) are encryption images of two plain images with one-bit difference, the mathematical definitions of the UACI and NPCR are as follows:

$$ {NPCR}\left( {C_{1} ,C_{2} } \right) = \sum\limits_{i,j} {\frac{{D\left( {i,j} \right)}}{R}} \times 100\% $$
(12)
$$ {\varvec{UACI}}\left( {C_{1} ,C_{2} } \right) = \sum\limits_{i,j} {\frac{{\left| {C_{1} \left( {i,j} \right) - C_{2} \left( {i,j} \right)} \right|}}{R \times S}} \times 100\% $$
(13)
$$ \user2{D}\left( {i,j} \right) = \left\{ {\begin{array}{*{20}l} 0 \hfill & {\user2{if}{\text{ }}C_{1} \left( {i,j} \right) = C_{2} \left( {i,j} \right)} \hfill \\ 1 \hfill & {\user2{if}{\text{ }}C_{1} \left( {i,j} \right) \ne C_{2} \left( {i,j} \right)} \hfill \\ \end{array} } \right. $$
(14)

where \(R\) represents the number of pixels and \(S\) is the largest pixel value.

In this paper, we adopt a proposed [42] strict standard test, which calculates the critical value of \({NPCR}\), and \({UACI}\) based on a given significance level to show the ability of the algorithm to resist differential attacks.

$$ N_{\upalpha }^{*} = \frac{{R -\upphi ^{ - 1} (\upalpha )\sqrt {R/S} }}{R + 1} $$
(15)
$$ \left\{ \begin{gathered} u_{\upalpha }^{* - } = \mu_{u} -\upphi ^{ - 1} \left( {\upalpha /2} \right)\sigma_{u} \hfill \\ u_{\upalpha }^{* + } = \mu_{u} +\upphi ^{ - 1} \left( {\upalpha /2} \right)\sigma_{u} \hfill \\ \end{gathered} \right. $$
(16)
$$ \mu_{u} = \frac{R + 2}{{3R + 3}} $$
(17)
$$ \sigma_{u} = \frac{{\left( {R + 2} \right)\left( {R^{2} + 2R + 3} \right)}}{{18\left( {R + 1} \right)^{2} R \times S}} $$
(18)

Under the 0.05 criterion of \(\upalpha \), for 256 \(\times\) 256-sized images, \(N_{0.05}^{*}\) is 99.5693% and \(\left( {u_{{{0}{.05}}}^{* - } ,u_{{{0}{.05}}}^{* + } } \right)\) is \(\left( {33.2824\% { ,}33.6447\% } \right)\).For 512 \(\times\) 512-sized images,\(N_{0.05}^{*}\) is 99.5893% and \(\left( {u_{{{0}{.05}}}^{* - } ,u_{{{0}{.05}}}^{* + } } \right)\) is \(\left( {33.3730\% \, , \, 33.5541\% } \right)\).For 1024 \(\times\) 1024-sized images,\(N_{0.05}^{*}\) is 99.5994% and \(\left( {u_{{{0}{.05}}}^{* - } ,u_{{{0}{.05}}}^{* + } } \right)\) is \(\left( {33.4183\% \, , \, 33.5088\% } \right)\). The ability of CLSM-IEA to resist differential attacks is shown in Tables 3, 4 and 5. The file name from 5.1.09 to 5.1.14 are 256 \(\times\) 256 size, from 5.2.08 to Gray.512 are 512 \(\times\) 512 size, from 5.3.01 to 7.2.01 are 1024 \(\times\) 1024 size, the significance level is 0.05. In Tables (3, 4), numbers in bold are test results that successfully passed the test.

Table 3 Comparing with different encryption algorithms in term of the NPCR test
Table 4 Comparing with different encryption algorithms in term of the UACI test
Table 5 NPCR and UACI test scores using CLSM-IEA for color images of different sizes

As Tables 3 and 4 display, compared to some advanced image encryption schemes, only the CLSM-IEA passed all the tests, demonstrating its superior capabilities to defend against differential attacks.

Table 5 shows that all the color images of different sizes pass the stringent test. The NPCR and UACI values are very close to the ideal value, which indicates that CLSM-IEA has an excellent characteristic in resisting differential attacks.

5.7 Noise and cropping attack analysis

Images are inevitable to be affected by noise and lose some data when they are transmitted over network. A reliable encryption scheme should ensure that the decrypted image is visualized with high quality, which indicates that it can reconstruct most of the original information from the cipher image that has been affected by noise disturbance and data loss.

Figure 16 shows the quality of the decrypted image under different levels of salt & pepper noise interference in the cipher image. As shown in the Fig. 16, even though the decrypted images may not be able to retrieve all the content of the plaintext image, most of the information in the original image can still be obtained.

Fig. 16
figure 16

Noise attack analysis. (a) decryption result with 1% ‘salt & pepper’ noise; (b) decryption result with 5% ‘salt & pepper’ noise; (c) decryption result with 10% ‘salt & pepper’ noise

Figure 17 shows the quality of the decrypted images under different levels of data loss for the cipher images. As seen in Fig. 17, even if a large portion of the information in the cipher image has been lost, decrypted images can still recover the main contents of the original image with high visual quality.

Fig. 17
figure 17

Data loss attack analysis: (a)1/16 data loss of cipher image and its decryption result; (b) 1/16 center data loss of cipher image and its decryption result; (c) 1/4 data loss of cipher image and its decryption result; (d) 1/4 data loss of cipher image and its decryption result

As shown in Figs. 16 and 17, the CLSM-IEA has talented resistance to noise and cropping attacks and could produce visually high-quality decrypted images without the local aggregation of missing pixels. This is because the alteration of pixels in the cipher image during decryption affects only a few pixels of decrypted image.

5.8 Speed performance

The image encryption schemes should be suitable for realistic applications owing to the rapid growth of image data capacities. The CLSM-IEA owns high efficiency because it only needs two chaotic sequences and one round of permutation and diffusion. To evaluate the efficiency of CLSM-IEA, we obtain the average time for different sizes of images by 100 experiments. Meanwhile, we compare the efficiency of CLSM-IEA with some state-of-the-art encryption algorithms. The speed performance results are shown in Table 6. The results show that the CLSM-IEA can encrypt different sizes of images in a few seconds, demonstrating its high efficiency (Table 6).

Table 6 Comparison with different algorithms in term of encryption time (s)

6 Conclusion

To overcome the shortcomings of some existing chaotic maps and improve the security of the encryption schemes, we propose the 2D-CSLM, which displays an extremely wide chaotic range and superior chaotic behaviors in terms of the trajectory, bifurcation diagram, LE, SE, PE and TestU01 tests. Furthermore, an image encryption scheme based on the 2D-CLSM is constructed. The 2D-CLSM-based image encryption algorithm (CLSM-IEA) consists of the chaotic efficient permutation and random multi-directional diffusion. The chaotic efficient permutation can quickly separate adjacent pixels from horizontal and vertical directions at the same time. The random multi-directional diffusion uses a secret order to change pixel values in multiple directions. The chaotic efficient permutation and random multi-directional diffusion dramatically strengthen the randomness of the encryption process and significantly improve the security of the encryption scheme. Simulations show that CLSM-IEA achieves a high level of security, and can effectively resist various known security attacks. In future work, we will explore the application of the proposed algorithm to video encryption, medical image encryption, and simultaneous super-resolution encryption.