Commit 6ce2d4c48ee0ff08c0f1791d99410521a7c221d1

Authored by Brice COLOMBIER
1 parent 39870016e9
Exists in master

Add README

Showing 2 changed files with 45 additions and 2 deletions

1 1 *.npy
2 2 *.bin
3 3 *.txt
4   -*.py~
5   -.gitignore~
  4 +*.*~
  1 +# Parallel traces preprocessing
  2 +
  3 +## Description
  4 +
  5 +This script applies preprocessing to power traces by combining pairs of samples.
  6 +The possible pairs of samples are taken inside a sliding window which slides over the trace.
  7 +The operation used to combine the samples can be chosen.
  8 +Thanks to Python `multiprocessing` package, the trace is split into blocks that are processed in parallel.
  9 +
  10 +Combining pairs of samples allows to launch a first-order CPA on a first-order masked implementation, which would otherwise require a second-order CPA.
  11 +
  12 +## Install
  13 +
  14 +```bash
  15 +# Download sources
  16 +git clone git@gitlab.emse.fr:brice.colombier/traces-preprocessing.git
  17 +cd traces-preprocessing
  18 +
  19 +# Download and build dependencies:
  20 +# On Windows
  21 +pip install scikit-image
  22 +# On Ubuntu
  23 +sudo apt-get install python-skimage
  24 +```
  25 +
  26 +## Usage
  27 +
  28 +The script is typically used in the following manner:
  29 +
  30 +```bash
  31 +python preprocessing.py traces_masked.npy --op=multiplication --window_size=5 --min_dist=1 --dtype=float64 --ncores=4
  32 +```
  33 +
  34 +The parameter is the file in which the traces are stored in `numpy` format.
  35 +Options are detailed below.
  36 +
  37 +## Options
  38 +
  39 +- `--op`: operation to compute on the pair of samples. Should belong to `{'addition','multiplication','squared_addition','absolute_difference'}`
  40 +- `--window_size`: width of the sliding window
  41 +- `--min_dist`: minimum distance between two samples in a pair
  42 +- `--dtype`: `numpy` data type for the samples of the processed trace
  43 +- `--ncores`: number of cores to use for the parallel computation