Introduction

The need for information security policies is paramount given the acceleration of civilization’s progress. Data security has emerged as one of the top concern in these days. The widespread use of electrical devices necessitates the adoption of many encryption approaches. Nowadays, online credit card numbers and online banks are frequently used for online payments. By transforming data into an unintelligible format, encryption is also employed to address security concerns. However, recently, concerns shifted more to data security and the new issue attracting the attention of researchers is image security. In recent years, the technology has advanced significantly, so some military formations save important data in image files. Image confidentiality and copyright are crucial in amplifying general security and privacy and hence should not be compromised. Algebra and specifically chaos theory has recently emerged as a requirement for image security due to features such as: its sensitivity to initial conditions, the stochastic nature of the process, and spread spectrum signals with large bandwidth power density profiles. However, many researchers have pointed out the short password cycles and low accuracy problems of low-dimensional sequences, such as 1D chaotic map, which cannot form an effective security defense for image encryption. On the other hand, higher dimensions maps contain considerable randomness and improve the level of image security enormously. In response to the mentioned image security issues, several authors have developed single image encryption methods based on these high-dimensional chaotic maps.

In their work, Q. Yin et al.1 put forwarded a new method called single-image encryption using Breadth-First Search and dynamic diffusion. The permutation stage uses Breadth-First Search while the diffusion is done by a dynamic-diffusion technique. According to the authors in2, the image encryption scheme proposed used the hidden attractor chaotic systems with permutation using Knuth–Durstenfeld method for pixels. H. Liu et al.3 has presented a color image encryption technique with one-time keys and chaotic maps which was used to introduce disturbance in # and pixel positions by a chaotic map and encryption based on DNA rule. In addition, X.Y. Wang4 proposed a new encryption method based on DNA sequences together with chaotic maps and included the hamming distance concept in the key sensitivity analysis process. H. Liu et al.5 developed a color image encryption technique for black and white using bit-level permutation and piece-wise linear chaotic maps for scrambling. In addition to plain chaotic systems, hyper chaotic maps have been studied for image encryption. For example, M. Zhou et al.6 introduced a hyper chaotic-based encryption technique to transform the blocks’ change in pixels using closed-loop diffusion. G. In7, Cheng et al. used hyper chaotic maps and a diffusion-permutation algorithm to present an encryption technique that is based on RGB images. Further, present studies have extended and developed research in the area of multiplex networks, with X. Wang et al.8 using the semi-tensor matrix product theory and Boolean systems for encryption and X. Wang et al.9 using the coupled logistic maps lattices as keys for diffusion and permutation. In addition, Wang, X.Y. et al.10 presented an encryption method converted on Hopefield neural chaotic network. There is a growing stream of work in the literature on applying chaos theory-based encryption techniques that when many of these techniques rely on individual image, there is limited usage of the bigger images’ capabilities.

The practice of encrypting multiple images is one of the hottest topics in the modern multimedia security field. Various authors have put forward a number of methods for encrypting two or more optical images11. These multiple image encryption (MIE) methods comprise a number of ways among which are asymmetric cryptosystems12, Fourier domain techniques13, Fourier transform methods14, and wavelet lifting transform algorithms15. Nevertheless, for the encryption of digital images, the features of these optically designed image encryption techniques may not be so desirable. As a result, more focus has been directed to utilize MIE techniques suitable for digital images security and protection. For example, X. Li et al.16 have proposed an MIE technique using the wavelet transform domains, but the decrypted images had a low probability of the plain image coefficients. Likewise, X. Zhang et al.17 presented a safe MIE technique making use of DNA operations which despite of its efficiency, imposes complication because of the DNA operation coding and decoding. Shamsi and Laiphrakpam28 suggest expanding the data of images to be concealed in audio in the form of encrypted data for confidentiality and stability and Shamsi, et al.29 presented a concept where the cipher data concealing scheme produces visually logical results along with encryption. Furthermore, Shamsi et al.,30 exposed weaknesses in the multi-layer security model and presented resolutions against them as well as a steganalic review of Shamsi and Singh31 that integrated cryptographic approaches with data hiding to ensure the authenticity of secret data. Altogether, these contributions help to solve the problems of secure transfer and storage of data in multimedia applications. Comparing breaking methods for image encryption, present limitations in existing algorithms have been presented and discussed, such as the lack of feature utilization in single-image encryption and low distribution of plain image coefficients in decrypted images from particular MIE techniques which are intended for purely optical images. The main goals of this work are to outline the proposed scheme’s goals, which are subsequently aimed at eradicating these challenges and limitations observed in the existing encrypted schemes.

A Gaussian integer is a complex number which has coordinates with integer values; Gaussian integers are natural generalization of integers in the number theory. These complex numbers may be described in the form of \(\:a+bi\) where 'a' and 'b' are integers and 'i2' is imaginary which equals to − 1. For details, Gaussian integers possess outstanding features separated from ordinary integers. For example, every Gaussian integer has a unique factorization into smaller Gaussian integers as does an ordinary integer provided they’re part of a unique factorization domain. Moreover, Gaussian integers also have a central place in much of modern mathematics with the fields of application that are aimed at the improvement of the cryptographic algorithms used in secure communications. Its use is not restricted to mere mathematical theories, but appears important within the context of physical sciences, signal analysis and other related fields. In general, Gaussian integers fill the crucial role in revealing the interdependencies between number theory and other branches of mathematics and natural sciences, namely18,19,20,21. Sajjad et al.22 put forward the single image encryption model based on RGB image and SPN via Gaussian integer. Designing of S-box is done with the help of the affine map over Gaussian integers. Furthermore, the authors introduced the single RGB image encryption to illustrate the capability of the SPN model. On this backdrop, an effort should be made to generalize the work done and employ Gaussian integers for multiple RGB image encryption.

This research develops an improved cryptography algorithm with the focus of a single image encryption algorithm that is capable of encrypting multiple RGB images using Gaussian integers. The method shapes on single RGB image encryption, using properties of Gaussian numbers and their arithmetic, to design the encryption’s S-boxes. These S-boxes are incorporated as a part of the SPN structure and the cascaded with the permutation layer for each RGB image and in this manner, color data of one image is scrambled with another image. Performance analysis of the proposed scheme shows appreciable security against different attacks and proper encryption and decryption. The development presented in this work effectively provides a framework towards improving secure data transfer and storage of digital images using Gaussian integer encryption. The remainder of the manuscript is organized as follows: Sect. 2 discusses about Gaussian integer together with the generator of the residue classes. Section 3 presents the two S-boxes construction over Gaussian integers via the inverse affine map as well as security analysis. In Sect. 4, the steps of the encryption process through the SPN are described in detail. The comparison of the proposed technique to encryption approaches is made in Sect. 5. Finally, Sect. 6 sums up the main findings of the research.

Gaussian integers

Gaussian integers (GIs) are subset of complex numbers \(\:Z\left[i\right]=\{x+iy:\:x,y\in\:Z\:\)and \(\:{i}^{2}=-1\}\subseteq\:C.\) It is also a ring of Gaussian integers with multiplicative identity 1.

Conjugate

Let \(\:z=x+iy\) be a Gaussian integer, then \(\:\underline{z}=x-iy\) is the conjugate of \(\:z\).

Norm

Let \(\:z=x+iy\) be a Gaussian integer, then norm of \(\:z\) is;

$$\:N\left(z\right)=z\underline{z}$$

Theorem

19,20: The set of natural numbers for rational prime \(\:p\), there is a prime \(h\:\in\:{Z\left[i\right]}\), such that \(\:N\left(h\right)=p=h\underline{h}\). In particular,  \(\:p\) is not prime in \(\:{Z\left[i\right]}\).

Theorem

19,20: If the norm of a Gaussian integer \(\:N\left(h\right)\) is prime in \(\:Z\), then the Gaussian integer \(\:h\) is prime in \(\:{Z\left[i\right]}\).

Residue class of GI

Let \(\:Z\left[i\right]\) be the set of Gaussian integers and the residue class of Gaussian integers over modulo\(\:\:h=a+bi\) is \(\:{Z\left[i\right]}_{h}\). Then, the modulo function \(\:f:\:Z\left[i\right]\to\:{Z\left[i\right]}_{h}.\)

Then,

$$\:f\left(u\right)=v\:\left(mod\:h\right)=u-\left[\frac{u\underline{h}}{h\underline{h}}\right]h.$$

In the given scenario, we have a Gaussian integer represented by \(\:v\in\:{Z\left[i\right]}_{h}\). To round a Gaussian integer, we round its real part and coefficients of the imaginary part independently to the nearest integer. This means that each component is rounded separately to its closest integer value. By performing this rounding process, we ensure that the resulting number remains a Gaussian integer19,20.

Gaussian manheim weight and Gaussian manheim distance20

Let\(\:\:\beta\:,\:\gamma\:\in\:{Z\left[i\right]}_{h},\:\alpha\:=\gamma\:-\beta\:=c+di\) be a Gaussian prime. Then, the Gaussian Mannheim’s weight \(\:\left({W}_{GM}\right)\) of \(\:\alpha\:\) defined as

$$\:{W}_{GM}\left(\alpha\:\right)=\left|c\right|+\left|d\right|.$$

A Gaussian Mannheim Distance \(\:{d}_{GM}\:\)between \(\:\beta\:\) and \(\:\gamma\:\) is defined as

$$\:{d}_{GM}\left(\beta\:,\gamma\:\right)={W}_{GM}\left(\alpha\:\right)$$

Proposition 1

20: Let \(\:{\delta}_{k}={c}_{k}+{d}_{k}i\) be the different primes in \(\:{Z\left[i\right]}_{h}\) and \(\:{p}_{k}={c}_{k}^{2}+{d}_{k}^2ii\) are distinct prime integers in \(\:Z\), where \(\:k=1, 2,3,..., m. \,\text{If} \:{O(K)^*}_{\delta^2}\) is generated by \(\:\alpha\: \) then \(\:{\alpha\:}^{\frac{\phi\left(p^k\right)}{\text{2}}}\equiv\:-1(mod \: \delta^{k})\:\).

Proposition 2

20: Let \(\:{\delta}_{1}={c}+{d}i\) and \(\:{\delta}_{2}={a}+{b}i\) be the two prime integers in \(\:Z\left[i\right]\) and, \(\:{p}_{1}={c}^{2}+{d}^2i\)\(\:{p}_{2}={a}^{2}+{b}^2i\)  are two prime integers in \(\:Z\). Then, two elements of \(\:{Z\left[i\right]}_{\delta_1\delta_2}^*\) such that \(\:{e\:}^{\phi\left(p_2\right)}\equiv\:-1(mod \: \delta_{1} \delta_{2})\:\) and \(\:{f\:}^{\phi\left(p_1\right)}\equiv\:-1(mod \: \delta_{1} \delta_{2})\:\).

Proposition 3

20: Let \(\:{\delta}_{k}={c}_{k}+{d}_{k}i\) be the different primes in \(\:{Z\left[i\right]}_{h}\) and  \(\:{p}_{k}={c}_{k}^{2}+{d}_{k}^2i\) are different prime integers in \(\:Z\), Then, \(\:{\tau}_{k}\) be the elements of \(\:{Z\left[i\right]}_{\delta_{1} \delta_{2}...\delta_{k}}^*\), such that, \(\:{\tau_{k}\:}^{\phi\left(p_k\right)}\equiv\:-1(mod \: \delta_{1} \delta_{2}...\delta_{k}), k=1, 2, ..., m\).

Theorem 3

19: Let a Gaussian prime \(\:h\) with norm \(\:N\left(h\right)\) and a non-zero Gaussian integer \(\:\alpha\neq0\in\:{Z\left[i\right]}\), then;

\(\:{\alpha\:}^{N\left(h\right)}\equiv\:\alpha\:\)(mod\(\:\:h)\).

From Theorem 3, \(\:\alpha\:\) is known as the generator of residue class \(\:{Z\left[i\right]}_{h}\).

Theorem 4

20: If \(\:\langle\alpha\rangle=\:\langle a+bi\rangle\) is the generator of the Gaussian residue class with \(\:gcd\left(a, b\right)\:=1\) then,

$$\:Z\left[i\right]/<a+bi>\:\cong\:\:{Z}_{{a}^{2}+{b}^{2}}.$$

Algorithm for proposed n × n S-boxes and Pseudo Code

When it comes to improving security within a cryptographic system, there are several ways of introducing confusion. Of all these techniques, it can be said that employing of an S-box is one of the most efficient strategies in present day cryptosystem conventions. To achieve cryptographic strength, S-boxes are deployed, and they can be implemented using a set called Gaussian integers (GI). This points to a rich direction toward constructing a variety of safe S-boxes and to the importance of their use for constructing highly reliable and safe cryptographic systems. The construction steps for designing S-boxes over Gaussian integers are given in Table 1.

Table 1 Proposed algorithm for n×n S-boxes construction.

Step 1

Generate a cyclic group G of order p-1 with help of definitions and theorems of Sect. 2.

Step 2

Apply the mapping on the group G of step 1.

$$\:f\left({x}_{i}\right)=\frac{1}{a{x}_{i}^{-1}+b},\:where\:a{x}_{i}+b\ne\:0,\:{x}_{i}\in\:G\:and\:a,b\in\:{Z}\left[i\right]_{h}.$$

Step 3

We will separate both parts (real and vector) of the results of step 2.

Step 4

Simply do modulo \(\:{2\:}^{n}\) on the results of both parts of step 3 and get two sets \(\:{f_{1}}\) and \(\:{f_{2}}\) of order \(\:{2\:}^{n}\).

Step 5

Apply the affine mapping \(\:{g}\left(x_{i}\right)=\left(cx_{i}+d\right) (mod \:2^{n}\) on the sets \(\:{f_{1}}\) and \(\:{f_{2}}\).

Step 6

Finally get pair of S-boxes\(\:S_{1}\) and \(\:S_{2}\).

Pair of 8 × 8 S-boxes over the residue class of GI

Let\(\:\:\pi\:=65+34i\) be a Gaussian prime in the Gaussian residue class because \(\:p=N\left(\pi\:\right)=5381\) be a prime in integers\(\:\:Z\). So, \(\:\delta\:=1+10i\) be the Gaussian generator corresponding to the Gaussian residue class. Therefore, apply the all 6 steps of proposed algorithm and get pair of S-boxes \(\:A\) and\(\:\:B\), which are given in Tables 2 and 3.

Table 2 S-box 1 over the first part of GI (A).
Table 3 S-box 2 over the second part of GI (B).

Nonlinearity

An \(\:8\times\:8\) S-box constructed from the residue classes of Gaussian integers employs nonlinearity which exploits the inherent algebraic complexity it is inherent from the non-trivial substructures of a Gaussian integer ring, \(\:Z\left[i\right]\). As elements of the S-box are related to distinct residue classes modulo a well-chosen Gaussian prime, the construction offers increased cryptographic security thanks to the non-commutative as well as the non-associative property of such residue classes; this is enhanced by the bijective transformation of the S-box. Non-linearity, therefore expressed as the minimum of the Hamming distance between the Boolean functions of the S-box and all affine functions is a critical measure in resisting linear and differential cryptanalysis attacks. The residue structure of Gaussian integer also incurs high algebraic degrees and intricate transformation from inputs to output which in turn brings BIG non-linearity to the S-box in comparison to other S-box constructed over simpler field such as \(\:{F}_{{2}^{8}}.\) Gaussian integers are multiple dimension than simple binary numbers which are a combination of real and imaginary parts and adding to this non-linearity of the transform itself strengthens the cryptographic safety of the S-box. This complexity which is attached to the residue classes modulo Gaussian primes is present in S-box, with non-linearity levels that are optimum, and this S-box is used in high level encryption algorithms where the attacks based on linearity must be avoided at all costs. Proposed results with existing literature comparison of nonlinearity is given in Tables 4 and 5.

Table 4 Nonlinearity results of proposed S-boxes.
Table 5 Nonlinearity results comparison.

Bit independent criteria (BIC)

Inverses of all entries of the constructed \(\:8\times\:8\) S-box involving the residue classes of Gaussian integers with respect to their BIC. The cryptographic characteristics of \(\:Z\left[i\right],\)which is considered to be of vital importance, quantifies the contribution of distinct output bits in terms of their independence from variations in any single input. The BIC then determines the extent to which the algebraic complexity inherent in the non-trivial ring structure of the operations over the residue classes of Gaussian integers compromises the statistical independence of output bit transitions in case of an S-box. Due to the fact that S-box is derived from the residue classes modulo the Gaussian primes, the bit-wise mappings are multi-dimensional and highly nonlinear and depend on the Real and imaginary part of Gaussian integer. In the neighborhood input transformation the BIC guarantees that for each bit position of the output, change in any bit of the input must yield statistically independent output bit transitions and this contributes toward making the S-box resistant to differential cryptanalysis. For example, using the RNG to generate elements of a new algebraic structure, S-box, requires great statistical independence, the key aspect to cryptographic security, given that the inherent nature of modular arithmetic in Gaussian integers complicates separating operations among the bit positions within an element, hence increasing the difficulty of maintaining statistical independence among the bit positions in an element of an S-box constructed from Gaussian integers. Therefore, over the Gaussian integer residue classes, the BIC of the S-box is selected in such a way that all the output bits as well as variations in the input bits will least depend on each other and at the same time it also strengthens the diffusion properties that are important for the encryption technique involved in a secure method of coding. Additional properties of these residue classes make the output bits behave in a non-linear and independent manner which conforms this S-box to the higher levels of BIC standards in progressive block cipher innovations. BIC proposed results with existing literature comparison is given in Tables 6, 7 and 8.

Table 6 BIC results of S-box A.
Table 7 BIC results of S-box B.
Table 8 BIC results comparison.

Strict avalanche criterion (SAC)

It is to note that the concept of SAC for an \(\:8\times\:8\) S-box constructed over the residue classes of Gaussian integers \(\:Z\left[i\right]\) helps in measuring the capacity of small input transformation to affect the total output space of the S-box. SAC guarantees that in a quasi-half of the output bits, the transformation resulting from a single-bit flip of the input occurs in that particular bit and the subsequent bits with no exception as it is necessary to sustain the interaction or diffusion required for successful cryptographic functions. Indeed, concerning the S-box resulting from the Gaussian integer residue classes, the non-linear switching functions between the input and the output depend on the arithmetic operations within a finite ring of Gaussian integers modulo a Gaussian prime, implying intricate coupling of the bits. The presence of real and imaginary components in Gaussian integers enhances a rich algebraic structure of these numbers and the great instability at bit level is one more important factor which enables to achieve the SAC. The addition of non-linearity from these modular arithmetic operations in these residue classes provides assurance that small alterations in the input space will be spread out in the output space. This enhanced diffusion property is further compounded by the fact that the Gaussian integer field is the multi-dimensional one and the inter residue class transition leads to the non-trivial bit transitions satisfying the SAC. Furthermore, simply constructing the S-box over algebraic structure inherently injects pseudo-random like transformations that make it extremely difficult for the adversary to predict output bit changes which effectively renders the encryption algorithm immune from both differential and linear attacks. This proves that this S-box fulfills the SAC since the non-linearity and diffusion properties are achieved through the satisfaction of the residue classes of Gaussian integers thus propelling the use of S-Boxes in high-security cryptography. SAC proposed results with existing literature comparison is given in Tables 9, 10 and 11.

Table 9 SAC comparisons.
Table 10 SAC of S-box A.
Table 11 SAC of S-box B.

Linear approximation probability (LAP)

When constructed over the residue classes of Gaussian integers\(\:\:Z\left[i\right]\), S-box with \(\:8\times\:8\) entry 8-bit carries out the Linear Approximation Probability (LAP) which is a measure of how susceptible the S-box is to linear cryptanalysis with the probability that is the maximum linear combination of input bits with a linear combination of the output bits. In the case of an S-box based on Gaussian integer residue classes modulo a Gaussian prime the LAP describes how the algebraic complexity of these modular transformations interferes with linear approximation. Gaussian numbers, since they belong to a commutative ring, introduce non-trivial modular arithmetic involving both the real and the imaginary part that creates non-linear transformations which do not allow an attacker much freedom in attempting to guess linear approximations with reasonably high probability. The residue classes of \(\:Z\left[i\right]\) give rise to a correspondingly irregular and complex input-output correspondence, which by reason of the properties described previously inherent in a DES wash operation, make the confusion/diffusion properties of the S-box more difficult to analyze in terms of linear predictive models, thus making the prospect of a linear attack a higher risk for those engaged in DES. One of these measures which will be of paramount importance when assessing this resistance is LAP and with smaller values being much more secure. Through the appropriate maturation of the S-box over Gaussian integer residue classes, the design takes advantage of algebra richness to generate non-linear functions where any chance to perform linear approximation is experienced at a minimum probability. Therefore, the LAP of the S-box converges with the theoretical lowest value making any relationship through linear equations between input and output bits to be minimal. This improved resistance against linear cryptanalysis is due to the interconnection of modular arithmetic with the structure of Gaussian prime residue class which destroys any linear equation between the input and the output, satisfying high cryptographic standards for secure encryption system. LAP of proposed work with existing literature comparison is given in Table 12.

Table 12 LAP comparisons.

Differential approximation probability (DAP)

The Differential Approximation Probability (DAP) of an \(\:8\times\:8\) S-box which is over the residue classes of Gaussian integers \(\:Z\left[i\right]\) indicates the extent of vulnerability of the S-box to differential cryptanalysis, that is, the probability that for a given input difference x, there is an output difference, d. The non-linear as well as Multi-dimensional calculations in the Gaussian residues modulo a Gaussian prime make the pattern in which input integers’ differences determine the difference in the residues much more complex. A component which consists of Gaussian integers in real and imaginary forms enriches the modular arithmetic as opposed to fields like\(\:{\:F}_{{2}^{8}}\). This complexity means that when differences are propagated through the S-box, the change is very unpredictable; hence a reduced DAP. The residue class structure subverts regularities of mapping between the bit-level differences and the corresponding inputs and outputs in order to prevent frequent occurrence of any specific differential input-output pair. It is essential to make DAP low for protecting the S-box against differential cryptanalysis as the attackers’ key data rely on recurring differential pairs. Due to this modular implementation of the Gaussian integer arithmetic and the way in which the S-box has been designed, the inputs differences get propagated in a highly non-linear manner across both the real and imaginary parts, making it extremely difficult for a Differential Approximation Attack. Consequently, the S-box comes very close to realizing the optimal DAP values which therefore makes it extremely resistant to differential attack as all the differentials between inputs and outputs are highly complex and rare. The algebraic structure in terms of Gaussian integer residue classes demonstrates a higher resistance of such S-box to incoming attacks, especially when its differential correlations need to be minimized to prevent further attacks in encryption schemes. DAP of proposed results with existing literature comparison is given in Tables 13, 14 and 15.

Table 13 DAP comparisons.
Table 14 DAP of S-box A.
Table 15 DAP of S-box B.

Multiple RGB image encryption algorithm based on Gaussian integers and its pseudo code proposed

Multiple color image encryption algorithm is proposed with the following steps.

Step 1: Input Preparation.

Bring into the encryption procedure the original RGB images to be protected. Each RGB image is split into its three color channels: Red, Green, and Blue. Convert each channel into a matrix of pixel values that will be taken into a quantitative value by the computer. For encryption, should recognize the pixel values as the elements of the Gaussian integer residue class \(\:Z\left[i\right]\).

Step 2: S-Box Construction.

Construct two 8 × 8 S-boxes (\(\:{S}_{1}\) and \(\:{S}_{2}\)) over the residue classes of Gaussian integers \(\:Z\left[i\right]\), exploiting their algebraic properties.

Step 3: The structure of Substitution-Permutation Network (SPN).

We says that the proposed SPN structure helps greatly in improving the security of multiple color images in the Gaussian integer residue classes. Here’s an expanded explanation of the SPN framework, particularly the three-stage process:

Substitution

Subsequently \:{S}_{1} is important to offer confusion in the course of the encryption. The conventional process of this stage involves substituting of each single pixel of the channels Red, Green, and Blue by the S-box, individually. The function of an S-box is to substitute each pixel value by a new one in accordance with some assigned substitution table. The design of the S-box is such that the output pixel value depends strongly on the input pixel value, and vice versa, in a very nonlinear manner so as to very much hinder any analysis of the original image or the key by an attacker. This substitution brings in confusion, which erases the link that exist in between the plaintext image and the ciphertext.

The application of S-box over Gaussian integers \(\:\left(\mathbb{Z}\right[i\left]\right)\) also brings additional security because the operations in the Gaussian integers are much more complex compared to integer based cryptographic operations. This added complexity can increase the level of difficulty in cryptanalysis especially for those that attack linear or differential types of cryptanalysis.

Permutation

After substitution, the permutation step, \:{S}_{2} is applied to improve enhancement of diffusion property of the encryption. Diffusion identifies refer to the manner in which the effect of each plaintext bit is spread out through the ciphertext, so as to complicate cipher analysis. The permutation step manages to do this by rearranging the position of the pixel within the individual RGB channel. This rearrangement further guarantees that the pixel values from the substitution process using \:{S}_{1} are scattered within other various positions so that the impact of the original pixels is diluted.

The permutation is critical because it assists in decreasing the consistency on an attacker of locally patterned or symmetrical organization of the pixels in the picture. In this way the encryption system permits a permutation in each channel independently of the others and thus eliminates a possible weakness if the same permutation were applied to all the channels at the same time.

XOR Operation

The third and the last stage of the SPN offers an XOR operation using S-box \:{S}_{3}(generated by the XOR between \:{S}_{1} and \:{S}_{2}) on the result of permutation step. To achieve this, grey scale pixel values from the digital image are applied on RGB channels using the XOR gate. This stage is intended to put into practice the subtraction of the substitution and permutation operations, and to add even more randomness, making for it practically impossible for the attacker to guess or try to reverse the applied transformations.

The XOR operation not only increases the level of complexity of the cipher but also ensures for the conversion to be reversed then the key used to produce S-box is mandatory. In this case, the resulting S-box \(\:\left({S}_{3}\right)\) provides one last level of confusion and diffusion to each pixel of the image. The operations in combination yield a strong encryption system where original image plain text does not resemble the encrypted image at all.

Step 4: Last Transformation Steps.

During the implementation of the SPN framework all the channels of the RGB images embedded changes. This succession also guarantees to all the channels optimal diffusion and confusion outcropping as a definite guard against all caliber of cryptanalytic expiry.

Step 5: Output the Encrypted Image.

Lastly, when using the SPN framework, add all the three encrypted channels of Red, Green and Blue together to obtain the encrypted RGB image. Perform this process to all the images in the set of multiple RGB images.

Step 6: Final Output.

The encrypted images are generated that have high entropy, low pixel correlation coefficient, and improved resistance to differential and linear attack so that multimedia data can be transmitted securely.

Significance of SPN

The three-stage SPN framework is quite important as it carefully combines confusion and diffusion, two features that play very important roles in cryptography. As a result of the substitution step, there are no liner movements with the plaintext and the ciphertext, which makes it hard for the attackers to have direct relations. The permutation step is used to ensure pixel influences are spread all over the image and hence make it very secure. The combining of the XOR operation with the final S-box generation increases the level of complexity making the cipher immune to cryptanalytic attack. Combined with the three-stage operation, the size of the s-box is optimized for unpredictability in the ciphertext, which prevents differential and linear cryptography. Furthermore, since the encrypted data utilize the residues classes of Gaussian integers\(\:\:\left(\mathbb{Z}\left[i\right]\right)\), the encryption has a higher complicated structure compared to the RSA encryption, which enhances the cryptography security against advanced decryption techniques.

The Flowchart of proposed S-boxes constructed of Sect. 3 and multiple RGB image encryption of Sect. 4 is given in Fig. 1.

Fig. 1
figure 1

Flowchart of S-boxes and Multiple RGB Image Encryption of Proposed work.

This encryption algorithm uses Gaussian integers’ algebraic density and Substitution-Permutation Network to form an effective background to protect a multiple number of color images. Pseudo code of the proposed multiple color image encryption is given Table 16.

Table 16 Pseudo Code of RGB multiple image encryption over GI.

Investigation of multiple color image encryption using Gaussian integers

The results of the experiments as well as detailed performance analysis of the multiple RGB image encryption using Gaussian integers have been presented and proved that the proposed cryptographic technique is very effective for color images. In order to enhance the stenographic security and decrease the likelihood of the steganalysis, the work uses the algebraic properties of the Gaussian integers which are complex numbers with integer coefficients to encode the pixel values of the color image over the red, green, blue channels. The performance measures on encryption quality, key sensitivity and crypt modules of RGB image and its vulnerability to usual cryptanalysis indicates the safety factor boosted up a notch through the proposed method compared to the conventional digital image encryption. The encrypted images show a very small dynamic range for all color channels, thus proving that the pixel values are well spread after the encryption level and that there has been a significant decrease in pixel intercommunication or dependency, or confusion. Moreover, the key space discrimination also validates that the encryption scheme is safe from brute-force attacks due to the integrated Gaussian integer key space. Computation times for encryption and decryption are reasonable for practical use, indicating that the method is not only secure, but efficient as well. The above experimental results also demonstrate that the given method is highly resistant to differential attacks because even small modifications of the encryption key or the original image severely change the encrypted image. The results presented herein show that Gaussian integer-based encryption can be applied to enable safe ways of transmitting and storing RGB images in a number of contexts, such as digital photography, medical applications, and satellite imagery, where the preservation of image genuineness and ownership is crucial. Original and encrypted images of multiple RGB Images 1 and 2 is shown in Fig. 2.

Fig. 2
figure 2

Original and Encrypted Multiple Color RGB images.

A Histogram analysis of multiple Color RGB images

Histogram analysis of multiple RGB images that forms the cornerstone of image processing includes details of distribution the pixel weight on the red, green and blue color channels that gives insight into the color balance, contrast as well as the general look of the image. Thus, histograms help to determine what fraction of image contains objects of this or that brightness, which aspects of color balance may be incorrect, or whether there are problems with over- or under-exposure. Specifically, while working with several images simultaneously, the histograms’ comparison allows estimating the similarity of the further image set while, for example, image stitching requires images with similar histograms to be combined seamlessly. Furthermore, histogram analysis is also useful in tasks such as enhancement where operations such as histogram equalization is done to make contrast by spreading the pixel intensities uniformly over the available range. Percentage histograms are also useful in color correction processes to compensate the color balances which are produced during the capture of images; they are useful to set appropriate color channel effects. Furthermore, in image classification and recognition applications, histogram features can be employed as an index to differentiate one scene or object from the other based on histograms of color and/or intensity corresponding to the given images; therefore, histograms can be widely incorporated into feature extraction. In general, histogram analysis of multiple RGB images not only helps in comprehending the image attributes more ergonomic and analytical but also helps in applying multiple functionalities like image enhancement, color standardization, and improvement of effectiveness of various image based algorithms in applications that includes digital imaging, computer vision and multimedia processing. The Multiple RGB Image histogram analysis is presented in Figs. 3 and 4.

Fig. 3
figure 3

A Histogram Analysis of Color RGB Image 1.

Fig. 4
figure 4

A Histogram Analysis of Color RGB Image 2.

NPCR and UACI

Number of Pixel Change Rate (NPCR) and Unified Average Changing Intensity (UACI) are basic measures used in order to analyze image encryption algorithms especially to compare performances several RGB image encryption modes. These metrics are important in establishing the extent to which it is possible for an attacker employing Differential attacks to exploit the difference between the plaintext or the original image and the ciphertext or the encrypted image by applying minor changes to the plaintext and observing the changes. Concerning the RGB images, where every pixel has three channels of Red, Green, Blue, it becomes difficult to ensure the appropriate level of encryption, and therefore, the NPCR and the UACI play crucial roles as characteristics of the selected algorithm. It calculates the ratio of the pixels that translate in the encrypted image to the variation of just one pixel in the original image and can identify the diffusion feature of the algorithm. To aid in encryption, NPCR should be nearly 100%, this implies that a slight alteration of the original image, leads to changes in the encrypted image across all sections, meaning that the encrypted image is very sensitive to alterations made on the plain text, this is important so that the attacker cannot have any structural pattern of the encrypted data.

On the other hand, UACI compares the average difference of pixel intensity between two encrypted images where only the spatial position of the pixel in the original unencrypted image is different, so as to quantify how evenly intensity changes are distributed over the image by the algorithm. In the RGB image encryption, it is typical to have the UACI values of around 33% because such values present no distinguishable pattern sequences in the ciphertext. Moreover, high UACI values mean that the encryption process affects each pixel intensity in a huge manner thus enhancing image features’ elimination so as to enhance the image’s security against statistical attacks. The combined use of NPCR and UACI gives a more complete assessment of the encryption algorithm especially in the complex domain of RGB image encryption where equal distribution of the color channels and uniformity of the intensity changes is quite hard to achieve. Using these metrics, it is ascertained that any correlation between the original and the encrypted image is completely severed and the encrypted image has a high degree of sensitivity to input change across multiple RGB images to ensure optimum security. NPCR and UACI results is presented in the Table 17 below.

Table 17 NPCR and UACI of multiple encrypted RGB images.

Maximum deviation of multiple RGB image encryption over GI

Maximum deviation with reference to multiple RGB image encryption over the residue class of Gaussian integers manages the kind of difference that exists with regards to the pixel intensity as well as color distribution channel between the initial plain image and the final encrypted image. RGB image encryption when carried out using substitution-permutation networks and the residue classes of Gaussian integers, maps each pixel which is a combination of red, green and blue into a new encrypted space that has the attribute of naturally altering the color intensity because the operations are non-commutative. Complex multiplication and addition of the elements within these residue classes alter pixel values vastly from its initial form during the encryption process. In this case, maximum deviation describes the largest difference of pixel values in the encrypted image in comparison to the original image. This metric is essential in the ability and randomness of the encryption as generally if the values deviate they are stronger. Therefore, based on the elements of the Gaussian integers that include real and imaginary parts, the encryption algorithm extends the space transformation in the pixel domain along several dimensions further maximizing the level of security achieved. The employment of residue classes make the transformations to stay within a finite field and provide significant amount of image distortion as perceived from maximum deviation. When used in combination with a plurality of images, this helps to make the encryption scheme far more secure as evidenced by the deviation analysis that shows the ability of the encryption technique to withstand cryptanalytic attacks that key on slight variations in pixel values. Results of MD is given in Table 18.

Table 18 MD of multiple RGB images.

Irregular deviation of multiple RGB image encryption over GI

It is the random and non-periodical shift in multiple encryptions of images in RGB format over the residue class of Gaussian integers; meaning that pixel value changes will always be unpredictable over images which has been encrypted over complex arithmetic operations within this algebraic system. Unlike regular deviation, where the changes may follow a certain pattern irregular deviations are random and asymmetric affecting all the three color channels namely red, green and blue such that the resultant image is encrypted and seems distorted compared to the original image. This irregularity is caused by the fact that Gaussian integers as elements of number fields have both real and imaginary parts and do not commute under multiplication. When the pixel values are mapped through substitution-permutation networks (SPNs) into the residue class of Gaussian integers each of the pixel can be encrypted in such a way that the contrast and hue can be shifted in different areas of the image. This results to a relatively random form of deviation across the encrypted image; there could be some areas which exhibit very little deviation while other areas exhibit very huge deviations which are random. This randomness is further intensified when applied on multiple images as each image undergoes a different transformation because of the variations in the residue class operations. This kind of irregular deviation is very important in the security of the encryption since it becomes extremely hard for an adversary to reverse engineer the encryption or figure out any patterns of transformation of pixel values. Hence the irregular shifts of the pixels and the structure of the Gaussian integer residue classes will make the encryption very strong and non-repetitive making it abstract from statistical attacks that analyze changes in pixel. Results of ID is given in Table 19.

Table 19 ID of multiple RGB & their corresponding images.

Correlation analysis

The multiple RGB image correlation is a vital image processing parameter that quantifies the degree of linear dependency of the pixel intensity in three different colors Red, Green, and Blue for different images and hence quantifies the level of resemblance and dissimilarity in colors, textures and structures. High coherence means that images contain similar features, for example uniform distribution of color or similar patterns, which is an important consideration in image registration, stitching and mosaicking where it is important to blend images seamlessly. On the other hand, low correlation means that there are critical differences between the images which may be with regard to lighting, viewpoint or scene content, and can be applied where the objective is to detect change and so on. Correlation analysis is also important in image and data compression and removal studies since where images/images regions are highly correlated they can be effectively compressed which reduce the redundancy at considerable data loss. In the case of image fusion, correlation assists in the determination of what information should be mixed together thus producing in a much more informative fused image than the individual images. Moreover, in the machine learning and computer vision, the analysis of the RGB images may indicate how better the models are when performing tasks such as object recognition due to the correlation between the images and similar features used to give the results. Hence, by correctly identifying the correlation of RGB images, researchers and practitioners can improve image processing methods and guarantee credibility of image-based data, and improve the functioning of a multitude of visual computing applications. We have shown the correlation of proposed multiple RGB images, vertically horizontal as well diagonally in Figs. 5, 6 and 7; Table 20.

Fig. 5
figure 5

Vertical Correlation of Original and Encrypted Multiple RGB Images 1.

Fig. 6
figure 6

Horizontal Correlation of Original and Encrypted Multiple RGB Images 1.

Fig. 7
figure 7

Diagonal Correlation of Original and Encrypted Multiple RGB Images 1.

Table 20 Correlation of multiple RGB images.

Information Entropy

Entropy calculated on multiple RGB images is a relevant feature to measure the amount of uncertainty or randomness in the pixel density in the three R, G, B channels of the color spectrum thus offering an effective means for rating the relative complexity and variety of imagery within a time frame and across images. In the field of image processing entropy is higher in the regions of higher pixel value variation and in images what have more texture, color depth, and other complex patterns while lower entropy regions are mostly smooth and relatively simple with less information. During the analysis of more multiples RGB images the entropy for each of the color channels gives certain insights about information content for further compression where in areas of low entropy the data can be compressed more, with less loss of quality and for texture analyzing where entropy forms one of the characteristics by which one can differentiate between one texture and the next. In image segmentation also the entropy plays a vital role, it aids in the identifying the region having better or lesser detail content, and in information fusion when images with different entropy characteristics are fused, the resultant image will have richness in information. In the same context of image quality assessment as well as image enhancement, entropy offers a numerical measure of the trade-off between image content and noise, thus helping propose algorithms for improving the image quality. Researchers offer a new approach by which information entropy of RGB images informs its distribution, facilitating improved processing, compression, and interpreting tasks in a variety of fields that include, digital imaging, computer vision, remote sensing and multimedia. The entropy comparison of the proposed work with the existing literature is summarized in Table 21.

Table 21 Entropy of multiple RGB images.

MSE and PSNR of multiple RGB image encryption over GI

Peak Signal-to-Noise Ratio (PSNR), applied to the multiple RGB image encryption over the residue class of Gaussian integers is the important valuation measure stating the quality of the encrypted image compared to the original. PSNR calculates the quality that quantifies the maximum pixel intensity of the image to the noise or error which is bothersome while encrypting. For RGB images, PSNR is computed on all the three color channels which includes; red, green, and blue and gives a quantitative measure of how close the encrypted image is to the original in as much as quality is concerned. During the encryption using Gaussian integer residue classes, complex conjugate pixel transformation occurs and changes are significantly large resulting to low PSNR meaning high distortion. In this case, a lower value for PSNR is desirable because the image becomes more and more unrecognizable as the encryption is stronger while higher value for PSNR will mean that the image after going through the encryption process is almost the same and therefore, can be easily decrypted. This is a balance of distortion and encryption strength needed when doing the designs of secure image encryption systems where PSNR give measure of the ability of encryption to hide the original image details.

Mean squared error (MSE) is used in conjunction with PSNR as it quantifies the average squared difference between the pixel values of encrypted image and that of the original image. In the encryption of the RGB image over the residue class of Gaussian integers, every pixel of the encrypted image is compared with its counter-part in the original image with the help of MSE. The value obtained from MSE is in the range 255 255, where the larger the value, the larger the deviation between the two images, meaning that the encryption process has introduced more changes. Due to the fact that the operations in the domain of Gaussian integers are related to complex number manipulations, the transformations applied to pixels’ values can substantially differ in different regions of the image, which results in a general rise of the MSE indicator. Therefore, a high MSE has to do with encryption in that it has greatly transformed the image in its encrypted form by making it less recognizable. MSE therefore acts as the basic metric used in assessing the level of distortions that has been imposed to by the encryption process and which gives a measure of the robustness of the encryption that has been applied in concealing the image data. Results of PSNR and MSE is given in Table 22.

Table 22 PSNR and MSE results of multiple RGB Original & encrypted images.

Contrast

Multiple RGB images are contrasted and they have a critical impact on the image processing where the image enhancement, segmentation and computer vision are important issues. Contrast means the difference between the brightness and colors by virtue of which perceptive functions are possible and achievable contrast across a number of images is crucial in order to retain relevant visual data without losing it at more luminous and darker areas. Contrast changes can be caused by changes in lighting, changes in exposure or differences in objects and scenes to be imaged which makes contrast consistency across image sets difficult. Solving these issues necessitates the creation of complex contrast enhancement methods: adaptive histogram equalization, contrast stretching, and multi-scale retinex algorithms that raise contrast in the image so that the concealed details become much clearer. Further, irrespective of the measurement technique, contrast harmonization across multiple images is important in for instance image mosaicking or HDR imaging applications whereby images with different contrasts have to be combined in a way that the final output does not appear to be a montage of vying images but a smoothly joined single image. In other words, if the contrast of RGB images is managed effectively, the efficiency of images for automatic image analysis, the pixel quality, and the Overall Quality Index (OQI) of images can be increased, and the correspondence of imagery across multiple conditions can be maintained. Comparison of contrast results of proposed work is shown in Table 23.

Table 23 Contrast of multiple original and encrypted RGB images.

Energy

Energy in multiple RGB images is crucial to defining and enhancing many image process in-genhance operations such as image compression, segmentation, and feature extraction. In this context, energy is taken as the amount of pixel intensity differences or the dispersion of these differences across the image, used as a measure of the picture and textural content of the images. Local energy of the image is higher when it is more detailed, for example when transition from one color value to another is abrupt or when it has a texture, and lower when it has smooth gradients. Effective control and computation of energy in multiple RGB images is important for image fusion applications where joining images with distinct energy distribution is likely to improve the amount of information and in the operational control of images where energy distribution is used to determine which portions of the image are most important for implementation. Furthermore, energy-based methods are used in image segmentation to segment region of interest from other regions of an image and in edge detection algorithms where energy gradients are used to define the edges and boundaries of objects in an image. Thus, through a more accurate analysis and control of the energy features of the RGB images, the methods of the images’ subsequent processing are accelerated and aid is given to getting images of higher quality and the corresponding higher accuracy of the result obtained, including the tasks of recognition and identification of certain patterns, diagnostics of diseases, and the creation of the systems for remote sensing. The energy results are shown in Table 24.

Table 24 Energy of multiple original and encrypted RGB images.

Homogeneity

In the field of image processing, RGB image is usually acquired by capturing multi-images, the uniformity of which plays an essential role in determining the efficiency of the ensuing applications such as stitching, recognition as well as classification. Uniformity is all about distributing color uniformly, arranging textures and having equal or similar intensity levels on a given set of images which is not easily accomplished due to variations in lighting, camera setting, and the environment. Such inconsistencies can result in the formation of visible distortions, class errors and, in general, lower efficiency of the automated system. Therefore, the investigation of homogeneity in RGB images needs the design of effective computational methods to identify and eliminate variations within them with the help of histogram equalization, color correction, and texture analysis. Through these methods, it would be possible to increase the standardization of outlook of images in order to increase reliability of images during the required applications, which would lead to improvement in the results in real-world use. Also, in the case of there being a large number of images captured with a single camera figuring out homogeneity is severe not only for enhancing the quality of the image of every subject but also useful when stitching several images in a panorama which may be interrupted by the slightest of gaps. The homogeneity results of the proposed work is summarized in Table 25.

Table 25 Homogeneity of multiple original and encrypted RGB images.

Standard deviation

Standard deviation of multiple RGB images is statistically the simplest measure of dispersion of the pixel intensity level differing in the red, green, and blue planes, which provide essential information on image quality, including consistency and uniformity. In image processing, standard deviation works as an index of contrast, texture and noise in and between images to explain the amount of variation in color and intensity present. Large standard deviation values are often characterized by areas with high contrast and textural possibilities such as edges or more variant pixel contents while values of small standard deviation indicate regions more planar with low contrast. While processing a set of RGB images, one must compute the standard deviation of the image channels to identify variation in exposure, lighting, and other factors that are so important for alignment, fusion, and mosaicking. Additionally, in all noise detection and reduction techniques standard deviation plays a role, where ever an image shows a high standard deviation it is an indication of noise and the filtering method can be applied to bring down this type of variation while preserving the relevant details. Also in the context of image quality, standard deviation gives different quantitative values of the consistency of colors and brightness of multiple images so as to come up with coherent and appealing pictures. In return, by eliminating artefacts and better manipulating the complex RGB image standard deviation, researchers and practitioners can perform improved image processing, advanced image analysis, and obtain better image outcomes in various applications, as in industrial application photo and digital art, science and computer vision imaging. The SD results of the proposed work is presented in Table 26.

Table 26 Standard deviation (SD) of multiple RGB original and encrypted images.

NIST Test

The NIST test suite is known to be the statistical test suite applied to assess the randomness and security of crypto-graphic algorithms for multiple RGB image encryption. Hence, in the context of image encryption, the basic goal that is often postulated is to establish a maximum randomness in the encrypted image region such that a motivated attacker cannot gain any relevant information about the region of the original image. The NIST suite including frequency test, block frequency test, cumulative sums tests and more ensure the randomness of the encrypted output by computing pixel statistical characteristics on the red, green and blue channels. These tests are vital for ascertaining that the employment of encryption yields data that to all appearances is random noise to ensure that the seemingly correlated data exploitable by attackers is not generated by the encryption process. During multiple RGB image encryptions, each image comprises three related color channels, thus requiring the chaotic characteristic of each encrypted pixel for all the three channels to improve the overall security of the encrypted data. The pixel values have been set right by the encryption algorithm and through the tests provided by the NIST it is confirmed and the quality of encryption of the images are as per the stringent requirement for secure encoding of the visual information.

Also, using the NIST test suite to multiple RGB image encryption confirm the effectiveness of the application of the encryption algorithm and, at the same time, allows finding the flaws of the algorithm and improving it. For example, when some of NIST tests show that specific color channels or some areas of the image are not as random as needed, the encryption algorithm can be revised to improve the diffusion and confusion that the image encryption should offer. It is such an iterative enhancement process that is vital in the ability to come up with proper encryption methods that will be able to protect RGB images from various classifications of attacks that range from brute force, differential and statistical attacks. Moreover, as with any other engineering or artificial product, evidence in passing NIST tests can be deemed as credential that an image encryption algorithm is reliable and secure enough to be used in real life applications like secure image transmission, cloud storage, and digital rights management. As it can be seen, the RGB images are being used in the highly sensitive domains – including the medical imaging, satellite photography, and digital forensics, among others – and – as it will be shown in the conclusions of this research – the encryption algorithm used on the present application must meet the requirements set by the NIST test suite, so that the confidentiality and the integrity of the visual data contained in the images can be effectively protected. Hence, the NIST test suite is crucial in the testing of development of the encryption algorithms that will satisfy the necessary standard of randomness and security needed to protect multiple RGB images. The results of the NIST on the proposed work is presented in Table 27.

Table 27 NIST analysis of image 1.

Conclusion and future directions

In this work, we introduced a modified encryption approach for multiple color images by using Gaussian integers with new 8 × 8 S-boxes over residue classes of \(\:Z\left[i\right]\). By incorporating these S-boxes into a three-step Substitution-Permutation Network (SPN) the method got good diffusion and confusion and hence good cryptographic security. After the first two S-boxes, the authors have used the XOR of the two initial S-boxes to get the other S-box that considerably enhanced the encryption process by adding non-linearity. Herein using the proposed framework it was noticed that the RGB images were encrypted with high efficiency and better entropy for both cases, no correlation, excellent results for high cryptanalytic resistance including differential and linear cryptanalysis. This approach provides the optimum level of security solution for the multimedia encryption own to the challenging requirements for the modern communication technology systems. The future work can be done to extend this work for other image formats and higher dimensions of multimedia data like videos. More research about the improvement of theoretical time spent for the encryption scheme, particularly for real-time applications, should be conducted. Furthermore, the incorporation of machine learning for cryptanalysis could provide useful information on the vulnerability of GAI S-boxes, in addition to studying whether these can be useful in future dual layered systems that make use of traditional and quantum security mechanisms.