WinXP 上符合 FIPS 的哈希算法?

发布于 2024-07-30 02:13:55 字数 232 浏览 4 评论 0原文

如何在符合 FIPS 的 WinXP SP2 机器上使用 C# 来唯一地散列给定文件的内容? 我不关心性能(还?)。

希望有人能指出“规则”的一个例外,但似乎“*ServiceProvider”类符合 FIPS 标准且在 WinXP 上不可用,而“*托管”类在 WinXP 上可用但不符合 FIPS 标准。

MD5 已被淘汰,因为它不是可靠唯一的(是的,即使是很小的可能性对于我的项目来说也是不可接受的)。

How can I use C# on a FIPS-compliant WinXP SP2 box to uniquely hash the contents of a given file? I'm not concerned about performance (yet?).

Hopefully someone can point out an exception to the "rule", but it seems that the "*ServiceProvider" classes are FIPS-compliant and unavailable on WinXP, while the "*Managed" classes are available on WinXP and not FIPS-compliant.

And MD5 is out because it's not reliably unique (yes, even that small likelihood is unacceptable for my project).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪冰清 2024-08-06 02:13:56

如果您需要的只是一个哈希提供程序,当 Windows 计算机在注册表中打开符合 FIPS 的策略设置时,该提供程序不会出现任何错误,那么您可以使用 SHA1CryptoServiceProvider,它符合 FIPS,并且只需要 .Net 2.0 和 XP SP2。

但是 - 如果出于安全和策略原因您实际上需要真正符合 FIPS 的实施,那么简短的答案是要么将客户端升级到 Win XP SP3(或更新的操作系统),要么考虑使用第三方 FIPS 验证的加密服务提供商 (CSP)。

虽然 Win XP SP2 支持 SHA1 的 FIPS 兼容实现 (SHACryptoServiceProvider),它将在 FIPS 兼容模式(注册表设置)下工作,但 SHA1 不应该用于 2010 年后的新实现,并且可能不再符合 FIPS,具体取决于用法(即用于随机数生成与散列)。

如果您至少可以使用 XP SP3,则可以使用 SHA256CryptoServiceProvider 或 SHA512CryptoServiceProvider,它们均符合 FIPS 标准。

If all you need is a hashing provider that won't trip any errors when the Windows machine has the FIPS compliant policy setting in the registry turned on, then you can use SHA1CryptoServiceProvider, which is FIPS-compliant and only requires .Net 2.0 and XP SP2.

But - if you're actually needing a true FIPS-compliant implementation for security and policy reasons, then the short answer is either get the clients upgraded to Win XP SP3 (or newer OS) or look at using a third-party FIPS validated Cryptographic Service Providers (CSP).

While Win XP SP2 supports a FIPS compliant implementation of SHA1 (SHACryptoServiceProvider) that will work in FIPS compliant mode (registry setting), SHA1 is not supposed to be used for new implementations after 2010 and may no longer be FIPS compliant at all, depending on the usage (i.e. using for random number generation vs. hashing).

If you can get to at least XP SP3, then you can use SHA256CryptoServiceProvider or SHA512CryptoServiceProvider, which are both FIPS compliant.

绿萝 2024-08-06 02:13:56

这些似乎符合 fips 标准:

HMACSHA1、MACTripleDES 和 SHA1CryptoServiceProvider

参考:http://blog.aggregateintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html

It seems these are fips-compliant:

HMACSHA1, MACTripleDES, and SHA1CryptoServiceProvider

ref: http://blog.aggregatedintelligence.com/2007/10/fips-validated-cryptographic-algorithms.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文