Question: This Python homework simulates a simplified cache - based side - channel attack to illustrate the vulnerability. In this case, you will try to break

This Python homework simulates a simplified cache-based side-channel attack to illustrate the vulnerability. In this case, you will try to break a 6-bit encryption mechanism running on the target VM.
Objectives:
Simulate a scenario where a VM attacker tries to guess bits of a target VM secret key using variations in cache access times.
1) The program will take 2 arguments:
A csv file that will contain the delay to be added to the different encryption bits. The file will have the following format:
Encryption Bit,Delay
0,0.1
1,0.2
2,0.3
3,0.4
4,0.5
5,0.6
where the first column will represent the specific bit, and the second column the delay in seconds to be added. The time will simulate a "cache delay" when using that specific key bit.
A time delay that will represent the "cache latency" of an unknown key.
2) Your program will only use 6-bit keys. That means that a key will need to have a value between 0 and 63. I a key of '1' is passed, it means bit 0 is enabled for that key and the time delay for that bit must be added. If a key of '32' is passed, it means bit 5 is enabled so a time delay of 0.6 must be added.
3) Expected output
Using the bit delay file your program will perform a probePhase() where you will pass known keys to an encryption(str, key) method. This encryption method will add proper delays depending on the bits used on the key. The key can only be 6 bits long. During this probe phase your program will store relevant information on the different keys passed and the "cache latency" that is incurred after using these keys.
Using these cache profile your program will output the set of key(s) that are in the +/-0.05 seconds ballpark of the cache latency passed as input.
This is a sample program run:
python3 side-channel.py 0.70
Expected Output: [11,12,18,33]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!