当前位置:网站首页>[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
边栏推荐
- SD_ DATA_ RECEIVE_ SHIFT_ REGISTER
- AntiSamy:防 XSS 攻击的一种解决方案使用教程
- Comparison and selection of kubernetes Devops CD Tools
- Basic operation of chain binary tree (implemented in C language)
- 2022年推荐免费在线接收短信平台(国内、国外)
- 【剑指 Offer】59 - I. 滑动窗口的最大值
- 行业案例|数字化经营底座助力寿险行业转型
- 标准ACL与扩展ACL
- 微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
- Three forms of multimedia technology commonly used in enterprise exhibition hall design
猜你喜欢
Three forms of multimedia technology commonly used in enterprise exhibition hall design
强化学习-学习笔记8 | Q-learning
RISCV64
99% of people don't know that privatized deployment is also a permanently free instant messaging software!
Reinforcement learning - learning notes 8 | Q-learning
Basic operation of chain binary tree (implemented in C language)
6. About JWT
Redis
Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products
Five network IO models
随机推荐
Idea completely uninstalls installation and configuration notes
What is the general yield of financial products in 2022?
Reject policy of thread pool
小试牛刀之NunJucks模板引擎
Will domestic software testing be biased
Thread pool and singleton mode and file operation
Learn open62541 -- [67] add custom enum and display name
Wireshark analyzes packet capture data * cap
Antisamy: a solution against XSS attack tutorial
The moveposition function of rigidbody2d of unity2d solves the problem of people or screen jitter when moving
AntiSamy:防 XSS 攻击的一种解决方案使用教程
二叉树的基本概念和性质
[C language] string function
How much does it cost to develop a small program mall?
伺服力矩控制模式下的力矩目标值(fTorque)计算
清华、剑桥、UIC联合推出首个中文事实核查数据集:基于证据、涵盖医疗社会等多个领域
App capture of charles+postern
[Tawang methodology] Tawang 3W consumption strategy - U & a research method
C语言中匿名的最高境界
IP netns command (memo)