# SITM attack improved by Deep Learning

This repository holds scripts for execution of SITM attack improved by deep learning as described in master's thesis about [Side-channel cryptanalysis using deep learning methods](https://www.vut.cz/studenti/zav-prace/detail/151258) at Brno University of Technology.


## Usage 

There must be already trained model in same directory with name `model.h5` in H5 format. Model can be trained using [SITM model trainer](https://github.com/xmatus33/SITM_model_trainer). `Diff_trace` argument should point to single differencial power trace in `.npy` format as described in the paper.

```python
python3 SITM.py <p1> <p2> <diff_trace>
```

## Example 

Expectes `model.h5` traind model in same directory.

```python
python3 SITM.py 45E6148C7BD114504A3B934DF8E21E6C 2CE6148C7BD714504A3B914DF8E21E27 example_diff_trace.npy
```
