TPM 2.0 keyslots
Bind a vault to the local machine's TPM. Optional PIN, fused TPM + FIDO2, hybrid TPM + post-quantum.
A TPM 2.0 keyslot binds the vault to the specific TPM chip in the machine where you enroll it. The chip seals the wrap-KEK against its own endorsement seed; the seed never leaves the chip and is re-derived deterministically on every operation. The vault opens on that machine; it does not open on any other machine, even with the same passphrase or FIDO2 device.
TPM 2.0 keyslots work on Linux and Windows (Windows since
v0.5.0). On Windows the chip is reached through TBS (TPM Base
Services), the broker built into every supported Windows, so no
driver, admin rights, or code signing are needed to seal or unseal.
macOS does not expose a TPM, use a
Secure Enclave keyslot there instead (since v0.4.0). Slot
bytes are byte-identical across platforms: the same physical chip
unseals a vault regardless of which OS sealed it. The .lbx file
itself stays portable everywhere; only the TPM slot is bound to one
chip.
When to use a TPM slot
| You want | Use |
|---|---|
| Unlock without a hardware key on the daily-use machine | TPM (no PIN) + a passphrase backup |
| Hardware-bound + something the user knows | TPM + PIN |
| Two-factor "must have YubiKey AND must be on this machine" | Fused TPM + FIDO2 (single slot, both required) |
| Post-quantum on top of TPM binding | Hybrid TPM + ML-KEM-768 / 1024 |
| All of the above | Hybrid TPM + FIDO2 + ML-KEM-768 / 1024 |
Always pair a TPM slot with a backup slot. A TPM keyslot becomes permanently unrecoverable if:
- The chip is replaced (motherboard swap, device wipe at firmware level).
- You move the vault to another machine.
- The TPM is cleared by firmware reset.
The wizard and the GUI keep a backup passphrase slot when they create a TPM vault, and warn before you skip it. The CLI never creates a TPM-only vault (see below).
Variants
| Slot kind | Inputs at unlock | Notes |
|---|---|---|
Tpm2Sealed |
TPM only | Plain TPM seal; no PIN. Binds to chip + boot policy (no PCR sealing yet). |
Tpm2SealedPin |
TPM + PIN | TPM userAuth is the PIN. Wrong PINs count toward the chip's dictionary-attack lockout (typically about 32 attempts then a multi-hour cooldown), so even short PINs are practical. |
Tpm2Fido2 |
TPM + FIDO2 hmac-secret (fused) | Single slot, both factors required; HKDF mixes TPM-unsealed value with FIDO2 hmac-secret. |
HybridPqKemTpm2 |
TPM + ML-KEM-768 decap | Hybrid PQ on top of TPM binding. |
HybridPqKem1024Tpm2 |
TPM + ML-KEM-1024 decap | Same with category-5 KEM. |
HybridPqKemTpm2Fido2 |
TPM + FIDO2 + ML-KEM-768 decap | Three-factor + PQ. |
HybridPqKem1024Tpm2Fido2 |
TPM + FIDO2 + ML-KEM-1024 decap | Strongest TPM-bound option. |
Linux: TPM access without root
Unprivileged users need read/write access to /dev/tpmrm0 (the
in-kernel resource manager). Three things have to be true:
- The
tsssystem group exists. /dev/tpm0//dev/tpmrm0are ownedroot:tsswith mode0660(this is what the udev rule does).- Your user is a member of the
tssgroup.
The .deb (since v0.2.0) Recommends tpm-udev which provides
(1) + (2). The .rpm Recommends tpm2-tss which does the
equivalent on Fedora / RHEL / openSUSE. Installing via apt /
dnf gets both for you by default. You then only have to do (3)
yourself, Debian / Fedora convention forbids silent privileged-
group additions in package scripts:
sudo usermod -aG tss "$USER"
# Log out and back in (or `newgrp tss`) for the new group to take
# effect in your shell session.
id | tr , '\n' | grep tss # confirm
ls -l /dev/tpmrm0 # expected: crw-rw---- 1 root tss ...
If you installed via the tarball, or passed
--no-install-recommends / --setopt=install_weak_deps=False,
neither the group nor the udev rule exists. Use the bundled
installer:
./install.sh --tpm-setup # creates the group + udev rule + adds you
Or do it by hand:
sudo groupadd --system tss
sudo usermod -aG tss "$USER"
sudo tee /etc/udev/rules.d/60-tpm.rules > /dev/null <<'EOF'
KERNEL=="tpm[0-9]*", MODE="0660", GROUP="tss"
KERNEL=="tpmrm[0-9]*", MODE="0660", GROUP="tss"
EOF
sudo udevadm control --reload-rules
sudo udevadm trigger
# Log out + back in.
Verify:
tpm2_getrandom --hex 8 # if you have tpm2-tools installed
luksbox info my.lbx # should not error on TPM slots
The full playbook with troubleshooting is in
docs/TPM_LINUX_PERMISSIONS.md.
Windows: TPM access needs no setup
On Windows the chip is reached through TBS (TPM Base Services), the system broker present on every supported Windows. There is no group to join, no udev rule, and no admin elevation: a normal user process seals and unseals directly. Windows 11 hardware ships a TPM 2.0 chip by default (part of the launch floor); on a VM, enable the virtual TPM in your hypervisor (Hyper-V, VMware, VirtualBox all expose one).
# Confirm the chip is present and ready
Get-Tpm
# Create the vault with a passphrase, then add the TPM-bound slot
# (same slot kinds as Linux)
luksbox create my.lbx
luksbox enroll my.lbx --kind tpm2 # or --kind tpm2-pin
If a TPM operation reports the chip is locked out, reset the lockout
from an elevated PowerShell (do NOT run Clear-Tpm, which wipes the
owner hierarchy and permanently destroys every TPM slot in your
vaults). A vault sealed on Windows unseals on Linux through the same
physical chip, and vice versa.
CLI, create a TPM-bound vault
A TPM-bound slot cannot be a vault's first slot: create the vault
with a passphrase (or FIDO2) slot, which stays as your recovery path
if the chip dies or the machine is replaced, then enroll the
TPM-bound slot. enroll unlocks with the passphrase first.
luksbox create my.lbx
# Plain TPM (no PIN)
luksbox enroll my.lbx --kind tpm2
# TPM + PIN
luksbox enroll my.lbx --kind tpm2-pin
# Fused TPM + FIDO2 (both required to unlock)
luksbox enroll my.lbx --kind tpm2-fido2
# Hybrid TPM + ML-KEM-768 (writes a new .kyber seed file)
luksbox enroll my.lbx --kind hybrid-pq-tpm2 \
--pq-hybrid /media/usb/my.kyber
# Strongest: hybrid TPM + FIDO2 + ML-KEM-1024
luksbox enroll my.lbx --kind hybrid-pq-tpm2-fido21024 \
--pq-hybrid /media/usb/my.kyber
For the hybrid kinds, --pq-hybrid names the NEW seed file. If the
vault's only slots are hybrid ones too (for example a vault made with
create --kind hybrid-pq), unlock it with
--unlock-pq-hybrid <existing .kyber> (0.6.0+).
Unlocking
# Plain TPM and TPM + PIN slots
luksbox ls my.lbx --tpm2 /
# Fused TPM + FIDO2
luksbox ls my.lbx --tpm2-fido2 /
# Hybrid kinds: add the .kyber seed file
luksbox ls my.lbx --tpm2 --pq-hybrid /media/usb/my.kyber /
luksbox ls my.lbx --tpm2-fido2 --pq-hybrid /media/usb/my.kyber /
The same flags work with mount and every other command that opens a
vault.
- The TPM PIN goes only to PIN-protected slots (0.6.0+).
--tpm2tries both plain andtpm2-pinslots and asks for the PIN only when the vault has a PIN-protected one. If it also has a plain TPM slot, leave the PIN empty to use only that one. Earlier versions could try a slot with the wrong authorization (no PIN on a PIN slot, or a PIN on a plain one), and each of those attempts counted toward the chip's dictionary-attack lockout. For scripts, the PIN is read fromLUKSBOX_TPM_PIN, never fromLUKSBOX_PASSPHRASEor a passphrase piped on stdin. - Failures say why (0.6.0+). When no slot opens, the error now says why instead of only "unlock failed": for example the chip is in dictionary-attack lockout, the PIN was wrong, a PIN slot was skipped because no PIN was given, or the storage root key does not match a pinned slot (next section). The GUI and the wizard show the same reasons.
SRK pinning
Since 0.6.0, a new TPM keyslot can record the TPM's storage root key (SRK). Unlock then checks that the TPM presents the same key before anything is unsealed, and refuses otherwise. This defeats an active attacker on the TPM bus (a device between the chip and the motherboard) who substitutes their own key to read the unsealed secret. It is off by default, because a pinned slot needs LUKSbox 0.6.0 or later to unlock.
Turn it on for the TPM slots you create with:
- the global
--tpm-pin-srkflag (luksbox enroll my.lbx --kind tpm2 --tpm-pin-srk), orLUKSBOX_TPM_PIN_SRK=1in the environment; - the wizard, which asks before it seals the first new TPM slot of a session;
- the GUI checkbox "Pin the TPM storage root key in new TPM keyslots", shown wherever a TPM slot is created (the choice is remembered).
Existing slots are not changed. A plain tpm2 slot can be re-sealed
in place with luksbox update my.lbx --slot N --tpm-pin-srk; for the
other TPM kinds, enroll a new pinned slot and revoke the old one.
luksbox info my.lbx shows, for each TPM slot, whether its storage
root key is pinned.
If a pinned slot refuses with "the TPM's storage root key does not match the one this keyslot was sealed under", either the TPM was cleared or replaced (the slot can no longer be used on this machine; open the vault with your backup slot), or something between the computer and the TPM substituted the key.
TUI / GUI
The interactive wizard lists every TPM variant in its keyslot-kind menu, and the GUI create flow offers them through its factor-then-variant picker (TPM 2.0 first, then the variant). Neither the wizard nor the GUI's recent-vaults list marks which vaults are machine-bound, so note it yourself: a TPM-only vault opens only on the machine whose chip sealed it.