我是否需要存储CryptUnprotectData和CryptProtectData的密钥?

时间:2014-06-24 12:11:44

标签: winapi encryption storage dpapi

DPAPI有两个功能:CryptUnprotectDataCryptProtectData。 我读了They do the encryption or decryption by using a session key that the function creates by using the user's logon credentials.这是否意味着我不需要在任何地方存储这个密钥,它们会在我想要加密或解密数据时创建?
我也发现An important point to remember is that DPAPI merely applies cryptographic protection to the data. It does not store any of the protected data; therefore applications calling DPAPI must implement their own storage of the protected data.这是关于加密的密钥或文件吗?

1 个答案:

答案 0 :(得分:1)

上述功能使用特定于登录用户的密钥。因此,您不需要存储密钥。但是,这些功能仅用于数据转换,而不用于数据存储。这意味着您可以在任何地方存储加密数据块--CryptProtectData不会为您执行此操作。