HyperSCA is a hyperparameter optimization framework for deep learning-based side-channel attacks. It targets known-plaintext/profiling-based side-channel analysis research, emphasizing automated hyperparameter tuning and sca-aware loss functions to enhance attack performance.
Author: @happysaten
The corresponding paper for this project:
HyperSCA: A Comprehensive Hyperparameter Optimization Framework for Deep Learning-based Side Channel Attacks
The project adopts a modular design with clear separation of core logic:
HyperSCA/
├── configs/ # Dataset and experiment configuration files (TOML format)
├── dataloaders/ # Dataset loading and preprocessing helper code
├── models/ # CNN, Transformer, and custom loss implementations
├── hpo/ # Hyperparameter builders for Optuna search
├── utils/ # Attack metrics, AES utilities, logging, and tensor tools
├── train.py # Training entry point
├── tune.py # Optuna tuning entry point
├── eval.py # Evaluation and plotting entry point
└── run_tune.py # Script for batch launching tuning processes
This repository does not include a pre-created .venv directory. Please create the local environment using uv:
uv syncTo explicitly execute commands within the project environment:
uv run python --versionDependencies are defined in pyproject.toml.
uv run python train.pyBy default, train.py uses the built-in configuration in its main function.
uv run python tune.pytune.py launches the Optuna-based optimization process, trains candidate models, evaluates attack metrics, and saves experimental artifacts to the configured output directory.
uv run python eval.pyThe evaluation entry point loads saved models, performs attack evaluation, and can generate metric plots.
uv run python run_tune.py 4 "[0,1]"This helper script can launch multiple tuning processes and assign them to specified GPUs. To stop matching tuning tasks:
uv run python run_tune.py stopProject-level dataset and experiment configurations are located in the configs/ directory.
Typical configuration workflow:
- Select a dataset configuration, e.g.,
configs/ASCAD_R.toml. - Adjust model, optimizer, loss function, and batch-related parameters in the configuration file.
- Run
train.py,tune.pydirectly, or import relevant functions in custom scripts.
The configuration system centers around configs/config.py, which is reused by both training and evaluation entry points.
The following dataset sources are used for HyperSCA's experimental setup.
Complete experimental results and logs are available in the Releases page;
If you use HyperSCA in academic work, please cite this project.
% TODO: Add final BibTeX entry here after paper official publication.
@article{TODO_HyperSCA,
title = {HyperSCA: A Comprehensive Hyperparameter Optimization Framework for Deep Learning-based Side Channel Attacks},
author = {[TODO: Fill in authors]},
journal = {[TODO: Fill in journal or conference]},
year = {[TODO: Fill in year]},
note = {[TODO: Fill in DOI, arXiv, or official link]}
}