Introduction

In this modern era of technology, the transmission and storage of multimedia content grow rapidly. The security and privacy of these contents have been an unavoidable subject of research for the last few decades. One of the main issues in this era of fifth-generation communication is the privacy of digital content [1]. In different databases, the information is stored, and travel in the form of bits, this information includes digital images, audio, video, etc., and available to different users through the Internet. The databases can be accessed by an unauthorized user and the information can be stolen and misused if the databases are secure enough that the intruder cannot access this database, then will monitor the traffic, and can steal information during communication from the database to the authorized user. The information needs security during storage as well as the transmission phase, so that if the intruder gets that information, it will have no use for her. The science of securing information is called cryptography. Cryptography is traditionally referred to as the science of secrecy, although the concept of cryptography is more closely related to it today. Encryption is the act of converting "unhidden" plain text to "hidden" to guard it against data intruders. There is another aspect of this phase where the hided text desires to be decrypted to be understood at the other end. In our everyday lives, the use of cryptography is everywhere. We use it, for instance, to easily submit passwords through large networks for online transactions. Bank servers and email clients also use encryption to preserve their passwords. The authentication of all communicated information in our IoT-related world is encrypted and authenticated by cryptography. Cryptography can be categorized as symmetric and asymmetric key cryptography. In symmetric-key cryptography, the keys for encryption and decryption are the same. The encryption comprises of diffusion and confusion. Guidelines for a reasonable level of safety and the utmost adequate characteristics of a cryptosystem are presented in [2]. The recommended guidelines report three foremost concerns: implementation, key management, and security analysis. A comprehensive revision of various cryptosystems design techniques and development in meta-heuristic-based image encryption is presented in [3]; the numerous attacks and evaluation of results allied to cryptosystem have also been presented. Most of the researchers [4, 5] utilize chaos base generated sequences for the diffusion process, and due to extraordinary sensitivity to initial conditions, the use of chaos is widespread in cryptography [6,7,8]. Particle swarm optimization, based confusion, and chaotic map-based diffusion are presented in [9]. Fractals accompanied with chaotic maps have been also widely used in cryptography [10]. A lot of work has been done in the field of cryptography [11] discrete and continuous chaotic maps are utilized by the work presented in [12]. To add more diffusion in the cryptosystem fractals and multiple chaotic maps are utilized in [13]. For the deployment of the encryption scheme in different environments, several alterations have been done in the design of cryptosystems [14,15,16]. Chebyshev polynomial-based chaos has been utilized for image encryption [17]. Various transform like discrete cosine transform [18] and wavelet transform have also been utilized for image encryption [19, 20]. The encryption system can be broadly classified as classic and modern cryptosystems, in classic cryptosystems, the process of diffusion or confusion is done, one at a time while in modern cryptosystems, both confusion and diffusion are performed. Only confusion can be easily broken [21]. The work presented in [22] uses only confusion and can be easily decrypted the procedure in [21]. It is shown [21] that encryption by solitary S-box, which is the essential part of AES and DES, is not sufficient. A privacy-preserving data aggregation scheme with a flexibility property that uses ElGamal is presented in [23]. A secure and efficient mutual authentication protocol for smart grid under grid is proposed in [24].

In this article, we have utilized Chebyshev polynomial and fractal Tromino accompanied by pre-defined highly non-linear S-boxes to encrypt the secret images. Reducing computational complexity without affecting the security strength of a cryptosystem is important for real-time implementation. AES has excellent security, but when it came to implementation on images, it takes more time. Due to their uttermost simplicity in implementation and less computational complexity, the computed time for encryption makes this scheme suitable for real-time implementation. The reason for less time is the use of pre-defined S-boxes and less computational complexity of Chebyshev polynomial and fractal Tromino. The security analysis is performed and tabulated which reveals the strength of the cryptosystem to different cryptographic attacks. The remaining of the manuscript is arranged as the discussion of the different basics concepts and procedure are described in section two of the article, the step includes in the encryption process, and the explanation and flow diagram of the proposed cryptosystem is discussed in section three of the paper and to validate the strength and immunity to various attacks, the security analysis is computed and displayed in section four of the article, and finally, conclusion is drawn in Sect. 5 of the paper.

Preliminaries

This segment is dedicated to the discussion of basics utilized in the proposed cryptosystem.

Generation of fractal Tromino

The fractal Tromino is generated using the succeeding steps.

Step 1: A matrix R of dimension M × 3 N is created where M × N × 3 is the dimension of the plain image.

Step 2: two random keys k1 and k2 are created; each key has a length of 8-bits.

Step 3: The values of the Matrix generated in step 1 are updated using the following rule in Eq. (1):

$$ R(i,j) = \left\{ \begin{gathered} \bmod (j,f)\,\,\,\,\,\,if\,\bmod (i,k_{2} \times c) < k_{1} \times c \hfill \\ \bmod (i,f)\,\,\,\,\,\,if\,\bmod (j,k_{2} \times c) > k_{1} \times c \hfill \\ \bmod (c - i,c)\,\,\,\,otherwisw \hfill \\ \end{gathered} \right.\,\,, $$
(1)

where c can be computed using relation in Eq. (2)

$$ c = \sqrt {(255 - m) \times m} . $$
(2)

The value of c is rounded to the nearest digit, where m in Eq. (2) is the mean of the matrix generated in step 1.

Step 4: The matrix updated as in step 3 is reshaped M × N × 3. This is desired fractal Tromino. The generated fractal is shown in Fig. 1, and part b displays the image after XORing with the fractal.

Fig. 1
figure 1

a Generated fractal Tromino and b after XORing RGB Plain image with fractal

Chebyshev polynomial-based chaotic matrix generator

Chebyshev polynomial (CP) is a sequence of cosine-related polynomials. In this section based on CP, random sequences are created by utilizing [25] the two relations in Eq. (3)

$$ \begin{gathered} p(k + 1) = T_{n} (p_{k} ) = \cos (x \times \arccos (w_{k} )), \hfill \\ q(l + 1) = T_{m} (q_{l} ) = \cos (y \times \arccos (q_{l} )), \hfill \\ \end{gathered} $$
(3)

where the governing bounds for CP are \((p_{k}, q_{l} ) \in [-1,1]\) and \((l,k) \in [2,\infty ]\). The following describes the rest of the algorithm.

Step 1: The starting values \(p(0)\)\(q(0)\) and parameters \((x,y)\) are initiated as a key.

Step 2: Eq. (3) is iterated M × N times, where M × N is the size of each layer of the plain image, and by doing this, we have obtained two matrices containing the decimal fractional entries; these values are processed using Eq. (4)

$$ \begin{gathered} p(k) = \bmod (floor(abs(p(n) \times 10^{14} )),r), \hfill \\ q(l) = \bmod (floor(abs(q(m) \times 10^{14} )),r), \hfill \\ \end{gathered} $$
(4)

where r = 256.

Step 3: These two matrices are XORed and a third matrix is obtained.

The chaotic matrix is converted into a row vector in and the first 200 iterations output are plotted, as shown in Fig. 2.

Fig. 2
figure 2

First 200 iterations of the Chaotic Matrices generated using CPs

Fig. 3
figure 3

The process of confusion addition through substitution

Substitution using S-boxes

In cryptography, an S-box is a core element of the symmetric-key system that accomplishes the substitution. To unclear the relationship, in the block cipher between the key and the ciphertext, S-boxes are utilized. The process of substitution is shown in Fig. 3. In our case, we have utilized the highly non-linear S-boxes generated by [26]. The pixel of the plain image is taken; after converting into binary, it is divided into MSBs and LSBs, again converted into decimal; the MSB converted decimal indicates column index of S-box and the other indicates the row of the S-box, and the intersected element is a substitute of the pixel in the ciphered image.

Proposed encryption scheme

The proposed encryption scheme can be implemented using the following steps. The procedure is depicted in Fig. 4.

Step 1: The secret color RGB image that needs to be enciphered is loaded and split into respective channels.

Step 2: Two keys K1 and K2 are initiated and L-shaped fractal Tromino is generated using the procedure in Sect. 2.1 of the article.

Step 3: The 3-fractal Tromino is XORed with the respective layers of the image.

Step 4: The parameters for CPs are initiated and chaotic matrices are generated using the procedure discussed in Sect. 2.2 of the article.

Step 5: The chaotic matrices obtained in step 4 are XORed with outcomes of step 3.

Step 6: The processed image layers obtained in step 5 are further passed through the process of substitution using the procedure discussed in Sect. 2.3 of the article.

Step 7: The three split layers of the image obtained in step 1 are encrypted till step 6; now the three layers are combined to achieve the concluding encrypted RGB image.

The procedure of encryption is presented in Fig. 4. The process of decryption is carried out using the reverse approach, but instead, in the substitution phase using the S-boxes, first, the inverse S-boxes are computed, and the process of substitution is carried out using the inverse S-boxes following the same procedure for substitution as discussed in Sect. 2.3. To estimate the effectiveness of the proposed encryption against various thread security analysis is carried out and discussed in the upcoming section of the paper.

Fig. 4
figure 4

Proposed encryption scheme

Security analysis

To evaluate the strength of the cryptosystem in contradiction of various cryptographic threads, the security analysis of the system is essential. Here, we have encrypted Lena, baboon, airplane, girl, and pepper images, and the following analysis was carried out to validate the strength of the proposed system. The size of the images utilized is 256 × 256 × 3.

Differential analysis

To evaluate the immunity of the proposed cryptosystem to resist differential attacks, differential analysis is carried out. The number of pixels change rate (NPCR) and unified average changing intensity (UACI) are employed in the examination against differential attacks (DA). In DA, the intruder faintly changes the original image and encrypt that image then compares the originally encrypted and the modified encrypted images and tries to find information regarding the cryptosystem. The NPCR and UACI analysis are as described.

NPCR

In computing NPCR, one-pixel change in the plain image is done and comparing the modified encrypted and original image without modification is encrypted through the same encryption scheme and the percentage change in terms of pixel change rate is studied; for a good cryptosystem, the value of NPCR needs to high. The NPCR can be computed using the relation in Eq. (5)

$$ NPCR = \frac{{\sum\nolimits_{a,b} {D(a,b)} }}{M \times N}, $$
(5)

where

$$ D(a,b) = \left\{ \begin{gathered} 0\,\,if\,\,O(a,b) = O^{^{\prime}} (a,b) \hfill \\ 1\,\,if\,\,O(a,b) \ne O^{^{\prime}} (a,b) \hfill \\ \end{gathered} \right., $$
(6)

where M × N is the dimension of images and O symbolizes the original image, O is the encrypted image after the one-pixel change. The NPCR value for a good cryptosystem needs to be near 100. The NPCR is computed and displayed in Table. 1. The results of NPCR show strong immunity toward differential attacks.

Table 1 NPCR and UACI for (256 × 256 × 3) images, having a first alteration

UACI

After one-pixel alteration in the plain image, the average alteration in intensity among the original image encrypted and the modified image encrypted is studied in UACI. It can be computed using Eq. (7)

$$ UACI = \frac{{\sum\nolimits_{a,b} {O(a,b) - O^{^{\prime}} (a,b)} }}{255 \times M \times N}. $$
(7)

The values of UACI are computed for various images and tabulated as in Table 1. The computed value of NPCR is closest to the theoretically achievable value of 100 in each case, and comparison with the recently proposed encryption scheme is presented in Table 2. The graphs are shown in Fig. 5 from NPCR and UACI measurements we are confidently claiming that our proposed cryptosystem is secure against differential analysis.

Table 2 Comparison of NPCR and UACI for (256 × 256 × 3) Lena with existing techniques
Fig. 5
figure 5

Graph of NPCR and UACI for (256 × 256 × 3) images: a NPCR and UACI for Test images. b Comparison with recently suggested encryption systems

Statistical analysis

The statistical analysis can also be utilized in the cryptanalysis of an Encryption scheme. To confirm the robustness of encryption against statistical attacks, histograms, and correlation among adjacent pixels are utilized, to withstand the statistical analysis, the encrypted must have a uniform histogram and zero correlation among the adjacent pixels.

Histogram analysis

A graph displaying the occurrence of something is known as a histogram. Typically, the histogram has bars that reflect the frequency of data that occurs in the data collection as a whole. The histogram has two axes, the x-axis and the y-axis. The x-axis includes an occurrence whose frequency has to count. The y-axis has a frequency. Various bar heights indicate the different frequency of data occurrence. Figure 6, displays the histograms of both plaintext and ciphertext. It can be seen from Fig. 6 that the non-uniform histogram having more frequent pixels in the range 200–50 refers to Fig. 6a, i.e., some pixel's frequency is less as compared to the rest. While the histogram of the encrypted image has an equal count of occurrence of every pixel and the distribution is uniform. When the histogram of an image is uniform, it does not convey any beneficial statistics to the intruders. Keeping in view the histograms in Figs. 6 and 7, we are confidently claiming that the Proposed encryption scheme retains great immunity against attacks that utilize histogram examination.

Fig. 6
figure 6

Histogram analysis of plain and ciphered image layers. ac Histogram of Red, Green, and Blue channels of plain image. df Histograms of encrypted red, green, and blue layers

Fig. 7
figure 7

Three-dimensional histograms of a original image and b ciphered image

Correlation coefficient (CC)

The degree of association is calculated by the correlation coefficient (CC). The Pearson correlation coefficient is often named CC after its originator and is a linear association metric. On a scale that ranges from + 1 to 0 to − 1, the CC is computed. Either + 1 or − 1 reveals the full relationship between the two variables. In the case of images if the contiguous pixels are similar, the CC is near to unity; total lack of correlation is characterized by 0. The pixels in plain images are highly correlated and its CC is near to unity, as shown in Table. 3. The encrypted image pixels must not possess a high correlation to withstand statistical attacks. The CC for each layer of plain and encrypted images are computed using the relation given in Eq. (8) and displayed in Table 3

$$ r_{k,l} = \frac{A(k,l)}{{\sqrt {B(k)} \sqrt {B(l)} }}, $$
(8)

where

$$ A(k,l) = \frac{{\sum\nolimits_{a = 1}^{C} {((k_{a} - E(k)(l_{a} - E(l)))} }}{C}, $$
(9)
$$ B(k) = \frac{1}{C}\sum\limits_{a = 1}^{C} {(k_{a} - E(k))}^{2} , $$
(10)
$$ B(l) = \frac{1}{C}\sum\limits_{a = 1}^{C} {(l_{a} - E(l))}^{2} , $$
(11)

where A(k,l) is the covariance between pixel a and b, C is the number of pairs (a,b), and B(k), and B(l) represent the standard deviation of k and l. The linear relation is observed in Fig. 8 of the plain image pixels in all directions. While in the case of encrypted image, the pixels are distributed all over the plane.

Table 3 Correlation coefficient in three directions of plain and cipher 256 × 256 single layer
Fig. 8
figure 8

Pixels scattering of original image and encrypted image. a Vertical pixel scattering of plain image. b Vertical pixel scattering of ciphered image. c Horizontal pixel scattering of plain image. d Horizontal pixel scattering of ciphered image. e Diagonal pixel scattering of plain image. f Diagonal pixel scattering of ciphered image

Information entropy analysis (IE)

Randomness in information can be quantified using information entropy (IE). For an image that contains 256 levels of shades have an ideal value of IE 8. The purpose of encryption is to increase the randomness in the distribution of the pixels. The developed the value of the IE the higher will be the randomness in pixels distribution of an image and the harder it will be for an intruder to get any valuable information from the encrypted image. IE can be computed using the relation in Eq. (13)

$$ IE = - \sum\limits_{a = 0}^{N - 1} {p(k_{a} )} \log_{b} p(k_{a} ), $$
(13)

where p(ka) denotes the probability distribution for the event ka. The computed value of IE for each layer of plain and its equivalent ciphered image is displayed in Table 4. It can be perceived that the value of entropy is near to the superlative value of 8 in the case of encrypted layer images which shows the strength of the proposed cryptosystem.

Table 4 Information entropy for plain and cipher image 256 × 256, RGB image
Table 5 Information entropy for cipher image 256 × 256, RGB image
Table 6 Comparison of entropy for cipher image 256 × 256 × 3, RGB images with the recently proposed algorithm

Mean square error analysis (MSE)

Pixel-by-pixel squared difference examination of the plain and ciphered image is done in MSE analysis. The high value of MSE is the necessity of a worthy encryption structure (Tables 5, 6). The MSE can be computed by utilizing the relation in Eq. (14)

$$ MSE = \frac{1}{M \times N}\sum\limits_{a = 1}^{M} {\sum\limits_{b = 1}^{N} {((O(a,b) - P(a,b))^{2} } } , $$
(14)

where M × N is the dimension of images and O symbolizes the plain image and P symbolizes the processed ciphered image. The measurement of MSE is computed from different images and displayed in Table 7.

Table 7 MSE measurement for each layer of 256 × 256 test images

Peak signal-to-noise ratio (PSNR)

PSNR, is computed by utilizing MSE as depicted in Eq. (15) as the MSE is in the denominator so when it divides by the high value of MSE will result in a small PSNR. For a good encryption scheme, the lower value of PSNR is preferred. The PSNR can be computed using the relation in Eq. (15)

$$ PSNR = \frac{{(2^{m} - 1)^{2} }}{MSE}, $$
(15)

where m denotes the bits per pixel, and PSNR is often dignified in dBs. The measurement of PSNR is computed for every layer of the encrypted and plain image and tabulated in Tables 7 and 8. Table 9 shows the comparison of the MSE for the proposed system with the recently proposed systems.

Table 8 MSE measurement for each layer of 256 × 256 test images
Table 9 Comparison of average MSE measurement of Lena 256 × 256 test image with existing techniques

Throughput analysis for encryption procedure

The throughput of the cryptosystem is the proportion of the total size of the image to be encrypted to the total time taken by the encryption process for the image to encrypt. For real-time communication, throughput of a system is considered one of the most key performance indicators for an encryption scheme, the high the throughput the better the system. The throughput can be computed using the relation in Eq. (16)

$$ {\text{Throughput}} = \frac{{{\text{Size}}\,\,{\text{of}}\,\,{\text{plaintext}}}}{{{\text{Time}}\,\,{\text{for}}\,\,{\text{encryption}}}}. $$
(16)

The memory occupied by the file to be enciphered is 500kBs, and the duration taken for encryption is 2.0050104. The throughput computed is 249.37527 kbs.

Time analysis

Time analysis of the proposed encryption scheme is carried out using MATLAB 2018 b on a PC Intel(R), Core(TM) i3-7700 CPU @ 3.60 GHz, 8 GB RAM with Windows 8. The computed time is tabulated in Table 10. The time analysis shows that the proposed encryption system is suitable for practical implementation.

Table 10 Time analysis of the proposed encryption system
Table 11 Test findings for the proposed Cryptosystem from NIST SP 800–22 experiments

NIST-based Randomness analysis

A non-regulatory and physical science laboratory National of Standard and Technology (NIST) issued a special edition of randomness test named NIST randomness analysis [36], which utilizes for the randomness in data. The detail of the tests is presented in [36], and the test is said to be certified if the value of the outcomes is less than unity. The subject test is accomplished, and the outcomes are displayed in Table 11. All the random tests are certified by the encryption scheme, it can be perceived from the results that the ciphered image achieves high randomness, which is the desired characteristic of a good encryption system.

Heat map analysis

The part of an image that grabs more attention is indicated warm-to-cool color spectrum in a heat map. The heat map for a plain image is computed. The heat map tells where the most important content of this image lies. In Fig. 9a, the most important content of image Lena lies in the range, colored as 200–256 in the scroll map. In the encrypted image, this content should be spread all over the encrypted image referred to Fig. 9b; in the encrypted image, the color is spread, and there are no contiguous pixels of the same color. The heat map in the encrypted image does not make any sense and does not convey any useful info regarding the most important content of the image as the most important information is distributed in an encrypted image. Part c of Fig. 9 signifies the distribution of the pixels of the most important content of image Lena. The part d of Fig. 9 shows the scattering of pixels of the most important content of the Lena image.

Fig. 9
figure 9

Heat map analysis. a Plain Image. b Ciphered Image. c Pixels distribution

Conclusion

In this article, utilizing L-shaped fractal Tromino, three fractals are generated followed by the generation of CPs based chaotic matrices for the encryption process. To obscure the relation of key and ciphertext substitution is performed using highly non-linear S-boxes. The security analysis is performed and tabulated. The performance comparison with the recently proposed encryption schemes is performed. The security analysis reveals that the suggested encryption system possesses strong invulnerability against various threads.