This SystemC design demonstrates a power attack on an RSA encrypted communication between a subject and a server.

Prerequisite: SystemC and a corresponding compiler (e.g. g++) must be installed on your system. This case study has only been tested on an Ubuntu 18.04 system with SystemC versions 2.3.1 and 2.3.3.

The power traces that are generated during simulation can be visualized using the corresponding HTML file visualizationRSA.html in ../PowerVisualization.

Compilation:

1. adapt SYSTEMC_HOME in the Makefile to your system. 
2. > make

After successful compilation, the system can be executed with:

./main [parameter]

The parameter specifies the kind of attack that should be executed. Without a parameter, the communication between subject and server is undisturbed.

parameter="ZEMD" [numberOfTraces]:

	Executes the ZEMD algorithm.
	numberOfTraces determines how many traces are used in each step. Default is 200. Must be greater than the length of the key.
	
parameter="tweakedZEMD" [numberOfTraces] [numberOfRepetitions]:

	Executes the ZEMD algorithm.
	numberOfTraces determines how many traces are used in each step. Default is 200. Must be greater than the length of the key.
	numberOfRepetitions determines the number of comparisons for each bit. Default is 3.

parameter="CCA" [numberOfTraces]:

	Executes a cross-correlation attack.
	numberOfTraces determines how many traces are used in each step. Default is 500. Must be greater than the length of the key. At most 1000 traces are recommended.

parameter="powerHWMeasurement":

 	Executes the simulation and measures the correlation between Hamming weight and power consumption of each decryption. 




