CredProtect 和 CryptProtectData 之间的区别。哪个更好?

问题描述 投票:0回答:1

我一直在寻找保护应用程序中密码数据的方法。我最初使用

CryptProtectData
API,但我看到 Windows 凭据提供程序示例使用
CredProtectW
API。加密方面有什么区别,哪个更好?

windows cryptography windows-credential-provider
1个回答
0
投票

正如这些文章所说:

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
,因为如果您想在不久的将来制作它便携式,你会遇到问题。
    

© www.soinside.com 2019 - 2024. All rights reserved.