Standard deviation in SCA101 CPA4_2 on AES jupyter notebook

Hi,

We want to send the same plaintext for 50-200 times (set in basic.py, fixedPlain = False) in CPA on AES. When we send the same plaintext for 50-200 times, we get standard deviation as 0 and hence the key guess (which has standard deviation function in denominator) as NaN (0- Not a Number).
How to modify the formula so that we send the same plaintext for N times and guess the key, instead of sending different plaintexts for N times.

Hi,

As far as I know, an attack where the plaintext does not change is not possible with CPA.

Alex

Thanks for the response, could you please confirm and explain why it is not possible?

We’re using the linearity of a data set to distinguish between key guesses. All of your data shares a coordinate; it doesn’t make any sense to ask which is the most linear of a bunch of vertical lines.

Hi,

I have a follow-up question. If the plaintext for every iteration changes, how is that the trace array plot for all iterations overlap in the plot?
Since plaintexts are different for each iteration, shouldn’t the plot look different?

No, the plot shouldn’t look different between captures. The effect of different data on the power trace is very small and only in a few spots so it will be difficult to see differences without doing something like averaging a bunch of traces and subtracting traces.

Alex