当前位置:网站首页>[tpm2.0 principle and Application guide] Chapter 16, 17 and 18
[tpm2.0 principle and Application guide] Chapter 16, 17 and 18
2022-07-07 19:04:00 【Godams】
The first 16 Chapter Order audit
The audit is responsible for recording in the host and TPM Between TPM Commands and parameters . The host is responsible for maintaining logs , Logs may exist in the host memory or hard disk .TPM Use similar PCR The extended record of records these parameters , Then return a signature summary of the audit log . The recipient of the signature summary can verify the signature , To verify the integrity of the log .
TPM Expand the hash of command and response parameters into an audit summary
16.1 Why audit ?
stay TPM in , The audit is responsible for recording in the host and TPM Between TPM Command and corresponding parameters , And only audit successfully executed orders . The host is responsible for maintaining logs , The log may exist in the memory or disk of the host . When the host saves the actual parameters ,TPM By analogy for PCR To record these parameters . after ,TPM Return a signature summary of the audit log . The recipient of the signature digest can verify the signature , To verify the integrity of the log .
16.3 Types of audit
- Order audit : Responsible for recording all instances of a selected command set , Regardless of the conversation .
- Session audit : Session audit records all commands in a session , Regardless of orders .
A dedicated session allows the receiver to detect whether the audit session is interrupted by an unaudited intervention command . Exclusive sessions can also be used to ensure that there are no intervening commands .
16.4 The audit log
The required steps :
(1) The auditor first reads the list of command and response parameters from an audit log – The storage of logs and the execution of commands are on the host side , Then calculate the hash values of command parameters and response parameters .
(2) Auditors perform a calculation equivalent to expansion – Follow the steps 1 Calculate the hash value of each command and corresponding parameters and add the results to an audit summary .
(3) Verify the digital signature . utilize TPM Signature and a public key pair step 2 Verify the audit summary calculated in .
(4) The auditor returns to a trusted root certificate through a certificate chain , So as to establish trust in the verification public key .
The first 17 Chapter Decrypt and encrypt the session
Decryption and encryption sessions are in connection with TPM Provide confidentiality for sensitive information in the process of exchanging sensitive information
17.1 The role of encrypting and decrypting sessions
Encryption and decryption sessions protect secret information transmitted on insecure media .
The calling program is to protect the confidentiality of data , You can use a call only program and TPM Know the command encryption key to encrypt data . Part of the key is determined by the parameters used to open the session .
A decryption session notification TPM The first parameter is encrypted . It means to be TPM After receiving the parameter , It needs to be decrypted , Therefore, it is named decryption session .
For a response , An encrypted session indicates TPM This parameter has been encrypted before the first response parameter is returned . After receiving the encrypted response parameters , The caller uses the response decryption key to decrypt the data .
17.3 Restrictions on decryption and encryption
Only the first command parameter can be encrypted , And the first command parameter can be decrypted .
17.4 Decryption and encryption settings

17.5 XOR and CFB Patterns and their general processes ?
There are two different symmetric key patterns that can be used to encrypt and decrypt sessions :XOR and CFB.
CFB Mode provides high-strength encryption , But need TPM And calling programs support a hash algorithm and an encryption algorithm .
XOR Only hash algorithm is needed , And it is the right choice for scenarios that require a very small amount of code , But this method is less secure .
When a session begins ,TPM Generate a session key . To use encryption and decryption sessions , The caller needs to generate the session key for the two sessions separately . Unify all processes into one flow , The steps related to the encryption and decryption session life cycle are as follows :
(1) Use Tpm2_startAuthSession Start session , Set the symmetry parameter to
·CFB Pattern :
Symmetric.algorithm=TPM_ALG_AES;
Symmetric.keyBits.aes=128;
Symmetric.mode.aes=TPM_ALG_CFB;
·XOR Pattern :
Symmetric.algorithm=TPM_ALG_XOR;
Symmetric.keyBits.exclusiveOr=TPM_ALG_SHA256;
(2) Generate the session key and save
(3) For a, the first parameter is TPM2B The order of , If you want to encrypt this parameter , You can do the following :
· In order to use this session to generate a Hmac secret key , The session key is also included in the generation process of this key .
· about CFB Pattern :
· Use session hash algorithm 、HMAC secret key 、 Special labels (CFB)、nonceNewer、nonceOlder as well as Encrypted bits to generate encryption key and initial vector IV.
· Use encryption keys and IV Encrypt the first parameter
· about XOR Pattern :
· Use HMAC secret key 、 Session hash algorithm 、nonceNewer、nonceOlder And encrypted bits to generate Mask
· XOR the plaintext data with the mask , Generate encrypted data
· Set up sessionAttributes.decyrpt position
(4) If the first response parameter is TPM2B, And hope TPM Send this parameter in encrypted form , Set up sessionAttributes.encrypt position
(5) Send command to TPM
(6) receive TPM Response returned
(7) If the first response parameter is TPM2B And sessionAttributes.encrypt Has been set up , Follow these steps :
· In order to use this session to generate a Hmac secret key , The session key is also included in the generation process of this key .
· about CFB Pattern :
· Use session hash algorithm 、HMAC secret key 、 Special labels (CFB)、nonceNewer、nonceOlder as well as Decrypted bits to generate decryption key and initial vector IV.
· Use decryption key and IV Encrypt the first parameter
· about XOR Pattern :
· Use HMAC secret key 、 Session hash algorithm 、nonceNewer、nonceOlder And decrypted bits to generate Mask
· XOR ciphertext data with mask , Generate clear text data
The first 18 Chapter Context management

TAB and RM: A higher level description 
TAB:
RM
RM Basic operations that must be performed :
- Virtualize all and TPM Exchange operation
- Maintain tables that record the context of objects and sequences
- For loading into TPM Objects and sequences in , Maintain a virtual handle to TPM Mapping relationship of handle
- For being sent to TPM The order of
Sending to TPM Before , Capture all command byte streams
Check all handles in the authorization domain and handle domain
边栏推荐
- What is the general yield of financial products in 2022?
- 【MIME笔记】
- "Decryption" Huawei machine vision Corps: Huawei is moving up and the industry is moving forward
- 基于图像和激光的多模态点云融合与视觉定位
- 企业MES制造执行系统的分类与应用
- Nat address translation
- 二叉树的基本概念和性质
- Embedded interview questions (algorithm part)
- Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products
- 2022-07-04 matlab读取视频帧并保存
猜你喜欢

RIP和OSPF的区别和配置命令

App capture of charles+postern

6. About JWT
![[software test] from the direct employment of the boss of the enterprise version, looking at the resume, there is a reason why you are not covered](/img/73/cbbe82fd6bdfa8177f5bfcf683010d.jpg)
[software test] from the direct employment of the boss of the enterprise version, looking at the resume, there is a reason why you are not covered

Continuous test (CT) practical experience sharing

线程池和单例模式以及文件操作

抢占周杰伦

Redis集群与扩展

高温火烧浑不怕,钟薛高想留清白在人间

The live broadcast reservation channel is open! Unlock the secret of fast launching of audio and video applications
随机推荐
DataSimba推出微信小程序,DataNuza接受全场景考验? | StartDT Hackathon
完整的电商系统
[sword finger offer] 59 - I. maximum value of sliding window
数据验证框架 Apache BVal 再使用
线程池和单例模式以及文件操作
NAT地址转换
The highest level of anonymity in C language
我感觉被骗了,微信内测 “大小号” 功能,同一手机号可注册两个微信
Recommend free online SMS receiving platform in 2022 (domestic and foreign)
二叉树的基本概念和性质
unity2d的Rigidbody2D的MovePosition函数移动时人物或屏幕抖动问题解决
嵌入式C语言程序调试和宏使用的技巧
AntiSamy:防 XSS 攻击的一种解决方案使用教程
链式二叉树的基本操作(C语言实现)
来了!GaussDB(for Cassandra)新特性亮相
Three forms of multimedia technology commonly used in enterprise exhibition hall design
线程池中的线程工厂
虚拟数字人里的生意经
RISCV64
Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products