From 7e6b33ae7f475cb637a627fd00a48ed19199847e Mon Sep 17 00:00:00 2001 From: shimunn <41011289+shimunn@users.noreply.github.com> Date: Sun, 28 Feb 2021 12:56:57 +0100 Subject: [PATCH] Theory of operation (#30) --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index 361bf41..7cafda0 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,36 @@ sudo -E fido2luks -i replace-key /dev/disk/by-uuid/ sudo rm -rf /usr/lib/dracut/modules.d/96luks-2fa /etc/dracut.conf.d/luks-2fa.conf /etc/fido2luks.conf ``` +## Theory of operation + +fido2luks builds on two basic building blocks, LUKS as an abstraction over linux disk encryption and and the FIDO2 extension [`hmac-secret`](https://fidoalliance.org/specs/fido-v2.0-rd-20180702/fido-client-to-authenticator-protocol-v2.0-rd-20180702.html#sctn-hmac-secret-extension). +The `hmac-secret` extension allows for an secret to be dervied on the FIDO2 device from two inputs, the user supplied salt/password/keyfile and another secret contained within the FID2 device. The output of the `hmac-secret` function will then be used to decrypt the LUKS header which in turn is used to decrypt the disk. +``` + + +-------------------------------------------------------------------------------+ + | | + | +-----------------------------------------+ | + | | FIDO2 device | | + | | | | + | | | | ++-------+--------+ +------+ | +---------------+ | | +------------------------+ +| Salt/Password +-> |sha256+------------------------> | | | v | LUKS header | ++----------------+ +------+ | | | | | | +---------------+ + | | | | +--------+ +------------------------+--------> |Disk master key| + | | sha256_hmac +---------> | sha256 +-------> | Keyslot 1 | +---------------+ ++----------------+ | +----------+ | | | +--------+ +------------------------+ +| FIDO credential+---------------> |Credential| +----> | | | | Keyslot 2 | ++----------------+ | |secret | | | | +------------------------+ + | +----------+ +---------------+ | + | | + | | + +-----------------------------------------+ + +``` +Since all these components build upon each other losing or damaging just one of them will render the disk undecryptable, it's threfore of paramount importance to backup the LUKS header and ideally set an backup password +or utilise more than one FIDO2 device. Each additional credential and password combination will require it's own LUKS keyslot since the credential secret is randomly generated for each new credential and will thus result +in a completly different secret. + ## License Licensed under