# Algorithm for Generating S-Boxes with Prescribed Differential Properties
## 5 Experimental Results  
In this section, we present experimental results to support our theoretical analysis of the algorithm. To obtain the presented results, we used a custom software called \"SBox Tool\" [49], developed in Python. This software can generate a selected number of S-boxes of a given size using different methods, analyze them, and export the results for further statistical processing. In the first experiment, we analyzed a large number of randomly generated bijective S-boxes generated using Python's random permutation method. Table 3 contains a cumulative distribution of \(\delta\)-differentially uniform S-boxes. The values are based on a dataset of 10,000 randomly generated S-boxes. The experimental values are consistent with the estimates obtained by the \"bins and balls\" method presented in Table 2.  
We implemented the proposed method based on depth-first search (Algorithm 3) in the \"S-box tool\" software. We tested the method by generating datasets of 100 bijective S-boxes \(S:\mathbb{Z}_{2}^{n}\to S:\mathbb{Z}_{2}^{n}\) with different parameter settings. As the generated S-boxes were bijective, all of them are balanced. Although our method does not focus on other S-box properties, we have included the distribution of nonlinearity of the generated S-boxes for comparison with other methods based on the suggestion of an anonymous reviewer. The summary of the results is presented in Tables 4-8. We show two different methods of S-box generation: \"Random\" denotes simple random generation, while our new method is denoted by the label \"P_DDT\". The parameter \(\delta_{max}\) denotes the limit on partial DDT items allowed during the search. The \"time\" column is the average time required to generate an S-box with the selected method, while columns in \"Nr. of \(\delta\)-uniform S-boxes\" show the distribution of the maximum value in the final DDT among the generated S-boxes (out of 100 generated S-boxes). Finally, the columns in \"Nonlinearity\" show the distribution of the nonlinearity among the generated S-boxes (out of 100 generated S-boxes). \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline  & & & & & & & & & & \\ \hline method & time [s] & \(n\) & \(\delta_{max}\) & 4 & 6 & 8 & 10 & 0 & 2 & 4 \\ \hline P\_DDT & 0.04398 & 4 & 4 & 100 & 0 & 0 & 0 & 0 & 44 & 56 \\ \hline P\_DDT & 0.02742 & 4 & 6 & 5 & 95 & 0 & 0 & 0 & 91 & 9 \\ \hline P\_DDT & 0.02582 & 4 & 8 & 3 & 59 & 38 & 0 & 3 & 92 & 5 \\ \hline P\_DDT & 0.02295 & 4 & 10 & 5 & 60 & 27 & 8 & 2 & 92 & 6 \\ \hline Random & 0.00056 & 4 & - & 1 & 65 & 25 & 7 & 9 & 88 & 3 \\ \hline \end{tabular}
\end{table} 
Table 4: Comparison of random generation of S-boxes with the proposed method based on partial DDT for an S-box size of \(n=4\). \begin{table}
\begin{tabular}{c c c c c c c} \hline
**S-Box Size** & \(\delta=4\) & \(\delta=6\) & \(\delta=8\) & \(\delta=10\) & \(\delta=12\) \\ \hline \(n=4\) & 5.15\% & 65.53\% & 95.03\% & 99.36\% & 99.98\% \\ \(n=6\) & 0 & 0.23\% & 50.09\% & 94.05\% & 99.51\% \\ \(n=8\) & 0 & 0 & 0.33\% & 39.88\% & 93.93\% \\ \hline \end{tabular}
\end{table} 
Table 3: Cumulative distribution of \(\delta\)-differentially uniform S-boxes based on a dataset of 10,000 randomly generated S-boxes. \begin{table}
\begin{tabular}{c c c c c c c c c c} \hline  & & & & & & & & & \\ \hline method & time [s] & \(n\) & \(\delta_{max}\) & 4 & 6 & 8 & 10 & 2 & 4 & 6 & 8 \\ \hline P\_DDT & 1.52535 & 5 & 4 & 100 & 0 & 0 & 0 & 0 & 0 & 9 & 91 \\ \hline P\_DDT & 0.07977 & 5 & 6 & 0 & 100 & 0 & 0 & 0 & 2 & 45 & 53 \\ \hline P\_DDT & 0.07214 & 5 & 8 & 0 & 19 & 81 & 0 & 0 & 2 & 56 & 42 \\ \hline P\_DDT & 0.06545 & 5 & 10 & 0 & 22 & 58 & 20 & 0 & 5 & 58 & 37 \\ \hline Random & 0.00051 & 5 & - & 0 & 20 & 66 & 14 & 1 & 2 & 66 & 31 \\ \hline \end{tabular}
\end{table} 
Table 5: Comparison of random generation of S-boxes with the proposed method based on partial DDT for an S-box size of \(n=5\).