Annotating, Tracking, and Protecting Cryptographic Secrets with CryptoMPK

1. Introduction

CryptoMPK is a source code analysis and transformation system to implement a domain-based memory isolation, which makes the protection of cryptographic confidential data practical.

High level workflow of CryptoMPK:

  1. Automatically tracking and labeling all sensitive memory buffers and operations in source code related to crypto keys with a context-sensitive, crypto-aware information flow analysis.
  2. Partitioning the source code into crypto and non-crypto domains with a context-dependent privilege switch instrumentation.
  3. Utilizing Intel Memory Protection Keys (MPK) feature to generate executables with efficient domain switching, and protects the generated binary code against typical memory disclosure vulnerabilities such as arbitrary memory read.

2. Source code

We have implemented a prototype of paper. The source code of our prototype is available at here.

source code structure

Building Prerequisites

In order to build the CryptoMPK toolchain, you will need:

Building Instructions

  1. Switching to the root directory of source code.
  2. mkdir build; cd build; cmake ..; make
  3. a dynamic library (build/cryptompk.so) is generated, which is the main pass of CryptoMPK in form of an LLVM plugin.

3. Prebuilt binaries

We also provided a set of prebuilt binaries of CryptoMPK including:

The prebuilt binaries are available at here.

4. Experiments Dataset

The dataset of our experiments is available at here. It covers the follwing application scnearios:

For each case, we provided the following data: