# Metaheuristics in the Optimization of Cryptographic Boolean Functions

^{1}

^{2}

^{3}

^{4}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Problem Statement: Formal Definitions

#### 2.1. Boolean Functions and Representations

#### 2.2. Walsh Hadamard Transform

#### Parseval’s Equation

#### 2.3. Cryptographic Properties of Boolean Functions and Special Functions

## 3. Literature Review

## 4. Trajectory-Based Proposals

#### 4.1. Representation of Solutions

#### 4.2. Neighborhood

#### 4.3. Cost Functions

- In the second value of ${C}_{3}$ we try to minimize the maximum absolute value ${X}_{\alpha}$ and the second maximum absolute value ${X}_{\alpha -1}$ in the WHT. In order to attain this aim, it takes also into account the number of appearances of these values (${\eta}_{\alpha}$ and ${\eta}_{\alpha -1}$) in the WHT. This is implemented as follows:$${\xi}_{1}\left(\mathcal{S}\right)={\left({\eta}_{\alpha}\times {X}_{\alpha}\right)}^{3}+({\eta}_{\alpha -1}\times {X}_{\alpha -1}).$$
- Let ${X}_{k}$ be a value such that ${X}_{k-1}\le \mathcal{X}<{X}_{k}$, with $\mathcal{X}$ defined as in Reference [12]. In the second value of the cost function, we try to minimize the appearance of entries with absolute values greater than $\mathcal{X}$ assigning larger penalties to larger values:$${\xi}_{2}\left(\mathcal{S}\right)=\sum _{i=k}^{\alpha}{(2\times {\eta}_{i}\times {X}_{i})}^{i-k+1}.$$

#### 4.4. Full Hill Climbing

Algorithm 1: Full Hill Climbing (FHC). |

#### 4.5. First Improvement Quasi-Tabu Search

Algorithm 2: First Improvement Quasi-Tabu Search (FIQTS). |

## 5. Population-Based Proposals

**Lamarckian Memetic Algorithm**(LMA): modifications performed in the individual improvement procedure are written back in every individual representation.**Baldwin Memetic Algorithm**(BMA): modifications change the fitness of the individuals without altering its representation.

Algorithm 3: Lamarckian Memetic Algorithm (LMA). |

#### 5.1. A Lamarckian Memetic Algorithm with a Generational Replacement with Elitism (LMA-GRE)

Algorithm 4: Crossover strategy applied in all our optimizers. |

Algorithm 5: Mutation strategy applied in all our optimizers. |

Algorithm 6: Reproduction strategy applied in all our optimizers. |

Algorithm 7: Generational Replacement with Elitism (GRE) Technique. |

#### 5.2. LMA with a Replacement Considering Elitism and Dynamic Diversity Control (LMA-REDDC)

Algorithm 8: REDDC Survivor Selection Technique. |

#### 5.3. A Memetic Algorithm Based on Clusters

Algorithm 9: REDDCC Survivor Selection Technique. |

Algorithm 10: MAC-REDDCC Method. |

Algorithm 11: Mating Selection for MAC-REDDCC. |

Algorithm 12: Improvement Phase for MAC-REDDCC. |

#### 5.4. Parameterization Study

- ${D}_{{C}_{0}}$: initial distance threshold used to maintain a proper diversity in each cluster (see Algorithm 10 line 14).
- ${D}_{0}$: it is responsible for controlling the degree of diversity maintained in the whole population (see Algorithm 10 line 13).
- ${C}_{size}$: indicates the maximum size allowed for each cluster (see Algorithm 9 line 12). Note that since the acceptance of individuals only depends on the information of the closest already selected survivor, some clusters might eventually contain more that ${C}_{size}$ individuals.
- N: number of individuals in the population and number of offspring generated at each generation (see Algorithm 6 line 1).
- ${T}_{ls}$: stopping criterion of the local search procedure for offspring with parents belonging to the same cluster (see Algorithm 12 line 5).
- ${K}_{ls}$: if the offspring is generated with parents belonging to different clusters, the local search time applied to this kind of individuals is ${T}_{ls}\times {K}_{ls}$ (see Algorithm 12 line 3).
- ${p}_{cc}$: indicates the probability to cross individuals belonging to different cluster (see Algorithm 11 line 12).
- ${p}_{m}$: probability of performing swaps to mutate the individual (see Algorithm 5 line 2).
- ${p}_{c}$: probability of interchanging each gene (see Algorithm 4 line 9).
- ${K}_{E}$: indicates the proportion of time with additional promoted exploration (see Algorithm 10 line 6).

#### 5.5. Comparison Among Population-Based Metaheuristics

#### 5.6. Hybridization with an Algebraic Technique

## 6. Conclusions and Future Work

## Author Contributions

## Funding

## Acknowledgments

## Conflicts of Interest

## References

- Xiao, G.Z.; Massey, J.L. A spectral characterization of correlation-immune combining functions. IEEE Trans. Inf. Theory
**1988**, 34, 569–571. [Google Scholar] [CrossRef] - Katz, J.; Lindell, Y. Introduction to Modern Cryptography (Chapman 8 Hall/Crc Cryptography and Network Security Series); Chapman & Hall/CRC: Boca Raton, FL, USA, 2007. [Google Scholar]
- Millan, W.; Clark, A.; Dawson, E. Smart hill climbing finds better boolean functions. In Workshop on Selected Areas in Cryptology 1997, Workshop Record; Citeseer: University Park, PA, USA, 1997; pp. 50–63. [Google Scholar]
- Picek, S.; Jakobovic, D.; Miller, J.F.; Marchiori, E.; Batina, L. Evolutionary methods for the construction of cryptographic boolean functions. In European Conference on Genetic Programming; Springer: Berlin/Heidelberg, Germany, 2015; pp. 192–204. [Google Scholar] [CrossRef]
- Picek, S.; Ege, B.; Batina, L.; Jakobovic, D.; Chmielewski, Ł.; Golub, M. On using genetic algorithms for intrinsic side-channel resistance: The case of aes s-box. In Proceedings of the First Workshop on Cryptography and Security in Computing Systems; Association for Computing Machinery: New York, NY, USA, 2014; pp. 13–18. [Google Scholar] [CrossRef] [Green Version]
- Picek, S.; Carlet, C.; Guilley, S.; Miller, J.F.; Jakobovic, D. Evolutionary algorithms for boolean functions in diverse domains of cryptography. Evol. Comput.
**2016**, 24, 667–694. [Google Scholar] [CrossRef] [PubMed] - Sarkar, P.; Maitra, S. Nonlinearity bounds and constructions of resilient Boolean functions. In Annual International Cryptology Conference; Springer: Berlin/Heidelberg, Germany, 2000; pp. 515–532. [Google Scholar] [CrossRef] [Green Version]
- Doganaksoy, A.; Dündar, B.G.; Göloglu, F.; Saygı, Z.; Sulak, F.; Uguz, M. Constructions of highly nonlinear balanced boolean functions. In Proceedings of the Ulusal Kriptoloji Sempozyumu, Ankara, Turkey, 18–20 November 2005. [Google Scholar]
- Segura, C.; Hernandez, A.; Luna, F.; Alba, E. Improving diversity in evolutionary algorithms: New best solutions for frequency assignment. IEEE Trans. Evol. Comput.
**2017**, 21, 539–553. [Google Scholar] [CrossRef] - Romero Ruiz, E.; Segura, C. Memetic algorithm with hungarian matching based crossover and diversity preservation. Comput. Sist.
**2018**, 22. [Google Scholar] [CrossRef] [Green Version] - Aldana-Bobadilla, E.; Kuri-Morales, A. A clustering method based on the maximum entropy principle. Entropy
**2015**, 17, 151–180. [Google Scholar] [CrossRef] [Green Version] - Elhosary, A.M.; Hamdy, N.; Farag, I.A.; Rohiem, A. State of the art in Boolean functions cryptographic assessment. Int. J. Comput. Netw. Commun. Secur.
**2013**, 1, 88–94. [Google Scholar] - MacWilliams, F.J.; Sloane, N.J.A. The Theory of Error-Correcting Codes; Elsevier: Amsterdam, The Netherlands, 1977. [Google Scholar]
- Millan, W.; Clark, A.; Dawson, E. An effective genetic algorithm for finding highly nonlinear Boolean functions. In International Conference on Information and Communications Security; Springer: Berlin/Heidelberg, Germany, 1997; pp. 149–158. [Google Scholar] [CrossRef]
- Millan, W.; Clark, A.; Dawson, E. Heuristic design of cryptographically strong balanced Boolean functions. In International Conference on the Theory and Applications of Cryptographic Techniques; Springer: Berlin/Heidelberg, Germany, 1998; pp. 489–499. [Google Scholar]
- Clark, J.A.; Jacob, J.L. Two-stage optimisation in the design of Boolean functions. In Australasian Conference on Information Security and Privacy; Springer: Berlin/Heidelberg, Germany, 2000; pp. 242–254. [Google Scholar] [CrossRef]
- Clark, J.A.; Jacob, J.L.; Maitra, S.; Stanica, P. Almost Boolean functions: The design of Boolean functions by spectral inversion. In Proceedings of the 2003 Congress on Evolutionary Computation, 2003. CEC ’03, Canberra, ACT, Australia, 8–12 December 2003; IEEE: Piscataway, NJ, USA, 2003; Volume 3, pp. 2173–2180. [Google Scholar] [CrossRef]
- Burnett, L.; Millan, W.; Dawson, E.; Clark, A. Simpler methods for generating better Boolean functions with good cryptographic properties. Australas. J. Comb.
**2004**, 29, 231–248. [Google Scholar] - Izbenko, Y.; Kovtun, V.; Kuznetsov, A. The design of boolean functions by modified hill climbing method. In Proceedings of the 2009 Sixth International Conference on Information Technology: New Generations, Las Vegas, NV, USA, 27–29 April 2009; IEEE: Piscataway, NJ, USA, 2009; pp. 356–361. [Google Scholar] [CrossRef]
- McFarland, R.L. A family of difference sets in non-cyclic groups. J. Comb. Theory Ser. A
**1973**, 15, 1–10. [Google Scholar] [CrossRef] [Green Version] - Picek, S.; McKay, R.I.; Santana, R.; Gedeon, T.D. Fighting the symmetries: The structure of cryptographic boolean function spaces. In Proceedings of the 2015 Annual Conference on Genetic and Evolutionary Computation, Coimbra, Portugal, 8–11 September 2015; ACM: New York, NY, USA, 2015; pp. 457–464. [Google Scholar] [CrossRef]
- Picek, S.; Jakobovic, D.; Miller, J.F.; Batina, L.; Cupic, M. Cryptographic Boolean functions: One output, many design criteria. Appl. Soft Comput.
**2016**, 40, 635–653. [Google Scholar] [CrossRef] - Picek, S.; Santana, R.; Jakobovic, D. Maximal nonlinearity in balanced boolean functions with even number of inputs, revisited. In Proceedings of the 2016 IEEE Congress on Evolutionary Computation (CEC), Vancouver, BC, Canada, 24–29 July 2016; IEEE: Piscataway, NJ, USA, 2016; pp. 3222–3229. [Google Scholar] [CrossRef]
- Goyal, R.; Yadav, S.P. An evolutionary approach to construct cryptographically strong Boolean functions. Int. J. Syst. Assur. Eng. Manag.
**2012**, 3, 1–5. [Google Scholar] [CrossRef] - Črepinšek, M.; Liu, S.H.; Mernik, M. Exploration and Exploitation in Evolutionary Algorithms: A Survey. ACM Comput. Surv.
**2013**, 45, 35:1–35:33. [Google Scholar] [CrossRef] - Segura, C.; Coello, C.A.C.; Segredo, E.; Aguirre, A.H. A novel diversity-based replacement strategy for evolutionary algorithms. IEEE Trans. Cybern.
**2016**, 46, 3233–3246. [Google Scholar] [CrossRef] [PubMed] - Clark, J.A.; Jacob, J.L.; Stepney, S. Searching for cost functions. In Proceedings of the IEEE Congress on Evolutionary Computation, Portland, OR, USA, 19–23 June 2004; pp. 1517–1524. [Google Scholar] [CrossRef] [Green Version]
- Talbi, E.G. Metaheuristics: From Design to Implementation; John Wiley & Sons: Hoboken, NJ, USA, 2009; Volume 74. [Google Scholar]
- Moscato, P. On evolution, search, optimization, genetic algorithms and martial arts: Towards memetic algorithms. Caltech Concurr. Comput. Program, C3p Rep.
**1989**, 826, 1989. [Google Scholar] - Chen, X.; Ong, Y.S.; Lim, M.H.; Tan, K.C. A multi-facet survey on memetic computation. IEEE Trans. Evol. Comput.
**2011**, 15, 591–607. [Google Scholar] [CrossRef] - Eiben, A.E.; Smith, J.E. Introduction to Evolutionary Computing (Natural Computing Series); Springer: Berlin/Heidelberg, Germany, 2008. [Google Scholar]
- Tang, D.; Zhang, W.; Tang, X. Construction of balanced Boolean functions with high nonlinearity and good autocorrelation properties. Des. Codes Cryptogr.
**2013**, 67, 77–91. [Google Scholar] [CrossRef] [Green Version] - Asghar, A.; Iqbal, M.M.; Ahmed, W.; Ali, M.; Parvez, H.; Rashid, M. Logic algebra for exploiting shared SRAM-table based FPGAs for large LUT inputs. In Proceedings of the 2017 First International Conference on Latest Trends in Electrical Engineering and Computing Technologies (INTELLECT), Karachi, Pakistan, 15–16 November 2017; pp. 1–4. [Google Scholar] [CrossRef]
- Asghar, A.; Iqbal, M.M.; Ahmed, W.; Ali, M.; Parvez, H.; Rashid, M. Exploring Shared SRAM Tables in FPGAs for Larger LUTs and Higher Degree of Sharing. Int. J. Reconfig. Comput.
**2017**, 2017. [Google Scholar] [CrossRef] [Green Version]

**Figure 3.**Population entropy for MAC-REDDCC, LMA-REDDC and LMA-GRE when coupled with an algebraic-based initialization.

n | CF | Min | Max | Mean | Median | ${\mathbf{\sigma}}_{{{N}}_{\mathit{n}}}$ | $\overline{\mathit{t}}\left(\mathit{s}\right)$ |
---|---|---|---|---|---|---|---|

8 | ${C}_{1}$ | 108 | 112 | 110.16 | 110 | 1.503 | $3.4\times {10}^{-2}$ |

${C}_{2}$ | 112 | 116 | 114.12 | 114 | 0.627 | $1.6\times {10}^{0}$ | |

${\mathbf{C}}_{\mathbf{3}}$ | 114 | 116 | 115.92 | 116 | 0.396 | $2.4\times {10}^{-1}$ | |

${C}_{4}$ | 108 | 112 | 111.84 | 112 | 0.792 | $3.1\times {10}^{-2}$ | |

10 | ${C}_{1}$ | 464 | 472 | 469.4 | 470 | 1.863 | $7.9\times {10}^{-1}$ |

${C}_{2}$ | 482 | 484 | 482.72 | 482 | 0.97 | $1.8\times {10}^{2}$ | |

${\mathbf{C}}_{\mathbf{3}}$ | 480 | 484 | 483.16 | 484 | 1.621 | $1.6\times {10}^{1}$ | |

${C}_{4}$ | 468 | 480 | 475.44 | 476 | 1.809 | $1.9\times {10}^{0}$ |

n | CF | Min | Max | Mean | Median | ${\mathbf{\sigma}}_{{\mathit{N}}_{\mathit{n}}}$ | $\overline{\mathit{t}}\left(\mathit{s}\right)$ |
---|---|---|---|---|---|---|---|

8 | ${C}_{1}$ | 108 | 112 | 110.16 | 110 | 1.448 | $3.8\times {10}^{-2}$ |

${C}_{2}$ | 112 | 116 | 114 | 114 | 0.7 | $1.1\times {10}^{0}$ | |

${\mathbf{C}}_{\mathbf{3}}$ | 114 | 116 | 115.96 | 116 | 0.283 | $1.4\times {10}^{-1}$ | |

${C}_{4}$ | 108 | 116 | 112.6 | 112 | 1.629 | $3.7\times {10}^{-2}$ | |

10 | ${C}_{1}$ | 466 | 472 | 470.16 | 470 | 1.888 | $6.8\times {10}^{-1}$ |

${C}_{2}$ | 482 | 484 | 482.68 | 482 | 0.957 | $9.4\times {10}^{1}$ | |

${\mathbf{C}}_{\mathbf{3}}$ | 480 | 484 | 483.64 | 484 | 1.12 | $1.0\times {10}^{1}$ | |

${C}_{4}$ | 472 | 480 | 478.48 | 480 | 2.27 | $3.4\times {10}^{-1}$ |

**Table 3.**Comparison between FIQTS and FHC with the cost function ${C}_{3}$ in executions at fixed time.

n | Method | Min | Max | Mean | Median | ${\mathbf{\sigma}}_{{\mathit{N}}_{\mathit{n}}}$ |
---|---|---|---|---|---|---|

8 | FIQTS | 114 | 116 | 115.96 | 116 | 0.283 |

FHC | 114 | 116 | 115.92 | 116 | 0.396 | |

10 | FIQTS | 480 | 484 | 481.52 | 482 | 1.182 |

FHC | 480 | 482 | 480.08 | 480 | 0.396 |

${\mathit{D}}_{{\mathit{C}}_{0}}$ | ${\mathit{D}}_{0}$ | ${\mathit{C}}_{\mathit{size}}$ | N | ${\mathit{T}}_{\mathit{ls}}$ | ${\mathit{K}}_{\mathit{ls}}$ | ${\mathit{p}}_{\mathit{cc}}$ | ${\mathit{p}}_{\mathit{m}}$ | ${\mathit{p}}_{\mathit{c}}$ | ${\mathit{K}}_{\mathit{E}}$ |
---|---|---|---|---|---|---|---|---|---|

20 | 100 | 10 | 200 | 0.01 | 1.0 | 0.2 | 0.002 | 0.5 | 1.0 |

n | Min | Max | Mean | Median | ${\mathbf{\sigma}}_{{\mathit{N}}_{\mathit{n}}}$ | ${\mathit{S}}_{\mathit{r}}$ |
---|---|---|---|---|---|---|

10 | 484 | 488 | 486.96 | 487 | 1.087 | 50% |

${\mathit{D}}_{{\mathit{C}}_{\mathbf{0}}}$ | ${\mathit{D}}_{\mathbf{0}}$ | ${\mathit{C}}_{\mathit{size}}$ | $\mathit{N}$ | ${\mathit{T}}_{\mathit{ls}}$ | ${\mathit{K}}_{\mathit{ls}}$ | ${\mathit{p}}_{\mathit{cc}}$ | ${\mathit{p}}_{\mathit{m}}$ | ${\mathit{p}}_{\mathit{c}}$ | ${\mathit{K}}_{\mathit{E}}$ | Mean | ${\mathit{S}}_{\mathit{r}}$ |
---|---|---|---|---|---|---|---|---|---|---|---|

14 | 60 | 20 | 350 | 0.08 | 2.0 | 0.2 | 0 | 0.2 | 0.2 | 488 | 100% |

Method | ${\mathit{D}}_{{\mathit{C}}_{0}}$ | ${\mathit{D}}_{0}$ | ${\mathit{C}}_{\mathit{size}}$ | N | ${\mathit{T}}_{\mathit{ls}}$ | ${\mathit{K}}_{\mathit{ls}}$ | ${\mathit{p}}_{\mathit{cc}}$ | ${\mathit{p}}_{\mathit{m}}$ | ${\mathit{p}}_{\mathit{c}}$ | ${\mathit{K}}_{\mathit{E}}$ |
---|---|---|---|---|---|---|---|---|---|---|

MAC-REDDCC | 14 | 60 | 20 | 350 | 0.08 | 2.0 | 0.2 | 0 | 0.2 | 0.2 |

LMA-REDDC | × | 60 | × | 350 | 0.08 | × | × | 0 | 0.2 | 0.2 |

LMA-GRE | × | × | × | 350 | 0.08 | × | × | 0 | 0.2 | × |

n | Method | Min | Max | Mean | Median | ${\mathbf{\sigma}}_{{\mathit{N}}_{\mathit{n}}}$ |
---|---|---|---|---|---|---|

8 | MAC-REDDCC | 116 | 116 | 116 | 116 | 0 |

LMA-REDDC | 116 | 116 | 116 | 116 | 0 | |

LMA-GRE | 116 | 116 | 116 | 116 | 0 | |

10 | MAC-REDDCC | 488 | 488 | 488 | 488 | 0 |

LMA-REDDC | 486 | 488 | 487.44 | 488 | 0.907 | |

LMA-GRE | 482 | 484 | 483.92 | 484 | 0.396 |

n | Method | Min | Max | Mean | Median | ${\mathbf{\sigma}}_{{\mathit{N}}_{\mathit{n}}}$ |
---|---|---|---|---|---|---|

10 | MAC-REDDCC | 492 | 492 | 492 | 492 | 0 |

LMA-REDDC | 492 | 492 | 492 | 492 | 0 | |

LMA-GRE | 492 | 492 | 492 | 492 | 0 |

**Table 10.**Comparison between hybrid methods for the amount of individuals found with nonlinearity equal to 492.

Method | Min | Max | Mean | Median |
---|---|---|---|---|

MAC-REDDCC | 350 | 350 | 350 | 350 |

LMA-REDDC | 350 | 350 | 350 | 350 |

LMA-GRE | 1 | 1 | 1 | 1 |

© 2020 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 (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

López-López, I.; Sosa-Gómez, G.; Segura, C.; Oliva, D.; Rojas, O.
Metaheuristics in the Optimization of Cryptographic Boolean Functions. *Entropy* **2020**, *22*, 1052.
https://doi.org/10.3390/e22091052

**AMA Style**

López-López I, Sosa-Gómez G, Segura C, Oliva D, Rojas O.
Metaheuristics in the Optimization of Cryptographic Boolean Functions. *Entropy*. 2020; 22(9):1052.
https://doi.org/10.3390/e22091052

**Chicago/Turabian Style**

López-López, Isaac, Guillermo Sosa-Gómez, Carlos Segura, Diego Oliva, and Omar Rojas.
2020. "Metaheuristics in the Optimization of Cryptographic Boolean Functions" *Entropy* 22, no. 9: 1052.
https://doi.org/10.3390/e22091052