ecryptfs-generate-tpm-key
Generate eCryptfs key within the TPM
SYNOPSIS
ecryptfs-generate-tpm-key [options]
PARAMETERS
--force
Overwrite an existing key with the same name.
--tpm-device=
Specify the TPM device to use. Default is /dev/tpm0.
The name to assign to the generated and wrapped key. This name will be used when mounting or accessing the encrypted data.
DESCRIPTION
The `ecryptfs-generate-tpm-key` command is a utility designed to create and securely store an eCryptfs encryption key within a Trusted Platform Module (TPM). This process involves generating a random key and then 'wrapping' it, meaning encrypting it using a key held securely inside the TPM. The wrapped key is then stored on disk, but cannot be unwrapped without the TPM.
This enhances the security of eCryptfs encrypted data by leveraging the hardware-based security of the TPM, protecting against offline attacks where an attacker gains physical access to the system but cannot access the TPM's secrets.
The command interacts with the TPM to perform the key wrapping operation. It also ensures that appropriate metadata is stored along with the wrapped key to facilitate later key retrieval and usage within the eCryptfs framework.
It is commonly used as part of a larger setup to protect user home directories with eCryptfs, where the encryption key is protected by the TPM.
CAVEATS
The TPM must be properly initialized and configured before using this command. Also, the user running the command must have the necessary permissions to access the TPM device. It is crucial to understand that if the TPM fails or is reset, the wrapped key will be irretrievable, leading to permanent data loss. Therefore, a backup strategy of the unwrapped key is highly recommended. Backing up wrapped key without the TPM is pointless.
KEY BACKUP RECOMMENDATION
While the TPM provides strong protection, it's essential to maintain a secure backup of the *unwrapped* encryption key. This backup should be stored offline and protected with strong encryption. This ensures data recovery in case of TPM failure. Use tools like `ecryptfs-unwrap-passphrase` to unwrap the key *before* backing it up.
Note: It is important to destroy or encrypt the unwrapped key after backup!
TPM OWNERSHIP
Ensure that the TPM is properly owned and configured before using `ecryptfs-generate-tpm-key`. Incorrect TPM ownership or configuration can lead to errors or security vulnerabilities.
Pay attention during TPM initialization!
HISTORY
The `ecryptfs-generate-tpm-key` command was developed as part of the eCryptfs project to provide enhanced security through hardware-backed key storage using TPMs. It reflects the growing trend of leveraging hardware security modules to protect sensitive data. The command's evolution has been influenced by the need for stronger encryption and protection against increasingly sophisticated attacks.
SEE ALSO
ecryptfsd(8), mount.ecryptfs(8)