EUROPEAN JOURNAL OF PURE AND APPLIED MATHEMATICS 2025, Vol. 18, Issue 2, Article Number 6228 ISSN 1307-5543 – ejpam.com Published by New York Business Global 1 A Novel SPN based Multiple RGB Images Security2 over the Residue Classes of Quaternion Integers H[K]δ3 Muhammad Sajjad1,∗, Nawaf A. Alqwaifly2,∗4 1 NUTECH School of Applied Science and Humanities, National University of Technology,5 Islamabad, 44000, Pakistan6 2 Department of Electrical Engineering, College of Engineering, Qassim University,7 Saudi Arabia8 9 Abstract. In this paper, we propose a Substitution and Permutation Network (SPN)-based en- cryption scheme for secure multiple RGB images over the residue classes of quaternion integers H[K]δ. In this context, the new construction of n× n substitution boxes (S-boxes) using quater- nion integers is proposed in order to enhance cryptographic strength. The traditional approaches for S-boxes are mostly based on Gaussian, Eisenstein, and elliptic curves, but quaternion inte- gers are a four-dimensional algebra that is somewhat different mathematically, and these provide additional resistance in terms of cryptographic attacks. The strong security attributes of the de- signed S-boxes. As for multiple RGB image encryption, in order to achieve both confusion and diffusion, the proposed method employs the SPN framework and quaternion integer-based S-boxes. Structured SPN framework based on substitution, permutation, and XOR operations used by the encryption algorithm. It is shown that the encryption method proposed greatly increases the re- sistance against statistical, differential, and cryptanalytic attacks. The quaternion integer-based encryption framework is used to convey the confidentiality and integrity of multiple RGB images, which promises to be a good solution for secure multimedia applications. The results confirm that quaternion integer algebra can constitute a useful basis for constructing resilient cryptographic primitives for the modern digital security challenges. 2020 Mathematics Subject Classifications: 16S38, 11T71, 94A6010 Key Words and Phrases: Quaternion integers, Multiple RGB Image Encryption, SPN, Confu-11 sion, Diffusion, Security Analysis12 13 1. Introduction14 To safeguard multimedia content from unauthorized access, tampering, and cyber15 threats, advanced cryptographic techniques have emerged in response to the evolving16 landscape of digital communication and data sharing. Traditionally these include AES17 ∗Corresponding author. ∗Corresponding author. DOI: https://doi.org/10.29020/nybg.ejpam.v18i2.6228 Email addresses: muhammad.sajjad@nutech.edu.pk (M. Sajjad), nkoiefly@qu.edu.sa (N. A. Alqwaifly) https://www.ejpam.com 1 Copyright: © 2025 The Author(s). (CC BY-NC 4.0) M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 2 of 35 and RSA-type schemes but have been rendered less viable due to challenges like the quan-18 tum computing threat and so on; thus, we now have more resilient approaches like post-19 quantum cryptography (PQC), homomorphic encryption and lattice-based cryptosystems.20 Although encryption in multimedia security is not sufficient, further mechanisms such as21 digital watermarking, steganography, and perceptual hashing are incorporated for authen-22 ticity and copyright protection while allowing for secure content distribution. In addition,23 chaos-based encryption methods and cryptographic models built using deep learning have24 established a place for them, as they allow for improvement over randomness and adapt-25 ability, thus making them ideally suitable to face off against statistical and differential26 attacks. Since the development of blockchain technology, secure multimedia transactions27 have also been explored on the basis of security frameworks that are decentralized the28 need, on the one hand, to depend on centralized authorities and, on the other hand, to29 guarantee traceability and integrity in these transactions. Cryptography also becomes30 more optimized for reducing stronger security mechanisms through artificial intelligence31 and machine learning by increasing synergy with cryptography [1]. This means that adap-32 tive security can be done that focuses on real-time threats in multimedia communications.33 34 The primary component of non-linearity in block ciphers is substitution boxes (S-35 boxes), which are very important components to strengthen the crypto security because36 they provide confusion and are immune to cryptanalytic attacks. This design of an optimal37 S-box balances various cryptographic properties such as high nonlinearity, low differential38 uniformity, and minimum probability of linear approximation to make the S-box robust39 against linear and differential cryptanalysis. Current S-box construction approaches are40 based on algebraic structures, specifically in the form of finite fields; however, there have41 been a number of developments in constructing S-boxes from a more sophisticated al-42 gebraic domain, i.e., Gaussian and Eisenstein integers, quaternion algebras, and Galois43 fields, to increase their cryptographic strength. Furthermore, S-boxes are generated dy-44 namically by evolutionary algorithms, artificial intelligence techniques and deep learning45 models according to the needs of an evolving security challenge. Currently, modern encryp-46 tion protocols start introducing dynamic and key-dependent S-boxes in order to introduce47 additional complexity and make the cryptographic systems less vulnerable with respect to48 the adaptive attacks. However, their application is not limited to the conventional ciphers49 but also extends to the transparent braiding ciphers, where they are found important in50 the areas of lightweight cryptography, chaotic encryption schemes, and secure image pro-51 cessing, where the nonlinearity in them is a very effective means of providing security of52 data and unpredictability of data [2, 3].53 54 The single and multiple image RGB encryption is a very complex task which must be55 done to ensure confidentiality, integrity, and resistance to tax attacks while retaining the56 visual data quality. In contrast to grayscale images whose pixel intensity values lie in only57 one channel, RGB images contain three interdependent color channels, and consequently58 there exist specialized encryption techniques to deal with the multi-dimensional structure59 of the RGB images. Pixel-level permutation and diffusion mechanisms are conventional;60 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 3 of 35 modern approaches involve the use of chaos theory, fractal geometry or DNA encryption61 with strength of security and efficiency. Furthermore, the encryption over quaternion and62 Eisenstein integer domains is also more robust by bringing in structurally higher dimen-63 sions into the algebraic structures, thereby enhancing randomness and intrinsic security.64 For multiple image encryption applications, joint encryption schemes, compressive sens-65 ing, etc., are used for simultaneous encryption and, at the same time, keeping complexity66 low. Moreover, real-time image encryption using a hybrid model that improves adapt-67 ability and efficiency was also explored by combining deep learning and cryptographic68 techniques. Moreover, robust encryption mechanisms for RGB multimedia data are de-69 sired due to the increasing demand for secure image transmission in medical imaging,70 surveillance, etc [4, 5].71 72 Quaternion integers allow us to move past complex numbers and take an extension of73 algebra into a four-dimensional algebraic system with some unique properties that have74 been used in cryptography, coding theory and secure communications. Quaternion alge-75 bras are defined as the non-commutative extension of the Gaussian and Eisenstein integers76 and yield a rich mathematical framework in which one can define cryptographic primitives77 with enhanced security characteristics. Such inherent structure allows the development of78 SPNs with improved confusion and diffusion properties and secure realization of encryp-79 tion schemes. Quaternion-based constructions in error-correcting codes help in robust80 channel coding techniques, which enhance the data reliability in a noisy communication81 environment. Moreover, quaternion integer-based cryptosystems have also been used for82 public key encryption, digital signatures and secure key exchange protocols using their83 algebraic complexity that makes them resistant to conventional cryptanalytic attacks. In-84 deed, recent research also explores their usage in image and signal processing, specifically85 in extracting new and secure features in image and signal representation. Also, with the86 growing evolution in the security threats, the integration of quaternion-based mathemat-87 ical structures in the modern cryptographic systems can open a way to develop enhanced88 configurable cryptographic information spread algorithms with high performance and en-89 hanced resistance towards the modern attack vectors [6–8].90 91 To begin with, the encryption system is based on algebraic structures and multimedia92 security, which is now a key component in the encryption schemes. On the other hand,93 Menezes et al. [1] report in detail traditional cryptographic methods which offer strong and94 secure communications. These challenges, however, call for the adoption of the advanced95 mathematical structures with quaternion integers, which allow more algebraic properties96 in the encryption and error correction [6]. Ozen and Guzeltepe [9, 10], which bring the97 use of quaternion integers into cyclic codes, and hence into robust encryption schemes.98 Shah and Rasool [8] also develop this research by demonstrating how quaternion-based99 coding can be advantageous in secure data transmission. More recently, Sajjad and Shah100 [7] suggest a version of the Berlekamp–Massey algorithm for decoding cyclic codes over101 quaternion integers, which further confirms their cryptographic power. Additionally, Saj-102 jad et al. [11] give higher-length cyclic codes based on quaternion integers as well as new103 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 4 of 35 decoding algorithms for better error resilience. S-boxes are fundamental nonlinear com-104 ponents in symmetric cryptography to make it secure by introducing confusion. Khan et105 al. [3] provide more motivation for the construction of strong S-boxes by noting that this106 remains a focal area of research, and we use chaotic Lorenz systems to construct robust107 substitution boxes. Carlet and Ding [2] give a comprehensive consideration on how to108 analyze S-box nonlinearities from a cryptographic point of view. These concepts are then109 utilized to design S-boxes over Gaussian and Eisenstein integers by Sajjad et al. [12, 13]110 and shown to be useful in block cipher security. Moreover, in [4] the substitution box111 generator is introduced that is purpose-built for image encryption together with its exten-112 sion of quaternion intensity in [14] to achieve enhanced nonlinearity and security. These113 results have been further optimized in recent research of Artuğer and Özkaynak [15], who114 applied randomized selection methodologies to S-box nonlinearity.115 116 In recent years, the increase in multimedia communication has created the need for117 image encryption, especially with RGB images. An SPN-based RGB image encryption118 scheme over Gaussian numbers is proposed by Sajjad et al. [5], and it is shown to be more119 resistant to statistical attacks compared to its counterpart over a finite field. Abd EL-120 Latif et al. [16] use quantum walk-based pseudorandom number generators for quantum121 color image encryption, and Ibrahim and Alharbi [17] integrate Henon maps and elliptic122 curve cryptography to provide efficient image security. Shamsi and Laiphrakpam [18] in a123 similar fashion widen the scope of multimedia data embedding to the case of audio-based124 image encryption. Consequently, Wang et al. [19] propose fast encryption based on paral-125 lel computing, while Cheng et al. [20] use hyperchaotic systems and permutation diffusion126 architecture to enhance the security. Malik and Shah [21] also design a scheme for multiple127 image encryption using 3D chaotic maps which utilize the power of chaos theory in mul-128 timedia security. With the development of many advanced transformations and chaotic129 systems, the multiple image encryption techniques have become much more complex. Both130 Yin and Wang [22] use breadth-first search and dynamic diffusion for better randomness,131 while Wang et al. [23] use DNA sequence operations for chaotic image encryption. Wang132 et al. [24, 25] recently created hidden attractor chaos systems and conservative hyper-133 chaotic architectures, which strengthen cryptographic strength even more. Wang and Li134 [26] also combine Hopfield chaotic neural networks into color image encryption, and Wang135 and Gao [27] also use Boolean network synchronization. An additional dimension of se-136 curity is also provided by optical cryptosystems such as asymmetric key cryptosystems137 for multiple image encryption described by Liu et al. [28]. Xiong et al. [29] is one other138 well-known contribution based on pixel exchange operations and vector decomposition,139 and Deng et al. [30] is yet another contribution based on spectral cropping and spatial140 multiplexing. Li et al. [31] also investigatedwang2020imagea wzhou2020novelform-based141 techniques, which, however, use robust chaotic maps for secure image encryption. Zhang142 and Wang [32, 33] also extend DNA encoding and 3D permutation models, and Li et al.143 [31] further improve security using compressive ghost imaging.144 145 In response to the fast growth of digital communication and multimedia applications,146 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 5 of 35 strong security features are required for secure access to sensitive image data from cy-147 ber or unauthorized access. Traditional methods of encryption using Gaussian integers148 and Eisenstein integers have been shown to be useful for protecting the content in a dig-149 ital domain, but the cryptanalysis of such traditional methods has sometimes been too150 easy [5, 12–14]. It is further evident from the advances in attacks due to increasing so-151 phistication, including, among others, differential cryptanalysis, linear cryptanalysis, and152 statistical attacks, that the need for a more resilient cryptographic framework is all the153 more important [2–4]. Quaternion integers form a non-commutative extension of complex154 numbers and, as such, furnish more algebraic structure and more security for encryp-155 tion systems in a higher dimension. Relevant recent research [7, 9–11] has also pointed156 out quaternion algebra’s possibility to be employed in building cryptographic primitives,157 in particular, designing S-boxes and encrypting frameworks. Indeed, the employment of158 quaternion integers in cryptographic applications offers some unique advantages, such as159 increased diffusion and confusion properties, less algebraic complexity, and a larger key160 space that aids in combating different attacks [5, 13, 14]. As a result, encryption schemes161 based on Substitution Permutation Network (SPN) are found to be very effective for secure162 image encryption. SPN frameworks based on S-boxes over finite fields like GF(2n), elliptic163 curves or Gaussian integers, remain vulnerable to cryptanalysis for the reason that they164 have algebraic properties [12, 13]. This is a novel cryptographic primitive based on quater-165 nion integer-based S-boxes which augment the nonlinearity and differential uniformity of166 the encryption process by introducing quaternion integer-based S-boxes into the utilization167 of the SPN structure [5, 14]. The rationale behind this study is that a very secure multiple168 RGB image encryption system based on the mathematical strength of quaternion integers169 is to be developed. The proposed approach is to use quaternion-integer-based S-boxes to170 integrate the security of digital images against multiple attacks with good efficiency of171 computation [5, 13, 14]. In terms of multimedia security, this research adds an innovative172 cryptographic model in the form of combining algebraic developments and pragmatic en-173 cryption mechanisms to address the fast-emerging difficulties that digital data protection174 in modern communication systems faces.175 176 The goal of this research is to propose a new cryptographic framework, among whose177 building blocks are quaternion integers, which improve the security of conferences where178 several RGB images are being displayed at once. Another one of the key contributions179 is the formation of an original way to create n × n S-boxes based on quaternion inte-180 gers. In contrast to other S-box designs based on Gaussian or Eisenstein integers, elliptic181 curves or chaotic functions, the proposed method is algebraically distinct in that it uses182 the exceptional four-dimensional algebraic structure of quaternion integers. As for the183 generated S-boxes, the non-commutative nature of quaternion multiplication allows for184 much more nonlinear, differential uniform, and strict avalanche characteristics than can185 be obtained using finite field techniques, which makes it highly resistant to linear and dif-186 ferential cryptanalysis. Finally, the proposed framework uses these S-boxes as substitution187 and permutation elements of an SPN, with the aim of guaranteeing a high degree of con-188 fusion and diffusion properties to achieve secure multimedia encryption. The work makes189 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 6 of 35 another considerable contribution by introducing a fast multi-image encryption scheme190 which allows processing multiple RGB images simultaneously. The encryption scheme191 has been designed with strong security features and efficient computation, ideal for ap-192 plication in real time, such as secure cloud storage, medical imaging, video surveillance,193 etc. Statistical tests, entropy measurement, correlation analysis and differential attack194 resistance are rigorously performed on the proposed method, and it is shown to achieve195 superior performance in terms of security when compared with the existing techniques.196 In addition, this research points out the ability of quaternion integers to be used in the197 analogical cryptographic applications and lays a foundation for future studies of more198 high-dimensional algebraic structures, which can be used for encryption. The results lead199 us to conclude that the proposed system is practical and efficient, which helps to advance200 secure multimedia communication.201 2. Quaternion Integers202 By following [7–11], let H(R) be the Hamilton quaternion algebra over the real numbers203 R. It is a non-commutative but associative unital algebra if it satisfies the following204 conditions.205 • H(R) = {a0+a1i+a2j+a3k : ∀ai ∈ R} is a free R-module with basis {±1,±i,±j,±k}.206 • Element 1 is the multiplicative identity.207 • Operations on the basis elements ±1,±i,±j,±k are given in Figure. 1.208 Figure 1: Multiplication of basis elements The ring of quaternion H(Z) = {b0+b1i+b2j+b3k : for all b0, b1, b2, b3 ∈ Z} contained209 in H(R), where Z is the ring of integers. If q = b0+ b1i+ b2j+ b3k is a quaternion integer,210 then q̄ = b0−b1i−b2j−b3k is the quaternion conjugate of q. LetN(q) = qq̄ = b20+b21+b22+b23211 be the norm of q. A quaternion integer q has only two parts: one is the scalar part (S.P.)212 b0 and the other is the vector part (V.P.) b1i+b2j+b3k. In a quaternion, the commutative213 property of multiplication does not hold. It is possible only in the case of two vector parts214 of quaternion integers being parallel.215 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 7 of 35 2.1. Subring of the Quaternion Integer Ring [7, 11]216 Define H(K) as:217 H(K) = {a+ bU | a, b ∈ Z}, where U = i+ j + k. Hence, H(K) is a subring of the quaternion integer ring H(Z), and218 also the commutative property of multiplication holds H(K).219 2.2. Sum and Product of Two Quaternions [6]220 Let q1 = c0 + c1i+ c2j + c3k and q2 = d0 + d1i+ d2j + d3k be two quaternion integers.221 Then, their sum q1 + q2 and product q1q2 will also be quaternion integers as:222 q1 + q2 = (c0 + c1i+ c2j + c3k) + (d0 + d1i+ d2j + d3k) 223 = (c0 + d0) + (c1 + d1)i+ (c2 + d2)j + (c3 + d3)k = e0 + e1i+ e2j + e3k = q3. 224 q1q2 = (c0 + c1i+ c2j + c3k)(d0 + d1i+ d2j + d3k) = c0d0 + c0d1i+ c0d2j + c0d3k + c1d0i− c1d1 + c1d2k − c1d3j + c2d0j − c2d1k − c2d2 + c2d3i + c3d0k + c3d1j − c3d2i− c3d3 = (c0d0 − c1d1 − c2d2 − c3d3) + (c0d1 + c1d0 + c2d3 − c3d2)i + (c0d2 + c2d0 + c3d1 − c1d3)j + (c0d3 + c3d0 + c1d2 − c2d1)k = g0 + g1i+ g2j + g3k = q4. Theorem 1. [3, 11], the set of natural numbers for each odd rational prime p, there exists225 a prime δ ∈ H(Z) such that,226 N(δ) = p = δδ̄, in particular, p is not prime in H(Z).227 Theorem 2. [3, 11], let δ ∈ H(Z) be prime in H(Z) if and only if N(δ) is prime in Z.228 Definition 1. [3, 11], let H(K)δ be the residue class of H(K) modulo δ, where δ = a+bU .229 Then the modulo function is defined as:230 ϕ : H(K) = {a+ bU : a, b ∈ Z} → H(K)δ, 231 ϕ(q) = z mod δ = q − [ qδ̄ p ] δ, where z ∈ H(K)δ, and the brackets [ · ] denote rounding to the nearest integer. To perform232 quaternion integer (QI) rounding, the scalar part (S.P.) and the coefficient of the vector233 part (C.V.P.) must be independently rounded to the nearest integers.234 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 8 of 35 Definition 2. [3, 11], let β, ρ ∈ H(K)δ and define α = β − ρ = (b0 + b1i + b2j + b3k)235 mod δ. The quaternion Mannheim weight WQM (α) is defined as:236 WQM (α) = |b0|+ |b1|+ |b2|+ |b3|. The quaternion Mannheim distance dQM (ρ, β) between β and ρ is then given by:237 dQM (ρ, β) = WQM (α). Remark 1. [11], indeed, quaternion Mannheim weight WQM is metric.238 Theorem 3. [7], if gcd(a, b) = 1, then239 H(K)/⟨a+ b(i+ j + k)⟩ ∼= Za2+3b2 . Proposition 1. [7], let δk = ak + bk(i + j + k) be distinct primes in H(K), and let240 pk = Za2k+3b2k be distinct primes in Z, for k = 1, 2, 3, . . . ,m. If g is a generator of H(K)δk ,241 then242 g φ(pk) 2 ≡ −1 mod δk. Proposition 2. [7], let δ1 = a1 + b1(i + j + k) be a prime in H(K), and let p ∈ Za21+3b21 243 be a prime in Z. If H(K)δ is generated by g, then244 α φ(p) 2 ≡ −1 mod δ. Corollary 1. [7], let δ = a + b(i + j + k) be a quaternion prime in H(K), such that the245 norm N(δ) = p = a2 + 3b2 is a prime in Z. If H(K)δ is generated by α, then246 αφ(p) ≡ 1 mod δ. Remark 2. The group generated by ⟨α⟩ in the above Corollary is denoted by QR.247 3. Quaternion Integers based n× n S-boxes248 Substitution boxes (S-boxes) are essential components used in modern cryptography,249 introducing confusion in encryption algorithms to enhance their security. Traditionally,250 S-boxes are constructed using finite fields. However, recent studies reveal the potential251 of quaternion integers to design highly nonlinear and cryptographically resilient S-boxes.252 Quaternions, which generalize complex numbers into a four-dimensional non-commutative253 algebra, provide unique mathematical properties that offer increased resistance to crypt-254 analytic attacks. In the proposed method, the S-box is defined as a k × k matrix of255 quaternion integers. The quaternion algebraic structure is then employed to construct256 n × n (n ≤ k) S-boxes with desirable cryptographic properties such as high nonlinearity257 and low differential uniformity. Quaternion integer elements are systematically selected258 and integrated into a secure substitution layer with strong security and sound efficiency.259 The construction utilizes an optimization algorithm to enhance cryptographic strength.260 S-Box Construction Steps:261 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 9 of 35 (i) Based on definitions and theorems in Section II, a quaternion integer-based cyclic262 group, denoted as QR, is defined. This group is structured to have an order of p−1.263 (ii) The group QR is subjected to the following transformation and mapped to another264 quaternion group using a transformation function:265 g(xi) = 1 ax−1 i + b , where x−1 i is the multiplicative inverse of xi in QR, and a and b are quaternion266 integers. The expression ax−1 i + b must be a non-zero part of the quaternion residue267 class.268 (iii) The scalar and vector parts of the resulting quaternion elements are separated to269 form the output of the mapping function. These components are processed indepen-270 dently in the following steps.271 (iv) Apply modular reduction modulo 2n to each component (scalar and vector), pro-272 ducing two separate sets of order 2n, denoted as QR1 and QR2 .273 (v) Another transformation is applied to both sets QR1 and QR2 using the function:274 h(xi) = (cxi + d) mod 2n, where c and d are constants carefully selected to ensure the cryptographic properties275 such as high nonlinearity and low differential uniformity are met.276 (vi) A secure encryption process is then performed to generate a pair of S-boxes, denoted277 Ss and Sv, using quaternion operations. These S-boxes serve as the core nonlinear278 components in cryptographic systems to resist various attacks.279 Significance of Quaternion-Based S-Boxes: The use of quaternion integers in the280 construction of S-boxes provides several advantages that can enhance both the security281 and efficiency of the substitution layers in block ciphers. Unlike traditional finite field-282 based S-boxes, quaternion-based S-boxes leverage the non-commutative algebraic structure283 of quaternions to introduce increased complexity and resilience to attacks. Due to their284 four-dimensional nature, quaternions offer a richer mathematical framework, improving285 nonlinearity — a critical attribute against differential and linear cryptanalysis. Quater-286 nion integer-based S-boxes exhibit a strong avalanche effect, whereby small changes in287 input cause substantial changes in output, thereby enhancing security. Furthermore, such288 S-boxes demonstrate low differential uniformity, making differential attacks ineffective, and289 maintain bijectivity (one-to-one mapping), which is essential for secure substitution. More-290 over, these S-boxes are efficient and scalable, making them ideal for modern cryptographic291 applications, including lightweight encryption schemes for resource-constrained environ-292 ments such as IoT devices and embedded systems. Consequently, quaternion integer-based293 S-boxes emerge as robust and promising alternatives to traditional designs, offering en-294 hanced protection against emerging cryptographic threats.295 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 10 of 35 4. 8× 8 S-boxes over Quaternion Integers and Analysis296 From quaternion algebra transformations, it is possible to construct 8×8 S-boxes with297 scalar and vector parts independently processed. Suppose the quaternion prime298 δ = 80 + 31i+ 31j + 31k, with norm299 N(δ) = 9283, being prime in Z, and the generator300 α = 2 + 19i+ 19j + 19k. Two S-boxes are constructed distinctively as follows:301 (i) Scalar Parts S-box Ss: This S-box Ss is designed by running all the steps as302 described above on the real (scalar) part of quaternions. It is mapped using the303 ‘inverse affine’ transformation, modular arithmetic, and the transformation function304 h(xi) applied to the input values.305 (ii) Vector Parts S-box Sv: This is an S-box created for the vector (pure quaternion)306 part, based on the transformation of the i, j, k parts of quaternion elements to make307 it resistant to differential attacks.308 By independently designing Ss and Sv, the resulting S-boxes, the vulnerability to crypt-309 analysis is reduced in both cryptographic applications, secure image encryption, and block310 ciphers. This is achieved by utilizing the multidimensional algebraic properties of quater-311 nions. Tables 1 and 2 contain the completed S-box values.312 4.1. Nonlinearity313 S-box nonlinearity (NL) represents a fundamental element of cryptographic strength314 because S-boxes use quaternion integer parts to generate separate nonlinearity functions315 between scalar and vector components. The S-boxes benefit from quaternion algebra to316 achieve their increased complexity since this mathematical framework exploits the multidi-317 mensional nature of the structure. The scalar S-box performs computations on quaternion318 element real parts through modular transformations and permutation mappings along with319 affine operations, thereby establishing high levels of nonlinearity that counter linear ap-320 proximations. The vector S-box uses modular exponentiation and rotation-based diffusion321 together with non-affine substitutions as individual transformations for the pure quater-322 nion components to achieve strong resistance to differential cryptanalysis. The evaluation323 of S-box nonlinearity depends on calculating their Hamming distances from affine functions324 to ensure maximum unpredictability in output variations from small input variations. The325 quaternion structure protects system security through the distribution of mathematical op-326 erations among multiple parts, which reduces statistical correlations, making it practically327 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 11 of 35 Table 1: Ss over the scalar part of QI 188 79 28 130 44 234 176 146 215 184 114 17 162 1 199 158 57 71 34 12 212 156 62 179 20 169 124 159 66 196 222 175 244 91 206 132 144 250 116 143 123 96 54 140 217 127 76 174 29 186 183 150 235 22 82 3 161 239 31 5 241 218 48 190 232 118 152 247 119 171 77 134 194 107 133 255 83 111 170 195 10 126 185 115 14 21 226 105 84 245 238 75 47 202 219 137 92 197 85 149 100 253 249 33 55 50 49 164 192 246 43 18 240 108 32 172 64 102 167 237 207 122 68 81 90 69 251 145 16 198 252 181 139 89 182 224 168 151 13 153 4 228 67 242 51 216 128 204 208 9 8 201 135 87 103 220 11 229 56 173 88 97 189 113 209 6 41 138 142 36 205 60 15 160 30 40 177 52 211 141 210 225 166 221 65 112 248 125 178 78 165 59 24 98 73 148 203 136 101 35 131 121 45 42 7 58 109 155 191 214 93 104 2 46 213 80 70 117 200 227 61 180 254 147 231 129 243 187 38 154 230 106 72 99 94 120 19 193 25 37 86 157 26 63 74 0 23 39 27 53 223 110 95 233 163 236 impossible to perform linear approximations. These S-boxes achieve strong confusion and328 diffusion capabilities through independent scalar and vector part processing, which pro-329 tects against attacks including linear cryptanalysis, differential cryptanalysis and algebraic330 attacks. The complex encryption system’s strength increases through the combination of331 quaternion integer algebraic characteristics in substitution processes. The distinct nonlin-332 earity features of quaternion-based S-boxes provide an enhanced cryptographic approach333 for developing block ciphers along with implementing secure image encryption systems334 and future cryptographic protocol designs [3, 5, 12, 17]. The research for nonlinearity335 characteristics and relevant literature review appears in the proposed results in Table 3 as336 well as Table 4.337 4.2. Bit Independent Criteria338 It is crucial for enhancing resistance against differential and linear cryptanalysis that339 the S-boxes over quaternion integers are separately constructed according to the Bit Inde-340 pendent Criteria (BIC) nonlinearity of the scalar and vector parts. The more independent341 the change of each output bit with respect to changes in input is, the more this criterion342 is satisfied, and there should be no predictable pattern of any bit. By applying modular343 transformation and affine mappings to the real part of quaternion elements, the scalar S-344 box is designed such that each output bit is statistically independent. On the other hand,345 the vector S box processes the pure quaternion components separately using different mod-346 ular exponentiation and rotation-based transformations to increase the unpredictability347 of the output bits. We compute the correlation between pairs of output bits and find348 that changes in one bit do not affect the others in a way that is predictable. In crypto-349 graphic applications this bit independence property is critical, since the presence of such350 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 12 of 35 Table 2: Sv over the scalar part of QI 60 207 156 2 172 106 48 18 87 56 242 145 34 129 71 30 185 199 162 140 84 28 190 51 148 41 252 31 194 68 94 47 116 219 78 4 16 122 244 15 251 224 182 12 89 255 204 46 157 58 55 22 107 150 210 131 33 111 159 133 113 90 176 62 104 246 24 119 247 43 205 6 66 235 5 127 211 239 42 67 138 254 57 243 142 149 98 233 212 117 110 203 175 74 91 9 220 69 213 21 228 125 121 161 183 178 177 36 64 118 171 146 112 236 160 44 192 230 39 109 79 250 196 209 218 197 123 17 144 70 124 53 11 217 54 96 40 23 141 25 132 100 195 114 179 88 0 76 80 137 136 73 7 215 231 92 139 101 184 45 216 225 61 241 81 134 169 10 14 164 77 188 143 32 158 168 49 180 83 13 82 97 38 93 193 240 120 253 50 206 37 187 152 226 201 20 75 8 229 163 3 249 173 170 135 186 237 27 63 86 221 232 130 174 85 208 198 245 72 99 189 52 126 19 103 1 115 59 166 26 102 234 200 227 222 248 147 65 153 165 214 29 154 191 202 128 151 167 155 181 95 238 223 105 35 108 Table 3: NL of the S-box functions S-boxes g1 g2 g3 g4 g5 g6 g7 g8 Ss 108.00 108.00 106.00 108.00 108.00 104.00 106.00 108.00 Sv 108.00 108.00 106.00 108.00 108.00 104.00 106.00 108.00 an S-box renders the linear correlations or differential trails attacked useless. Quaternion-351 based S-boxes, due to independent scalar and vector processes of the scalar and vector352 parts, spread bit changes over several dimensions, and their complexity and security are353 further increased. Because quaternions are inherently multidimensional, the BIC of the354 patterns remains very dispersed among bits, rendering algebraic and statistical attacks in-355 effective. The properties are such that quaternion-based S-boxes are indeed highly suited356 for cryptographic applications like secure encryption, block cipher design, and advanced357 data protection mechanisms [12, 13, 17]. Part of the proposed research of BIC is shown358 in Tables 5, 6, and 7, which present the results and comparative analysis of the results359 Table 4: NL of the S-box functions S-boxes Schemes Nonlinearity Ss Proposed (QI) 107.00 Sv Proposed (QI) 107.00 [12] Eisenstein Integers 106.75 [17] Elliptic Curve 104.00 [3] Chaotic Map 104.70 [5] Gaussian Integers 106.50 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 13 of 35 found in existing literature.360 Table 5: BIC of Ss 0.0 0.5371 0.4785 0.4980 0.5020 0.4922 0.5000 0.5137 0.5371 0.0 0.4844 0.5332 0.5020 0.5156 0.4902 0.5000 0.4785 0.4844 0.0 0.4824 0.4883 0.4922 0.5137 0.4902 0.4980 0.5332 0.4824 0.0 0.4805 0.4863 0.5117 0.4980 0.5020 0.5020 0.4883 0.4805 0.0 0.5039 0.5020 0.5059 0.4922 0.5156 0.4922 0.4863 0.5039 0.0 0.4824 0.4980 0.5000 0.4902 0.5137 0.5117 0.5020 0.4824 0.0 0.5000 0.5137 0.5000 0.4902 0.4980 0.5059 0.4980 0.5000 0.0 Table 6: BIC of Sv 0.0 0.5371 0.4785 0.4980 0.5020 0.4922 0.5000 0.5137 0.5371 0.0 0.4844 0.5332 0.5020 0.5156 0.4902 0.5000 0.4785 0.4844 0.0 0.4824 0.4883 0.4922 0.5137 0.4902 0.4980 0.5332 0.4824 0.0 0.4805 0.4863 0.5117 0.4980 0.5020 0.5020 0.4883 0.4805 0.0 0.5039 0.5020 0.5059 0.4922 0.5156 0.4922 0.4863 0.5039 0.0 0.4824 0.4980 0.5000 0.4902 0.5137 0.5117 0.5020 0.4824 0.0 0.5000 0.5137 0.5000 0.4902 0.4980 0.5059 0.4980 0.5000 0.0 Table 7: BIC of Sv S-boxes Maximum Minimum Average Ss 0.609 0.391 0.499 Sv 0.609 0.391 0.499 [12] 0.625 0.391 0.502 [17] 0.543 0.473 0.503 [13] 0.609 0.375 0.505 4.3. Strict Avalanche Criterion361 The strict avalanche criterion of S-boxes over quaternion integers is a key property362 for high diffusion and cryptographic attack resistance. For the S-box to be used in SAC,363 the change from the input, as tiny as flipping a single bit, should lead to about a 50%364 change of the output bits; i.e., it should be highly unpredictable. The real part of quater-365 nion elements is applied to the scalar S-box in quaternion-based scale S-box design by366 using modular transformations and affine mapping, so that the scalar S-box retains strong367 avalanche property in the scalar domain. On the contrary, the vector S-box works on the368 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 14 of 35 independent imagination component separately, and doing so independently of its trans-369 formations, such as modular exponentiation, rotation-based diffusion, and non-affine per-370 mutations, in order to maximize the number of bit transitions induced from input changes.371 The quaternion structure, however, develops an inherent way of enhancing SAC compli-372 ance due to multidimensional transformations encasing the effects of each single bit flip373 over both scalar and vector components, resulting in a much greater global flow of outputs.374 This property greatly contributes to security since it makes it impossible for attackers to375 establish predictable relationships between input and output values. Quaternion-based376 cryptographic systems are said to meet SAC requirements, so that they ensure the scalar377 and vector S-boxes are resistant to differential and linear cryptanalysis and therefore are378 appropriate cryptographic systems for use in encryption, block ciphers, and other types379 of advanced cryptographic systems [12, 13, 17]. Tables 8, 9 and 10 compare the proposed380 results to existing literature via SAC.381 Table 8: SAC of Ss 0.53125 0.546875 0.5 0.5625 0.484375 0.546875 0.46875 0.515625 0.46875 0.4375 0.515625 0.515625 0.484375 0.53125 0.46875 0.546875 0.546875 0.4375 0.515625 0.46875 0.59375 0.484375 0.4375 0.5 0.53125 0.484375 0.515625 0.53125 0.5 0.546875 0.46875 0.5 0.515625 0.421875 0.5 0.5625 0.46875 0.515625 0.46875 0.5 0.515625 0.546875 0.5 0.5 0.546875 0.40625 0.484375 0.5 0.5625 0.515625 0.5625 0.5 0.484375 0.453125 0.5 0.53125 0.484375 0.53125 0.546875 0.421875 0.53125 0.53125 0.453125 0.46875 Table 9: SAC of Sv 0.53125 0.546875 0.5 0.5625 0.484375 0.546875 0.46875 0.515625 0.46875 0.4375 0.515625 0.515625 0.484375 0.53125 0.46875 0.546875 0.546875 0.4375 0.515625 0.46875 0.59375 0.484375 0.4375 0.5 0.53125 0.484375 0.515625 0.53125 0.5 0.546875 0.46875 0.5 0.515625 0.421875 0.5 0.5625 0.46875 0.515625 0.46875 0.5 0.515625 0.546875 0.5 0.5 0.546875 0.40625 0.484375 0.5 0.5625 0.515625 0.5625 0.5 0.484375 0.453125 0.5 0.53125 0.484375 0.53125 0.546875 0.421875 0.53125 0.53125 0.453125 0.46875 4.4. Linear Approximation Probability382 Linear Approximation Probability (LAP) of S-boxes over quaternion integers over383 scalar and vector domains separately is an important measure to resist linear cryptanalysis384 such that the linear relation between input and output bits is not easily exploitable.385 Another thing is the efficiency of the attacks — the lower the LAP value, the higher the386 probability that no linear equation will fit the S-box accurately; therefore, the attacks387 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 15 of 35 Table 10: SAC Comparison S-boxes Maximum Minimum Average Ss 0.594 0.406 0.503 Sv 0.594 0.406 0.503 [12] 0.578 0.375 0.502 [17] 0.610 0.422 0.516 [13] 0.594 0.406 0.504 remain ineffectual. In quaternion-based S-box construction, the scalar S-box is designed388 by doing modular arithmetic and doing affine transformation on the real part of the389 quaternion so that the correlations between input and output are still nonlinear. To390 further reduce the linear dependencies, the imaginary components are transformed through391 independent transformations like modular exponentiation and rotation-based diffusion, as392 well as non-affine mappings using vector S- boxes. The nonlinearity of S-boxes is naturally393 improved using a quaternion structure, where the sweeping transformations over multiple394 dimensions increase the degree of randomness in the linearity of the approximation. An395 overall cryptographic system is ensured of stronger security through the low LAP of the396 scalar and vector S-boxes, which helps resist the linear cryptanalysis. That being said,397 S-boxes based on quaternions have a high suitability in encryption schemes, block ciphers,398 and other cryptographic applications that utilize those characteristics to keep the data399 safe [12, 13, 17]. Table 11 is the comparison between the proposed work and existing400 literature regarding the LAP.401 Table 11: LAP Comparison S-boxes LAP Ss 0.141 Sv 0.141 [12] 0.133 [17] 0.148 [13] 0.133 4.5. Differential Approximation Probability402 Differential Approximation Probability (DAP) of S-boxes over quaternion integers is403 a key security parameter that characterizes their resistance against differential cryptanal-404 ysis by measuring the probability of occurring predictable output differences for which405 one determines some specific input differences. The strong diffusion required of the S-406 box is guaranteed by a lower DAP value, so that the transformation process could be407 relatively hard to trace for the attackers. In quaternion-based S-box design, the scalar408 S-box is built by modular arithmetic and affine mappings on the real component so as409 the input changes by a small bit, the output turns out to be very unpredictable. Just410 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 16 of 35 as the vector S box processes the imaginary components, it uses independent transforma-411 tions like modular exponentiation, rotation-based diffusion, and non-affine permutations412 and applies those extremely unpredictable differential transitions. The quaternion alge-413 bra naturally improves the diffusion properties of S-boxes by distributing transformation414 in multi-dimensional space in such a way that differences in the input tokens propagate415 through a very complex and highly nonlinear process. Quaternion-based cryptographic416 systems independently optimize the scalar as well as vector parts to incorporate mini-417 mal DAP values and hence provide superior resistance against differential attacks, making418 them ideal for use in the encryption algorithms, block ciphers, and secure communication419 algorithms that need strong confusion and diffusion to guarantee data security [12, 14, 17].420 Literature comparison through Tables 12, 13, and 14 is done with the proposed results.421 Table 12: DAP of Ss 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03906 0.03125 0.03906 0.02344 0.03125 0.03125 0.03125 0.01562 0.02344 0.02344 0.02344 0.02344 0.02344 0.01562 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.03125 0.03125 0.03125 0.02344 0.03125 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.03906 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.03906 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.03125 0.03125 0.02344 0.01562 0.02344 0.03125 0.03125 0.02344 0.02344 0.04688 0.02344 0.03125 0.03906 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.01562 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.04688 0.03125 0.02344 0.03125 0.03125 0.02344 0.02344 0.03125 0.02344 0.01562 0.02344 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.03125 0.02344 0.02344 0.03906 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.03906 0.02344 0.03125 0.03125 0.02344 0.02344 0.03125 0.02344 0.03906 0.03125 0.02344 0.03125 0.03125 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.03125 0.03125 0.02344 0.02344 0.03125 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.02344 0.03906 0.03125 0.03125 0.03125 0.02344 0.03125 0.03906 0.02344 0.03125 0.03125 0.03125 0.02344 0.02344 0.03125 0.03906 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.03906 0.02344 0.02344 Table 13: DAP of Sv 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03906 0.03125 0.03906 0.02344 0.03125 0.03125 0.03125 0.01562 0.02344 0.02344 0.02344 0.02344 0.02344 0.01562 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.03125 0.03125 0.03125 0.02344 0.03125 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.03906 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.03906 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.03125 0.03125 0.02344 0.01562 0.02344 0.03125 0.03125 0.02344 0.02344 0.04688 0.02344 0.03125 0.03906 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.01562 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.04688 0.03125 0.02344 0.03125 0.03125 0.02344 0.02344 0.03125 0.02344 0.01562 0.02344 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.03125 0.02344 0.02344 0.03906 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.03125 0.02344 0.03125 0.03125 0.03125 0.02344 0.02344 0.02344 0.03125 0.02344 0.03906 0.02344 0.03125 0.03125 0.02344 0.02344 0.03125 0.02344 0.03906 0.03125 0.02344 0.03125 0.03125 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.03125 0.03125 0.02344 0.02344 0.03125 0.03125 0.02344 0.03125 0.02344 0.02344 0.02344 0.03125 0.03125 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.02344 0.03125 0.02344 0.02344 0.03906 0.03125 0.03125 0.03125 0.02344 0.03125 0.03906 0.02344 0.03125 0.03125 0.03125 0.02344 0.02344 0.03125 0.03906 0.02344 0.02344 0.02344 0.02344 0.02344 0.02344 0.03125 0.03906 0.02344 0.02344 Table 14: DAP Comparison S-boxes DAP Ss 0.047 Sv 0.047 [12] 0.039 [17] 0.047 [14] 0.039 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 17 of 35 4.6. Fixed Points422 A fixed point of a function f is an element x in the domain such that f(x) = x.423 This may provide an exploitable foundation for cryptographic systems, allowing attack-424 ers to exploit predictable mappings. In quaternion-based S-Box implementation, where425 scalar and vector parts are separately processed, certain careful choices of modular trans-426 formation and affine mapping result in minimal numbers of fixed-point occurrences. A427 nonlinear transformation of the scalar S box derived from the real part of quaternion inte-428 gers is performed to vastly diversify the outputs. Just like the vector S-box dealing with429 the imaginary components, it applies independent modular exponentiation and rotation-430 based transformations to break the direct input-to-output relationships that may exist.431 Eliminating or reducing fixed points by introducing quaternion-based S-boxes, security432 can be improved in the sense that they are more resistant to algebraic attacks and can be433 applied elsewhere in encryption schemes and secure communication systems [4, 15]. The434 fixed point’s comparison is given in Table 15.435 4.7. Differential and Linear Branch Number436 As was stated above, the branch number of an S-box plays a crucial factor in measur-437 ing its effectiveness in spreading input differences over the output and thus its efficiency438 against differential and linear cryptanalysis. Increasing differential branch number (DBN)439 guarantees a small input difference produces large output differences; thus, differential440 attacks impose less damage. Likewise, a high linear branch number (LBN) prevents linear441 approximation attacks by making it difficult for attackers to have a good statistical corre-442 lation between input and output values. In quaternion-based S-box design, scalar S-box443 maximizes these branch numbers in modulo arithmetic and affine transformations, and444 vector S-box improves it in the same component mapping. Being inherently multidimen-445 sional, quaternion integers provide superior confusion and diffusion as compared to usual446 transformations that would result in even more complex complexity of these transforma-447 tions inherently, which further enhances the cryptographic security [4, 15]. LBN and DBN448 comparison is given in Table 15.449 4.8. Linear Structure450 It is the idea that when linear relations exist between input and output bits, they can451 be used for the application of linear cryptanalysis against the encryption system. In a well-452 designed S-box, the substitution process should be highly nonlinear and unpredictable, and453 there should be a minimum linear structure. Non-affine transformations, modular expo-454 nentiation and quaternion rotations on the multidimensional quaternion space are applied455 to obtain quaternion-based S-boxes where scalar and vector parts are generated separately456 under quaternion linear transformations without linear dependencies. The scalar S-box457 is there to ensure the real number transformations make inimitable patterns, and the458 vector S-box, which concerns the imaginary parts, uses independent transformations to459 further boost the non-linearity. Quaternions-based S-boxes minimize computational cost460 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 18 of 35 and minimize linear structure, resulting in high resistance to linear cryptanalysis, and are461 thus ideal for secure encryption protocols, block ciphers and other cryptographic appli-462 cations needing strong nonlinearity [4, 15]. The linear structure comparison is given in463 Table 15.464 Table 15: Comparative analysis of DBN, LBN, FP, and LS S-boxes DBN LBN FP LS Ss 1 1 1 0 Sv 1 1 1 0 [15] 2 2 2 0 [4] 1 2 2 0 5. Multiple RGB Image Algorithm over Quaternion Integers465 (i) Input Preparation: First, the RGB images which need to be protected are im-466 ported, and the encryption process starts. Images stored in the RGB color model467 have each pixel consisting of a combination of red, green and blue values. In order to468 achieve encryption, the pixel values of the image channels are mapped to elements469 of the quaternion integer set H(K)δ. Specifically, this mapping ensures that the470 encryption scheme is conducted in the quaternion domain with the dip advantage of471 the quaternion algebraic structure to provide enhanced security.472 (ii) S-Box Construction: Using quaternion integer residue classes H(K)δ, two 8 × 8473 S-boxes are constructed Ss and Sv. The introduction of nonlinearity and complexity474 with these structures is important, as they enormously strengthen the encryption.475 The use of quaternion arithmetic has a unique set of properties that are more re-476 sistant to cryptographic breaking attacks than what is provided using integer-based477 approaches.478 (iii) SPN Framework: The encryption scheme is developed in the SPN framework,479 and the security of multiple RGB images is improved by the following three steps:480 Substitution Step: Of the stages, the first is the Substitution Step, where the con-481 fusion is introduced using S-box Ss. Then substitute every one of the Red, Green,482 and Blue channel pixels accordingly by a substitution operation which replaces the483 input values with the corresponding outputs from Ss. Thus, quaternion-integer-484 based S-boxes allow high nonlinearity, rendering it much more difficult to carry out485 a study, particularly on linear and differential attacks. Permutation Step: The486 S-box Sv is used in the second stage to perform a permutation step, which improves487 the diffusion properties by redistributing transformed pixel values. The reordering488 of each RGB channel is independent of each other, eliminating substitution-induced489 correlations for a reduced chance for pattern detection from attackers. This process490 is enhanced by adding the quaternion integer domain, which increases the number491 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 19 of 35 structure to a more complex number and disrupts statistical relations further. Fi-492 nal XOR Operation: The generation of S′-box depends on performing an XOR493 operation between Ss and Sv which marks the final transformation. Security reaches494 its highest mark in the last step, which introduces additional randomization. The495 pixel values in digital images experience an XOR operation using rendering; it is496 impractical for hackers to perform keyless reconstruction of transformations. The497 decryption process remains possible only through the precise encryption key that498 was originally used in the process.499 (iv) Final Transformation: Every RGB channel receives a transformation through500 the SPN process which optimizes confusion and diffusion across the complete image.501 The purpose of this security-enhancing step is to protect against both differential and502 statistical attacks, thus creating an encrypted image with strong resistance against503 unauthorized decryption attempts.504 (v) Output the Encrypted Image:: The implementation of all encryption methods505 produces an encrypted RGB image which results from merging the modified red,506 green and blue color channels. The encryption algorithm runs for all RGB images507 contained in the dataset to deliver complete information security.508 (vi) Security Enhancement and Final Output: A cryptographic process results in509 encrypted images that present high levels of randomness through increased entropy510 along with low pixel correlation alongside intense resilience to cryptographic anal-511 ysis. Through quaternion integer-based encryption the framework delivers secure512 multimedia transmission since encrypted images become significantly unpredictable513 to both modern cryptanalysis methods and traditional cryptanalytic attacks.514 Significance of RGB Multiple Color Image Encryption: Secure multimedia data515 transmission benefits substantially from the use of quaternion integers to encrypt multi-516 ple RGB images. Modern cryptographic attacks frequently break traditional encryption517 methods based on real and complex numbers because these methods lack enough algebraic518 complexity. The security benefits from quaternion integer use stem from their elevated519 dimensional structure along with their non-commutative properties, which cause brute-520 force attacks, linear approximations and differential cryptanalysis to become increasingly521 difficult to perform. The main benefit of using quaternion encryption is its channel in-522 dependence processing capability, which ensures secure image integrity by maintaining523 dependencies across color channels and providing strong diffusion and confusion capa-524 bilities. Quaternion residue classes integrated with substitution-permutation networks525 (SPN) adopt mathematical methods for distributing pixel data that make them resilient526 against statistical attacks. Nonlinearities strengthen due to the construction of secure527 S-boxes based on quaternion integer residue classes because these results help protect528 against cryptographic weaknesses. Quaternions enable efficient implementation of secure529 transformations that produce encrypted images with high entropy values and reduced cor-530 relation along with strong dependency to keys. The encryption technique delivers excep-531 tional benefits for secure image transfer and cloud backup alongside defence needs because532 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 20 of 35 it maintains highly confidential data while resisting attacks effectively. This encryption533 framework takes advantage of quaternion integers’ distinct algebraic properties to develop534 a superior encryption system when compared to classic approaches, thus delivering better535 security and computation speed to actual multimedia encryption operations.536 Sections 3 and 4 S-box construction joins the production process with multiple RGB image537 encryption methods as described in Section 5 according to Figure 2.538 Figure 2: Flowchart of proposed study 6. Applications of Multiple RGB Image Encryption over Quaternion539 Integers540 Multiple RGB image encryption over quaternion integers is a very powerful technique541 for encrypting the digital images in a secure way by utilizing the multidimensional prop-542 erties of the quaternions. Quaternions are four-dimensional, and quaternion-based en-543 cryption operates over the quaternion system, which means scalar and three imaginary544 components. The increase in complexity and unpredictability of the encryption process is545 achieved by means of this higher-dimensional representation which is capable of complex546 transformation. Using this methodology, each of the RGB images is separated into their547 color channels, where they are then converted into quaternion space and processed with548 encryption using substitution-permutation networks (SPN), modular arithmetic and affine549 transformations, respectively, on the scalar and vector components. This involves strong550 diffusion and confusion, meaning that even a very modest change of the original image551 leads to a very different output in the encrypted version. Quaternion multiplication and552 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 21 of 35 rotation functions allow for much more sensitivity of the system to keys, and the system is553 thus very resistant to brute force and statistical attacks. With this technique, the secure554 encryption and transmission of multiple RGB images while resisting cryptography attacks555 can be easily achieved; hence, this is a good technique for secure image communication,556 cloud saving, and multimedia security applications [5, 16, 21, 34]. Figure 3 shows two557 original multiple RGB images I1, and I2 alongside their encrypted versions. Figure 3: Quaternion integers-based multiple original and encrypted RGB images 558 6.1. Histogram Analysis (HA)559 Histogram analysis is a vital method of checking the security and performance of more560 than one RBG image encryption utilizing quaternion integers. This analyzes the distri-561 bution of pixel intensity values in encrypted images to determine whether the encryption562 process indeed covers up all the statistical properties of the original images. In a well-563 encrypted image both the histogram and the power spectrum should look uniform (homo-564 geneously distributed across the entire intensity/density range); this blocks any detectable565 patterns for attackers to exploit. If we encrypt the RGB images that are in the form of566 quaternion integers using such an encryption algorithm, the encryption algorithm trans-567 forms the scalar and vector components separately based on nonlinear operations such as568 substitution, permutation, and quaternion multiplication. By placing constraints on indi-569 vidual components of a color plane of an image, this further strengthens the security of the570 encrypted image such that each color channel undergoes independent transformations that571 are still correlated. The histograms of the original and encrypted images analyzed show572 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 22 of 35 that the proposed quaternion-based encryption breaks the pixel correlations, hence pro-573 ducing histograms largely similar to signatures of randomness. This randomness greatly574 limited the likelihood of a statistical attack based on the encrypted image since the attack-575 ers cannot learn any meaningful information from the encrypted image. This encryption576 scheme is proven effective in that the histogram of the encrypted image is entirely devoid577 of any resemblance to that of the original image and is strong against frequency-based578 cryptanalysis; hence, the images are kept confidential [5, 16, 21]. Figure 4 is the multiple579 original and encrypted RGB image histogram analysis.580 Figure 4: Histogram analysis of original and encrypted images I1&I2 6.2. NPCR581 In regards to multiple RGB image encryption over quaternion integers, we have a582 metric of key interest: the Number of Pixels Change Rate (NPCR), which measures how583 sensitive an encryption algorithm is to small changes in the plaintext image. The NPCR584 measures the percentage of pixels that are moved (changed) in the encrypted image to585 only one changed pixel in the original image. A higher value of NPCR indicates that586 the encryption process spreads minor changes over the whole encrypted image, so the587 changes are resistant to attacks and cannot be used to extract details from encrypted588 images. In quaternion-based encryption, where an RGB image is mapped to quaternion589 space and processed independently on scalar and vector parts, a small modification to590 the input causes a large alteration in the encrypted output. Quaternion multiplication,591 rotation-based transformations, and substitution permutation networks (SPN) are used592 to guarantee even a very small change in any one pixel will propagate unintelligibly into593 all three color channels. Therefore, an ideal quaternion-based encryption scheme achieves594 NPCR near to 99%, indicating that the encryption method gives a high degree of random-595 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 23 of 35 ness and unpredictability, making it very hard to extract meaningful info from encrypted596 pictures for the assailants [5, 16, 21, 34]. The NPCR results are in Table 16.597 6.3. UACI598 The Unified Average Changing Intensity (UACI) is another important metric used to599 assess the use of the image encryption algorithm to measure the average intensity difference600 between the original and the encrypted images. Higher UACI values quantify the impact601 of small changes in the plaintext image on the encrypted image, i.e., the stronger the602 diffusion properties. For the encryption over quaternion integers in multiple RGB images,603 UACI is used to evaluate how efficiently the encryption spoils the overall pixel intensity604 distribution in different color channels. As quaternion-based encryption encrypts the scalar605 and vector components of an image independently and applies modular arithmetic, affine606 mappings, and quaternion rotations to the transformed form independent of each other,607 the slight changes in the input will have a large variation in pixel intensity after encryption.608 Using this enhanced diffusion mechanism, attackers are prevented from building statistical609 correlations between the encrypted and unencrypted images for security. Typically, an610 optimal quaternion-based encryption scheme achieves a high UACI value, indicating that611 the mean of change across the encrypted image is sufficiently high with substantial change612 in pixel intensity, which is the most important factor in resisting statistical and differential613 attacks [5, 16, 21, 34]. The UACI results are in Table 16.614 Table 16: NPCR and UACI analysis NPCR UACI Images Red Green Blue Red Green Blue Image I1 0.9962 0.9962 0.9961 0.2999 0.3145 0.3185 Image I2 0.9960 0.9961 0.9963 0.2956 0.3094 0.3112 [16] 0.9960 0.9961 0.9961 0.3347 0.3347 0.3346 [21] 0.9969 0.9969 0.9966 0.3367 0.3332 0.3367 [34] 0.9961 0.9961 0.9961 0.3544 0.3177 0.3419 [5] 0.9959 0.9964 0.9962 0.3269 0.3037 0.2762 6.4. Maximum Deviation615 Maximum deviation analysis is an important statistical measure for the modelling616 and evaluation of the randomness and effectiveness of the encryption of quaternion inte-617 gers into multiple RGB images. It quantifies the largest absolute difference between the618 pixel intensity distributions of the original and encrypted images and gives insight into619 how well the encryption algorithm disrupts the structural properties of the input data.620 The larger the maximum deviation value, the better the encryption scheme, as it im-621 plies that the encrypted image appears very unpredictable and significantly distinguishes622 from the original. Maximum deviation analysis is used to validate the diffusion capability623 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 24 of 35 of quaternion-based encryption, and the argument is that where RGB images are trans-624 formed by distinct transformations on the scalar and vector parts of quaternion space,625 maximum deviation analysis validates the algorithm’s diffusion capability. By application626 of quaternion multiplication, affine transformation, and, of course, nonlinear operations,627 the smallest fluctuation in pixel value is propagated extensively across all the color chan-628 nels and makes intensity distribution drastically different. Researchers also analyze the629 maximum deviation between histograms of the original and encryption images to verify630 that the proposed encryption scheme successfully removes the pattern and is not vulner-631 able to statistical attacks. The maximum deviation values obtained by quaternion-based632 encryption signify its robustness to provide secure transmission and storage of many RGB633 images against crypto threats [5, 34]. Table 17 provides the results obtained from MD634 testing.635 6.5. Irregular Deviation636 As an important statistical measuring method, irregular deviation of multiple RGB637 image encryption over quaternion integers is carried out. This analysis checks whether638 the histograms of the encrypted images have been regularized to an extent comparable639 to that of the histogram between the histogram of the original and encrypted images by640 the encryption algorithm and verifies that such patterns may appear in the previous im-641 ages. The irregular deviation value is a high value which implies that the encrypted image642 has some randomness, and thus attacks cannot guess anything about the image due to643 randomness. In the encryption process of quaternion-based encryption, the RGB images644 mapped in quaternion space are subjected to independent transformations on scalar and645 vector components, which disrupts pixel intensity distributions of all color channels. To646 achieve said variation, quaternion multiplication, nonlinear transformations and permu-647 tation substitution operations are used. By inspecting the histograms of the plaintext648 and ciphertext images with regard to the irregular deviation, it is shown that quaternion649 encryption has a very high entropy. The encryption scheme thus has an additional level of650 randomness that prevents statistical attacks to secure transmission and storage of multiple651 RGB images in cryptographic applications [5, 34]. The results regarding ID are presented652 in Table 17.653 Table 17: MD and ID analysis NPCR UACI Images Red Green Blue Red Green Blue Image I1 Encrypted 52021 61841 61742 38097 37989 37924 Image I2 Encrypted 61424 62086 52113 38171 37937 38159 [34] 53397 48329 53529 29231 25127 28374 [5] 60210 47069 62218 26266 19443 27027 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 25 of 35 6.6. Correlation Analysis654 The term evaluation metric includes correlation analysis, horizontal, vertical and di-655 agonal correlation in order to measure the average security of utilizing multiple RGB656 image encryption with quaternion integers. In an unencrypted image, neighbouring pixels657 are strongly correlated because natural images are full of neighbouring pixels that have658 similar intensity values. Nevertheless, any good encryption scheme should significantly659 decrease these correlations so as to render the encrypted image look like nothing but a660 random noise. Through quaternion-based encryption techniques, RG images are converted661 to quaternion space, and encryption is done independently on scalar and vector compo-662 nents. To ensure that neighbouring pixels in horizontal, vertical, and diagonal directions663 all receive individual and impossible-to-predict transformations, the process of encryption664 involves non-linear transformations, quaternion multiplication, and substitution permuta-665 tion network (SPN). Thus, although the neighbouring pixels of the encrypted image still666 show some correlation coefficients, they are approaching values close to zero, which means667 that there is no more statistical relationship between the adjacent pixels. Such reduction668 in correlation ensures that the encrypted image does not betray any structural information669 from the original image, so it is very immune to statistical attacks. Then it is found that670 quaternion-based encryption can significantly enhance security and thus is an effective671 way for secure image transmission and storage by comparing the horizontal, vertical and672 diagonal correlations before and after encryption [5, 16, 21, 34]. The correlation analysis673 is given in Figure 5 and 6 with Table 18 data.674 Figure 5: Vertical, diagonal and horizontal correlation analysis of image I1 Figure 6: Vertical, diagonal and horizontal correlation analysis of image I2 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 26 of 35 Table 18: Vertical, diagonal and horizontal correlation analysis of different images Vertical Diagonal Horizontal Images Red Green Blue Red Green Blue Red Green Blue Image I1 Original Red 0.9340 0.7323 0.5096 0.9038 0.6895 0.5161 0.9235 0.7030 0.5486 Green 0.5420 0.9474 0.9431 0.5494 0.9068 0.9054 0.5506 0.9410 0.9388 Blue 0.5423 0.7284 0.9462 0.5679 0.7200 0.8945 0.5530 0.7589 0.9408 Image I1 Encrypted Red -0.0400 0.0067 -0.0234 -0.0026 0.0017 0.0312 0.0284 0.0115 0.0365 Green 0.0462 -0.0158 0.0145 -0.0186 0.0074 -0.0144 0.0040 -0.0168 0.0035 Blue 0.0306 0.0039 -0.0308 -0.0472 -0.0077 0.0103 -0.0190 0.0102 0.0321 Image I2 Original Red 0.8956 0.6007 0.3919 0.8669 0.5082 0.3964 0.9201 0.6211 0.3671 Green 0.3843 0.9275 0.9250 0.3603 0.8285 0.9071 0.3508 0.9142 0.9258 Blue 0.3805 0.7224 0.9174 0.3655 0.7086 0.8968 0.3911 0.7223 0.9323 Image I2 Encrypted Red -0.0027 -0.0324 0.0205 -0.0136 0.0149 0.0055 0.0033 -0.0675 -0.0665 Green 0.0164 -0.0081 -0.0133 -0.0217 -0.0512 0.0539 -0.0260 0.0179 0.0124 Blue 0.0425 -0.0180 0.0351 0.0162 -0.0239 0.0115 0.0013 -0.0432 -0.0107 6.7. Information Entropy675 It is an important figure of speech for multiple RGB image encryption over quaternion676 integers and randomness and security. It is the measure of uncertainty of the encrypted677 image; in an ideal encryption scheme, the entropy value for such an image with 8 bits678 of greyscale or color should be close to 8, thus indicating a uniform distribution of pixel679 intensities. In quaternion-based encryption, RGB images are mapped to quaternion space,680 followed by the independent transformation of scalar and vector components of each im-681 age according to substitution, permutation, quaternion multiplication and modular arith-682 metic. Therefore, these processes make the pixel intensity values of the encrypted image683 distributed as randomly as possible, without having any inherent patterns of the original684 image. A large entropy value indicates that the image content is well obfuscated by the685 encryption method, and he or she is highly resistant to statistical attack, information686 leakage and cryptanalysis. The entropy of the image if considerably lower than 8 implies687 that the image carries redundant information which could be used by the attackers to de-688 duce the original image. The quaternion-based encryption achieves entropy values close to689 the theoretical maximum, thereby securing the encrypted multiple RGB images by creat-690 ing the maximum randomness for transmission and storage in cryptographic applications691 [5, 16, 35]. A comparison of the proposed work’s entropy evaluation is made to the existing692 research noted in Table 19.693 Table 19: Information Entropy comparison Information Entropy Images Red Green Blue Average Image I1 7.9992 7.9994 7.9993 7.9993 Image I2 7.9993 7.9994 7.9992 7.9993 [16] 7.9913 7.9914 7.9916 7.9916 [35] 7.9888 7.9896 7.9890 7.9892 [21] 7.9995 7.9995 7.9994 7.9995 [5] 7.9976 7.9967 7.9976 7.9987 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 27 of 35 6.8. MSE694 Mean Squared Error (MSE) is employed to compare the original encrypted images in695 multiple RGB image encryption over quaternion integers. The MSE quantifies the average696 squared differences between the corresponding pixel intensities, and the higher values of697 MSE mean that stronger encryption is achieved through ensuring a significant deviation698 from the original image. In a quaternion-based encryption, i.e., transforming images to699 quaternion space to allow scalar and vector components of each pixel to be independently700 processed by substitution, permutation, and quaternion multiplication operations, in the701 quaternion-based encryption process, the pixel intensity variation is maximized. For a well-702 designed encryption scheme, the MSE measures should be high such that the encrypted703 image has no similarity to the original one, which makes the image resistant to visual704 attacks as well as statistical analysis. On the one hand, quaternion-based encryption with705 large MSE values both guarantees good diffusion and confusion so as to avoid attackers706 obtaining any meaningful pattern or reconstructing the original image [34]. The data707 collected MSE are given in Table 20.708 6.9. PSNR709 The Peak Signal to Noise Ratio (PSNR) is an important metric to evaluate the qual-710 ity degradation between the original encrypted images in many RGB image encryptions711 over quaternion integers. PSNR inversely relates to MSE, and a lower PSNR means the712 encryption has better performance, meaning that the encrypted image is much distorted713 and can’t be recognized from the original. Since quaternion-based encryption is an inde-714 pendent transformation of the scalar and vector components of an image using nonlinear715 and algebraic operations, it increases pixel randomness and hence reduces the PSNR value716 significantly. The lower PSNR indicates that the encrypted image went through extreme717 modifications, and those kinds of modifications would be beyond the capability for attack-718 ers to decode the original image by means of standard signal processing. PSNR values are719 found to be low, also indicating that the encryption is effective in validating the encryp-720 tion’s robustness and the resistance to inverse attacks [34]. Table 20 contains the collected721 PSNR and MSE data.722 Table 20: MSE and PSNR analysis MSE PSNR Images Red Green Blue Red Green Blue Image I1 Original 2.50 2.33 2.53 44.1849 44.4965 44.1297 Image I1 Encrypted 2.54 2.48 2.38 44.1080 44.2180 44.3952 Image I2 Original 2.53 2.62 2.48 44.1320 43.9747 44.2144 Image I2 Encrypted 2.44 2.53 2.36 44.2969 44.1377 44.4353 Original Image [34] 2.23 2.47 2.10 44.6746 44.2313 44.9505 Encrypted Image [34] 2.43 2.42 2.38 44.3020 44.3185 44.4057 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 28 of 35 6.10. Contrast723 The parameter of multiple RGB image encryption over quaternion integers is contrast724 analysis, which is the difference of intensity between two adjacent pixels. To prevent725 the encrypted image from displaying any identifiable features of the plaintext image, the726 original contrast levels of the plaintext image should be disrupted by encrypting them in727 a secure encryption algorithm. Quaternion encryption provides an additional source of728 randomness and distorts the contrast distribution by mapping RGB images to quaternion729 space and performing independent transformations of the scalar and vector components.730 Encryption with strong encryption is indicated by high intensity currents in the encrypted731 image by eliminating the structural consistency and the sensitivity to statistical attacks.732 The encrypted images should have their contrast values that do not correlate with those733 of the original images to ensure secure image transmission and storage as well [21, 34].734 Table 21 presents the result of contrast evaluation in the proposed work.735 6.11. Energy736 Energy is a texture analysis measure to determine if pixel intensity distribution in737 the image is one of repetitive pattern (with a high value) or random (with a low value).738 The purpose of multiple RGB image encryption over quaternion integers is to obtain an739 energy value of a disordered and unpredictable pixel distribution. The quaternion based740 encryption is built upon substitution permutation networks (SPN), quaternion multipli-741 cation and nonlinear transformation mechanisms to disrupt original energy distribution742 such that encrypted image is with a uniform and random texture. The encryption process743 is effective if there is a significant deviation in energy values between the original and en-744 crypted images and therefore no recognizable patterns can be exploited by the attackers.745 By thoroughly encrypting an image, its energy value to its plaintext counterpart should be746 drastically different, as a confirmation that encryption can perform visual data obfuscation747 [21, 34]. The presented energy data is shown in Table 21.748 Table 21: Contrast and energy analysis Contrast Energy Images Red Green Blue Red Green Blue Image I1 Original 0.5693 0.6411 0.6196 0.0752 0.0735 0.0713 Image I1 Encrypted 10.5357 10.4913 10.4710 0.0156 0.0156 0.0156 Image I2 Original 0.6062 0.7930 0.6063 0.0828 0.0748 0.0906 Image I2 Encrypted 10.4667 10.5053 10.5311 0.0156 0.0156 0.0156 Original Image [21] 0.5439 0.5000 0.4726 0.5439 0.5000 0.4726 Encrypted Image [21] 10.5114 10.4770 10.4894 10.5114 10.4770 10.4894 Original Image [34] 0.4717 0.4879 0.4261 0.0838 0.0834 0.1242 Encrypted Image [34] 10.4878 10.4861 10.5034 0.0156 0.0156 0.0156 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 29 of 35 6.12. Statistical Homogeneity749 Statistical homogeneity relates to the uniformity of a gray image’s texture and is de-750 termined based on successive pixel intensities. For the scheme of multiple RGB image en-751 cryption over quaternion integers, it needs to break pixel similarity so that the encrypted752 image will be more homogenous. Quaternion based encryption does this by separately753 transforming the scalar and vector part of each pixel by modular arithmetic, affine trans-754 formation, and quaternion rotation. These transformations also bring randomness thus755 neighboring pixels of encrypted image not related in any steady way. A lower homogene-756 ity value in the encrypted image means the encryption algorithm adversely disturbs the757 structural consistency of the image rendering it very indomitable to statistical as well as758 differential attacks. The security of quaternion based encryption is enhanced because it759 reduces homogeneity and the encrypted image cannot be meaningfully extracted by the760 attacker [34]. The results of the proposed work for homogeneity are presented in Table761 22.762 6.13. Standard Deviation763 The SD is a necessary statistical index for the evaluation of dispersion of pixel inten-764 sities in multiple RGB image encryption over quaternion integers. The greater the value765 of an encrypted image’s SD, the broader the spread of pixel intensities, since this indi-766 cates a strong encryption process that has removed all patterns and correlations present767 in the original image. Quaternion based encryption uses separate scalar and vector com-768 ponents upon which they interleave nonlinear transforms, quaternion multiplication and769 permutation-substitution networks in order to distribute pixel values uniformly across770 color channels. This dispersion is required for achieving a very high randomness in the771 encrypted image so it can be resistant to statistical attacks. If the chosen encryption772 process is secure, we should observe a greatly different SD between the original and the773 encrypted images, which ensures that the encryption has successfully masked the struc-774 tural consistency. Through a high SD, quaternion based encryption not only increases775 security for multiple RGB images, but prevents these images from being decrypted or776 pattern recognized by any unauthorized user [34]. Table 22 shows a description of the SD777 test results of the proposed work.778 Table 22: Homogeneity and standard deviation Homogeneity Standard Deviation Images Red Green Blue Red Green Blue Image I1 Original 0.8335 0.8324 0.8293 57.4332 64.5652 65.8041 Image I1 Encrypted 0.3891 0.3892 0.3899 73.8951 73.9193 73.9622 Image I2 Original 0.8384 0.8198 0.8499 54.7737 63.0304 63.5231 Image I2 Encrypted 0.3801 0.3897 0.3897 73.9140 73.8647 73.9488 Original Image [34] 0.8855 0.8726 0.8855 9.5315×103 8.5820×103 1.0732×104 Encrypted Image [34] 0.3892 0.3897 0.3889 72.3821 67.0023 61.9652 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 30 of 35 6.14. NIST Test779 Randomness of quaternion integer multiple RGB image encryption: The NIST sta-780 tistical test suite is a standard method for testing random and security strength of the781 encryption scheme, especially for the multiple RGB image encryption over integers. This782 suite exercises several tests of various aspects of randomness to check that the encrypted783 images have highly unpredictable pixel distributions. Frequency test is used to deter-784 mine that whether the amount of ones and zeros in the encrypted image is the same and785 therefore the randomness is uniform. However, the block frequency test expands this idea786 by analyzing certain blocks in the encrypted image, ensuring that there is randomness787 maintained between segments of the encrypted image. The rank test ensures that the788 encryption breaks down structured relationships of values in the image, and the linear789 dependence is examined between pixel values. The runs test (M=10,000) and long runs of790 Ones test check for the consistency of sequences of like pixel values, and there is no resid-791 ual of predictable pattern. Repeated patterns are analyzed in the overlapping templates792 and non-overlapping templates tests, which verify that quaternion based encryption would793 result in a large variability over the image. The spectral DFT tests evaluate the encrypted794 data on periodic structures, which prevents the frequency based attacks since it should not795 contain the dominating spectrum. The complexity of pixel arrangements is estimated by796 the approximate entropy test and thus verifies that the encrypted image has an irregular797 unpredictable structure. The universal test is a test if the encrypted image has compress-798 ible patterns with high randomness, and thus is resistant to redundancy-based attacks.799 The serial tests determine the independence of pixel transitions, that pixels are not next800 to each other and follow any pattern. The cumulative sum tests (forward and reverse)801 include tests that verify the uniformity of pixel distribution across the encrypted image802 without any directional biases. Random excursions and random excursions variants tests803 evaluate the randomness of the trajectory of pixel value sequence to ensure that quater-804 nion based encryption successfully destroys patterns and continues to be unpredictable.805 Multiple methods of RGB image encryption over quaternion integers then pass these NIST806 tests and show robustness to securing image data, resisting statistical, differential and fre-807 quency based cryptanalysis techniques [34, 36]. NIST evaluates its results through Table808 23.809 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 31 of 35 Table 23: NIST analysis of encrypted image I1 Tests P-values Remarks Red Green Blue Frequency 0.72795 0.52709 0.84952 ✓ Block frequency 0.8214 0.94307 0.64453 ✓ Rank 0.29191 0.29191 0.29191 ✓ Runs (M=10,000) 0.29579 0.52292 0.020941 ✓ Long runs of ones 0.7127 0.7127 0.7127 ✓ Overlapping templates 0.85988 0.85988 0.81567 ✓ No overlapping templates 1 0.9994 0.99981 ✓ Spectral DFT 0.14679 0.77167 0.11048 ✓ Approximate entropy 0.90625 0.35541 0.5992 ✓ Universal 0.99668 0.98733 0.99844 ✓ Serial p values 1 0.55822 0.020917 0.030786 ✓ Serial p values 2 0.64206 0.0036093 0.92887 ✓ Cumulative sums forward 0.224 0.24591 0.24146 ✓ Cumulative sums reverse 0.96051 0.88005 1.0587 ✓ Random excursions X = -4 0.15244 0.30689 0.13725 ✓ X = -3 0.23199 0.46172 0.21775 ✓ X = -2 0.10689 0.25688 0.0091833 ✓ X = -1 0.83873 0.71524 0.83249 ✓ X = 1 0.82206 0.62668 0.63515 ✓ X = 2 0.052698 0.0055571 0.3526 ✓ X = 3 0.60677 0.28872 0.26048 ✓ X = 4 0.12628 0.2527 0.58195 ✓ Random excursions variants X = -5 0.7473 0.89286 0.98091 ✓ X = -4 0.89103 0.93913 0.82814 ✓ X = -3 0.95691 0.92801 0.46022 ✓ X = -2 0.91666 0.81554 0.40709 ✓ X = -1 0.67238 0.2665 0.61527 ✓ X = 1 0.46848 0.68617 0.61527 ✓ X = 2 0.23567 0.86111 0.90103 ✓ X = 3 0.19469 0.75183 0.74815 ✓ X = 4 0.22621 0.76003 0.37052 ✓ X = 5 0.28584 0.89286 0.48767 ✓ 7. Discussion, Conclusion, and Future Work810 This paper proposes a novel encryption scheme for different ways of combining mul-811 tiple RGB images which are secured by Substitution-Permutation Network (SPN)-based812 encryption scheme for quaternion integers. Using the mathematical properties of the813 quaternions integers, specifically their four dimension, the proposed method increases the814 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 32 of 35 cryptographic strength of S-boxes, consequently improving nonlinearity, confusion, and815 diffusion properties. Using quaternion integer based S boxes in conjunction with an SPN816 based encryption scheme gives high security level, protected from attack by statistical,817 differential and cryptanalytic attacks. Furthermore, the proposed algorithm is computa-818 tionally efficient, which allows for real time applications in domains where secure mul-819 timedia transmission in cloud storage, medical imaging, and such are progressing. The820 presented encryption framework is tested through extensive theoretical and experimental821 analysis and is proved to be resilient and practical compared to the conventional methods.822 Computational complexity in the future research can be optimized, other cryptographic823 primitives can be extended by the approach, and the applicability in resource constrained824 environment can be further explored for enhancing the digital security in modern multi-825 media applications.826 The optimization of computational complexity of quaternion integer based encryption827 schemes for real time application can be one future research. These larger and more com-828 plex algebraic structures offer further security benefits including exploration of octonion829 or sedenion integers. It is possible to broaden the applicability of the proposed framework830 to other cryptographic primitives such as hash functions and digital signatures. Working831 together with the latest technologies like quantum cryptography and lightweight crypto-832 graphic protocols for IoT and edge computing, the process of encryption may be integrated833 and this would serve as a lot of help in having a good digital security in different uses.834 Acknowledgements835 The Researchers would like to thank the Deanship of Graduate Studies and Scientific836 Research at Qassim University for financial support (QU-APC-2025).837 Data availability838 The images used in this study were obtained from ’The USC-SIPI Image Database’839 (https://sipi.usc.edu/database). The images were combined and processed to meet the840 specific pixel requirements of the experiment. The researcher can contact to the Muham-841 mad Sajjad for getting the images.842 References843 [1] Alfred J Menezes, Paul C Van Oorschot, and Scott A Vanstone. Handbook of applied844 cryptography. CRC press, 2018.845 [2] Claude Carlet and Cunsheng Ding. Nonlinearities of s-boxes. Finite fields and their846 applications, 13(1):121–135, 2007.847 [3] Majid Khan, Tariq Shah, Hasan Mahmood, Muhammad Asif Gondal, and Iqtadar848 Hussain. A novel technique for the construction of strong s-boxes based on chaotic849 lorenz systems. Nonlinear Dynamics, 70:2303–2311, 2012.850 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 33 of 35 [4] Naveed Ahmed Azam, Umar Hayat, and Maria Ayub. A substitution box generator,851 its analysis, and applications in image encryption. Signal Processing, 187:108144,852 2021.853 [5] Muhammad Sajjad, Tariq Shah, Tanveer ul Haq, Bander Almutairi, and Qin Xin.854 Spn based rgb image encryption over gaussian integers. Heliyon, 10(9), 2024.855 [6] Giuliana P Davidoff, Peter Sarnak, and Alain Valette. Elementary number theory,856 group theory, and Ramanujan graphs, volume 55. Cambridge university press Cam-857 bridge, 2003.858 [7] Muhammad Sajjad and Tariq Shah. Decoding of cyclic codes over quaternion integers859 by modified berlekamp–massey algorithm. Computational and Applied Mathematics,860 43(2):102, 2024.861 [8] Tariq Shah and Summera Said Rasool. On codes over quaternion integers. Applicable862 Algebra in Engineering, Communication and Computing, 24(6):477–496, 2013.863 [9] Mehmet Ozen and Murat Guzeltepe. Codes over quaternion integers. European864 Journal of Pure and Applied Mathematics, 3(4):670–677, 2010.865 [10] Mehmet Özen and Murat Güzeltepe. Cyclic codes over some finite quaternion integer866 rings. Journal of the Franklin Institute, 348(7):1312–1317, 2011.867 [11] Muhammad Sajjad, Tariq Shah, Mohammad Mazyad Hazzazi, Adel R Alharbi, and868 Iqtadar Hussain. Quaternion integers based higher length cyclic codes and their869 decoding algorithm. Computers, Materials & Continua, 73(1), 2022.870 [12] MohammadMazyad Hazzazi, Muhammad Sajjad, Zaid Bassfar, Tariq Shah, and Ash-871 wag Albakri. Nonlinear components of a block cipher over eisenstein integers. Com-872 puters, Materials & Continua, 77(3), 2023.873 [13] Muhammad Sajjad, Tariq Shah, and Robinson Julian Serna. Designing pair of non-874 linear components of a block cipher over gaussian integers. Computers, Materials &875 Continua, 75(3), 2023.876 [14] Muhammad Sajjad, Tariq Shah, Huda Alsaud, and Maha Alammari. Designing pair of877 nonlinear components of a block cipher over quaternion integers. AIMS Mathematics,878 8(9):21089–21105, 2023.879 [15] Fırat Artuğer and Fatih Özkaynak. An effective method to improve nonlinearity value880 of substitution boxes based on random selection. Information Sciences, 576:577–588,881 2021.882 [16] Ahmed A Abd EL-Latif, Bassem Abd-El-Atty, and Salvador E Venegas-Andraca.883 Controlled alternate quantum walk-based pseudo-random number generator and its884 application to quantum color image encryption. Physica A: Statistical Mechanics and885 its Applications, 547:123869, 2020.886 [17] Saleh Ibrahim and Ayman Alharbi. Efficient image encryption scheme using henon887 map, dynamic s-boxes and elliptic curve cryptography. IEEE Access, 8:194289–888 194302, 2020.889 [18] Zeba Shamsi and Dolendro Singh Laiphrakpam. Securing encrypted image informa-890 tion in audio data. Multimedia Tools and Applications, 82(21):33063–33085, 2023.891 [19] Xingyuan Wang, Le Feng, and Hongyu Zhao. Fast image encryption algorithm based892 on parallel computing system. Information sciences, 486:340–358, 2019.893 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 34 of 35 [20] Guangfeng Cheng, Chunhua Wang, and Hua Chen. A novel color image encryp-894 tion algorithm based on hyperchaotic system and permutation-diffusion architecture.895 International Journal of Bifurcation and Chaos, 29(09):1950115, 2019.896 [21] Dania Saleem Malik and Tariq Shah. Color multiple image encryption scheme based897 on 3d-chaotic maps. Mathematics and Computers in Simulation, 178:646–666, 2020.898 [22] Qi Yin and Chunhua Wang. A new chaotic image encryption scheme using breadth-899 first search and dynamic diffusion. International Journal of Bifurcation and Chaos,900 28(04):1850047, 2018.901 [23] Xing-Yuan Wang, Ying-Qian Zhang, and Xue-Mei Bao. A novel chaotic image en-902 cryption scheme using dna sequence operations. Optics and Lasers in Engineering,903 73:53–61, 2015.904 [24] SiCheng Wang, ChunHua Wang, and Cong Xu. An image encryption algorithm based905 on a hidden attractor chaos system and the knuth–durstenfeld algorithm. Optics and906 Lasers in Engineering, 128:105995, 2020.907 [25] Minjun Zhou and Chunhua Wang. A novel image encryption scheme based on con-908 servative hyperchaotic system and closed-loop diffusion between blocks. Signal Pro-909 cessing, 171:107484, 2020.910 [26] Xing-Yuan Wang and Zhi-Ming Li. A color image encryption algorithm based on911 hopfield chaotic neural network. Optics and Lasers in Engineering, 115:107–118,912 2019.913 [27] Xingyuan Wang and Suo Gao. Image encryption algorithm for synchronously up-914 dating boolean networks based on matrix semi-tensor product theory. Information915 sciences, 507:16–36, 2020.916 [28] Wei Liu, Zhenwei Xie, Zhengjun Liu, Yan Zhang, and Shutian Liu. Multiple-image917 encryption based on optical asymmetric key cryptosystem. Optics Communications,918 335:205–211, 2015.919 [29] Y Xiong, C Quan, and CJ Tay. Multiple image encryption scheme based on pixel920 exchange operation and vector decomposition. Optics and Lasers in Engineering,921 101:113–121, 2018.922 [30] Pingke Deng, Ming Diao, Mingguang Shan, Zhi Zhong, and Yabin Zhang. Multiple-923 image encryption using spectral cropping and spatial multiplexing. Optics Commu-924 nications, 359:234–239, 2016.925 [31] Chun-Lai Li, Hong-Min Li, Fu-Dong Li, Du-Qu Wei, Xuan-Bing Yang, and Jing926 Zhang. Multiple-image encryption by using robust chaotic map in wavelet transform927 domain. Optik, 171:277–286, 2018.928 [32] Xiaoqiang Zhang and Xuesong Wang. Multiple-image encryption algorithm based on929 the 3d permutation model and chaotic system. Symmetry, 10(11):660, 2018.930 [33] Xiaoqiang Zhang and Xuesong Wang. Multiple-image encryption algorithm based on931 dna encoding and chaotic system. Multimedia Tools and Applications, 78(6):7841–932 7869, 2019.933 [34] Muhammad Sajjad, Tariq Shah, Rafik Hamza, Bander Almutairi, and Robinson Ju-934 lian Serna. Multiple color images security by spn over the residue classes of gaussian935 integer. Scientific Reports, 15(1):6425, 2025.936 M. Sajjad, N. A. Alqwaifly / Eur. J. Pure Appl. Math, 18 (2) (2025), 6228 35 of 35 [35] Hongjun Liu, Jian Liu, and Chao Ma. Constructing dynamic strong s-box using 3d937 chaotic map and application to image encryption. Multimedia Tools and Applications,938 82(16):23899–23914, 2023.939 [36] Lingfeng Qu, Fan Chen, Shanjun Zhang, and Hongjie He. Cryptanalysis of reversible940 data hiding in encrypted images by block permutation and co-modulation. IEEE941 Transactions on Multimedia, 24:2924–2937, 2021.942