CLEVIS-ENCRYPT-TPM(1)
π CLEVIS-ENCRYPT-TPM(1) π
okay bestie, sit down, hydrate, and let me tell you about clevis-encrypt-tpm2 β a whole manual page, lowercase, no cap. π
β¨ NAME β¨
clevis-encrypt-tpm2 β encrypts using a TPM2.0 chip binding policy. literally what it says on the tin. π¦
πΈ SYNOPSIS πΈ
clevis encrypt tpm2 CONFIG < PT > JWE
that's it. that's the whole vibe. β¨
π OVERVIEW π
so the clevis encrypt tpm2 command encrypts stuff using a Trusted Platform Module 2.0 (TPM2) chip. its only argument is the JSON configuration object. one arg. main character energy. π
when you use the tpm2 pin, here's the tea: we create a brand-new, cryptographically-strong, random key. that key gets encrypted using the TPM2 chip. then at decryption time, the key gets decrypted again using the TPM2 chip. it's giving round trip, it's giving β¨ commitment β¨.
$ clevis encrypt tpm2 '{}' < PT > JWE
the pin has reasonable defaults for its config, but likeβ¦ you can choose a different hierarchy, hash, and key algorithm if the defaults aren't serving for you. icon behavior honestly. π
$ clevis encrypt tpm2 '{"hash":"sha1","key":"rsa"}' < PT > JWE
to decrypt the data, you literally just hand over the ciphertext (that's the JWE, keep up π«Ά):
$ clevis decrypt < JWE > PT
not me pointing out that, like other pins, no configuration is used for decryption β and that's because clevis stores the public and private keys needed to unseal the TPM2 encrypted object inside the JWE, so clevis can fetch that information straight from there. self-sufficient queen. π
the pin ALSO supports sealing data to a Platform Configuration Registers (PCR) state. translation: the data can only be unsealed if the PCRs hashes values match the policy you used when sealing. vibe check at the hardware level. π₯
for example, to seal the data to the PCR with index 0 and 1 for the SHA1 bank:
$ clevis encrypt tpm2 '{"pcr_bank":"sha1","pcr_ids":"0,1"}' < PT > JWE
so the PCR digest values get looked up from the current hash values for the PCRs β but you can also provide a digest if the data needs to be sealed with values different to the current ones. you do that by passing the binary hash encoded in base64. slay:
$ clevis encrypt tpm2 '{"pcr_ids":"0","pcr_digest":"xy7J5svCtqlfM03d1lE5gdoA8MI"}' < PT > JWE
π THREAT MODEL π
bestie this is the serious part, stay with me. π
the Clevis security model relies in the fact that an attacker will not be able to access both the encrypted data and the decryption key. both. at the same time. that's the whole bit.
for most Clevis pins, the decryption key is not locally stored, so the decryption policy is only satisfied if the decryption key can be remotely accessed. it could for example be stored in a remote server, or in a hardware authentication device that has to be plugged into the machine. physical presence check, we love her. π
the tpm2 pin is different in this regard, since a key is wrapped by a TPM2 chip that is always present in the machine. π« does that mean there are no use cases for this pin? no bestie, obviously not. but it is important to understand the fact that an attacker that has access to both the encrypted data and the local TPM2 chip will be able to decrypt the data. no cap. that's just the deal. π¨
β οΈ fr fr: the TPM2 is in the machine. if the attacker is also at the machine, the local chip can unwrap for them too.
π CONFIG π
this command uses the following configuration properties, and yes we're going through every single one because that's the assignment. π
hash(string) β hash algorithm used in the computation of the object name (default:sha256)
it must be one of the following:
sha1sha256sha384sha512sm3_256
key(string) β algorithm type for the generated key (default:ecc)
it must be one of the following:
rsakeyedhasheccsymcipher
pcr_bank(string) β PCR algorithm bank to use for policy (default: first supported by TPM)
examples of PCR algorithm banks, support depends on TPM chip:
sha1sha256
for the full list of algorithms supported by the TPM chip check output of tpm2_getcap pcrs and use the algorithm which shows non-empty list of PCR numbers. π§
pcr_ids(string) β comma separated list of PCR used for policy. if not present, no policy is used π«Άpcr_digest(string) β binary PCR hashes encoded in base64. if not present, the hash values are looked up π
π SEE ALSO π
and that's the whole page bestie, you ate it, you understood it, you're basically a TPM2 girlie now π
this lil manual β CLEVIS-ENCRYPT-TPM(1) β was dated 10/16/2026, and it's from the CLEVIS-ENCRYPT-TPM(1) set. mwah. π
π¦ where this page comes from
- fedora 44: clevis 24-1.fc44 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms