A highly nonlinear S-box based on a fractional linear transformation

We study the structure of an S-box based on a fractional linear transformation applied on the Galois field \documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$GF(2^{8})$$\end{document}GF(28). The algorithm followed is very simple and yields an S-box with a very high ability to create confusion in the data. The cryptographic strength of the new S-box is critically analyzed by studying the properties of S-box such as nonlinearity, strict avalanche, bit independence, linear approximation probability and differential approximation probability. We also apply majority logic criterion to determine the effectiveness of our proposed S-box in image encryption applications.

blocks. The S-box based on Skipjack algorithm is also known as Skipjack F-table (Kim and Phan 2009). The XYi S-box is a mini version of a block cipher with block size of 8 bits. It has increased efficiency in computer applications (Shi et al. 2002). The Residue Prime S-box uses the field of residues of a prime number as an alternative to the Galois field based S-boxes (Abuelyman and Alsehibani 2008). These widely used S-boxes play the role of benchmarks in the field of cryptography. Among these, AES, APA and Gray S-boxes attain the highest nonlinearity measure 112. The S-box algorithm proposed in this framework produces high nonlinearity effect as achieved by the top S-boxes AES, APA and Gray, however, unlike these S-boxes, our S-box is structured by employing a single direct map rather the composition of two or more maps which makes this algorithm more efficient and economic in both software and hardware applications.
It is highly desired property for a cryptographically strong S-box to show good resistance towards linear and differential cryptanalysis (Biham and Shamir 1991;Matsui 1998). For a Boolean function f, the linear cryptanalysis is based on finding affine approximation to the action of a cipher (Nyberg 1993). Recently some efficient models are studied for S-boxes based on fractional linear transformations (Hussain et al. 2011(Hussain et al. , 2013a. S-box being the only nonlinear component in block cipher always requires high nonlinearity effect Ding 2004, 2007;Nyberg 1992Nyberg , 1993. Motivated by some recently presented designs, we in this paper propose an algorithm to structure an 8 × 8 S-box using fractional linear transformation applied on the Galois field GF (2 8 ) which produces very high nonlinearity measure. We further analyse the properties of the new S-box by different commonly used tests such as nonlinearity, strict avalanche criterion (SAC), bit independent criterion (BIC), linear and differential approximation probability tests (LAPT, DAPT). We then compare the results with those for the famous S-boxes and observe that our new S-box, based on a simple and straightforward algorithm, produces coherent results.
The material presented in this paper is organized as follows. In "Algorithm for S-box" section we explain in detail the construction and major properties of the underlying Galois field GF (2 8 ). We further discuss some interesting features of the fractional linear transformation and describe how this transformation is applied on the Galois field to structure the new S-box. "Analyses of S-box" section deals with the analysis of S-box against several common attacks and compares the cryptographic potential of our proposed S-box with other S-boxes such as AES, APA, Gray, Skipjack, Xyi and Residue Prime. In "Statistical analyses of S-box" section we perform some statistical analysis based on the image encryption application of the S-box and in "Conclusion" section we present conclusion regarding the significance of the new S-box when critically observed in comparison with the previously known models.

Algorithm for S-box
This section mainly deals with the structure of our S-box. Before we discuss the constituent algorithm, we need to go through some fundamental facts.
A function f : F n 2 → F 2 is called a Boolean function. We define a vectorial Boolean function F : F n 2 → F m 2 as where x = (x 1 , x 2 , . . . , x n ) ∈ F n 2 and each of f i 's for 1 ≤ i ≤ m is a Boolean function referred to as coordinate Boolean function. An n × n S-box is precisely defined as a vectorial Boolean function S : F n 2 → F n 2 . At this stage, it seems quite practical to understand the structural properties of the Galois field used to construct an S-box. Generally for any prime p, Galois field GF (p n ) is given by the factor ring is an irreducible polynomial of degree n.
For an 8 × 8 S-box, we use GF (2 8 ). In advanced encryption standards (AES), the construction of GF (2 8 ) is based on the degree 8 irreducible polynomial η(x) = x 8 + x 4 + x 3 + x + 1. In Hussain et al. (2013b), η(x) = x 8 + x 4 + x 3 + x 2 + x + 1 is used as the generating polynomial. Here we choose η(x) = x 8 + x 6 + x 5 + x 4 + 1 as the irreducible polynomial that generates the maximal ideal < η(x) > of the principal ideal domain F 2 [X]. It is important to note that we may choose any degree 8 irreducible polynomial for constructing GF (2 8 ) however the choice of generating polynomial may affect our calculations as the binary operations are carried modulo the used polynomial (see Benvenuto 2012 for details).
Generally the construction of an S-box requires a nonlinear bijective map. In literature many algorithms based on such maps or their compositions are presented to synthesize cryptographically strong S-boxes. We present the construction of S-box based on an invertible nonlinear map known as the fractional linear transformation. It is a function of the form az+b cz+d generally defined on the complex plain C such that a, b, c and d ∈ C satisfy the non-degeneracy condition ad − bc � = 0. The set of these transformations forms a group under the composition. The identity element in this group is the identity map and the the inverse dz−b −cz+a of az+b cz+d is assured by the condition ad − bc � = 0. One can easily observe that the algebraic expression of this map has a combined effect of inversion, dilation, rotation and translation. The nonlinearity and algebraic complexity of the fractional linear transformation motivates the idea to employ this map for byte substitution.
For the proposed S-box we apply fractional linear transformation g on the Galois field discussed above, i.e. g : GF (2 8 ) → GF (2 8 ) given by g(t) = at+b ct+d , where a, b, c and d ∈ GF (2 8 ) such that ad − bc � = 0 and t varies from 0 to 255 ∈ GF (2 8 ). We may choose any values for parameters a, b, c and d that satisfy the condition ad − bc � = 0. Here, for calculations, we take a = 29 = 00011101, b = 15 = 00001111, c = 8 = 00001000 and d = 9 = 00001001. One may observe that as we are working on a finite field, g(t) needs to be explicitly defined at t = 47 (at which denominator vanishes), so in order to keep g bijective we may define the transformation as given below; Following the binary operations defined on the Galois field (Benvenuto 2012), we calculate the images of g as shown in Table 1. Thus the images of the above defined transformation yield the elements of the proposed S-box (see Table 2).
It is important to mention that an 8 × 8 S-box has 8 constituent Boolean functions. A Boolean function f is balanced if {x|f (x) = 0} and {x|f (x) = 1} have same cardinality or the Hamming weight HW(f ) = 2 n−1 . The significance of the balance property is that the higher the magnitude of a function's imbalance, the more likelihood of a high probability linear approximation being obtained. Thus, the imbalance makes a Boolean function weak in terms of linear cryptanalysis. Furthermore, a function with a large imbalance can easily be approximated by a constant function. All the Boolean functions f i , i ≤ i ≤ 8, involved in the S-box as shown in Table 2 satisfy the balance property. Hence, the proposed S-box is balanced. It might be of interest that in order to choose feasible parameters leading to balanced S-boxes satisfying all other desirable properties (as discussed in the next section), one can use constraint programming, a problem solving strategy which characterises the problem as a set of constraints over a set of variables (Kellen 2014;Ramamoorthy et al. 2011). An S-box is used to convert the plain data into the encrypted data, it is therefore essential to investigate the comparative performance of the S-box. We, in the next section, analyse the newly designed S-box through various indices to establish the forte of our proposed S-box.

Analyses of S-box
For the assessment of the cryptographic strength of our S-box, in this section, we apply some widely used analysis techniques such as nonlinearity, bit independence, strict avalanche, linear and differential approximation probabilities etc. In the following subsections we present all these performance indices one by one.

Nonlinearity
The nonlinearity indicator counts the number of bits which must be altered in the truth table of a Boolean function to approach the nearest affine function. Table 3 shows that for the newly designed S-box, the average nonlinearity measure is 112. Figure 1 shows that when we compare this with different famous S-boxes, the nonlinearity of the proposed S-box is similar to that of the top S-boxes such as AES, APA and Gray and much higher then that of the Skipjack, Xyi and Residue Prime S-boxes.

Linear approximation probability
The linear approximation probability determines the maximum value of imbalance in the event. Let Ŵ x and Ŵ y be the input and output masks respectively and X consists of all possible inputs with cardinality 2 n , the linear approximation probability for a given S-box is defined as; Table 4 and Fig. 2 show that the linear approximation probability of the newly structured S-box is much better than those for Skipjack, Xyi and Residue prime S-boxes.

Differential approximation probability
The differential approximation probability is defined as;  where x and y are input and output differentials respectively. In ideal conditions, the S-box shows differential uniformity (Biham and Shamir 1991). The smaller the differential uniformity, the stronger is the S-box. It is evident from the Table 4 and Fig. 3 that the differential approximation probability of the proposed S-box is similar to those of the AES, APA and Gray S-boxes and much better than the Skipjack, Xyi and Residue Prime S-boxes.

Strict avalanche criterion
For any cryptographic design, when we change the input bits, the performance of the output bits is examined by this criterion. It is desired that a change in a single input bit must cause changes in half of the output bits. In other words a function F : F n 2 → F n 2 is said to satisfy SAC if for a change in an input bit i ∈ {1, 2, . . . , n} the probability of change in the output bit j ∈ {1, 2, . . . , n} is 1/2. It is clear from the results shown in Table 4 and Fig. 4 that our S-box satisfies the requirements of this criterion.

Bit independence criterion
The criterion of bit independence, introduced by Webster and Tavares (1986), is used to analyse the behaviour of bit patterns at the output and the effects of these changes in the subsequent rounds of encryption (Tran et al. 2008). For any vector Boolean function F : F n 2 → F n 2 , ∀ i, j and k ∈ {1, 2, . . . , n} with j � = k, inverting input bit i causes output bits j and k to change independently. In cryptographic systems it is highly desired to increase independence between bits as it makes harder to understand and forecast the design of the system.
The numerical results of BIC are given in Table 4 and are compared in Fig. 5. It can be observed that according to these results our S-box is quite similar to the AES, APA and Gray S-boxes.

Statistical analyses of S-box
In this section we present some useful statistical analysis of the new and some famous S-boxes. We apply the majority logic criterion (Hussain et al. 2012) in order to determine the effectiveness of the proposed S-box in image encryption applications.
Due to the expeditious developments in the area of digital image processing, it is quite challenging to protect the digital information against different attacks. In the last few years many efficient algorithm have been presented by the researchers regarding secure image encryption schemes (Bao and Zhou 2015;Gao and Chen 2008;Murguia et al. 2012;Ramirez-Torres et al. 2014;Vargas-Olmos et al. 2015, 2016. During the image encryption process distortions occur and the strength of the encryption algorithm used is characterized by the type of these distortions. We examine this by using various parameters generated by different statistical analysis regarding entropy, contrast, correlation, energy and homogeneity respectively. We begin with the entropy analysis which is used to measure the randomness in a system. This characterizes the texture of image. Some other analyses (as named above) are also applied in combination with the entropy analysis to enhance the authenticity of the results regarding the performance of an S-box. Contrast analysis measures the ability to identify objects in an image. To ensure strong encryption an elevated level of contrast is required. Correlation analysis is used to analyze the statistical properties of an S-box. By this analysis we determine the similarity between the pixels patterns of the plain and the encrypted images. Energy analysis determines the measure of the energy of an encrypted image when processed by various S-boxes. This measure gives the sum of squared elements in GLCM. The homogeneity analysis is used to determine the closeness of the elements distribution in the grey level co-occurrence matrix (GLCM) to GLCM diagonal. It is worth mentioning that a strong encryption algorithm requires a small measure of correlation, energy and homogeneity however high value of entropy and contrast. Figure 6 shows the plain image of Lena and its encryption using the new S-box. It is quite obvious from the visual results that our method of encryption creates acceptable level of confusion.
For an image, its histogram graphically represents image-pixels distribution by plotting the number of pixels at each intensity level (Ramirez-Torres et al. 2014). It has been established that the histogram of the original and the encrypted image should be significantly different so that attackers could not extract the original image from the encrypted one. Figure 7 shows the respective histograms of Lena's plain image and its encrypted a b version. The histogram analysis evidently proves the stability of our proposed method against any histogram based attacks. In order to determine the quantitative measure of the efficiency of the proposed method in image encryption, MLC is applied on a typical 512 × 512 image of Lena for the new S-box and results are compared with the other famous S-boxes. The numerical results for correlation, entropy, contrast, homogeneity and energy are arranged in Table 5. It is observed that the proposed S-box satisfies all the criteria to be used for the safe communication.
We may further test the performance of the proposed method in noisy environments. For this purpose, we consider ⊂ Z 2 as a bounded rectangular grid. Let U = {u(i) | i ∈ �} and V = {v(i) | i ∈ �} be the true and noisy images, respectively, such that where u(i) and v(i) ∈ R + are the intensities of gray level and n(i) is an independent and identically different Gaussian random noise with zero mean and variance σ 2 at pixel i ∈ . The continuous image is interpreted as the Shannon interpolation of the discrete grid of samples v(i) over . The goal here is to test the performance of method on noisy image V in order to analyse the behaviour of proposed method in comparison with its test on the true image U. For this purpose three different noise levels with σ = 25, 50 and 75 are considered in Fig. 8 to test the significant application of the proposed v(i) = u(i) + n(i), i = (i 1 , i 2 ) ∈ �,  algorithm. It can be observed that in case of noisy environment slight variations occur in visual quality and quantitative results as shown in Fig. 9 and Table 6. One can see that the entropy level of noise corrupted pixels is decreasing with increase in the level of Gaussian random noise. It shows most of the pixels are adopting similar grey levels in random data instead of particular arrangement of pixels in the original image. The contrast level also decreases with increasing noise level. Similarly changes in other parameters can be observed. The comparative analysis performed by applying AES S-box at the same noise levels is also shown in Table 7 and Fig. 10. One can observe that, with the increase in noise, the visual and numerical results obtained by the newly designed S-box are better or at least pretty similar to the recent state-of-the-art AES S-box (Daemen and Rijmen 2002). Based on the experimental results regarding the overall performance of our proposed algorithm, it is demonstrated that the newly synthesized S-box satisfies all the criteria of acceptability to be used for secure communication.    Fig. 8b. c Encryption of Fig. 8c