1 Introduction

1.1 Background

It is becoming increasingly common to transfer a large amount of data over a public network. This data could be public, but it could also be confidential [1]. That is why issues related to privacy and confidentiality of data, and more importantly images that have many applications [2,3,4,5], are becoming of great importance. For this reason, researchers have had their attention focused on the creation of a more reliable and effective encryption algorithm, especially because many advancements have taken place in the domain of the internet and digital communication [6]. Digital images are characterized by a powerful correlation between two side-to-side pixels, strong redundancy, and large amounts of data. Many image encryption algorithms, including data encryption standard (DES) and advanced encryption standard (AES) have many disadvantages that make them unqualified to encrypt images in today’s digital communication. For this reason, many attempts are being made to develop new encryption algorithms, specifically for images. Among these attempts, there have been trials to use chaos theory and fractals in image encryption [7, 8].

The special nature of chaos theory has helped it gain prominence in many scientific fields. Among the fields that have made use of this theory, one can site physics, engineering, mathematics, computer science, biology, and the arts, along with cryptography [9, 10]. A chaotic system is highly sensitive to initial parameters, certain, ergodic, etc. Pseudo-random sequences form chaotic maps that create chaotic sequences. All of the previous are highly complex, highly unpredictable and difficult to analyze. These chaotic maps are used for encryption in modern times, as they have large key spaces and possess a non- linear dynamic behavior. The design of efficient encryption protocols is possible due to the use of chaos theory and cryptography [11,12,13]. A certain level of data security is needed for chaos-based encryption schemes and cryptanalysis has revealed a better mechanism is always needed for these systems. This is where hyperchaotic encryption systems come into play. Compared to a chaotic system, hyper-chaos is of a higher dimension and has two or more positive Lyapunov exponents. In a dynamical system, the number and sign of the Lyapunov exponent are measurements of the rate of the gap separating infinitesimally proximal trajectories. To achieve more randomness in a system, a higher number of positive exponents and a minimum of one negative exponent, to provide stability, are needed [14,15,16].

Among the branches of nonlinear science, fractal is a hot topic. To produce fractals, a pre-set number of iterations are done for a mathematical function. Many examples of fractals are available in nature. For example, the Highway Dragon, simply known as the Dragon Curve, is a fractal curve, which requires an iterated function system (IFS), as it is a fractal. Simply stated, a simple pattern is initially produced and put into a recursive function that keeps on running until the set objective is reached [17, 18]. The randomness of fractal images makes it a perfect candidate for the design of a cryptosystem with high security and reliability. Another property of fractal plays an important role in the strength of a cryptosystem. Fractals are sensitive to their initial values. This is another of their characteristics that is most suitable for a cryptosystem to have, as it strengthens the encryption scheme. As such, intruders, trying to find the correct key to decrypt images encrypted with fractal-based algorithms, are unlikely to succeed. Key size is another important feature that determines the strength of a cryptosystem, as it affects the number of times attackers need to work to find the encryption key, in a brute force attack. As such, key size estimates the possibility of a collision attack. The size of the encryption key is a determinant of the exchange key space. When a fractal key is used for encryption, the exchange key space depends on key size. Thus, key space is extended, its size shrinks, resulting in a more complex key [19, 20].

1.2 Related work

In this section, results of some of the previous research work related to image encryption will be explored. Fractals and 2D-chaotic maps were used for the secure transmission of images in [19], where the importance of combining both systems in an image encryption scheme was realized. Another researcher combined the swarm optimization algorithm (PSO) and cellular automata (CA) in a hyperchaotic image encryption scheme [21]. Subsequently, to produce the initial conditions of the hyperchaotic system, the value of the hash function was used. The latter is in close relation to the plaintext image undergoing encryption. Also, the correlation between side-to-side pixels within the image was calculated using the PSO. In [22], a proposal was made to use hybrid chaotic maps in grayscale image cryptosystems. This proposal involves two steps: the first achieved confusion through the use of Arnold’s cat map, the second used the proper selection of three types of maps, Sine, Logistic, and Tent to achieve the principle of diffusion. In [23], Julia’s set of fractals along with 3D Lorenz chaotic maps were used to accomplish a hybrid image encryption scheme high in security. The system used in this research depended on the application of shuffling with the help of a fractal key and a 3D Lorenz chaotic map. Pixels of the standard image were shuffled adding confusion to the shuffling process. The diffusion applied a 3D Lorenz chaotic map which contributed to the distortion of all the pixels within the image. A new image encryption proposal was presented in [24], it was based on chaos, Hilbert curves, and H-fractals. The SHA-3 algorithm was used to calculate the hash value of the plaintext image. This represented the initial value of the chaos system. In order to scramble the global position of pixels and the value of each pixel in the image, chaos-generated sequences were used. Following this step, the scrambling of local pixels positions took place, along with the two-time diffusion of pixel value with an alternative use of the Hilbert curve and H-fractal [25]. This paper consisted of three components, an Arnold map, a Mandelbrot set, and DNA computation. All contributed to the generation of the cipher image. In [26], a Mandelbrot Julia set was used to produce a digital image encryption algorithm. In this paper, the parts, real and imaginary, were extracted from the generalized M-J set and used to generate the pseudo-random sequences. As for the generalized M-J set, its use in image encryption was verified with the help of several rounds of XOR encryption. The use of Hilbert fractals in image encryption was demonstrated in [27]. This paper applied fractal keys and S-boxes in hyper-chaotic systems for image encryption. In [28], three components were used for color image encryption, namely DNA cryptography, Lorenz and Rossler’s chaotic system, and a 2D logistic map. As such, DNA cryptography techniques were used for the encryption of RGB images. As for diffusion, at the pixel level, the three channels of test images were encrypted with the help of Lorenz and Rossler’s chaotic system. In [29], A novel hyperchaotic system, devoid of any equilibrium point, was introduced and thoroughly examined. The integration of this hyperchaotic system was utilized to develop an innovative steganography technique capable of achieving a heightened steganography capacity. The underlying process involved segmenting and quantizing a confidential color image, followed by block discrete cosine transformation. The embedded information was subsequently compressed through run-length encoding. Ultimately, the encrypted data was randomly inserted into the least significant bit of cover images. An improved multiparty quantum private comparison protocol based on quantum homomorphic encryption has been introduced in [30].

1.3 Our contribution

This research proposed a new image encryption algorithm that applies fractal shapes and the chaotic map, to design a more secure and more effective image cryptosystem than the ones currently available. The specific type of fractal shapes mentioned in this article are used for the first time and their generation is based on the Henon map, which replaces lines in the initial pattern. Thus, security and randomness are increased in this algorithm. These properties are tested through the application of autocorrelation properties and the NIST analysis. In comparison with other algorithms, this one seems to be superior. As such, an image encryption system done through the application of generated chaos fractal dragon (ChFrDr) images is introduced. The proposed algorithm, can be summarized in the following points:

  • Generation of Chaos Fractal Dragon (ChFrDr) Images:

  1. 1.

    The Henon map with the initial conditions \(\left\{{x}_{o}, {y}_{o}\right\}\) and control parameters \(\{a, b\}\) is used as the initial pattern to generate new dragon shapes.

  2. 2.

    From the previous step, a copy of the Henon map is rotated in the anti-clockwise direction, it is then attached to the end of the First shape.

  3. 3.

    A continuation of the rotation previously described above is performed on the shape produced in the previous step. It is then also attached to the end of the second shape. This is considered the third iteration, followed by others.

  4. 4.

    The result of the process described above (through its various iterations) is chaos fractal dragon (ChFrDr) shapes.

Several parameters contribute to the production of the dragon fractal images, including the initial pattern, the Henon map (the initial pattern’s control parameter), the rotation angle, and the number of iterations applied. A different dragon fractal shape can be produced through this method if initial parameters are changed.

  • Application of the Chaos Fractal Dragon Shapes (ChFrDr) for Image Encryption Based on Hyper-Chaotic Map:

  1. 1.

    A control map is used to select five dragon fractal images from a previously generated set of different images. A hyper-chaotic map is employed to generate random sequences that fill the sparse structure of the fractal shape, resulting from the previously described process.

  2. 2.

    Chaotic fractal (ChFr) S-box can be generated with the help of one of the five chosen (ChFrDr) shapes. As for the other (ChFrDr) shapes, it is used in the image diffusion step for encryption.

  3. 3.

    The process of IWT is applied for the input plain image for the purpose of reaching an approximation as well as three detail sub-bands.

  4. 4.

    A normalization takes place for the three detail sub-bands, in order to modify the intensity of the pixels and keep them within the range of generated (ChFrDr) images, i.e., 0 to 255.

  5. 5.

    Following this step, the encoding of the pixel value for each of the detail sub-bands takes place to obtain 8-bits. These pixel values are then reshaped into a 1D binary sequence. The binary stream is then shuffled with the help of a secret M-sequence. For the diffusion of the shuffled sub-bands, three different (ChFrDr) images are used.

  6. 6.

    The approximation of sub-bands is rendered more difficult through the replacement of the value of each pixel with the value of the chaos fractal (ChFr) S-box. This step is followed by diffusion of the encoded sub-image by applying one of (ChFrDr) images.

  7. 7.

    To obtain the final encrypted image, the four encrypted sub-bands previously encrypted are arranged.

Tests and security analyses were run to check the effectiveness and security of the suggested algorithm. A comparison was also performed between this and other encryption algorithms, and the newly proposed technique delivered better results than the others.

1.4 Structure of article

The previous part marks the first section of this paper, followed by a discussion of Dragon fractals in Section 2, a discussion of chaotic maps, an introduction to hyper-chaotic maps in Section 3, and a description of the proposed algorithm of image encryption using dragon fractals in Section 4. The remaining sections of the paper are Section 5 with an explanation of the experiment’s results, Section 6 with the evaluation analysis of chaos fractal dragon (ChFrDr) images, Section 7 with a discussion of the security of this newly developed encryption method, and Section 8 with the conclusion of the research.

2 Dragon fractal

The fractal is initially a geometric shape repeated several times. It is produced by the Iterative Function System (IFS). One example of such fractals is the dragon curve. Depending on the way it is drawn, a dragon curve can show in different orientations [18]. To generate a dragon fractal, the following methods are used:

  1. 1.

    Draw a line going downwards.

  2. 2.

    Rotate the shape 90 ◦ anti-clockwise, starting from the endpoint of the previous step.

  3. 3.

    Continue the process by applying repetition with 90 ◦ anti-clockwise rotations.

  4. 4.

    A pattern starts to take shape with successive iterations.

  5. 5.

    The first iteration produced two lines, but after 18 iterations, the result was more than quarter-million lines. At this point, the shape seems to have a solid color as the lines blended together. The process of iterations can continue as long as needed. Figure 1 shows the steps of producing a dragon fractal with different iterations.

Fig. 1
figure 1

Dragon Fractal at Different Iteration

3 Chaotic maps

Before the details of the proposed algorithm are thoroughly explained, it is important to explain the characteristics of chaotic maps. Chaotic maps are deterministic evolution functions. However, their behavior is unpredictable as they are highly sensitive to initial conditions. Mixing, random-like behavior, and ergodic behavior are also very important characteristics of chaotic maps. Their properties of high non-linearity, extreme randomness, and large chaotic range make them ideal candidates for use in cryptosystems and help them ward off different types of attacks [25, 31,32,33]. The chaotic maps described below are applied in the proposed algorithm.

3.1 Henon map

The Henon map is a system with discrete time dynamics that possesses good chaotic behavior. This map picks a specific point represented by \(\left\{{x}_{n}, {y}_{n}\right\}\) then effects a change to this point according to the following equations [34,35,36]:

$${x}_{n+1}=1-a{x}^{2}+{y}_{n}$$
(1)
$${y}_{n+1}=1-b{x}_{n}$$
(2)

The initial conditions of the map \(\left\{{x}_{n}, {y}_{n}\right\}\) and parameters \(\{a , b\}\) are the main determinants of the output resulting from the behavior of the Henon map. The pseudo-random sequence is the result of the chaotic behavior of this map when mentioned parameters \(\{a , b\}\) take the values 1.4 and 0.3, respectively. As such, the system becomes random and hard to fathom.

3.2 Logistic map

As for logistic maps, they are second-degree polynomial maps. The possess initial conditions \(\left({X}_{o}\right),\) control parameters \((r)\) and their output is \((X)\). Their inputs are variable, and they can be expressed as follows [25, 37]:

$${x}_{n+1}=r {x}_{n}(1-{x}_{n})$$
(3)

where r is the chaotic parameter, while n is the number of iterations. \(r \in [0, 4], x \in [0, 1].\) Chaos takes place when \(r \in [3.57, 4].\)

3.3 Hyper chaotic map

Low-dimensional chaotic systems have certain shortcomings that were overcome by hyperchaotic systems. As such, they can make more complex chaotic sequences. The definition of 5D hyper-chaotic systems can be expressed by [38]:

$$\dot{{x}_{1}}=a\left({x}_{2}-{x}_{1}\right)+{x}_{4}+{x}_{5}$$
(4)
$$\dot{{x}_{2}}=c{x}_{1}-{x}_{1}{x}_{3}-{x}_{2}$$
(5)
$$\dot{{x}_{3}}={x}_{1}{x}_{2}-b{x}_{3}$$
(6)
$$\dot{{x}_{4}}=-{x}_{1}{x}_{3}+p{x}_{4}$$
(7)
$$\dot{{x}_{5}}=q{x}_{1}$$
(8)

In the above equations, parameters \(a, b, c, p\;and\;q\) take the values 10, 8/3, 28, 1.3, and 2.5, respectively. The 5D hyper-chaotic Lorenz system possesses three positive Lyapunov exponents. As such, its dynamics are very complex, and its trajectories can expand in three different directions. When the initial states of this 5D hyper-chaotic map take the following values \({x}_{1}(0)= 0.325\), \({x}_{2}(0)= 0.476\), \({x}_{3}(0)= 1.256\),\({x}_{4}(0)= 0.628\;and\;{x}_{5}(0)= 1.5\), then a hyper-chaotic state is achieved and five chaotic sequences are produced.

4 Propose image encryption algorithm based on dragon fractal images

The proposed image encryption scheme suggested in this paper depends on fractal shapes having iterations of the chaotic map. Advantages of this system over other algorithms include its high efficiency, complex structure, added security, and improved resistance to attacks. The steps used to construct this scheme follow this order. In step one, the Henon map is used to generate different new fractal shapes. The resulting new fractal shapes have a sparse structure; hence, we fill the spaces with random values generated from the hyper chaotic map. We can use one of the five generated chaotic fractal shapes to construct a chaotic fractal (ChFr) S-Box. In addition, the other four chaotic fractal shapes can be used in diffusion for encryption applications. Step two is to obtain an approximation and detailed sub-bands for the original image through IWT. Step three involves the use of the logistic map to modify the binary bit of every pixel within the three previously mentioned detailed sub-bands. This is followed by the diffusion of the shuffled images with the help of three different ChFrDr images. Step four is about the replacement of the value of each pixel within the approximation sub-band the value of a chaos fractal (ChFr) S-Box. Following this step, a diffusion of the encoded sub-image takes place with the help of another ChFrDr image. Once the four sub-bands are arranged, the final encrypted image is reached. Figure 2 shows the block diagram of the proposed algorithm.

Fig. 2
figure 2

Block Diagram of the Proposed Image Encryption Algorithm

4.1 Chaotic Fractal Dragon (ChFrDr) key generation

The concept of fractals involves the graphical generation of shapes with properties of self-similarity generated through the use of a recursive or iterative algorithm to make a new form of images. In this article, we can create new fractal shapes with more complicated generators. There are two parameters to each fractal, the initiator and the generator. The new concept of this paper involves the use of the Henon map as an initiator. As for the generator, its components include a map of initial conditions, several iterations (n), and angle rotation (R). The parameters, when applied, help improve the security of the entire process. Algorithm 1, below, explains the process of the generation of dragon images.

  1. Step 1:

    The initial pattern of the fractal shape is the Henon map with initial conditions \(\left\{{x}_{n}, {y}_{n}\right\}\) and the parameter \(\{a, b\}\) take the values 1.4 and 0.3, respectively. The fractal output’s behavior depends on these conditions of the map.

  2. Step 2:

    A copy of the map mentioned above is rotated anti-clockwise at an angle of (R) degree, and then is attached to the end of the first shape.

  3. Step 3:

    The process is repeated, from the endpoint reached in the previous step. Whereas the copy is rotated in the same direction by the same angle a number of times. As such, each iteration produces twice as many copies of the initial generator. The number of repetitions of this process depends on the requirements of its use. Figure 3 shows the generation of chaos fractal Dragon (ChFrDr) shapes in different iterations. as for Fig. 4, it shows different shapes of chaos fractal Dragon (ChFrDr) for a variety of parameters.

Fig. 3
figure 3

Generation of Chaos Fractal Dragon (ChFrDr) Shapes in Different Iterations

Fig. 4
figure 4

Different Shapes of Dragon Fractals for a Variation of Parameters

Algorithm 1
figure a

Chaos Fractal Dragon (ChFrDr) Key Generation

4.2 Modification of Chaos Fractal Dragon (ChFrDr) images

A control map helps in choosing the five ChFrDr images employed in the proposed algorithm. Since these shapes are somewhat sparse, a 5D hyperchaotic map is used to supply random values to fill the sparsity of the shapes. The hyper-chaotic map explained in Section 3, produces random sequences employed in the previously described process. The secret key of this system is its initial conditions and control parameters. The former were fixed at \({x}_{1}\left(0\right)= 0.325, {x}_{2}\left(0\right)= 0.476, {x}_{3}\left(0\right)= 1.256, {x}_{4}\left(0\right)= 0.628\;and\;{x}_{5}\left(0\right)= 1.5,\) and the latter, which are a, b, c, p and q,are 10, 8/3, 28, 1.3 and 2.5. The results are five random sequences. Each of the resulting sequences serves as a replacement for white pixels to produce (ChFrDr) images. To generate the chaotic fractal dragon (ChFrDr) images, Algorithm 2, is employed.

4.3 Application of ChFrDr to image encryption

As a first step, the original image (size 256 × 256) is inserted. The second step involves the use of IWT to reach an approximation (LL) and three detailed sub-bands (HL, LH, and HH) of the original image.

  • For Encryption Details Sub-Band (HL, LH, and HH)

  • The intensity of pixels in each of the sub-bands is normalized to become within the range of 0 to 255 (that of ChFrDr images). The pixels of each sub-band then issue an 8-bit binary sequence. A logistic map is used to shuffle these sequences (see Section 3 above). For each sub-band processed, the initial conditions of the logistic map are modified.

  • The diffusion (XOR) of each shuffled normalized sub-band takes place with the help of (ChFrDr) images. As such normalized sub-images HL, LH, and HH are encrypted by three (ChFrDr) images F1, F2 and F3, respectively.

  • Steps for Encryption Approximation Sub-band (LL)

To begin with, F4, one of the (ChFrDr) images, is resized within one S-box. This (ChFr) S-box has a size of 16 × 16 and is constituted of 8-bit integers ranging from 0 to 255. The value of said (ChFr) S-box is used to substitute the value of pixels within the approximation sub-band LL, in the next step. This substitution takes place according to Algorithm 3, as per the following steps:

  1. Step 1:

    The substitution input is made of an 8-bit binary code, representing a number within the range of (0–255). These are the pixel values of each sub-image.

  2. Step 2:

    The chaos fractal S-box is a 16 × 16 matrix made of columns and rows numbered from (0 to 15).

  3. Step 3:

    For value substitution to take place, rows and columns are assigned 8-bit inputs.

  4. Step 4:

    This means that of the 8-bit inputs, the first four are assigned to rows, while the second four are assigned to columns.

  5. Step 5:

    To find the new value to be substituted for each pixel, its location is found within the S-box and then the number of rows and columns it is located in is calculated. Following this step, F5, one of the chaos fractal images is used to XOR the substitution sub-band image.

Finally, the approximation and three detailed images (a total of four sub-bands) are arranged to produce the final image, after encryption. Block diagram for application (ChFrDr) to image encryption has been shown in Fig. 5.

Fig. 5
figure 5

Block Diagram for Application (ChFrDr) to Image Encryption

Algorithm 2
figure b

Modification of Chaos Fractal Dragon (ChFrDr) Images

Algorithm 3
figure c

Substitution of Approximation Sub-band with Chaos Fractal (ChFr) S-Box

5 Experimental results

An efficient encryption algorithm is deemed efficient when it yields an encrypted image with essential differences compared to the original image, from a statistical point of view. Tests run to examine the suggested algorithm’s security features show that it has superior security features and is highly robust. \(256 \times 256\) grayscale images were used in the testing experiments using MATLAB software. Original and encrypted images can be seen in Fig. 6. This figure shows the difference between the two images, which means that the algorithm has been effective in its encryption abilities.

Fig. 6
figure 6

Original and Final Encrypted Image

6 Evaluation Analysis of Chaos Fractal Dragon (ChFrDr) images

The clear qualities of its output show the strength of a given generator. These qualities include random- ness, auto-correlation, and sensitivity for key and when present marks the efficiency of the generator regardless of its design. In this research, different statistical tests were used to check the randomness of chaos fractal dragon (ChFrDr) images, including:

6.1 NIST Test

The NIST test suite, with its 15 independent statistical tests, is used to examine the randomness behavior related to (ChFrDr) images generated in this proposed algorithm. p-value and proportion are also employed to ensure the accuracy of analysis and evaluation. A p-value is greater than 0.01 with 99 certainty yields a pseudo-random sequence [6]. In Table 1, a comparison is drawn between the results of the NIST test for five chaos fractal images, as well as other algorithms, which depend on hyper-chaotic maps, 5D chaotic maps, and fractals. Results showed that the images encrypted through the suggested algorithm have passed the NIST test with success and even yielded better results than the other algorithms.

Table 1 NIST Test Results for Five Chaos Fractal Dragon (ChFrDr) Images in Comparison with Other Algorithms

6.2 Auto-Correlation test

The auto-correlation between random sequences should be a delta function, as for mutual correlation, it should amount to zero. In Fig. 7, it can be seen that the correlation characteristics for the five used chaos fractal images were reached.

Fig. 7
figure 7

The Auto-correlation among Five chaos Dragon fractal (ChFrDr) Images

6.3 Sensitivity test

To ensure the characteristic of sensitivity during the process of code generation, a change in the initial parameters of the system is done. This can be achieved through a change in the initial condition of the Henon map, along with angle rotation and number of iterations. The result is new (ChFrDr) images. The correlation test is employed to verify that this process has taken place. Results of the correlation test for (ChFrDr) images generated upon key change can be seen in Table 2. Upon inspection of this table, it can be seen that the correlation coefficient between these generated (ChFrDr) images each time the key is changed is around the value of zero, proving that each (ChFrDr) image generated is totally different. As such, the conclusion drawn is that the process of the generated (ChFrDr) images achieved through this algorithm is highly sensitive.

Table 2 Correlation Coefficient among Chaos Fractal Dragon (ChFrDr) Images

7 Security analysis of image encryption

Multimedia files can be subjected to different types of attacks. Among which we can cite various types of brute force, known-plaintext, chosen cipher-text, statistical, and differential attacks. For a cryptosystem to be effective, it must be able to resist all types of attacks, including the above-mentioned ones. Different types of analyses were carried out on the proposed algorithm to ensure its robustness against various attacks. These tests include histogram analysis, Chi-Square, information entropy analysis, and correlation coefficient. Two more tests, under the shade of differential analysis, were conducted, i.e., the unified average intensity change (UACI) and the number of pixel change rate (NPCR) [8, 41].

7.1 Histogram analysis

This section will explore the histogram analysis and results reached for original and encrypted images. Both images were quite different in structure, from a statistical point of view. Original images had tilts and spikes in their histogram, whereas the histogram of cipher images was flat and uniform. Thus, no statistical resemblance could be concluded between both. The various stages of the histogram for the proposed algorithm can be seen in Fig. 8. Figure 9 shows the histograms of different original and encrypted images with said encryption method. Histogram’s variance \(x\) in calculated for quantity analysis to determine the uniformity of said image. \({x}_{i}\) and \({x}_{j}\) mark the number of the pixel whose gray value equals \(i\) and \(j\), respectively [42,43,44,45].

Fig. 8
figure 8

Histogram Analysis for each Sub-Band

Fig. 9
figure 9

Histogram of Original and Encrypted Images; (A1)—(A4) The Original Images; (B1)—(B4) The Histogram of Original Images; (C1)—(C4) The Encrypted Images; (D1)—(D4) The Histogram of Encrypted Images

$$Var\left(x\right)=\frac{1}{{n}^{2}}\sum_{i=1}^{n}\sum_{j=1}^{n}\frac{1}{2}{({x}_{i}-{x}_{j})}^{2}$$
(9)

A cipher image is highly uniform when its variance is small. Table 3 shows the values for a variance of the cipher images tested. These figures show that upon simulation, the histogram of encrypted images is uniform in its distribution. Upon comparing the histogram results of images encrypted with the proposed algorithm and those encrypted using other algorithms, it could be concluded that variance values for the former and smaller than for all the latter. As such, the proposed algorithm has higher robustness and can withstand statistical attacks.

Table 3 Variance values for the Histogram Analysis of Different Cipher Images

7.2 Chi-Square test analysis

To determine the uniformity of grayscale pixels quantitatively, the chi-square test analysis is applied. Grayscale images are highly uniform when their chi-square value is small [47,48,49]. To calculate this chi-square test, the following formula is employed:

$${x}_{test}^{2}=\sum_{i=0}^{255}\frac{{({obs}_{i}-{exp}_{i})}^{2}}{{exp}_{i}}$$
(10)

where, \({exp}_{i}\) is the expected frequency, while \({obs}_{i}\) is the observed frequency. The former is expressed as such:

$${exp}_{i} =\frac{M\times N}{256}$$
(11)

where, M × N represents the size of the image. Table 4 shows the results of the chi-square test for the cipher images encrypted with the proposed algorithm, as well as those encrypted with other algorithms.

Table 4 The Chi-Square Test of Cipher Images

7.3 Information entropy analysis

There are two aims to information entropy. The first is to check uncertainty in the information of the image and the second is to evaluate gray value distribution within said image. Information entropy ranges from zero to eight, with eight being the best result. For an encryption algorithm to be good, it must bring the information entropy of the encrypted image close to the maximum value [46, 50,51,52,53]. The following equation is used to calculate information entropy:

$$E=\sum_{i=1}^{N-1}P({X}_{i}) {log}_{2} P({X}_{i})$$
(12)

where, \(N\) is the total number of symbols \((X)\), while \(P\left({X}_{i}\right)\) marks the possibility of occurrence of symbol \(\left({X}_{i}\right)\). Entropy of cipher images encrypted with the suggested scheme and those encrypted with other schemes can be seen in Table 5. It is clear from this Table that the information entropy of the cipher image encrypted with the algorithm proposed in this paper has a value proximal to 8, the ideal value, yielding the best of all the results compared. As such, it can be concluded that images encrypted with the help of the suggested scheme have random pixel-value distribution.

Table 5 Entropy Information Analysis

7.4 Correlation Coefficient

A correlation analysis is usually conducted in encryption applications to check the resemblance between the original and the encrypted image. When two pixels are close to one another, they are usually similar, with a high correlation value. For a cryptosystem to be effective, it has to disrupt this correlation. As such, a correlation coefficient between two pixels that is close to zero is a sign of an effective encryption scheme [46, 54,55,56]. Equation 13 is used to calculate the correlation coefficient between two adjacent pixels in all directions (vertical, horizontal, or diagonal):

$${r}_{xy}=\frac{cov(x,y)}{\sqrt{D(x)}\times \sqrt{D(y)}}$$
(13)

where, \({r}_{xy}\) represents the correlation coefficient, \(cov\) marks the covariance between pixels \((x)\) and \(\left(y\right), (x)\) and \((y)\) represent the grayscale value of a certain pixel located on the plaintext and on the cipher text image, respectively, \(D(x)\) is the variance, and \(E(x)\) is the mean. The correlation of two adjacent pixels on the original and its encrypted image can be seen in Fig. 10. Three examples can be seen in this Figure, adjacent pixels in the horizontal, vertical, and diagonal directions. On the cipher image, pixel correlation seems to have diminished significantly from the original. A comparison between the correlation coefficients of images encrypted with the proposed, as well as other algorithms, can be seen in Table 6. For the original image, the correlation coefficient was close to one. The proposed algorithm succeeded in bringing this value close to zero. This makes this encryption scheme better than others, in its ability to decrease the correlation coefficient between adjacent pixels on the encrypted image.

Fig. 10
figure 10

Correlation of two Adjacent Pixels of the Original and its Encrypted Image

Table 6 Correlation Coefficient between Two Adjacent Pixels in the Original and Encrypted Images

7.5 Contrast

Contrast measures the difference in intensity between two neighboring pixels. The encryption scheme is deemed more efficient when contrast values are high [57, 58, 60]. Contrast can be mathematically calculated using Eq. (14):

$$Contrast={\left|i-j\right|}^{2} P(i,j)$$
(14)

where, \(p\left(i, j\right)\) represents the location of pixels in the gray-level co-occurrence matrix (GLCM). Contrast values for the suggested algorithm can be seen in Table 7, which yields the best results when compared to other encryption schemes.

Table 7 Contrast of Cipher Images

7.6 Differential attack

The number of pixel change rate (NPCR) and the unified average changing intensity (UACI) are the two methods used to determine the effect of a difference of one bit between the original and the cipher images [55, 56]. The formulas to follow are used to calculate said indicators:

$$NPCR=\frac{{\sum }_{i,j}D(i,j)}{M\times N}\times 100\%$$
(15)
$$UACI=\frac{{\sum }_{i,j}{E}_{1}\left(i,j\right)-{E}_{2}(i,j)}{255\times M\times N}\times 100\%$$
(16)

where, \(M\) is the length of the cipher image and \(N\) is its width, \({E}_{1}\left(i,j\right)\) represents the cipher image before the change in a single pixel, while \({E}_{2}\left(i,j\right)\) is the cipher image but after the change. Values for UACI and NPCR can be seen in Table 8 for the proposed algorithm close to optimum values. UACI had an optimum value of 33.4635%, while NPCR had a value of 99.6094%. It is sufficient proof that the pro- posed algorithm is highly sensitive to even minimal changes in the original image and can thus, thwart differential attacks.

Table 8 NPCR & UACI

7.7 Key sensitivity analysis

It is necessary to track the sensitivity of the encryption process toward changes in the encryption key, due to the importance of this issue. If the encryption’s key sensitivity is high, even minor changes in said key can result in a different image [14]. Chaos fractal dragon (ChFrDr) images are highly sensitive to their initial parameters, and this gives them a great advantage. As previously mentioned, the initial key consists of the control parameters of the chaotic map, the angle of rotation, and the number of iterations. A change in the encryption key was made by first changing the initial parameters of the Henon map. This resulted in a change of 99.642235%, confirming the key’s sensitivity to the initial condition of the Henon map. The second step in testing key sensitivity is to change the angle of rotation. This step yielded new (ChFrDr) images and the result was different by 99.665204%, indicating the system’s sensitivity to changes in the rotation angle. Another important change that affects hyperchaotic maps is the change in the initial conditions of this map. Upon making a small change in the initial conditions affecting the encryption key, the decrypted image was 99.59844% different from the original image. It can then be concluded that the proposed algorithm is highly sensitive to its main key, as a slight change in the key can lead to an incorrect result, i.e., a decrypted image that is completely different from the original image that was initially encrypted. The results of the experiments testing the key sensitivity of the suggested algorithm can be seen in Fig. 11, with images showing the high sensitivity of the new cryptosystem to its main key.

Fig. 11
figure 11

Results of the Key Sensitivity of the Proposed Image Cryptosystem

8 Conclusion and future work

The requirements for improved security and higher attack resistance of multimedia files in communication systems motivated this research. We propose a new encryption algorithm based on Dragon fractal images and hyper-chaotic maps, named (ChFrDr) images. These images are shown to be perfect candidates for use in image cryptosystems, as they are characterized by high complexity and improved security. The proposed image encryption algorithm based on the (ChFrDr) images has been assessed by several tests and analyses to ensure its effectiveness and improved security. Several 256 × 256 images were used to check the sensitivity of the algorithm towards its key, which showed that it was indeed sensitive to any changes taking place in said key. Adjacent pixel correlation tests were conducted, and the correlation coefficients for pixels on the encrypted image are shown to have small values in all directions (horizontal, vertical, and diagonal). The value of information entropy for the encrypted images tested was close to 8, the ideal value. Optimum values for UACI and NPCR were almost reached for encrypted images. These results prove that the proposed cryptosystem has better performance than other comparable algorithms. As such, it is concluded that our algorithm, employing chaotic fractal Dragon images, is a perfect candidate for securing the transfer of multimedia files in multimedia communication systems. In future work, we can apply a control map to select the initial condition of the chaotic map to further improve the efficiency of the encryption system. Additionally, we plan to use another type of chaotic map, such as a gingerbread man, and a 2D logistic map to generate different fractal images and their applications for image encryption.