我一直在寻找保护应用程序中密码数据的方法。我最初使用
CryptProtectData
API,但我看到 Windows 凭据提供程序示例使用 CredProtectW
API。加密方面有什么区别,哪个更好?
正如这些文章所说:
https://threathunterplaybook.com/library/windows/data_protection_api.html
https://www.linkedin.com/pulse/protect-data-machine-account-microsoft-capi-kashif-mushtaq/
CryptProtectData
是 DPAPI
的一部分。
它用于加密您的主密钥(Windows 用户登录密码),并在早期版本的 Windows 以及 Windows 7 及之后的版本中使用 3DES
。
AES-256
是
CredProtectW
的一部分。找不到它使用的算法,但知道它与 CAPI
具有类似的概念,但在数据的 CryptProtectData
上有例外(只有 integrity
有 CryptProtectData
)以防密文中毒。
keyed integrity check
或
ChaCha20-Poly1305
,因为如果您想在不久的将来制作它便携式,你会遇到问题。