Git Product home page Git Product logo

cache-analyzer's Introduction

Side-channel Attacks โ€” Last-Level Cache Analyzer

The CPU cache can speed up memory references. Spectre attacks expolit the system by mapping the value of a sensitve piece of information to whether or not a specific cache line exists on the cache.

The purpose of this script is to infer the size of the Last Level Cache (LLC) of a system via timing memory accesses. Such a side-channel algorithm exploits similar vulnerabilities as those used by Spectre and Meltdown.

The overall idea in designing this script is deciding how much memory can be maximally maintained in the system by timing memory reads/writes and comparing fast (in the cache) with slow (not in the cache) accesses. Once the size of the LLC is crossed, the system will start evicting existing memory objects from the cache; thus, if you try to access them again, that would be a cache-miss: a slow memory access.


Getting the Program to Work

To clone and compile the program:

git clone https://github.com/HK-Transfield/Cache-analyzer.git
cd Cache-analyzer/
javac CacheAnalyzer.java

To run the program:

java CacheAnalyzer

Alternative Testing Configurations

Inside the program are commented out lines of code used as alternative testing configurations. This includes:

  • An array of sizes that increases linearly from 1MB to 20MB, rather than exponential array sizes
  • Random array access, rather than sequential array access.

If you wish to test these other parameters, uncomment them and remember to comment out any other conflicting parameters. Then recompile the program and run using the above mentioned commands.

cache-analyzer's People

Contributors

hk-transfield avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.