[tpm2] Design for Secrets Encryption
accounts <burnsds.accounts at protonmail.com> Wed, 28 Sep 2022 13:18:05 +0000
| Newsgroups | dev.linux.lists.tpm2 |
|---|---|
| Message-ID | <fYPnYNhBp-T2NJbufHcLy_ghr5nUgil-fSR-DCBm1O-wHQVJsMEnMhNVMzvh6fTbm_ZuT03DNsaTH2_ZY0qkTEF-iNbliDXcofYuN5SlnRM=@protonmail.com> |
I am working a Linux IoT integration with TPM 2.0, and have a requirement to use the TPM for encrypting secrets. Unfortunately, disk encryption is not an option. I’m using the tss2 and tpm2 tools found here. https://tpm2-tools.readthedocs.io/en/latest/ I’m new to TPM and have some questions regarding the implementation. It appears as I can use two approaches. The first approach uses tss2_createkey and tss2_encrypt to encrypt the secrets during device provisioning. tss2_decrypt would then be used to decrypt the secrets at boot. When using tss2_createkey, where is the private key stored? Is the private key encrypted by the SRK which would allow it to be stored on an unencrypted disk? The other option is to generate a key pair (using open ssl) and store the private key in the TPM NV index. Assuming the first option stores the private key outside of the TPM, are there any security benefits to this approach? As a side note, the key will be tied to a PCR based auth policy. It should only be released if the valid software configuration boots on the device. Thanks for the help! Dan Burns
attachment.htm
(text/html, 2.6 KB)
<div style="font-family: Arial; font-size: 14px;"><p style="font-size:11pt;line-height:1.5;margin:0in 0in 8pt;font-family:Calibri, sans-serif">I am working a Linux IoT integration with TPM 2.0, and have a requirement to use the TPM for encrypting secrets.<span> <span> </span></span>Unfortunately, disk encryption is not an option.<span> <span> </span></span>I’m using the tss2 and tpm2 tools found here.<span> <span> </span></span><a href="https://tpm2-tools.readthedocs.io/en/latest/" rel="noreferrer nofollow noopener" target="_blank" style="color:var(--interaction-norm);text-decoration:underline;cursor:pointer">https://tpm2-tools.readthedocs.io/en/latest/</a> </p><p style="font-size:11pt;line-height:1.5;margin:0in 0in 8pt;font-family:Calibri, sans-serif">I’m new to TPM and have some questions regarding the implementation.<span> <span> </span></span>It appears as I can use two approaches.<span> <span> </span></span>The first approach uses tss2_createkey and tss2_encrypt to encrypt the secrets during device provisioning.<span> <span> </span></span>tss2_decrypt would then be used to decrypt the secrets at boot.<span> <span> </span></span>When using tss2_createkey, where is the private key stored?<span> <span> </span></span>Is the private key encrypted by the SRK which would allow it to be stored on an unencrypted disk? </p><p style="font-size:11pt;line-height:1.5;margin:0in 0in 8pt;font-family:Calibri, sans-serif">The other option is to generate a key pair (using open ssl) and store the private key in the TPM NV index.<span> <span> </span></span>Assuming the first option stores the private key outside of the TPM, are there any security benefits to this approach? </p><p style="font-size:11pt;line-height:1.5;margin:0in 0in 8pt;font-family:Calibri, sans-serif">As a side note, the key will be tied to a PCR based auth policy.<span> <span> </span></span>It should only be released if the valid software configuration boots on the device.</p><p style="font-size:11pt;line-height:1.5;margin:0in 0in 8pt;font-family:Calibri, sans-serif">Thanks for the help!</p><p style="font-size:11pt;line-height:1.5;margin:0in 0in 8pt;font-family:Calibri, sans-serif">Dan Burns</p><br><br></div>
<div class="protonmail_signature_block protonmail_signature_block-empty" style="font-family: Arial; font-size: 14px;">
<div class="protonmail_signature_block-user protonmail_signature_block-empty"></div>
<div class="protonmail_signature_block-proton protonmail_signature_block-empty">
</div>
</div>