Digging Deeper: Operator Analysis for Optimizing Nonlinearity of Boolean Functions

Marko Djurasevic, Domagoj Jakobovic, Luca Mariot, Stjepan Picek

TL;DR

This paper provides a systematic analysis of how genetic operators (mutation and crossover) affect the nonlinearity of Boolean functions, a critical property for cryptography. The authors demonstrate that while the mapping between a function's truth table and its nonlinearity is complex, simple local search strategies combined with more informative fitness functions can significantly outperform standard genetic algorithms in finding highly nonlinear functions.

What Problem Does This Paper Address?

Boolean functions are the backbone of modern cryptography, coding theory, and telecommunications. For a Boolean function to be cryptographically secure, it must be "highly nonlinear"—meaning it is as far as possible from any simple linear function to thwart linear cryptanalysis.

However, finding these functions is a nightmare for optimizers. The search space grows super-exponentially: for a function with just 7 inputs, there are $2^{128}$ possible functions. Most researchers use metaheuristics like Genetic Algorithms (GAs) to search this space, but they often treat the genetic operators (like flipping a bit) as "black boxes." There is a significant gap in understanding how a change in the genotype (the function's truth table) translates to a change in the phenotype (its nonlinearity, calculated via the Walsh-Hadamard Transform). This paper aims to "dig deeper" into that mapping to design better optimization algorithms.

Methods

The authors conduct an exhaustive analysis for small functions (3 and 4 variables) and use sampling for larger ones (up to 10 variables). Their approach involves:

  • Operator Analysis: They test eight mutation operators and two crossover operators (summarized in Figure 1) to see how they transition a function from one nonlinearity level to another.
  • Fitness Function Design: They compare a basic fitness function ($fitness_1$), which only looks at the nonlinearity value, against a more sophisticated one ($fitness_2$). The latter provides a smoother gradient by counting how many times the maximum absolute value appears in the Walsh-Hadamard spectrum, helping the algorithm "see" progress even when the raw nonlinearity hasn't changed yet.
  • Algorithm Comparison: They evaluate a standard steady-state GA against a Greedy Local Search (LS) and a modified "LS-revert" (LS-R) that can backtrack from dead-ends.
Table 1: Selected mutation operators and their neighborhood sizes

Datasets

The "datasets" in this study are the mathematical spaces of Boolean functions of varying sizes:

  • Exhaustive Sets: All possible functions for $n=3$ and $n=4$ variables.
  • Sampled Sets: Representative samples for $n=5$ to $n=10$ variables to evaluate algorithmic performance in larger, more realistic search spaces.

Key Insights and Ideas

  • Predictable Shifts: Some simple operators, like "bit set" (changing a 0 to a 1), produce perfectly consistent change patterns in the Walsh-Hadamard spectrum regardless of the function they are applied to (see Figure 2). This suggests we can theoretically "target" specific spectral changes.
  • Position Doesn't Matter (Much): For bit-flip mutations, the probability of increasing nonlinearity depends almost entirely on the function's current nonlinearity, not on which bit you flip.
  • Crossover's Diminishing Returns: Crossover is highly effective when parents have low nonlinearity and similar quality. However, as functions become more optimized, crossover starts behaving like a "macro-mutation," and simple mutation-based local search becomes more efficient.
  • The "Dead-End" Problem: The authors identified specific functions (e.g., 1120 functions at $n=4$) that represent local optima where no single-bit or two-bit flip can improve nonlinearity. This explains why simple hill-climbers often get stuck.
Table 2: Changes in the Walsh-Hadamard spectrum: bit set operator, n = 3

Key Results

  • LS Outperforms GA: In larger search spaces ($n=8, 9, 10$), the Greedy Local Search variants consistently found functions with higher nonlinearity than the Genetic Algorithm.
  • The Power of Information: Using $fitness_2$ (incorporating spectral information) led to a massive performance boost for Local Search. For $n=9$, LS with $fitness_2$ reached a mean nonlinearity of ~236, whereas with $fitness_1$ it struggled to pass 230.
  • LS-Revert is King: The LS-R variant, which can revert moves to explore different neighborhood paths, achieved the best overall results, reaching near-optimal nonlinearity values for $n=8$ (116) and $n=10$ (480+).

Limitations and Future Work

  • Scalability: While Local Search is effective, its time complexity increases significantly with the number of variables ($n$). For very large $n$, the neighborhood size might become prohibitive.
  • Encoding Types: This study focused on bit-string (truth table) encoding. The authors suggest that symbolic encoding (using trees to represent functions, as in Genetic Programming) often yields better results and should be analyzed using similar operator-transition methods.
  • Vectorial Functions: The authors plan to extend this analysis to S-boxes (vectorial Boolean functions), which are even more complex but vital for block ciphers like AES.

Summary updated

BibTeX
@inproceedings{djurasevic2023digging,
  author = {Marko Djurasevic and Domagoj Jakobovic and Luca Mariot and Stjepan Picek},
  title = {{Digging Deeper: Operator Analysis for Optimizing Nonlinearity of Boolean Functions}},
  booktitle = {GECCO Companion},
  year = {2023},
}
Figure