当前位置:网站首页>[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
边栏推荐
- Review of network attack and defense
- App capture of charles+drony
- Will low code help enterprises' digital transformation make programmers unemployed?
- idea彻底卸载安装及配置笔记
- 来了!GaussDB(for Cassandra)新特性亮相
- Do you know all four common cache modes?
- Complete e-commerce system
- PTA 1101 B是A的多少倍
- [Tawang methodology] Tawang 3W consumption strategy - U & a research method
- 二叉树的基本概念和性质
猜你喜欢
Wireshark analyzes packet capture data * cap
數據驗證框架 Apache BVal 再使用
面试唯品会实习测试岗、抖音实习测试岗【真实投稿】
String type, constant type and container type of go language
Creative changes brought about by the yuan universe
CVPR 2022 - learning non target knowledge for semantic segmentation of small samples
DeSci:去中心化科学是Web3.0的新趋势?
我感觉被骗了,微信内测 “大小号” 功能,同一手机号可注册两个微信
Scientists have observed for the first time that the "electron vortex" helps to design more efficient electronic products
微信网页调试8.0.19换掉X5内核,改用xweb,所以x5调试方式已经不能用了,现在有了解决方案
随机推荐
Hutool - lightweight DB operation solution
完整的电商系统
Redis
10 schemes to ensure interface data security
How to choose the appropriate automated testing tools?
coming! Gaussdb (for Cassandra) new features appear
Usage of PHP interview questions foreach ($arr as $value) and foreach ($arr as $value)
学习open62541 --- [67] 添加自定义Enum并显示名字
高考填志愿规则
前首富,沉迷种田
国内的软件测试会受到偏见吗
Continuous test (CT) practical experience sharing
抢占周杰伦
Do you know all four common cache modes?
Charles+Postern的APP抓包
PTA 1102 teaching Super Champion volume
伺服力矩控制模式下的力矩目标值(fTorque)计算
Interview vipshop internship testing post, Tiktok internship testing post [true submission]
Learn open62541 -- [67] add custom enum and display name
Nat address translation