A repo with the code artifacts for the Spec-o-Scope paper
The code in this repository was tested on a Intel Core i5-8250U. For experimentation on a different processor, the following have to be modified:
- The cache details in
consts.h. - The RDTSC threshold between cached/uncached addresses in
consts.h. - The Prime+Scope prime pattern in
primescope.h. - The gate implementation in
classic_bt_gates.cc. In particular, delays chains have to be adjusted. - The LLC slice hash function used for assisted eviction set construction. (
physical_to_slice()inutil.cc).
./build.shTo set up a consistent frequency and enable huge pages (for easier eviction set generation) run
./setup.shThe python scripts require numpy, matplotlib, seaborn, tqdm.
python3 -m pip install -U numpy matplotlib seaborn tqdmRun using
./build/main paper_experiments rdtscp_latencyExample output in paper_expr/rdtscp_latency.res.
Run using
./build/main paper_experiments gate_type > paper_expr/gate_type.txtProcess data using
python3 scripts/paper_gate_type.pyResulting graph is in paper_expr/gate_type.png.
Run using
./build/main paper_experiments multi_sample_rates > paper_expr/multi_sample_rates.txtProcess data using
python3 scripts/paper_multi_sample_rates.pyResulting graphs are in paper_expr/multi_sample_rates_y{0,40}.png.
Run using
sudo ./build/md_main test_aes_break min_distinguish > paper_expr/min_distinguish.txtNote, the use of sudo is for construction of eviction sets.
Process data using
python3 scripts/paper_min_distinguish.pyResulting graph is in paper_expr/min_distinguish_a2.png.
Run attack using
sudo ./build/main test_aes_break ttable_msb -o paper_expr/ttable_msb.txtGenerate graph using
python3 scripts/paper_ttable_msb_oracle.pyResulting graph is in paper_expr/ttale_msb_oracle.png.
Process data using
python3 scripts/aes_ttable_correlation_score_mp.pyGenerate graph using
python3 scripts/paper_ttable_msb_traces.pyResulting graph is in paper_expr/ttable_msb_traces.png.
Example output is in paper_expr/ttable_msb_traces.res.
Run attack using
sudo ./build/main test_aes_break ttable_sr -o paper_expr/ttable_sr.txtProcess data using
./build/ttable_sr_analysisGenerate graph using
python3 scripts/paper_ttable_sr_traces.pyResulting graph is in paper_expr/ttable_sr_traces.png.
Example output is in paper_expr/ttable_sr_traces.res.
Run attack using
sudo ./build/main test_aes_break sbox_msb -o paper_expr/sbox_msb.txtProcess data using
python3 scripts/paper_witness_threshold.pyResulting graph is in paper_expr/sbox_msb_threshold.png.
Process data using
python3 scripts/paper_sbox_msb_oracle.pyResulting graph is in paper_expr/sbox_msb_oracle.png.
Process data using
python3 scripts/aes_sbox_2msb_new.pyGenerate graph using
python3 scripts/paper_sbox_msb_traces.pyResulting graph is in paper_expr/sbox_msb_traces.png.
Example output is in paper_expr/sbox_msb_traces.res.
Run attack using
sudo ./build/main test_aes_break2 sbox_sr_adaptive -o paper_expr/sbox_sr.txt 2> paper_expr/sbox_sr_traces.txtProcess data using
python3 scripts/paper_sbox_sr_oracle.pyResulting graph is in paper_expr/sbox_sr_oracle.png.
Process data using
python3 scripts/paper_sbox_sr_pearson.pyResulting graph is in paper_expr/sbox_sr_pearson.png.
Process data using
python3 scripts/paper_sbox_sr_traces.pyResulting graph is in ppaper_expr/sbox_sr_traces.png.
Process data using
./build/sbox_sr_analysisExample output is in paper_expr/sbox_sr_attack.res.
Process data using
./build/sbox_sr_analysisGenerate graph using
python3 scripts/paper_pearson_cumulative.pyResulting graph is in paper_expr/pearson_cumulative.png.