Share This Article:

A Modern Method for Constructing the S-Box of Advanced Encryption Standard

Abstract Full-Text HTML XML Download as PDF (Size:352KB) PP. 234-244
DOI: 10.4236/am.2019.104018    29 Downloads   48 Views
Author(s)    Leave a comment
The substitution table (S-Box) of Advanced Encryption Standard (AES) and its properties are key elements in cryptanalysis ciphering. We aim here to propose a straightforward method for the non-linear transformation of AES S-Box construction. The method reduces the steps needed to compute the multiplicative inverse, and computes the matrices multiplication used in this transformation, without a need to use the characteristic matrix, and the result is a modern method constructing the S-Box.

1. Introduction

The S-Box table of AES is taken as a lookup table to substitute an input byte by another, this table is constructed using a non-linear transformation depends on the usual method taking more calculation steps to give the corresponding byte.

The S-Box plays a fundamental role in encryption and decryption processes, as byte substitution appears in many steps. At the first round of the encryption process, we add the plaintext matrix to the key matrix, then we substitute each byte by another byte according to S-Box, for example, to substitute the byte xy(say), we take the byte in the cell that has x as the column index and y as the row index, we do this substitute byte step in all rounds of the encryption process, and in all round of the decryption process, we do the inverse substitute byte step, to substitute the byte xy(say), we take the index of the column, and the index of the row of the cell that contains xy, as the left and the right character of the result byte, respectively. The S-Box (Table 1), involves substitution bytes for all bytes from {00} to {FF} in hexdecimal presentation.

The S-Box is constructed using the following operations [1] :

1) Finding the multiplicative inverse of an input byte in the finite field $GF\left({2}^{8}\right)$ based on the irreducible polynomial $P\left(x\right)={x}^{8}+{x}^{4}+{x}^{3}+x+1$ .

2) Multiplying this multiplicative inverse by a specific matrix (matrix M).

3) Adding the multiplication result to a specific vector $\left(\left\{63\right\}=01100011\right)$ .

We convert the hexadecimal presentation of the input byte into binary presentation as $\left({a}_{7}{a}_{6}{a}_{5}{a}_{4}{a}_{3}{a}_{2}{a}_{1}{a}_{0}\right)$ and write it as a polynomial $A\left(x\right)={a}_{7}{x}^{7}+{a}_{6}{x}^{6}+{a}_{5}{x}^{5}+{a}_{4}{x}^{4}+{a}_{3}{x}^{3}+{a}_{2}{x}^{2}+{a}_{1}x+{a}_{0}$ , let its multiplicative inverse be $T\left(x\right)={t}_{7}{x}^{7}+{t}_{6}{x}^{6}+{t}_{5}{x}^{5}+{t}_{4}{x}^{4}+{t}_{3}{x}^{3}+{t}_{2}{x}^{2}+{t}_{1}x+{t}_{0}$ , we multiply $T\left(x\right)$ by the following characteristic matrix:

$M=\left[\begin{array}{cccccccc}1& 0& 0& 0& 1& 1& 1& 1\\ 1& 1& 0& 0& 0& 1& 1& 1\\ 1& 1& 1& 0& 0& 0& 1& 1\\ 1& 1& 1& 1& 0& 0& 0& 1\\ 1& 1& 1& 1& 1& 0& 0& 0\\ 0& 1& 1& 1& 1& 1& 0& 0\\ 0& 0& 1& 1& 1& 1& 1& 0\\ 0& 0& 0& 1& 1& 1& 1& 1\end{array}\right]$ (1)

Then, we add the result to (01100011).

We note that, for the input {00} the output is {63}.

Table 1. The AES S-Box.

1.1. Problem Statement

We search for an easier and straightforward method for constructing the AES S-Box.

1.2. Proposed Solution

The multiplicative inverse of an input byte can be computed in clear steps using an iterated formula.

Multiplying the multiplicative inverse matrix by the characteristic matrix can be determined directly from this multiplicative inverse using simple XOR operations, without a need to use the characteristic matrix.

2. Traditional Way

In cryptography, the extended Euclidean algorithm has wide uses especially for finding a multiplicative inverse (modular inverse).

Euclidean algorithm is used to find the greatest common divisor of two integers a and b, (denoted by $\mathrm{gcd}\left(a,b\right)$ ).

When $b>a$ , and

$b-r=aq$ (2)

for some integers r and q, we say

$r=b\left(\mathrm{mod}a\right)$ (3)

and if $b\left(\mathrm{mod}a\right)=0$ then

$\mathrm{gcd}\left(a,b\right)=a$ (4)

With the polynomials $A\left(x\right)$ and $P\left(x\right)$ , we write $\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)$ [2] .

The algorithm below gives $\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)$ , where $A\left(x\right)

The step (1.(a)) of the algorithm (1) involves the division algorithm:

$P\left(x\right)=A\left(x\right)q\left(x\right)+r\left(x\right)$ (5)

where $0\le r\left(x\right)=P\left(x\right)\mathrm{mod}A\left(x\right) .

It implies that [4]

$\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)=\mathrm{gcd}\left(A\left(x\right),r\left(x\right)\right)$ (6)

If $r\left(x\right)\ne 0$ , the step will be repeated, let us write the repeated application of the division algorithm as:

$P\left(x\right)={q}_{1}\left(x\right)A\left(x\right)+{r}_{1}\left(x\right)$ , $0\le {r}_{1}\left(x\right)

$A\left(x\right)={q}_{2}\left(x\right){r}_{1}\left(x\right)+{r}_{2}\left(x\right)$ , $0\le {r}_{2}\left(x\right)<{r}_{1}\left(x\right)$

${r}_{1}\left(x\right)={q}_{3}\left(x\right){r}_{2}\left(x\right)+{r}_{3}\left(x\right)$ , $0\le {r}_{3}\left(x\right)<{r}_{2}\left(x\right)$

$\cdots$

${r}_{i-3}\left(x\right)={q}_{i-1}\left(x\right){r}_{i-2}\left(x\right)+{r}_{i-1}\left(x\right)$ , $0\le {r}_{i-1}\left(x\right)<{r}_{i-2}\left(x\right)$

${r}_{i-2}\left(x\right)={q}_{i}\left(x\right){r}_{i-1}\left(x\right)+{r}_{i}\left(x\right)$ , $0\le {r}_{i}\left(x\right)<{r}_{i-1}\left(x\right)$ (7)

When ${r}_{i}\left(x\right)=0$ , and since

$\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)=\mathrm{gcd}\left({r}_{i-1}\left(x\right),{r}_{i}\left(x\right)\right)$ (8)

we get

$\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)={r}_{i-1}\left(x\right)$ (9)

The extended form of the Euclidean algorithm is called Extended Euclidean algorithm, it gives (besides $\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)$ , $X\left(x\right)$ and $Y\left(x\right)$ such that

$\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)=A\left(x\right)X\left(x\right)+P\left(x\right)Y\left(x\right)$ (10)

Rewrite the equations of the system (7) as:

${r}_{1}\left(x\right)=P\left(x\right)-{q}_{1}\left(x\right)A\left(x\right)$

${r}_{2}\left(x\right)=A\left(x\right)-{q}_{2}\left(x\right){r}_{1}\left(x\right)$

${r}_{3}\left(x\right)={r}_{1}\left(x\right)-{q}_{3}\left(x\right){r}_{2}\left(x\right)$

$\cdots$

${r}_{i-2}\left(x\right)={r}_{i-4}\left(x\right)-{q}_{i-2}\left(x\right){r}_{i-3}\left(x\right)$

${r}_{i-1}\left(x\right)={r}_{i-3}\left(x\right)-{q}_{i-1}\left(x\right){r}_{i-2}\left(x\right)$ (11)

Then, in the last equation of system (11), ${r}_{i-1}\left(x\right)={r}_{i-3}\left(x\right)-{q}_{i-1}\left(x\right){r}_{i-2}\left(x\right)$ , replace ${r}_{i-2}\left(x\right)$ with its value from the above equation (it involves ${r}_{i-3}\left(x\right)$ ), then replace ${r}_{i-3}\left(x\right)$ with its value from the above equation, continue doing this replacement, we obtain

$\begin{array}{c}{r}_{i-1}\left(x\right)={r}_{i-3}\left(x\right)-\left({q}_{i-1}\left(x\right)\right)\left({r}_{i-4}\left(x\right)-\left({q}_{i-2}\left(x\right)\right)\left({r}_{i-5}\left(x\right)-\left({q}_{i-3}\left(x\right)\right)\\ \text{\hspace{0.17em}}\text{\hspace{0.17em}}×\left({r}_{i-6}\left(x\right)-\left({q}_{i-4}\left(x\right)\right)\left(\left(\cdots \right)\left(P\left(x\right)-{q}_{1}\left(x\right)A\left(x\right)\right)\right)\right)\right)\right)\end{array}$ (12)

Equation (12) takes the form

${r}_{i-1}\left(x\right)=A\left(x\right)X\left(x\right)+P\left(x\right)Y\left(x\right)$ (13)

In our problem $1\le i<8$ , and since the multiplicative inverse only exists when the gcd is 1 [5] .

${r}_{i-1}\left(x\right)=1$ (14)

The multiplicative inverse [2] of $A\left(x\right)$ modulo $P\left(x\right)$ is ${A}^{-1}\left(x\right)$ such that

$A\left(x\right){A}^{-1}\left(x\right)=1\left(\mathrm{mod}P\left(x\right)\right)$ (15)

When $\mathrm{gcd}\left(A\left(x\right),P\left(x\right)\right)=1$ ,

$1=A\left(x\right)X\left(x\right)+P\left(x\right)Y\left(x\right)$ (16)

$1\left(\mathrm{mod}P\left(x\right)\right)=\left(A\left(x\right)X\left(x\right)+P\left(x\right)Y\left(x\right)\right)\left(\mathrm{mod}P\left(x\right)\right)$ (17)

and since

$P\left(x\right)Y\left(x\right)=0\left(\mathrm{mod}P\left(x\right)\right)$ (18)

we get

$X\left(x\right)={A}^{-1}\left(x\right)$ (19)

So, the procedure of the extended Euclidean algorithm finds the greatest common divisor, also it finds the multiplicative inverse.

Below an algorithm to find ${A}^{-1}\left(x\right)$ , we will denote ${A}^{-1}\left(x\right)$ by $T\left(x\right)$ .

Now, we have $T\left(x\right)=\left({t}_{7}{t}_{6}{t}_{5}{t}_{4}{t}_{3}{t}_{2}{t}_{1}{t}_{0}\right)$ , we multiply it (from the left) by matrix M

$M\left(T\left(x\right)\right)=\left[\begin{array}{cccccccc}1& 0& 0& 0& 1& 1& 1& 1\\ 1& 1& 0& 0& 0& 1& 1& 1\\ 1& 1& 1& 0& 0& 0& 1& 1\\ 1& 1& 1& 1& 0& 0& 0& 1\\ 1& 1& 1& 1& 1& 0& 0& 0\\ 0& 1& 1& 1& 1& 1& 0& 0\\ 0& 0& 1& 1& 1& 1& 1& 0\\ 0& 0& 0& 1& 1& 1& 1& 1\end{array}\right]\left[\begin{array}{c}{t}_{0}\\ {t}_{1}\\ {t}_{2}\\ {t}_{3}\\ {t}_{4}\\ {t}_{5}\\ {t}_{6}\\ {t}_{7}\end{array}\right]=\left[\begin{array}{c}{t}_{0}+{t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{5}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}+{t}_{4}\\ {t}_{1}+{t}_{2}+{t}_{3}+{t}_{4}+{t}_{5}\\ {t}_{2}+{t}_{3}+{t}_{4}+{t}_{5}+{t}_{6}\\ {t}_{3}+{t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}\end{array}\right]$ (20)

Then, we add the result to $\left(\left\{63\right\}=01100011\right)$ to obtain the output of the input $A\left(x\right)=\left({a}_{7}{a}_{6}{a}_{5}{a}_{4}{a}_{3}{a}_{2}{a}_{1}{a}_{0}\right)$

$\left[\begin{array}{c}{t}_{0}+{t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{5}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}+{t}_{4}\\ {t}_{1}+{t}_{2}+{t}_{3}+{t}_{4}+{t}_{5}\\ {t}_{2}+{t}_{3}+{t}_{4}+{t}_{5}+{t}_{6}\\ {t}_{3}+{t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}\end{array}\right]+\left[\begin{array}{c}1\\ 1\\ 0\\ 0\\ 0\\ 1\\ 1\\ 0\end{array}\right]=\left[\begin{array}{c}{t}_{0}+{t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}+1\\ {t}_{0}+{t}_{1}+{t}_{5}+{t}_{6}+{t}_{7}+1\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{6}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}+{t}_{7}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}+{t}_{4}\\ {t}_{1}+{t}_{2}+{t}_{3}+{t}_{4}+{t}_{5}+1\\ {t}_{2}+{t}_{3}+{t}_{4}+{t}_{5}+{t}_{6}+1\\ {t}_{3}+{t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}\end{array}\right]$ (21)

Example

Using the traditional way, we want to find the output byte that corresponding to the input byte {53} (Table 2).

$\left\{53\right\}=01010011$ , $A\left(x\right)={x}^{6}+{x}^{4}+x+1$ , $P\left(x\right)={x}^{8}+{x}^{4}+{x}^{3}+x+1$ .

Iteration 1

Iteration 2

Iteration 3

$T\left(x\right)={y}_{1}\left(x\right)={x}^{7}+{x}^{6}+{x}^{3}+x=11001010$ .

$\left[\begin{array}{cccccccc}1& 0& 0& 0& 1& 1& 1& 1\\ 1& 1& 0& 0& 0& 1& 1& 1\\ 1& 1& 1& 0& 0& 0& 1& 1\\ 1& 1& 1& 1& 0& 0& 0& 1\\ 1& 1& 1& 1& 1& 0& 0& 0\\ 0& 1& 1& 1& 1& 1& 0& 0\\ 0& 0& 1& 1& 1& 1& 1& 0\\ 0& 0& 0& 1& 1& 1& 1& 1\end{array}\right]\left[\begin{array}{c}0\\ 1\\ 0\\ 1\\ 0\\ 0\\ 1\\ 1\end{array}\right]=\left[\begin{array}{c}0\\ 1\\ 1\\ 1\\ 0\\ 0\\ 0\\ 1\end{array}\right]$ (22)

$\left[\begin{array}{c}0\\ 1\\ 1\\ 1\\ 0\\ 0\\ 0\\ 1\end{array}\right]+\left[\begin{array}{c}1\\ 1\\ 0\\ 0\\ 0\\ 1\\ 1\\ 0\end{array}\right]=\left[\begin{array}{c}1\\ 0\\ 1\\ 1\\ 0\\ 1\\ 1\\ 1\end{array}\right]$ (23)

The output is $11101101=ED$ .

Table 2. To find the output of {53}.

3. Modern Way

We use the formula [6] below to find the multiplicative inverse.

3.1. The Iterated Formula

The iterated formula

${T}_{i}\left(x\right)=\left({q}_{i}\left(x\right)\right)\left({T}_{i-1}\left(x\right)\right)+{T}_{i}\left(x\right)$ , $2\le i<8$ (24)

where ${T}_{0}\left(x\right)=1,{T}_{1}\left(x\right)={q}_{1}\left(x\right)$ , gives the multiplicative inverse $T={T}_{i}$ when ${r}_{i}=1$ .

To show that, we use the system (11).

When $i=1$ , ${r}_{1}\left(x\right)=1$ ,

${r}_{1}\left(x\right)=P\left(x\right)-\left({q}_{1}\left(x\right)\right)\left(A\left(x\right)\right)$ (25)

$1=P\left(x\right)-\left({q}_{1}\left(x\right)\right)\left(A\left(x\right)\right)$ (26)

We obtain $T\left(x\right)={q}_{1}\left(x\right)={T}_{1}\left(x\right)$ . (Equation (24), takes this as given).

When $i=2$ , ${r}_{2}\left(x\right)=1$ , ${r}_{1}\left(x\right)\ne 0$ ,

${r}_{2}\left(x\right)=A\left(x\right)-\left({q}_{2}\left(x\right)\right)\left({r}_{1}\left(x\right)\right)$ (27)

$\begin{array}{c}1=A\left(x\right)-\left({q}_{2}\left(x\right)\right)\left(P\left(x\right)-\left({q}_{1}\left(x\right)\right)\left(A\left(x\right)\right)\right)\\ =\left(1-\left({q}_{2}\left(x\right)\right)\left({q}_{1}\left(x\right)\right)\right)\left(A\left(x\right)\right)-\left({q}_{2}\left(x\right)\right)\left(P\left(x\right)\right)\\ =\left(1-\left({q}_{2}\left(x\right)\right)\left({q}_{1}\left(x\right)\right)\right)\left(A\left(x\right)\right)-\left({q}_{2}\left(x\right)\right)\left(P\left(x\right)\right)\end{array}$ (28)

We obtain $T\left(x\right)=\left({q}_{2}\left(x\right)\right)\left({q}_{1}\left(x\right)\right)+1$ . From Equation (24)

$T\left(x\right)={T}_{2}\left(x\right)={q}_{2}\left(x\right){T}_{1}\left(x\right)+{T}_{0}\left(x\right)=\left({q}_{2}\left(x\right)\right)\left({q}_{1}\left(x\right)\right)+1$ (29)

When $i=3$ , ${r}_{3}\left(x\right)=1$ , ${r}_{1}\left(x\right)\ne 0$ , ${r}_{2}\left(x\right)\ne 0$ ,

${r}_{3}\left(x\right)={r}_{1}\left(x\right)-{q}_{3}\left(x\right){r}_{2}\left(x\right)$ (30)

$\begin{array}{c}1=P\left(x\right)-{q}_{1}\left(x\right)A\left(x\right)-{q}_{3}\left(x\right)\left(\left(1-{q}_{2}\left(x\right){q}_{1}\left(x\right)\right)A\left(x\right)-{q}_{2}\left(x\right)P\left(x\right)\right)\\ =\left(\left({q}_{3}\left(x\right)\right)\left(1-{q}_{2}\left(x\right){q}_{1}\left(x\right)\right)-{q}_{1}\left(x\right)\right)A\left(x\right)+K\left(x\right)P\left(x\right)\end{array}$ (31)

We obtain

$T\left(x\right)=\left({q}_{3}\left(x\right)\right)\left(1-\left({q}_{2}\left(x\right)\right)\left({q}_{1}\left(x\right)\right)\right)-{q}_{1}\left(x\right)={q}_{3}\left(x\right){T}_{2}\left(x\right)+{T}_{1}\left(x\right)$ (32)

and from Equation (24)

$T\left(x\right)={T}_{3}\left(x\right)={q}_{3}\left(x\right){T}_{2}\left(x\right)+{T}_{1}\left(x\right)$ (33)

By this way, we can show that Equation (24) gives $T\left(x\right)$ for $2\le i<8$ , when ${r}_{i}=1$ .

Below an algorithm to find $T\left(x\right)$ using the modern way.

Now, we want to multiply $T\left(x\right)$ by the matrix M.

First, write M as [7]

$M=\left[\begin{array}{cc}\left[\begin{array}{cc}\begin{array}{cc}1& 0\\ 1& 1\end{array}& \begin{array}{cc}0& 0\\ 0& 0\end{array}\\ \begin{array}{cc}1& 1\\ 1& 1\end{array}& \begin{array}{cc}1& 0\\ 1& 1\end{array}\end{array}\right]& \left[\begin{array}{cc}\begin{array}{cc}1& 1\\ 0& 1\end{array}& \begin{array}{cc}1& 1\\ 1& 1\end{array}\\ \begin{array}{cc}0& 0\\ 0& 0\end{array}& \begin{array}{cc}1& 1\\ 0& 1\end{array}\end{array}\right]\\ \left[\begin{array}{cc}\begin{array}{cc}1& 1\\ 0& 1\end{array}& \begin{array}{cc}1& 1\\ 1& 1\end{array}\\ \begin{array}{cc}0& 0\\ 0& 0\end{array}& \begin{array}{cc}1& 1\\ 0& 1\end{array}\end{array}\right]& \left[\begin{array}{cc}\begin{array}{cc}1& 0\\ 1& 1\end{array}& \begin{array}{cc}0& 0\\ 0& 0\end{array}\\ \begin{array}{cc}1& 1\\ 1& 1\end{array}& \begin{array}{cc}1& 0\\ 1& 1\end{array}\end{array}\right]\end{array}\right]$ (34)

Let

${M}_{1}=\left[\begin{array}{cc}\begin{array}{cc}1& 0\\ 1& 1\end{array}& \begin{array}{cc}0& 0\\ 0& 0\end{array}\\ \begin{array}{cc}1& 1\\ 1& 1\end{array}& \begin{array}{cc}1& 0\\ 1& 1\end{array}\end{array}\right]$ , ${M}_{2}=\left[\begin{array}{cc}\begin{array}{cc}1& 1\\ 0& 1\end{array}& \begin{array}{cc}1& 1\\ 1& 1\end{array}\\ \begin{array}{cc}0& 0\\ 0& 0\end{array}& \begin{array}{cc}1& 1\\ 0& 1\end{array}\end{array}\right]$ (35)

And write $T\left(x\right)$ as

$T=\left[\begin{array}{c}\left[\begin{array}{c}{t}_{0}\\ {t}_{1}\\ {t}_{2}\\ {t}_{3}\end{array}\right]\\ \left[\begin{array}{c}{t}_{4}\\ {t}_{5}\\ {t}_{6}\\ {t}_{7}\end{array}\right]\end{array}\right]$ (36)

Let

${T}_{1}=\left[\begin{array}{c}{t}_{0}\\ {t}_{1}\\ {t}_{2}\\ {t}_{3}\end{array}\right]$ , ${T}_{2}=\left[\begin{array}{c}{t}_{4}\\ {t}_{5}\\ {t}_{6}\\ {t}_{7}\end{array}\right]$ (37)

Then

${M}_{1}{T}_{1}=\left[\begin{array}{c}{t}_{0}\\ {t}_{0}+{t}_{1}\\ {t}_{0}+{t}_{1}+{t}_{2}\\ {t}_{0}+{t}_{1}+{t}_{2}+{t}_{3}\end{array}\right]$ (38)

${M}_{1}{T}_{2}=\left[\begin{array}{c}{t}_{4}\\ {t}_{4}+{t}_{5}\\ {t}_{4}+{t}_{5}+{t}_{6}\\ {t}_{4}+{t}_{5}+{t}_{6}+{t}_{7}\end{array}\right]$ (39)

${M}_{2}{T}_{1}=\left[\begin{array}{c}{t}_{3}+{t}_{2}+{t}_{1}+{t}_{0}\\ {t}_{3}+{t}_{2}+{t}_{1}\\ {t}_{3}+{t}_{2}\\ {t}_{3}\end{array}\right]$ (40)

${M}_{2}{T}_{2}=\left[\begin{array}{c}{t}_{7}+{t}_{6}+{t}_{5}+{t}_{4}\\ {t}_{7}+{t}_{6}+{t}_{5}\\ {t}_{7}+{t}_{6}\\ {t}_{7}\end{array}\right]$ (41)

So, the multiplication of M and $T\left(x\right)$ gives

$\left[\begin{array}{c}{M}_{1}{T}_{1}+{M}_{2}{T}_{2}\\ {M}_{2}{T}_{1}+{M}_{1}{T}_{2}\end{array}\right]$

From Equation (38) and Equation (39), we note that the results of these multiplications give the form

$\left[\begin{array}{c}\text{firstelement}\\ \text{first}+\text{second}\\ \text{first}+\text{second}+\text{third}\\ \text{first}+\text{second}+\text{third}+\text{fourth}\end{array}\right]$

of the second matrix, and similarly, Equation (40) and Equation (41), show that the results give the form

$\left[\begin{array}{c}\text{fourth}+\text{third}+\text{second}+\text{first}\\ \text{fourth}+\text{third}+\text{second}\\ \text{fourth}+\text{third}\\ \text{fourth}\end{array}\right]$

of the second matrix, so we don’t need to use matrix M, as the traditional method.

In the last step, we add $M\left(T\left(x\right)\right)$ to $\left(\left\{63\right\}=01100011\right)$ .

3.2. Example

Using the modern way, we want to find the output of {53}

$\left\{53\right\}=01010011$ , $A\left(x\right)={x}^{6}+{x}^{4}+x+1$ , $P\left(x\right)={x}^{8}+{x}^{4}+{x}^{3}+x+1$ .

First, finding the multiplicative inverse (Table 3).

Table 3. Finding multiplicative inverse of {53}.

Since ${r}_{3}\left(x\right)=1$ ,

$\begin{array}{c}T\left(x\right)={T}_{3}\left(x\right)=\left({q}_{3}\left(x\right)\right){T}_{2}\left(x\right)+{T}_{1}\left(x\right)\\ =\left({q}_{3}\left(x\right)\right)\left(\left({q}_{2}\left(x\right)\right)\left({q}_{1}\left(x\right)\right)+1\right)+{q}_{1}\left(x\right)\\ =\left(x+1\right)\left[\left({x}^{4}+{x}^{2}\right)\left({x}^{2}+1\right)+1\right]+{x}^{2}+1\\ ={x}^{7}+{x}^{6}+{x}^{3}+x\\ =11001010\end{array}$

Then, computing the matrices multiplication:

$\left[\begin{array}{c}0\\ 1\\ 0\\ 1\\ 0\\ 0\\ 1\\ 1\end{array}\right]\to \left[\begin{array}{cc}\left[\begin{array}{c}0\\ 1\\ 1\\ 0\end{array}\right]& \left[\begin{array}{c}0\\ 0\\ 0\\ 1\end{array}\right]\\ \left[\begin{array}{c}0\\ 0\\ 1\\ 1\end{array}\right]& \left[\begin{array}{c}0\\ 0\\ 1\\ 0\end{array}\right]\end{array}\right]=\left[\begin{array}{c}0\\ 1\\ 1\\ 1\\ 0\\ 0\\ 0\\ 1\end{array}\right]$ (42)

Last, adding (01100011)

$\left[\begin{array}{c}0\\ 1\\ 1\\ 1\\ 0\\ 0\\ 0\\ 1\end{array}\right]+\left[\begin{array}{c}1\\ 1\\ 0\\ 0\\ 0\\ 1\\ 1\\ 0\end{array}\right]=\left[\begin{array}{c}1\\ 0\\ 1\\ 1\\ 0\\ 1\\ 1\\ 1\end{array}\right]$ (43)

So, the output is $11101101=ED$ .

4. Conclusions

In this paper, a straightforward method for obtaining the Advanced Encryption Standard S-Box look-up table without the traditional use of the characteristic Matrix M is proposed. We have demonstrated that the two methods are equivalent. In addition, the multiplicative inverse of $A\left(x\right)$ has been found more elegantly.

In future work, we will investigate the properties and the impact of this technique on cipher complexity analysis.

Conflicts of Interest

The authors declare no conflicts of interest.

Cite this paper

Ahmed, W. (2019) A Modern Method for Constructing the S-Box of Advanced Encryption Standard. Applied Mathematics, 10, 234-244. doi: 10.4236/am.2019.104018.

 [1] National Institute of Standards and Technology (NIST) (2001) Advanced Encryption Standard (AES). FIPS Publication 197. [2] Burton, D.M. (2007) Elementary Number Theory. 6th Edition, McGraw-Hill, New York. [3] Menezes, A., van Oorschot, P. and Vanstone, S. (1997) Handbook of Applied Cryptography. CRC Press, New York. https://doi.org/10.1201/9781439821916 [4] Cormen, T.H., Leiserson, C.E., Rivest, R.L. and Stein, C. (2009) Introduction to Algorithms. 3rd Edition, The MIT Press, Cambridge, London. [5] Ahmed, W.E. (2019) A Way to Compute a Greatest Common Divisor in the Galois Field (GF (2^n)). Journal of Advances in Mathematics, 16, 8317-8321. https://doi.org/10.24297/jam.v16i0.8167 [6] Ahmed, W.E. (2019) Some Techniques to Compute Multiplicative Inverses for Advanced Encryption Standard. Journal of Advances in Mathematics, 16, 8208-8212. https://doi.org/10.24297/jam.v16i0.8016 [7] Ahmed, W.E. (2019) On Rijndael ByteSub Transformation. Applied Mathematics, 10, 113-118. https://doi.org/10.4236/am.2019.103010

comments powered by Disqus

Copyright © 2018 by authors and Scientific Research Publishing Inc.

This work and the related PDF file are licensed under a Creative Commons Attribution 4.0 International License.