bi-tud-sds/dizy-dl-sca
GitHub: bi-tud-sds/dizy-dl-sca
Stars: 0 | Forks: 0
# DIZY Side-Channel Attack using Deep Learning
This project implements a deep learning-based side-channel attack on the DIZY stream cipher. It uses power traces captured from a ChipWhisperer setup to train Convolutional Neural Networks (CNNs) that predict intermediate values, which can then be used to recover the secret key.
## Usage
The project is controlled via a command-line interface (CLI) with the following subcommands:
### download
python main.py download
**Note:** The dataset is hosted on Google Drive and is publicly available. The download script uses the dataset URL specified in the configuration file. The current dataset file ID is listed in the configuration file template, `config/config.py.template`.
### preprocess
Preprocesses the raw data from a ChipWhisperer project.
python main.py preprocess [--small-dataset] [--variable-key] [--analyze-labels] [--plot-traces]
- `--small-dataset`: Limit processing to the first 100K power traces. Only available for fixed-key dataset
- `--variable-key`: Process all ten collected datasets with variable keys
- `--analyze-labels`: Analyze label distribution
- `--plot-traces`: Plot sample power traces
### train
Train models.
python main.py train [--model-type MultiHeadModel|SeparateNetworksModel] [--variable-key]
- `--model-type`: Model type. Default is MultiHeadModel.
- `--variable-key`: Train model on a variable-key dataset
### evaluate
Evaluate the most recent model.
python main.py evaluate [--variable-key] [--models]
- `--variable-key`: Evaluate model using variable-key test dataset
- `--models`: Two model timestamps to compare
### analyze
Runs key convergence analysis using the most recently trained model to assess how well the model can recover key parts with increasing number of traces.
python main.py analyze [--variable-key] [--models model-0-timestamp model-1-timestamp] [--idx]
- `--variable-key`: Use variable-key test dataset for analysis
- `--models`: Two model timestamps to compare
- `--idx`: Run analysis for a specific 2-bit key group
## Requirements
- Python 3.x
- PyTorch
- NumPy
- Matplotlib
- Scikit-learn
- Pandas
- ChipWhisperer
You can install the required Python packages using:
pip install -r requirements.txt