gpt4 book ai didi

c++ - 如何检查 CNG Windows API 是否返回符合 FIPS 的算法实现

转载 作者:行者123 更新时间:2023-11-28 04:10:42 25 4
gpt4 key购买 nike

我在启用了 FIPS 模式的主机上调用 Windows CNG API (bcrypt.dll)。BCryptGetFipsAlgorithmMode 函数的结果证实了启用 FIPS 的事实。

如何确保 API 返回的算法实现符合 FIPS 标准?

看起来仅在主机上启用 FIPS 模式并不能保证 API 可以防止不符合 FIPS 的算法实例化,因为我可以成功获得 MD5 哈希算法(已知不符合 FIPS)。

最佳答案

KB 811833 says

This policy is only advisory to applications. Therefore, if you enable the policy, it does not make sure that all applications will comply. The following of areas in the operating system will be affected by this setting:

并继续列出受政策影响的事物。这包括 SChannel 和 .NET,但不包括 CNG API 本身。 This blog post确认 .NET 行为,但可以使用应用配置文件中的 enforceFIPSPolicy 覆盖它。

调用 BCryptOpenAlgorithmProvider 时,您可以通过指定 MS_PRIMITIVE_PROVIDER 强制提供者。

关于c++ - 如何检查 CNG Windows API 是否返回符合 FIPS 的算法实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57850789/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com