International Association for Cryptologic Research

International Association
for Cryptologic Research

Transactions on Cryptographic Hardware and Embedded Systems 2026

Improving the Selection Rule of Correlation Attacks for Remote Power Analysis


README

Improving the Selection Rule of Correlation Attacks

This repository contains datasets and scripts for the experiments reported in [1]. If you find these resources useful, please cite the paper!

I. Requirements

Hardware

The artifact provides datasets obtained from physical devices which can be used to reproduce the results in the paper. However, if you wish to set your own experiment, here we list the specifications:

Software

This artifact provides datasets which can be analyzed externally. And we also provide scripts which can be used to reproduce the results shown in the paper. For the most part we rely on Matlab.

II. Reproducing the results in the paper

Here we provide short tutorials on how to use the scripts in the dataset to reproduce the results shown in the paper.

A. Remote power analysis

  1. Launch MATLAB and open the meanmax/RemotePowerAnalysis/Scripts/automatize.m script. You don't need to change anything, but here are some things you could configure:
    • window_width is the s parameter described in [1], can go from 1 to 20.
    • projectdir is the dataset under analysis, change this path if you plan to use a different dataset.
    • steps is the number of points analyed, the script will generate results for all these numbers of traces.
    • num_bytes is the number of bytes under attack. This can be reduced to save time but then the number of repeated experiments will be lower.
    • num_exp can be increased in the case where you have multiple repetitions of an experiment.
    • If your computer is not powerful enough you can go inside meanmax/RemotePowerAnalysis/Scripts/cpa.m and modify c.NumWorkers to reduce the number of threads, or even remove the parallel loop. Otherwise this script does not need to be touched.
  2. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script will take a few minutes to produce the plots shown in Figure 6 of [1].
    • If you would like the scripts used to generate Figures 3 to 5 please contact us, they come from the same dataset.

B. Synthetic traces

There are three things that you can do regarding synthetic traces. You can generate a new dataset, analyze an available dataset, or simply replot the results.

[OPTIONAL] Generate a new dataset

  1. This step is optional since the artifact already contains a functional dataset.
  2. Launch MATLAB and open the meanmax/SyntheticTraces/Scripts/generate.m script. You don't need to change anything, but here are some things you could configure:
    • algo and mode don't affect anything, these are just names used for labeling.
    • M is the number of repetitions for the experiment.
    • N is the number of messages or traces.
    • num_samples is the number of samples in a synthetic trace.
    • betas is a list of values to be used for the parameter Beta as defined in [1].
    • alphas is a list of values to be used for the parameter Alpha as defined in [1].
    • If your computer is not powerful enough you can modify c.NumWorkers to reduce the number of threads, or even remove the parallel loop.
  3. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script can take up to a couple hours to produce the new dataset.

Analyze a dataset

  1. Launch MATLAB and open the meanmax/SyntheticTraces/Scripts/automatize.m script. You don't need to change anything, but here are some things you could configure:
    • betas should include some betas available in the dataset you want to process.
    • alphas should include some alphas available in the dataset you want to process.
    • window_width is the s parameter described in [1], can go from 1 to num_samples.
    • projectdir is the dataset under analysis, change this path if you plan to use a different dataset.
    • steps is the number of points analyed, the script will generate results for all these numbers of traces.
    • num_bytes is the number of bytes under attack. This can be reduced to save time but then the number of repeated experiments will be lower.
    • num_exps is the number of repetitions for an experiment.
    • If your computer is not powerful enough you can go inside meanmax/SyntheticTraces/Scripts/cpa.m and modify c.NumWorkers to reduce the number of threads, or even remove the parallel loop. Otherwise this script does not need to be touched.
  2. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script can take up to a few hours to analyze the dataset.

Plot the results

  1. Launch MATLAB and open the meanmax/SyntheticTraces/Scripts/replot.m script. You don't need to change anything, but here are some things you could configure:
    • dataset is the dataset under analysis, change this path if you plan to use a different dataset.
    • betas should match the betas defined for analysis.
    • alphas should match the alphas defined for analysis.
    • steps should match the steps defined for analysis.
    • num_bytes should match the num_bytes defined for analysis.
    • num_exps should match the num_exps defined for analysis.
  2. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script will take a few seconds to produce the plots shown in Figures 7, 8, 14, 15 of [1].

C. Real power traces

There are four things that you can do regarding real traces. You can capture a new dataset, misalign an available dataset, analyze an available dataset, or simply replot the results.

[OPTIONAL] Generate a new dataset

  1. This step is optional since the artifact already contains a functional dataset.
  2. Connect your hardware as described in the NewAE tutorial
  3. Using some code editor open meanmax/ChipWhisperer/Acquisition/capture.py, here are some things you could configure:
    • scope.adc.samples is the number of samples in the power trace.
    • scope.gain.db is the input gain.
    • bsfile is the bitstream for the NewAE CW305. Note that we provide a bitrstream for the CW305-A35.
    • target.pll.pll_outfreq_set(4E6, 1) defines the victim frequency.
    • scope.clock.clkgen_mul = 24 defines the number of samples per cycle. Please note that these parameters are related.
    • algo and mode don't affect anything, these are just names used for labeling.
    • M is the number of repetitions for the experiment.
    • N is the number of messages or traces.
  4. From a terminal execute
python capture.py

If all is working properly, in a few minutes you should have captured a new set of traces.

[OPTIONAL] Misalign an available dataset

  1. This step is optional since the artifact already contains a functional misaligned dataset.
  2. Launch MATLAB and open the meanmax\ChipWhisperer\Scripts\misalign.m script. You don't need to change anything, but here are some things you could configure:
    • betas is a list of values to be used for the parameter Beta as defined in [1].
    • num_exps should match the M defined for the dataset you want to misalign.
    • projectdir is the dataset under analysis, change this path if you plan to use a different dataset.
  3. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script can take up to a couple hours to produce the new misaligned dataset.

Analyze a dataset

  1. Launch MATLAB and open the meanmax/ChipWhisperer/Scripts/automatize.m script. You don't need to change anything, but here are some things you could configure:
    • betas should include some betas available in the dataset you want to process.
    • window_width is the s parameter described in [1], can go from 1 to scope.adc.samples.
    • projectdir is the dataset under analysis, change this path if you plan to use a different dataset.
    • steps is the number of points analyed, the script will generate results for all these numbers of traces.
    • num_bytes is the number of bytes under attack. This can be reduced to save time but then the number of repeated experiments will be lower.
    • num_exps is the number of repetitions for an experiment.
  2. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script will take a few minutes to analyze the dataset.

Plot the results

  1. Launch MATLAB and open the meanmax/ChipWhisperer/Scripts/replot.m script. You don't need to change anything, but here are some things you could configure:
    • dataset is the dataset under analysis, change this path if you plan to use a different dataset.
    • betas should match the betas defined for analysis.
    • steps should match the steps defined for analysis.
    • num_bytes should match the num_bytes defined for analysis.
    • num_exps should match the num_exps defined for analysis.
  2. Go to the EDITOR tab of MATLAB and click Run. Select Change Folder if prompted.
    • The script will take a few seconds to produce the plots shown in Figures 12 and 16 of [1].

III. Dataset structure

This artifact is made of three main parts, which correspond to Sections 4, 5, and 6 of [1]. Here we ilustrate the overall distribution of the files and in the following we provide brief descriptions.

image

A. Remote power analysis

In this experiment we study the characteristics of RPA traces and propose a novel selection rule which can improve CPA according to the performance indicators described in the paper.

Sensor: 8xTDC@200MHz implemented in the FPGA of an AMD-Xilinx Zynq-7000

Victim: Iterative AES128@10MHz implemented in the FPGA of an AMD-Xilinx Zynq-7000

Datasets

Scripts

B. ChipWhisperer

We use the NewAE ChipWhisperer capture system to acquire conventional power traces. We use these data to de-synchronize controlled subsets of traces and study their impact on the proposed attack.

Sensor: ChipWhisperer-Lite@96MHz

Victim: Iterative AES128@4MHz implemented in the FPGA of a NewAE CW350-35T

Datasets

Scripts

Acquisition

C. Synthetic traces

Lastly, we generate synthetic traces to control the misalignment rate (B) and the noise gain (a).

Datasets

Scripts

References

[1] Farràs, O., Grosso, V., Guiot, M., & Lara-Nino, C. A. (2026). Improving the Selection Rule of Correlation Attacks for Remote Power Analysis. IACR Transactions on Cryptographic Hardware and Embedded Systems, 2026(1), 402-424. 10.46586/tches.v2026.i1.402-424

@article{FGGL26,
    title   = {Improving the Selection Rule of Correlation Attacks for Remote Power Analysis},
    author  = {Farras, Oriol and Grosso, Vincent and Guiot, Miquel and Lara-Nino, Carlos Andres},
    journal = {IACR Transactions on Cryptographic Hardware and Embedded Systems},
    doi     = {10.46586/tches.v2026.i1.402-424},
    volume  = {2026},
    number  = {1},
    year    = {2026},
    month   = {Jan.},
    pages   = {402–424}}