I am trying to reproduce the side-channel power analysis attack described in this paper: https://pdfs.semanticscholar.org/7946/a8ee82658e2ffb017270331f220a55f5ace6.pdf for educational purposes.
The attack (on the HCS3xx family of chips) requires measuring the power consumption (i.e. current) that the chip is using in order to reveal its cryptographic key.
In the paper, they describe their setup as attaching a shunt resistor in the ground path and using a digital oscilloscope (with a sampling rate greater than 1MHz) to measure the voltage drop across this resistor.
I have reproduced this setup to the best of my abilities (pictured in the schematic below), but the problem is I don't have an oscilloscope.
Therefore, I've decided to use an Arduino Uno I have lying around as a poor man's oscilloscope.
Besides the fact that the Arduino ADC has a much lower sampling rate (~77KHz vs. the ideal 20MHz described in the paper), I have been having an issue getting a reliable voltage reading across the shunt.
While trying to use the full 10-bit ADC, and producing samples as
(ADCH << 8) | ADCL in my ADC ISR, I do not get any samples that are greater than 0.
However, when I left-align the ADC to only use 8-bit precision (with
ADMUX |= 1 << ADLAR and read with just
ADCH, I get non-zero values but none with a value greater than one.
Could it be that the amount of power that the chip consumes is so small that the Arduino does not have enough precision to read it? Or could it be that my shunt has too large of a resistance and is causing a reduced current throughout the circuit?