This repository represents ongoing experimental research in lightweight cryptographic optimization and does not claim production-ready cryptographic security guarantees.
# Lightweight S-Box Optimization Framework
## Overview
This repository contains a modular cryptographic optimization framework for the discovery and analysis of lightweight S-boxes using a Memetic Algorithm.
The framework focuses on the generation, evaluation, and optimization of 5x5 S-boxes for lightweight cryptographic applications.
The project combines:
- Evolutionary computation
- Memetic optimization
- Cryptographic property evaluation
- Lightweight security analysis
- Logic complexity evaluation
- Linearly equivalent S-box transformations
The framework was developed as part of research into lightweight cryptography and secure S-box construction.
---
# Repository Structure
```text
project/
│
├── algorithms/
│ ├── helpers.py
│ ├── fitness.py
│ └── memetic_algorithm.py
│
├── metrics/
│ ├── differential_metrics.py
│ ├── linear_metrics.py
│ ├── bic_sac.py
│ ├── boomerang_uniformity.py
│ ├── logical_complexity.py
│ ├── utils.py
│ └── vto.py
│
├── transformations/
│ └── linear_equivalence.py
│
├── analysis/
│ ├── speed_analysis.py
│ ├── comparison_analysis.py
│ └── invariant_property_analysis.md
│
├── config/
│ └── settings.py
│
├── requirements.txt
├── README.md
└── .gitignoreContains the core optimization engine.
Implements:
- population evolution
- mutation
- crossover
- elitism
- local search
- memetic improvement
- optimization orchestration
Implements the weighted fitness evaluation system used to score S-box candidates.
Contains reusable optimization helper functions such as:
- random S-box generation
- normalization and scaling functions
Contains cryptographic evaluation metrics.
Implements:
- differential branch number
- differential probability
- differential bound
- single-bit differential analysis
Implements:
- linear approximation analysis
- maximal linear bias evaluation
Implements:
- Bit Independence Criterion (BIC)
- Strict Avalanche Criterion (SAC)
Implements:
- Boomerang Connectivity Table (BCT)
- Boomerang Uniformity (BU)
Implements:
- Revisited Transparency Order (VTO)
Implements:
- Espresso-based logic minimization
- logical complexity estimation
Contains reusable utility functions used across metrics.
Contains S-box transformation and equivalence operations.
Implements:
- linearly equivalent S-box generation
- random equivalent transformations
- canonical S-box generation
- permutation-XOR equivalence analysis
Contains benchmarking, experimentation, and evaluation workflows.
Implements:
- runtime benchmarking
- statistical timing analysis
- metric performance evaluation
Implements:
- S-box comparison workflows
- experimental evaluation pipelines
- cryptographic property comparison
Documents:
- invariant cryptographic properties
- variant cryptographic properties
- affine-equivalence behaviour
- optimization-aware property categorization
Contains framework configuration files.
Contains:
- optimization parameters
- population settings
- mutation rates
- cache sizes
- framework constants
- external tool paths
- Modular memetic optimization framework
- Lightweight cryptographic analysis
- Multi-objective fitness evaluation
- Configurable optimization parameters
- Logic complexity estimation using Espresso
- Reusable transformation engine
- Support for cryptographic experimentation
- Structured framework architecture
The framework evaluates several important cryptographic properties:
- Differential Branch Number
- Differential Probability
- Differential Bound
- Linear Approximation Bound
- Linear Bias
- Boomerang Uniformity
- BIC-SAC
- Revisited Transparency Order (VTO)
- Logic Complexity
- Single-Bit Differential Analysis
The framework requires:
numpy
sage
matplotlib
Additional standard Python libraries used:
- functools
- random
- math
- subprocess
- logging
- statistics
- itertools
- time
The framework uses Espresso for logic minimization and logical complexity evaluation.
Example configuration:
ESPRESSO_PATH = "path/to/Espresso.exe"Configured in:
config/settings.py
python algorithms/memetic_algorithm.pypython analysis/speed_analysis.pyThe framework reports:
- best discovered S-box
- fitness score
- differential metrics
- linear metrics
- boomerang uniformity
- BIC-SAC
- VTO
- logical complexity
- statistical analysis results
This framework was developed for research into:
- lightweight cryptography
- secure S-box design
- memetic optimization
- cryptographic property analysis
- lightweight security for constrained devices
The framework focuses primarily on 5x5 S-box optimization for lightweight applications.
Potential future extensions include:
- GPU acceleration
- additional cryptographic metrics
- automated benchmarking
- machine learning guided optimization
- larger S-box dimensions
- visualization pipelines
- experiment tracking systems
- statistical reporting modules
Meaad Tori
Research Areas:
- Lightweight Cryptography
- S-Box Optimization
- Memetic Algorithms
- Cryptographic Engineering
- Security Optimization Frameworks
This repository represents an active research framework and experimental cryptographic evaluation environment. Some components remain under ongoing refinement and validation.