Transactions on Cryptographic Hardware and Embedded Systems 2026
DS-NSCA:
Differentiable Search for Non-Profiling Side-channel Analysis
README
DS-NSCA: Differentiable Search for Non-Profiling Side-channel Analysis
This repository contains the implementation of the DS-NSCA algorithm, along with supplementary materials for generating additional figures and reproducing the results reported in the paper.
Getting started
To avoid any conflicts, we recommend using a virtual environment. The code can be downloaded from our anonymous GitHub repository. Create a new Conda environment :
conda create -n ds_nsca python=3.8
Activate the environment:
conda activate ds_nsca
Install the required packages. We provide a requirements.txt file that lists all necessary dependencies:
pip install -r requirements.txt
Requirements
Here is a non-exhaustive list of the required packages with their default versions provided in the requirements.txt file:
torch(1.12.1)numpy(1.23.4)h5py(3.7.0)
Additionally, the CUDA version on our platform is 12.0.
Configurations of DS-NSCA
Hyperparameters
The different hyperparameters of DS-NSCA are:
| Hyperparameter | Description | Default | Suggested Range |
|---|---|---|---|
train_loss_fn |
Loss function for training model parameters $$\theta$$ | MSE | - |
val_loss_fn |
Loss function for validation to evaluate model performance | Pearson correlation coefficient | - |
epochs |
Total number of training epochs | 250 | 50–300, depending on dataset size and convergence |
scaling coefficient $$\lambda$$ |
Weight of validation feedback in multi-objective training | 0.25 | 0–0.5 for stable performance with limited data |
decay_factor |
Factor controlling exponential decay of learning rates or temperature schedules | 0.97 | 0.90–0.99, balancing stability and convergence speed |
key_lr |
Learning rate for key probability parameters $$\alpha$$ | $$1 \times 10^{-2}$$ | $$1 \times 10^{-3}$$ – $$1 \times 10^{-2}$$ for stable convergence |
model_lr |
Learning rate for model parameters $$\theta$$ | $$1 \times 10^{-3}$$ | $$1 \times 10^{-3}$$ – $$1 \times 10^{-2}$$, task-dependent |
optimizer |
Algorithm used to update parameters during training | Adam | - |
warmup_ period |
Number of epochs before applying validation feedback or other scheduled mechanisms | 15 | 10–25, depending on dataset size and early prediction reliability |
Model Architecture
For attack scenarios involving aligned traces, we recommend using an MLP model, as it has lower computational cost. For non-aligned traces, a CNN model is preferred. Compared with single-output methods, the multi-output (MOC) approach introduces additional network parameters to model multiple outputs effectively.
Implementations of these models are provided in the Until/Model.py.
Dataset
All datasets used in this work are publicly available. We do not redistribute the raw data and only provide access links below. Since some official links are no longer accessible, alternative links are provided where necessary.
- ASCAD: https://github.com/ANSSI-FR/ASCAD
- CHES_CTF: https://drive.google.com/file/d/1c6kHrBAn35w4a8TFWHu5QSPxKp5fM2Dc/view?usp=drive_link
- AES_HD(Original Release): https://github.com/gabzai/Methodology-for-efficient-CNN-architectures-in-SCA/blob/master/AES_HD/AES_HD_dataset.zip
- AES_HD (Updated Version): https://drive.google.com/file/d/1VTLwbhwh9qx4ZIAdOK4tap2hNJ1o6vJS/view
- AES_RD: https://github.com/gabzai/Methodology-for-efficient-CNN-architectures-in-SCA/tree/master/AES_RD/AES_RD_dataset
- ASCADv2: https://github.com/ANSSI-FR/ASCAD
Users should download the datasets from the corresponding links and organize them according to their experimental setup.
Examples
To facilitate the reproduction of our experiments, we provide runnable examples for each dataset, configured with the same hyperparameters as reported in the paper.
Each example is organized under a directory named after the corresponding dataset.
For instance, the example for the AES_HD dataset is located in the AES_HD/ directory.
In addition, the Until/ directory contains the core implementation files used across all experiments, including:
DataLoader.py: defines a lightweight PyTorchDatasetwrapper (CustomDataset) that encapsulates input traces and corresponding labels, enabling seamless integration with PyTorchDataLoader.Lossfunction.py: defines the training and validation loss functions used in the proposed method.Trainer.py: implements the training pipeline.
Together, these components enable reproduction of the experimental results and extension to other datasets.
License
This project is licensed under the MIT License. See the LICENSE file for details.