Abstract
Substitution boxes, or S-boxes, are one of the most important mathematical primitives in modern symmetric cryptographic algorithms. Given their importance, in the past decades, they have been thoroughly analyzed and evaluated by the academic world. Thus, a lot of desirable characteristics a given S-box should possess have been found. This includes, as much as possible, higher nonlinearity and algebraic degrees as well as, as much as possible, lower values of differential uniformity, autocorrelation and sum of squares indicator values. In this work, we use power mappings over to generate, enumerate and evaluate all bijective S-boxes yielded by pentanomials of the form given . We find a total of 152,320 different bijective S-boxes, which are further classified into 41,458 different groups in terms of the aforementioned characteristics as well as the number of their fixed points. Having this data, an S-box designer can easily generate a bijective substitution S-box with parameters of their choice. By using pentanomials, we show how we can easily construct S-boxes with cryptographic properties similar to those found in some popular S-boxes like the Kuznyechik S-box proposed by the Russian Federation’s standardization agency as well as the Skipjack S-box proposed by the National Security Agency of the USA.
MSC:
11T71; 94A60; 68P25
1. Introduction
Substitution boxes, or S-boxes, are one of the most important algebraic constructions for guaranteeing security in modern symmetric cryptographic algorithms. Being such a critical and significant mathematical structure, in the past decades, S-boxes have been thoroughly researched, analyzed and attacked. Throughout the literature, there are thousands of papers related to possible strategies for S-box construction. Those strategies can be logically divided into four major classes. The first one involves a straight algebraic construction, and an example of this S-box construction method is the well-known Rijndael S-box upon which the famous AES encryption algorithm [] is based. The second class is based on a heuristic search that starts from a pseudo-randomly generated seed. Some examples of such constructions are the hill climbing method algorithm discussed in [] and the simulated annealing approach presented in []. However, the heuristic routine could start with a highly competitive candidate instead of a pseudo-randomly generated one, which outlines the third construction method. An example of such a construction strategy is the modified immune algorithm proposed in []. Lastly, the fourth class is a collection of various hybrid approaches, which includes the generation of chaos-based S-boxes [], cellular automata-based S-boxes [] and other strategies that combine the classes above. Nevertheless, all these different strategies are trying to reach optimal or near-optimal S-boxes in terms of predetermined characteristics. The rule of thumb when searching for a secure S-box includes, but is not limited to, high nonlinearity value, low differential uniformity, high algebraic degree and low autocorrelation value.
One algebraic approach for constructing S-boxes with good cryptographic properties is based on power mappings. An enumeration of all 8-bit to 8-bit S-boxes with the trivial power mapping is presented in []. They are further classified to different classes by using their linear approximations and differential distribution tables. This method is further extended to higher-power functions like the binomial power functions discussed in []. In this work, we present a complete enumeration of all 8-bit to 8-bit S-boxes constructed by pentanomial power functions of the form given , and we further classify the results based on some important cryptographic characteristics. Then, we demonstrate how such a dataset could be utilized for finding power mapping equivalence approximations in terms of nonlinearity, -uniformity, algebraic degree and autocorrelation value to achieve the same characteristics as popular S-boxes.
2. Preliminaries
For convenience, throughout this section, we define the set .
Definition 1
(Boolean Function). A boolean function of n variables is a mapping from n binary inputs to one binary output . The binary truth table (BTT) of an n-variable boolean function is the vector of all the consecutive outputs of the boolean function:
The polarity truth table (PTT) of an n-variable boolean function is derived from the binary truth table. We define the PTT by . By the definition of the polarity truth table, it follows that:
Example 1.
For example, if we have a boolean function with three variables , then we have the following binary truth table:
Definition 2
(Algebraic Normal Form). The algebraic normal form of an n-variable boolean function , denoted by , is given by the following equation: , where the coefficient a belongs to B.
Example 2.
The boolean function given in the previous example is in ANF form.
Definition 3
(Algebraic Degree). The algebraic degree of a boolean function , denoted by , is equal to the number of variables in the longest item of its .
Example 3.
The number of variables in the longest item of the ANF form of the boolean function given in Example 1 is 3.
Definition 4
(Hamming Distance). The Hamming distance between two n-variable boolean functions and , denoted by , represents the number of differing elements in the corresponding positions of their truth tables.
Definition 5
(Linear Boolean Function). Any n-variable boolean function of the form
where , is called a linear function.
Definition 6
(Affine Boolean Function). Any n-variable boolean function of the form:
where and , is called an affine function.
Definition 7
(Walsh–Hadamard Transform). For an n-variable boolean function , represented by its polarity table , the Walsh–Hadamard transform, or WHT, , is defined by:
Example 4.
For example, if we have the same boolean function given in Example 1, i.e., , we have the following Walsh–Hadamard transform:
Definition 8
(Absolute Indicator). For an n-variable boolean function , we denote the absolute indicator of f as . For all except the zero vector, we write
The absolute indicator of f is calculated by
Example 5.
The absolute indicator of the boolean function given in Example 1 is 4.
Definition 9
(Vectorial Boolean Function–Substitution Table–S-box). An n-binary input to m-binary output mapping , which assigns some by to each , is called an substitution table (S-box) and is denoted by .
Example 6.
An example of an S-box in decimal notation is:
It can be described as follows. The input 000 is transformed to an output 011 in binary, which equals 3 in decimal. The next input, 001, is transformed to an output 110 in binary, which equals 6 in decimal, and so on.
Definition 10
(Bijective S-box). An S-box is said to be bijective if it maps each input to a distinct output and all possible outputs are present.
Example 7.
The S-box is bijective because it maps each input to a distinct output.
Definition 11
(S-box Extended WHT Spectrum Matrix (EWHTSM)). The extended Walsh–Hadamard transform spectrum matrix (EWHTSM) of an S-box is a matrix for which the columns are represented by the Walsh–Hadamard transform spectra of the boolean functions , where w and v are arranged lexicographically in and , respectively.
The importance of the S-box extended Walsh–Hadamard transform matrix is to quantitatively describe the distance with a special measure, similar to the Hamming distance, between each linear combination of coordinates in the given S-box and each possible linear function.
Definition 12
(Linear Approximation Table (LAT)). The linear approximation table of an S-box , denoted by or , is a table with rows and columns for which the entries are given by:
where Y is the consequent linear combination of the coordinates of the current S-box and X is the consequent linear function with length n.
Example 8.
The S-box has the following LAT:
Definition 13
(S-box Nonlinearity). The nonlinearity of an S-box , denoted by , is defined as:
where is the set of all absolute values of the elements in LAT except the uppermost left one.
Example 9.
The nonlinearity value of is 2.
Definition 14
(S-box Minimal Algebraic Degree). The minimal algebraic degree of an S-box is the minimum algebraic degree among all component functions of S.
where are the coordinate boolean functions of .
Example 10.
The minimal algebraic degree of is 2.
Definition 15
(S-box Absolute Indicator and Sum of Squares Indicator). The absolute indicator of a given S-box S, denoted as , is equal to the maximal absolute indicator among all absolute indicators of component functions of S, while the sum of squares indicator, denoted as , is the maximum sum of squared values of absolute indicators of component functions of S.
Example 11.
The absolute and sum of squares indicators of equal 8 and 128, respectively.
Definition 16
(S-box Differential Uniformity). Differential uniformity, or δ-uniformity, of a given S-box , denoted by , is defined by:
Example 12.
The differential uniformity value of is 2.
Definition 17
(S-box Fixed Points). The fixed points of a given bijective S-box are the set of those points x for which .
Example 13.
The set of fixed points of is .
Definition 18
(Power Mapping and Power Functions). Let us define a finite field . The power mapping of a given function for some fixed consists of all the mappings from x to for all . We can further define the sum of arbitrary power mappings as the power function.
Example 14.
Let us define a finite field and a function . We can easily construct the power mapping of x to y in F:
3. Classification of Pentanomial Power Functions in
Since all same-sized finite fields are isomorphic, we could take any irreducible polynomial to construct the finite field . The irreducible polynomial we used during our enumeration is . Then, for all possible elements , we consequently enumerate all possible pentanomials of the form given such that . If is a bijective S-box, its corresponding characteristics are calculated. We enumerated a total of 41,458 different classes distinguished by nonlinearity, differential uniformity, algebraic degree, autocorrelation value, fixed points and square of sum indicators. During the enumeration routine, we extracted a total of 152,320 different pentanomial power mappings that generate bijective S-boxes.
The overview and pseudo-code of our algorithm used throughout the enumeration routine is presented in Algorithm 1. In Table 1, several examples of pentanomial power mappings that yield distinguished classes are given. The first column of the table reveals the actual pentanomial that maps to a given S-box S. The next columns correspond, respectively, to the nonlinearity value of S, i.e., , to the differential uniformity, or -uniformity of S, i.e., , to the algebraic degree of S, i.e., , to the autocorrelation value of S, i.e., , to the number of fixed points in S as well as to the square of sum indicator of S, i.e., . The classes are sorted by the aforementioned characteristics from left to right. For example, the pentanomial under power mapping over and by using the irreducible polynomial yields the bijective S-box S shown in Figure 1.
| Algorithm 1 An Algorithm for Pentanomial Power Mapping Classification. | |
| Require: with irreducible polynomial | |
| Ensure: | |
| ▹ An empty set of classes | |
| for do | |
| ▹ The empty array | |
| for do | |
| over F | |
| end for | |
| if S is bijective then | |
| Calculates | ▹ Nonlinearity |
| Calculates | ▹ Differential uniformity |
| Calculates | ▹ Minimal algebraic degree |
| Calculates | ▹ Absolute indicator |
| Calculates | ▹ Fixed points |
| Calculates | ▹ Square of sum indicator |
| if then | |
| add in | ▹ New class is found |
| end if | |
| end if | |
| end for | |
Table 1.
Some pentanomial power mapping classes found in this work.
Figure 1.
An example of an AES-equivalent S-box generated by the pentanomial over and irreducible polynomial .
The characteristics of the S-box S shown in Figure 1 are , , , , 133,120 and a total of two fixed points (the first two points of the permutation representation, i.e., the zero and the one). It should be noted that this specific S-box is equivalent to the Rijndael S-box used in AES.
The full enumeration of the pentanomial power mappings yielded a rich spectrum of combinations of different S-box characteristics. Having this in mind, in Table 2, we show some pentanomial power mapping equivalents in terms of nonlinearity, -uniformity, algebraic degree and autocorrelation value that approximate popular S-boxes. For example, the Skipjack S-box proposed by the National Security Agency (NSA) of the USA has nonlinearity equal to 100, -uniformity of 12, an algebraic degree equal to 6 and an autocorrelation value of 96. An example of a pentanomial that yields a bijective S-box with exactly the same characteristics is . It should be noted that non-zero values of fixed points in a given S-box are an undesirable feature. However, we could easily transform to some other equivalent S-box with zero fixed points and without affecting its characteristics by applying an affine transformation. The same routine is applied in AES.
Table 2.
Pentanomial power mapping approximations of popular S-boxes.
4. Conclusions
In this paper, we successfully enumerated all possible power mappings of bijective 8-bit to 8-bit S-boxes using pentanomials of the form given . Based on various mathematical characteristics, we found a total of 41,458 different classes. The flexibility of the presented S-box generation strategy could be successfully utilized for constructing S-boxes with fine-grained characteristics of our choice. Furthermore, the data presented in this paper could be applied to reverse engineer S-boxes with unknown designs. The complete enumeration and dataset are provided as Supplementary Materials.
Supplementary Materials
The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/math12142154/s1, Table S1: Distinct power mapping classes.
Author Contributions
Conceptualization, M.D. and T.B.; methodology, M.D.; software, M.D.; validation, M.D. and T.B.; investigation, M.D. and T.B.; data curation, M.D. and T.B.; writing—original draft preparation, M.D. and T.B; writing—review and editing, M.D. and T.B. All authors have read and agreed to the published version of the manuscript.
Funding
This research was funded by the NSP SD program, which received funding from the Ministry of Education and Science of the Republic of Bulgaria under grant agreement No. D01-74/19.05.2022.
Data Availability Statement
The additional data as a pdf file containing all distinct power mapping classes is provided to the reviewers.
Conflicts of Interest
The authors declare no conflicts of interest.
References
- Daemen, J.; Rijmen, V. AES Proposal: Rijndael; National Institute of Standards and Technology: Gaithersburg, MD, USA, 1999.
- Kuznetsov, A.; Frontoni, E.; Romeo, L.; Poluyanenko, N.; Kandiy, S.; Kuznetsova, K.; Beňová, E. Optimizing hill climbing algorithm for S-boxes generation. Electronics 2023, 12, 2338. [Google Scholar] [CrossRef]
- Clark, J.A.; Jacob, J.L.; Stepney, S. The design of S-boxes by simulated annealing. New Gener. Comput. 2005, 23, 219–231. [Google Scholar] [CrossRef]
- Ivanov, G.; Nikolov, N.; Nikova, S. Cryptographically strong S-boxes generated by modified immune algorithm. In Cryptography and Information Security in the Balkans, Proceedings of the Second International Conference, BalkanCryptSec 2015, Koper, Slovenia, 3–4 September 2015; Revised Selected Papers 2; Springer: Amsterdam, The Netherlands, 2016; pp. 31–42. [Google Scholar]
- Dimitrov, M.M. On the design of chaos-based S-boxes. IEEE Access 2020, 8, 117173–117181. [Google Scholar] [CrossRef]
- Mariot, L.; Picek, S.; Leporati, A.; Jakobovic, D. Cellular automata based S-boxes. Cryptogr. Commun. 2019, 11, 41–62. [Google Scholar] [CrossRef]
- Aslan, B.; Sakalli, M.T.; Bulus, E. Classifying 8-bit to 8-bit S-boxes based on power mappings from the point of DDT and LAT distributions. In Arithmetic of Finite Fields, Proceedings of the 2nd International Workshop, WAIFI 2008, Siena, Italy, 6–9 July 2008; Proceedings 2; Springer: Amsterdam, The Netherlands, 2008; pp. 123–133. [Google Scholar]
- Isa, H.; Syed Junid, S.A.A.; Z’aba, M.R.; Endut, R.; Ammar, S.M.; Ali, N. Enhancement of Non-Permutation Binomial Power Functions to Construct Cryptographically Strong S-Boxes. Mathematics 2023, 11, 446. [Google Scholar] [CrossRef]
- Dolmatov, V. GOST R 34.12-2015: Block Cipher “Kuznyechik”; Technical Report; Center for Information Protection and Special Communications of the Federal Security Service of the Russian Federation: Moscow, Russia, 2016. [Google Scholar]
- Schneier, B.; Kelsey, J.; Whiting, D.; Wagner, D.; Hall, C.; Ferguson, N. Twofish: A 128-bit block cipher. NIST AES Propos. 1998, 15, 23–91. [Google Scholar]
- Lim, C.H. CRYPTON: A New 128-bit Block Cipher Specification and Analysis. Available online: https://api.semanticscholar.org/CorpusID:56701615 (accessed on 5 June 2024).
- Standaert, F.X.; Piret, G.; Rouvroy, G.; Quisquater, J.J.; Legat, J.D. ICEBERG: An involutional cipher efficient for block encryption in reconfigurable hardware. In Fast Software Encryption, Proceedings of the 11th International Workshop, FSE 2004, Delhi, India, 5–7 February 2004; Revised Papers 11; Springer: Amsterdam, The Netherlands, 2004; pp. 279–298. [Google Scholar]
- Grosso, V.; Leurent, G.; Standaert, F.X.; Varici, K.; Durvaux, F.; Gaspar, L.; Kerckhof, S. SCREAM & iSCREAM Side-Channel Resistant Authenticated Encryption with Masking. 2014. Available online: https://competitions.cr.yp.to/round1/screamv1.pdf (accessed on 5 June 2024).
- Karpman, P.; Grégoire, B. The LITTLUN S-box and the FLY block cipher. In Proceedings of the Lightweight Cryptography Workshop, Gaithersburg, MD, USA, 17–18 October 2016. [Google Scholar]
- Gérard, B.; Grosso, V.; Naya-Plasencia, M.; Standaert, F.X. Block ciphers that are easier to mask: How far can we go? In Cryptographic Hardware and Embedded Systems-CHES 2013, Proceedings of the 15th International Workshop, Santa Barbara, CA, USA, 20–23 August 2013; Proceedings 15; Springer: Amsterdam, The Netherlands, 2013; pp. 383–399. [Google Scholar]
- Barreto, P.; Rijmen, V. The Khazad legacy-level block cipher. Primit. Submitt. NESSIE 2000, 97, 1–20. [Google Scholar]
- Kanda, M.; Moriai, S.; Aoki, K.; Ueda, H.; Takashima, Y.; Ohta, K.; Matsumoto, T. E2–a new 128-bit block cipher. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. 2000, 83, 48–59. [Google Scholar]
- SKIPJACK and KEA Algorithm Specifications. 1998. Available online: https://cryptome.org/jya/skipjack-spec.htm (accessed on 5 June 2024).
- Barreto, P.; Rijmen, V. The Whirlpool hashing function. In Proceedings of the First Open NESSIE Workshop, Leuven, Belgium, 13–14 November 2000; Volume 13, p. 14. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).