Code Monkey home page Code Monkey logo

safetypin's Introduction

SafetyPin: Encrypted Backups with Human-Memorable Secrets

SafetyPin is a system for encrypted backups that provides a strong defense against hardware compromise. The system only requires users to remember a short PIN and defends against brute-force PIN-guessing attacks while protecting against an attacker that can adaptively compromise many hardware elements.

The implementation is split into two components:

  • HSM: The HSMs (hardware security modules) are used to store user secrets. We implement the HSM functionality on SoloKeys.
  • Host: The host is not run on any special hardware and simply coordinates the HSMs.

WARNING: This is an academic proof-of-concept prototype and has not received careful code review. This implementation is NOT ready for production use.

This implementation accompanies our paper SafetyPin: Encrypted Backups with Human-Memorable Secrets by Emma Dauterman, Henry Corrigan-Gibbs, and David Mazières to appear at OSDI20.

This prototype is released under the Apache v2 license (see License).

If setting up your own system, please read the instructions here. If running artifact evaluation, please read the instructions below.

Instructions for artifact evaluation

SSH into the test machine using the credentials provided separately. All the HSMs are connected to the machine via USB and flashed with the correct firmware. The code on the host is already built (you can rebuild the code by running make in host/).

To run all the experiments and generate all the plots, run:

cd bench
./runAll.sh     # 50 minutes

This will produce figures 8, 9, 10, and 11 in the bench/out folder. Details about running these experiments and the plots that are produced are included below. The figures we generated running the same scripts are included in bench/ref.

Each experiment follows the same general pattern. To run the experiment for Figure x, go to the bench folder and run python3 exp_figx.py, which will output raw data in out/figx.dat. To plot the data, run python3 plot_figx.py.

One caveat: the experiments run using a fixed source of randomness. We found that the SoloKey's RNG will occasionally crash, making it necessary to manually power cycle the key. We ran our experiments using the RNG, but in our setup allowing reviewers to remotely SSH into our machine, we use a fixed source of randomness.

Note: If for some reason an experiment takes significantly longer than the time estimate, please contact the authors, as the system may need to be physically reset (for example, due to a poor USB connection).

Figure 8

Run the experiment and plot the data for Figure 8 showing datacenter size vs audit time:

cd bench
python3 exp_fig8.py     # 16 minutes 
python3 plot_fig8.py    # few seconds

This will produce a plot close to Figure 8 on page 11 in the paper in bench/out/fig8.png. Use scp to copy this figure back to your local machine.

The only difference from the Figure 8 included in the paper is that we use 90 HSMs instead of 100 HSMs for this experiment (the remaining 10 HSMs have different firmware used to generate figure 9). To generate the figure in the paper, we reflashed HSMs between experiments (which we cannot be done remotely). The figure we generated using 90 HSMs is below for comparison:

Figure 9

Run the experiment and plot the data for Figure 9 showing how the number of recoveries before key rotation affects the time to decrypt and puncture:

cd SafetyPin/bench
python3 exp_fig9.py     # 20 minutes
python3 plot_fig9.py    # few seconds

This will produce a plot matching Figure 9 on page 11 in the paper in bench/out/fig9.png. Use scp to copy this figure back to your local machine.

Note that this experiment uses 10 HSMs that are flashed with firmware using different parameter settings. Between each experiment run, the code at the host is recompiled using a different setting of constants.

We include the figure we genereated below for reference:

Figure 10

Run the experiment and plot the data for part of Figure 10 showing the breakdown for recovery time with a cluster of 40 HSMs:

cd SafetyPin/bench
python3 exp_fig10.py     # 2 minutes
python3 plot_fig10.py    # few seconds

This will produce a plot matching the right half of Figure 10 on page 11 in the paper (breakdown of recovery time) in bench/out/fig10.png. Use scp to copy this figure back to your local machine.

Note that this figure looks slightly different than the one in the camera-ready because since submission, we fixed a bug that increased the log time.

We incldue the figure we generated below for reference:

Figure 11

Run the experiment and plot the data for Figure 11 showing how recovery time changes with cluster size:

cd SafetyPin/bench
python3 exp_fig11.py     # 10 minutes
python3 plot_fig11.py    # few seconds

This will produce a plot matching Figure 11 on page 12 up to a cluster size of 90 HSMs in bench/out/fig11.png. Use scp to copy this figure back to your local machine.

We only measure up to 90 HSMs because we reserve the last 10 HSMs for the experiment for figure 10, which requires the HSMs to use firmware with a different setting of the parameters. Note that this figure looks slightly different than the one in the camera-ready because since submission, we fixed a bug that increased the log time.

We include the figure we generated (only up to 90 HSMs) below for reference:

Acknowledgements

The code for the HSMs was adapted from the SoloKey project. The original source of the jedi-pairing library is available here. Some of the USB HID code is based on u2f-ref-code.

safetypin's People

Contributors

edauterman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

bbenzikry

safetypin's Issues

Polynomial interpolation

https://github.com/edauterman/hsm-impl/blob/66e816ca1900977520e4d34886c488f2c793af29/agent/shamir.cc#L106

Just FYI, there are faster (but more complicated) algorithms for interpolation. As the number of parties in the MPC increases this quadratic-time step might be a bottleneck. We can look at implementing one of these other algorithms later on if need be.

See algorithm 10.11 in this book:
https://www.cambridge.org/core/books/modern-computer-algebra/fast-polynomial-evaluation-and-interpolation/7E7AF0E32AB217547BA83B7F6BF06CAA

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.