Construction of Optimized Dynamic S-Boxes Based on a Cubic Modular Transform and the Sine Function

The protection of sensitive data from illegitimate users is one of the main challenges in today’s technological era. To handle prevailing security-related problems and challenges amicably, cryptographic techniques are applied for the fortification of data. State-of-the-art cryptographic ciphers generally use substitution-boxes (S-boxes) that help in accomplishing robust sanctuary of data. Provision of data security by a cipher is proportionate directly to the cryptographic strength of an S-box employed in the respective cipher. This research paper proposes to project a simple and innovative scheme for the generation of dynamic S-boxes by employing a novel cubic modular transformation along with the trigonometric sine function. A pioneering optimization phase, dynamic in nature, is also suggested that improvises the nonlinearity of the initial configuration of S-box. The overall proposed scheme possesses the potential to spawn a large count of strong S-boxes by smearing a minute variation in input parameters used in initial and optimization phases. Cipher key is used to employ values to the input parameters for the creation of dynamic S-boxes. A specimen S-box is presented, and its performance has been achieved through standard criteria of S-box evaluation along with the comparative analysis with some existing S-boxes. Recital and comparative investigations validate that the anticipated S-box possesses the real capability for its usage in cryptosystems for much needed data security.


I. INTRODUCTION
In the modern technological era, a tremendous volume of data is triggered on daily basis and its communication over public channels from one place to other places has become an obligatory part of our life. Data is a vital asset and must be protected from the attackers so that they are unable to use it maliciously if they obtain or steal it somehow. To prevent data from such hazards, its conversion into a meaningless form is done before its transmission over public channels. Different methods are employed to convert meaningful data The associate editor coordinating the review of this manuscript and approving it for publication was Jiafeng Xie. into meaningless data. Cryptography is one such domain that helps in this transformation and holds sturdy algorithms known as ciphers to assist in the security of data and information. These ciphers are categorized into two core types namely the Stream ciphers and Block ciphers [1]. The former cipher performs encoding or enciphering one byte/bit to another byte/bit at once. A block cipher performs these operations in a chunk-by-chunk manner. A chunk of data or information mostly contains more than one byte. Nowadays, block ciphers are frequently adopted by organizations to secure their confidential information from invaders due to simple implementation and easy deployment [2], [3]. Few illustrious block ciphers employed in numerous security VOLUME 9, 2021 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ applications are Advanced Encryption Standard (AES), Blowfish, RC5, Twofish, etc. A block cipher bestows security with the assistance of permutation and substitution operations which are used to translate plaintext form of data into an enigmatic form. In permutation, the bits/bytes of the message are shuffled in such a manner that the permutated message contains the same bits/bytes (of the original message), whereas a substitution method replaces bits/bytes of the original plaintext with some other bits/bytes that are not the constituents of the original message. A substation operation requires a table to assist in the replacement process known as a substitution box (S-box) [4]- [6]. A substitution box (S-box) is a significant element of modern block ciphers to assist in the generation of meaningless data (ciphertext) from the original message (plaintext). S-boxes help in creating a non-linear relationship among input (original message) and output (meaningless form) data to provoke more confusion for the Invaders. If an S-box employed in a particular block cipher is capable to generate more muddle for the attackers in the produced ciphertext, that cipher offers more protection to the plaintext. S-boxes work in a non-linear manner to enhance the protection of data, whereas other elements of a particular cipher operate in a linear style. Therefore, the security offered for the original message by a block cipher using S-boxes as the components directly depends on the cryptographic strength of these S-boxes [7]- [9]. The modern-day cryptosystems utilize two categories of S-boxes named as static and dynamic S-boxes. A static S-box has fixed arrangement of random values and a cipher using such an S-box provides less security to the plaintext as the invaders may be able to get such a static S-box somehow and produce plaintext from the captured ciphertext using it [10]. AES and DES ciphers used static S-boxes in their operation and attackers tried cryptanalytic efforts on these ciphers by exploiting the weaknesses offered by the respective static S-boxes. To daze the disadvantages and weaknesses of static S-boxes, modern block ciphers utilize dynamic S-boxes to avail the cryptographic fortes associated with them [11], [12]. A dynamic S-box is produced using cipher key and is capable to increase the cryptographic strength offered by a cipher. One can obtain different novel S-boxes by utilizing different values of the key. These dynamic S-boxes are employed in ciphers to improve the security of the sensitive information. As a result, innumerable researchers have proposed new and novel methods to generate key-dependent S-boxes under the control of secret key.
Chaos theory has the capability to produce randomness [13] and authors [14]- [19] have exploited this chaotic characteristic to generate robust S-boxes using various chaotic techniques for the protection of data. However, it was observed that a chaotic system does not disguise and protect data at all times [20]. Most of the hyperchaotic structures possess better complexities and dynamics than chaotic systems and a found another alternative to generate S-boxes. The hyperchaotic systems exhibit more than one positive Lyapunov exponents (LE) compared to the only one LE of a chaotic system [21]. So, a much more intricate attractor and dynamical performances are generated by the hyperchaotic systems as the system dynamics bloat in more than one direction, randomness is increased, and higher unpredictability is achieved [20], [21].
Consequently, authors [22], [23] have engendered cryptographically strong dynamic S-boxes based on hyperchaotic techniques. Another leading domain currently being utilized for the construction of strong S-boxes is DNA computing. Authors [24]- [29] exploited DNA computing and models to create robust and strong S-boxes and more secure ciphers. Investigation of DNA-based S-boxes proved and established their standing against cryptanalytic efforts. Another principal technique to produce dynamic and robust S-boxes is the linear fractional transformation (LFT). Researchers [30]- [33] applied LFT technique based on Galois Field (GF) in different ways to generate strong S-boxes. Many authors [34]- [36] introduced strong S-box generation methods based on simple and efficient transformations than the linear fractional transformations.
Advanced Encryption Standard (AES) is a renowned block cipher that utilized a single static S-box in encryption and a single static inverse S-box in decryption based on Galois Field in its working in each of its rounds. The arrangement of values in these AES static S-boxes is fixed. An invader having the knowledge of these static S-boxes gets the capability to launch attack(s) on the captured ciphertext and hence the protection of data is conceded. Similarly, computation of one value of AES S-box is based on the calculation of multiplicative inverse of one input value using Galois Field that consumes a lot of time and results in less efficient process to construct the resultant S-box. Keeping in view the weaknesses linked to the AES S-box, authors [37]- [41] projected numerous enhancements to the original AES S-box. These novel S-boxes are dynamic and better than AES S-box as a different S-box is employed in each of the AES rounds and linear and differential cryptanalysis efforts are made difficult as compared to the easy cryptanalytical efforts in case of AES static S-boxes.
Many modular schemes have been proposed for S-box generation by researchers like [31], [32], [34]- [35]. These proposals have demerits like use of fixed primitive polynomials [31], [32], presence of fixed points [31], lack of bijectivity [32], [34], less cryptographic strength [31], [34], [35], etc. So, there is a need of a novel modular approach that is free of the above-mentioned drawbacks. This research article introduces a novel scheme to create key-dependent strong S-boxes by employing values for the parameters A, B, and C from the cipher key. Each parameter has certain range of values and one has the option to pick any value from this range. This liberty of choosing any values makes the proposed scheme quite dynamic and consequently aids in increasing the cryptographic forte of the proposed S-box along with the augmented confusion for the invaders. The innovative scheme employs a novel cubic modular transformation (CMT) that is dynamic in nature along with the trigonometric Sine function to obtain an initial 8 x 8 S-box. The initial S-box results are further enhanced by employing an innovative heuristic evolution approach and one gets good nonlinear S-boxes having admirable cryptographic forte with respect to standard evaluation criteria.
Following are the principal contributions of our effort: • A novel and simple cubic modular transformation (CMT), dynamic in nature, along with the trigonometric Sine function is proposed to produce an initial S-box. A large number of strong S-boxes are produced by a minute variation in the parameters' values.
• An innovative heuristic-based optimization approach, dynamic in nature, is suggested that improvises the nonlinearity of the initial S-box. The resultant S-box as the result of this approach has the capability to generate additional muddle in the ciphertext for the invaders.
• Resultant S-box and other prevalent S-boxes are contemptuously evaluated by means of typical S-box criteria. This recital analysis authenticates the remarkable say of the proposed scheme for the generation of dynamic S-boxes. Rest of the paper has the following organization. Section II narrates the detailed methodology for the generation of S-boxes by employing an innovative cubic modular transform and a new heuristic-based optimization approach. Section III presents the generation of an example S-box and its recital and comparative analysis with some of the existing modernday S-boxes. Section IV describes the conclusion of the work done in the paper.

II. PROPOSED METHOD FOR S-BOX DESIGN
Today, researchers design and utilize S-boxes in block ciphers to create as much muddle in the ciphertext as possible to create confusion for the invaders. An S-box supports in producing a nonlinear connotation among the plaintext and the ciphertext. This mapping makes it very challenging for an attacker to produce the plaintext from the captured data (ciphertext). As a result, researchers try to explore new and novel transformations that help in the generation of strong S-boxes. Here, we introduce an innovative scheme by employing a novel and dynamic cubic modular transformation, a trigonometric sine function application, and a pioneering heuristic based optimization approach to generate dynamic and strong S-boxes having worthy cryptographic forte. Comprehensive procedure for the generation of the projected S-box involves the following four simple phases which are described in the subsequent section.

A. INNOVATIVE CUBIC MODULAR TRANSFORMATION
The proposed scheme erected substitution-boxes of size n × n using a novel cubic modular transformation (CMT) defined as a mathematical function in Eq. (1): The cipher key employs the values for the variables A and B which make the CMT transformation given in Eq. (1) dynamic. This dynamism of the above transformation helps in the erection of dynamic S-boxes. With simple variation in values of parameters A and B, entirely different S-box can be easily obtained.

B. SINE FUNCTION APPLICATION
The well-known trigonometric sine function is applied to the value R obtained from Eq. (1). This makeover is given in Eq. (2) as: The working methodology of Eq. (1) and (2) is also demonstrated in the flowchart given in Figure 1.

C. INITIAL S-BOX GENERATION
The initial 8 × 8 S-box for n = 8 construction procedure using Eqs (1) and (2) is presented in Algorithm 1 and also VOLUME 9, 2021   illustrated through a flowchart given in Figure 2. An example initial 8 × 8 S-box obtained for A = 13, B = 94 is specified in Table 1.

D. HEURISTIC-BASED OPTIMIZATION APPROACH
This step helps in permuting the values of the initial S-box generated using the procedure as presented in previous subsection. The proposed cubic modular transformation (CMT) N // Initial S-box Initializations: optimization approach in the proposed scheme plays a vital part to produce robust and strong dynamic S-boxes from the chosen initial S-Box. This phase is the most crucial part of the proposed S-box generation scheme. It is responsible for fetching the strong configuration of S-box which exhibits strong nonlinear cryptographic strength of the final S-box. This approach is presented in Algorithm 2 and depicted in Figure 3. The cipher key involves the values for the variables A, B, and C used in the optimization phase that makes the approach dynamic. A specimen 8 × 8 S-box constructed after the heuristic-based optimization phase is listed in Table 2.

III. SECURITY ASSESSMENT OF PROPOSED S-BOX
A cryptographic S-box generated with the help of a certain method may be strong one to resist attacks or weak one to be the target of attackers. To appraise the forte of S-boxes under consideration, certain conditions or criteria are assessed and these must be fulfilled by an S-box to claim its strength.  Table 1 by employing standard criteria [52] to evaluate the cryptographic strength of any given S-box. We picked newly explored S-box methods for comparison of the security topographies of our projected S-box with these prevailing S-boxes.

A. BIJECTIVENESS
An S-box must satisfy bijectiveness requirement in a decent way. The bijectivity guarantees that for each unique input value, unique output value is produced and vice versa. Consequently, this input-output association should exhibit 1-to-1 mapping. Our proposed 8 x 8 S-box as presented in Table 1 demonstrates this property as each inimitable input value produces inimitable output value. Each coordinate Boolean function of resultant S-box has total count of 1's (128) equivalent to total count of 0's as proposed in [9], [47].

B. NONLINEARITY
A strong substitution-box essentially has a nonlinear mapping between the ciphertext (output) and the plaintext (input) because a linear mapping makes it easy for an attacker to get original message from the ciphertext. A nonlinear mapping helps in defying the attacks by an invader to deduce the plaintext from the ciphertext and an S-box demonstrating a nonlinear association between its input and output is desired one. Such a nonlinear association (known as nonlinearity) VOLUME 9, 2021  needs to be higher. A high value of nonlinearity validates that the respective S-box is more resistant against the linear attacks. The nonlinearity value of an S-box with n-bit Boolean function S can be calculated with Eq. (3) [52]: where, T max (S) represents Walsh-Hadamard Transformation for S-box having an n-bit Boolean function S. The Boolean functions that establish our initial and proposed (final) Sboxes and the resultant nonlinearity scores are illustrated in Table 3. As shown in Table 3, the maximum nonlinearity score of initial S-box (given in Table 1) is 108, the minimum score is 106, and the average score is 106.5. The heuristic-based optimization approach presented in Algorithm 2 capable enough to yield an S-box which is having the maximum nonlinearity score of 112, the minimum score as 110, and a decent average score is 111.3 It clearly indicates a handsome improvisation in the nonlinearity scores of initial S-box through the novel heuristic-based optimization approach. The proposed S-box nonlinearity results are compared with state-of-the-art S-boxes in Table 4. The comparative results are evident that nonlinearity scores of our S-box exceed than the nonlinearity values of recently published S-box studies.

C. STRICT AVALANCHE CRITERION (SAC)
Websters and Tavares gave a criterion which guarantees that a one-bit change in the input (plaintext or key) must change  50% of the output bites [68]. This is famously known as the strict avalanche performance criterion (SAC). Strong encryption schemes should be able to satisfy this avalanche criterion well. The SAC scores of our proposed S-box are shown as the dependency matrix in Table 5. If the value of SAC of an S-Box is near 0.5, it is treated as a robust one. Average value of SAC scores from Table 5 is 0.5 that authenticates the fulfillment of SAC by our proposed S-box in a decent manner. The SAC score of proposed S-box is equated with the SAC scores of the some existing S-boxes in Table  6. Comparative result demonstrates that the proposed S-box SAC value shows an elegant and better fulfillment of SAC property compared to SAC values of these S-boxes.

D. BIT INDEPENDENCE CRITERION (BIC)
Bit independence criterion ensures that due to a one-bit change in the input (plaintext or key), change in the values of any bits from output is independent of each other [68]. An S-box designer attempts to generate an S-box while keeping in mind this criterion. BIC-Nonlinearity (BIC-NL) results of proposed S-box are illustrated in Table 6. Average BIC-NL value computed from Table 6 is 103.8. This score is an indication that output bits depend feebly on each other and hence proposed S-box appeases the BIC in an elegant manner. The BIC for nonlinearity of anticipated S-box is compared with the recently published S-boxes in Table 7. The critical assessment reveals that the BIC-NL value of the proposed S-box shows an elegant uniformity with the BIC-NL values of contemporary S-boxes.

E. LINEAR PROBABILITY (LP)
A cryptosystem creator tries to muddle plaintext bits in the best possible way to produce such a ciphertext that is more and more meaningless for the invaders and their attempts of cracking the ciphertext are useless. An S-box created carefully assists in achieving this jumble by producing nonlinear mapping between plaintext and ciphertext bits. The cryptographic forte of this mapping known as linear probability (LP) of an explicit 8 x 8 S-box F is calculated by Eq. (4) [69]. whereas, If a linear relationship exists among the input and output bits of an S-box, linear probability value of that S-box is high, and it is easy for invaders to perform linear cryptanalysis. Linear probability (LP) score of projected S-box depicted in Table 2 comes out as 0.125 which is very low, and it indicates the resistance of proposed S-box towards linear cryptanalysis. LP value of the proposed S-box VOLUME 9, 2021 is compared with the recently published S-boxes in Table 9.
The comparison result provides evidence that our S-box has enough cryptographic strength to confront the Matsui's cryptanalysis.

F. DIFFERENTIAL UNIFORMITY (DU)
Invaders seize ciphertext communicated over the public channels and try to cryptanalyze it. Different attempts are made by finding the alterations in the ciphertext as well as alterations in the input (plaintext). Careful analysis of such alterations assists an invader to reach the full or part of the key or plaintext [70]. An S-box creator attempts to reduce the dissimilarity between such alterations. Such a difference is assessed through differential uniformity (DU) property of S-boxes. Low value of DU helps in the resistance to the differential cryptanalysis. Value of DU of an n x n S-box S is computed using Eq. (5) [71].
The results of differential uniformity are presented in Table 8 through the differential distribution matrix. The maximum score of this matrix is 10 which the DU of the proposed S-box and respective score of DP (differential probability) is 0.039. The obtained low scores of differential uniformity and differential probability specify that anticipated S-box has the latent to defy differential cryptanalysis. The projected S-box DP sore is equated with DP values of some recently investigated S-boxes in Table 9. The comparative analysis provides evidence that the DP of proposed S-box is gracefully consistent with the values of DP of other S-boxes and thus possesses enough cryptographic strength to rebel the differential cryptanalytic efforts practiced by the invaders to break the ciphers involving S-boxes.

G. FIXED POINTS ANALYSIS (FPA)
If an n x n S-box S is designed in such a way that S (u) = u for some u's where 0 ≤ u ≤ 2 n -1, S has some fixed points (FP). Such an S-box presents severe weakness to the invaders of the ciphertext. Attackers try to find one or more FP's in an S-box employed in a cipher to exploit the feebleness presented by such S-boxes. Hence, careful S-box designers generate substitution boxes that don't own such fixed points [64]. The comparative analysis of some recent S-boxes and the proposed S-box with respect to the FP's is given in Table 9. The proposed S-box does not contain any FP and thus gratifies FPA condition gracefully. Table 9 reveals that some recent S-boxes contain fixed points and use of such S-boxes may provide weaker protection to the ciphertext.

H. EFFECTIVENESS OF NOVEL HEURISTIC-BASED OPTMIZATION APPROACH
To validate the effectiveness of the novel heuristic-based nonlinearity performance optimization approach, Table 10 is maintained to illustrate the average NL values of few initial S-boxes generated using Algorithm 1. These initial S-boxes are processed using proposed Algorithm 2 to improvise the NL scores. The results are shown in Table 10. It is evident that the novel heuristic-based optimization approach, presented in Algorithm 2 and Figure 3, effectively improvises the NL scores of the respective initial S-boxes as seen in Table 10. The effectiveness of the  suggested heuristic-based optimization approach is also described through the plot shown in Figure 4. It is visually evident that nonlinearity scores of initial S-boxes get improvised up to a remarkable extent which justifies the consistency of the complete proposed S-box construction scheme.

I. EFFICIENCY ANALYSIS
Several techniques exist to generate 8 × 8 S-boxes having high nonlinearity higher or equal to 110. The main advantage of our proposed scheme is the capability to construct large number of such dynamic and highly nonlinear S-boxes in an efficient way. To observe the efficiency of the projected S-box scheme, we implemented it in Visual C# and executed on a system having an Intel Core i7 CPU (2.2 GHz) and 4GB RAM. The computational efficiency of our projected technique was analyzed for set of S-boxes (i.e. both initial and final ones). The performance erection of S-box has been performed using novel heuristic-based optimization approach to extemporize nonlinearity of initial S-box. Table 11 demonstrates a comparative analysis of computational efficiency in terms of generation time of S-box constructions along with time incurred in recently published articles [62], [63], [72], [73], [75], [76] which have applied some heuristic approaches. Table 11 demonstrates that the computational time of generating our proposed S-box is handsomely inspirational as compared to those of [62], [63], [72], [73], [75], [76] while NL scores of these approaches are nearly equal and quite high.
To evaluate the computational efficiency and gain offered by the proposed heuristic approach when an initial S-Box with a certain nonlinearity value is given to it, different   20,000 initial S-boxes were generated using Algorithm 1. Nonlinearity values of each initial and final S-Box were noted along with the time (seconds) and the number of iterations taken. Although the nonlinearity of each initial S-Box was improvised by the application of the proposed heuristic evolution approach, we considered only those cases where the nonlinearity value gained by the final S-Box was >= 110. Table 12  It can be seen from Table 12 that an initial S-Box with high NL generally takes less time and number of iterations to produce final S-Box with high NL value. Figure 5 shows the relationship between the initial S-Box NL values and the number of final S-Boxes having NL >= 110.
Our projected technique for S-box construction employs modest, innovative, and dynamic cubic modular transformation (CMT) which is the first one of its nature, uses cubic trigonometric transform, and a novel dynamic heuristicbased optimization approach. As compared to the weak points present in many techniques in literature, proposed technique offers a freedom to erect dynamic S-boxes with high cryptographic forte and causes an attacker's efforts more ineffective.

IV. CONCLUSION
Several existing techniques generate S-boxes that lack different security standards like presence of fixed points, non-bijectiveness, low score of differential uniformity, etc. Other methods use static transformations, fixed irreducible polynomials, and static heuristic approaches. This research article projected a simple and innovative scheme for the creation of highly nonlinear S-boxes with a novel cubic modular transformation along with the trigonometric Sine function. A pioneering heuristic-based optimization approach, which is dynamic in nature, is suggested that improvises the nonlinearity of the initial S-box. The proposed scheme uses input parameters of integer type in transformation and optimization phases that possesses the potential to spawn a large count of sturdy S-boxes when a minute variation is applied in the parameters' values. Cipher key is used to employ values to the input parameters for the creation of dynamic S-boxes. A specimen S-box is spawned, and its recital has been achieved through standard criteria of S-box evaluation along with the comparative analysis with many existing S-boxes.
AHMED ALKHAYYAT received the B.Sc. degree in electrical engineering from AL KUFA University, Najaf, Iraq, in 2007, the M.Sc. degree from the Dehradun Institute of Technology, Dehradun, India, in 2010, and the Ph.D. degree from Cankaya University, Ankara, Turkey, in 2015. He is currently the Dean of International Relationship and Manager of the word ranking in the Islamic University, Najaf, Iraq. His research interests include the IoT in the health-care system, SDN, network coding, cognitive radio, efficient-energy routing algorithms, and efficientenergy MAC protocol in cooperative wireless networks and wireless body area networks, and cross-layer designing for self-organized networks. He contributed in organizing a several IEEE conferences, workshop, and special sessions. He served as a reviewer for several journals and conferences.
MUHAMMAD JUNAID ARSHAD is currently working as an Associate Professor with the University of Engineering and Technology (UET), Lahore. He is also a HEC Approved Ph.D. Supervisor and very much active in research. He has more than 50 national and international publications to his credit. He is working on three funded research proposals approved by HEC and UET. He has supervised more than 50 BS Research Projects, 60 M.Sc./M. Phil theses, and currently supervising five Ph.D. scholars. His research interests include protocols and algorithms for heterogeneous networks, data centre networks, multihomed networks focusing on performance, computer architecture, mobile ad-hoc networks, simulation and modeling, information security, cloud computing, and so on. He is a member of the IEEE Computer Society and the IEEE Communications Society Korea Information and Communications Society (KICS). He is serving as an editor/reviewer in many reputed International Research Journals. He is an Advisor of the Punjab Public Service Commission and the Federal Public Service Commission.
MIAN MUHAMMAD UMAR SHABAN received the B.S. degree in computer science from Government College University (GCU), Faisalabad, Pakistan, and the M.S. degree in computer science from the University of Management and Technology (UMT), Lahore, Pakistan. His current research interests include information security, ethical hacking, cryptanalysis, blockchain, and so on.