This repository contains the source code used to generate the results from the paper: "Exploring Feature Scenarios in Deep Learning-based Profiled Side-Channel Analysis".
Go to experimets/paths.py
file and set all dataset path folders for all feature selection
scenarios (RPOI, OPOI, NOPOI, NOPOI_DESYNC) and for all datasets (ASCADf, ASCADr, DPAV42, CHESCTF).
Go to experimets/paths.py
file and set all result path folders for all feature selection
scenarios (RPOI, OPOI, NOPOI, NOPOI_DESYNC) and for all datasets (ASCADf, ASCADr, DPAV42, CHESCTF).
- Download ASCADf raw traces: https://github.com/ANSSI-FR/ASCAD/tree/master/ATMEGA_AES_v1/ATM_AES_v1_fixed_key
- Download ASCADr raw traces: https://github.com/ANSSI-FR/ASCAD/tree/master/ATMEGA_AES_v1/ATM_AES_v1_variable_key
- Download DPAV42 raw traces: https://www.dpacontest.org/v4/42_traces.php
- Download CHESCTF raw traces: https://zenodo.org/record/3733418#.Yc2iq1ko9Pa
Set the following line:
sys.path.append('/project_root_folder')
in the following files:
ASCADf:
experiments/ASCADf/generate_dataset.py
experiments/ASCADf/grid_search_gta_mlp_cnn.py
experiments/ASCADf/grid_search_mlp_cnn_no_lda.py
experiments/ASCADf/random_search.py
experiments/ASCADf/random_search_da.py
experiments/ASCADf/test_best_models.py
ASCADr:
experiments/ASCADr/generate_dataset.py
experiments/ASCADr/grid_search_gta_mlp_cnn.py
experiments/ASCADr/grid_search_mlp_cnn_no_lda.py
experiments/ASCADr/random_search.py
experiments/ASCADr/random_search_da.py
experiments/ASCADr/test_best_models.py
DPAV42:
experiments/DPAV42/generate_dataset.py
experiments/DPAV42/grid_search_gta_mlp_cnn.py
experiments/DPAV42/grid_search_mlp_cnn_no_lda.py
experiments/DPAV42/random_search.py
experiments/DPAV42/random_search_da.py
experiments/DPAV42/test_best_models.py
CHESCTF:
experiments/CHESCTF/generate_dataset.py
experiments/CHESCTF/random_search.py
experiments/CHESCTF/random_search_da.py
experiments/CHESCTF/test_best_models.py
To prepare datasets, run following python scripts:
ASCADf:
experiments/ASCADf/generate_dataset.py
ASCADr:
experiments/ASCADr/generate_dataset.py
CHESCTF:
experiments/CHESCTF/generate_dataset.py
DPAV42:
experiments/DPAV42/convert_to_h5.py
experiments/DPAV42/generate_dataset.py
For random search, you have to run random_search.py
(or random_search_da.py
, for data augmentation)
files for each dataset. There are seven parameters to pass with the python file call:
- Leakage Model: HW or ID
- Model type: mlp or cnn
- Feature selection type: RPOI, OPOI, NOPOI or NOPOI_DESYNC
- Number of POIS: (e.g. 700 for ASCADf and OPOI)
- Target key byte: 0 to 15
- Regularization: True or False
- Resampling Window: 10, 20, 40 or 80 (for NOPOI and NOPOI_DESYNC. For RPOI and OPOI the value is ignored, but it has to be provided.)
To test best models, you have to run test_best_models.py
files for each dataset.
There are six parameters to pass with the python file call:
- Leakage Model: HW or ID
- Model type: mlp or cnn
- Feature selection type: RPOI, OPOI, NOPOI or NOPOI_DESYNC
- Number of POIS: (e.g. 700 for ASCADf and OPOI)
- Target key byte: 0 to 15
- Resampling Window: 10, 20, 40 or 80 (for NOPOI and NOPOI_DESYNC. For RPOI and OPOI the value is ignored, but it has to be provided.)
python experiments/ASCADf/test_best_models.py HW mlp OPOI 700 2 20
python experiments/ASCADf/test_best_models.py ID mlp OPOI 700 2 20
python experiments/ASCADf/test_best_models.py HW cnn OPOI 700 2 20
python experiments/ASCADf/test_best_models.py ID cnn OPOI 700 2 20
To run best found models for ASCADf, key byte 0, 10000 POIs, NOPOI with resampling window of 20:
python experiments/ASCADf/test_best_models.py HW mlp 10000 NOPOI 2 20
python experiments/ASCADf/test_best_models.py ID mlp 10000 NOPOI 2 20
python experiments/ASCADf/test_best_models.py HW cnn 10000 NOPOI 2 20
python experiments/ASCADf/test_best_models.py ID cnn 10000 NOPOI 2 20
To run best found models for ASCADr, key byte 0, 10000 POIs, NOPOI with resampling window of 20 :
python experiments/ASCADr/test_best_models.py HW mlp 25000 NOPOI 2 20
python experiments/ASCADr/test_best_models.py ID mlp 25000 NOPOI 2 20
python experiments/ASCADr/test_best_models.py HW cnn 25000 NOPOI 2 20
python experiments/ASCADr/test_best_models.py ID cnn 25000 NOPOI 2 20