## Lab 07 - Correlation Power Analysis

In this lab we'll implement a side-channel attack known as **Correlation Power Analysis**.
You can see some details for how to implement this in the lecture notes
here

The principle is quite simple:

Choose your target (generally the S-box output of some block cipher - in our case AES)

Obtain a large number (thousands) of leakage samples for that target, when processing different plaintexts

Choose a suitable leakage model (usually the hamming weight of the target value)

For each possible key candidate (e.g. all values from 0 to 255), compute

| Person's correlation coefficient between the leakage model estimate for that key candidate and the leakage traces.

Decide for the key that gives maximum correlation

We'll discuss more in detail at the lab.

In this lab we shall use Matlab or Octave (MATLAB is preferred for speed reasons):

Octave main page
Download link for Windows

You might also need these additional packages:

Link for additional packages

Use these files as starting point:
lab6.zip