Questions tagged «trusted-computing»

4
如何使用TPM(受信任的平台模块)加密字节
如何使用机器的TPM模块加密字节? 加密数据 Windows提供了一个(相对)简单的API来使用该CryptProtectDataAPI 加密Blob ,我们可以包装一个易于使用的函数: public Byte[] ProtectBytes(Byte[] plaintext) { //... } 的细节ProtectBytes比您可以轻松使用它的想法重要得多: 这是我想通过保存在其中的密钥加密的字节 System 还给我加密的斑点 返回的Blob是未记录的文档结构,其中包含解密和返回原始数据所需的所有内容(哈希算法,密码算法,salt,HMAC签名等)。 为了完整起见,以下ProtectBytes是使用Crypt API来保护字节的示例伪代码实现: public Byte[] ProtectBytes(Byte[] plaintext) { //Setup our n-byte plaintext blob DATA_BLOB dataIn; dataIn.cbData = plaintext.Length; dataIn.pbData = Addr(plaintext[0]); DATA_BLOB dataOut; //dataOut = EncryptedFormOf(dataIn) BOOL bRes = CryptProtectData( dataIn, null, //data description …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.