Code Monkey home page Code Monkey logo

yubikey_luks's Introduction

Yubikey + LUKS

This repository contains scripts and a initramfs hook to use a Yubikey to decrypt a secret at boot that will be used to unlock a LUKS partition.

What does it do ?

A secret (32 random bytes from the TPM) is created. That secret is encrypted using a Yubikey thanks to OpenSSL and the PKCS#11 engine. The cleartext version of the secret is then registered as a passphrase for a LUKS encrypted drive of the user's chosing.

A initramfs hook set the required files up so that everything that is needed to decrypt said secret is present in the initrd image at boot.

A keyscript is then used at boot to decrypt the secret if the Yubikey is present. If so, the decrypted secret is fed to cryptsetup. Done!

Usage

  1. SETUP A BACKUP PASSPHRASE FOR YOUR LUKS DRIVE
  2. Setup a Yubikey using prepare_yubikey.sh . This will create and import a certificate in slot 9d of the PIV applet.
  3. Prepare and encrypt a secret using prepare_encrypt_secret.sh . This is going to create the secret, encrypt it, set it as a LUKS passphrase for your device.
  4. Run install.sh as root. This will copy the files at the right place.
  5. Register /usr/share/verysecureboot/verysecureboot_unlock.sh as a keyscript in your /etc/crypttab.
  6. Run update-initramfs -u as root. This will update your initramfs with the new content.
  7. Reboot

If anything doesn't work as planned you'll likely be dropped in a rescue root shell from where you'll be able to unlock your encrypted drive using your backup passphrase, and then chroot into your main system in order to fix things.

yubikey_luks's People

Contributors

nic0w avatar

Watchers

James Cloos avatar  avatar

yubikey_luks's Issues

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.