SHA256CryptoServiceProvider和相关可能在WinXP上使用? [英] SHA256CryptoServiceProvider and related possible to use on WinXP?

查看:364
本文介绍了SHA256CryptoServiceProvider和相关可能在WinXP上使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以在Windows XP上使用SHA256CryptoServiceProvider和相关的SHA2提供程序吗?我知道提供者使用Vista及以上版本的密码服务是否可以从Microsoft安装这些服务?

Is it possible to use SHA256CryptoServiceProvider and related SHA2 providers on Windows XP? I know the providers use the cryptography services that are included in Vista and above is it possible to install these services in XP from Microsoft?

编辑:我应该提供更多的信息MSDN上的文档在Windows XP中受到支持是错误的。请参阅 http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback。 aspx?FeedbackID = 355031 ,这被Microsoft设计认可和接受。然而,在任何地方都没有任何工作(我看到),所以我不知道是否可以安装这个需要的服务正常工作,或者如果它是倾斜的风险试图在WinXP上安装IIS 6或7。 p>

I should've provided more information the documentation on the MSDN is wrong in regards to this being supported in Windows XP. See http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=355031 where this is acknowledged and accepted by Microsoft as by design. However there is no work around listed anywhere (that I saw) so I wasn't sure if it's possible to install the services this requires to work properly or if it's like tilting at windwills trying to install IIS 6 or 7 on WinXP.

推荐答案

似乎MSDN文档是正确的,它的设计应该在XP SP3中支持 ,如果不是,则仅仅是因为.NET 3.5中的错误

It seems that MSDN documentation is right in the sense that it should be supported in XP SP3 by design, and if it is not, it's only because of a bug in .NET 3.5.

AesCryptoServiceProvider和SHA256CryptoServiceProvider都使用相同的cryptograhics服务命名Microsoft增强型RSA和AES加密提供程序。在XP下,服务名称略有不同:Microsoft Enhanced RSA and AES Cryptographic Provider(Prototype)。 AesCryptoServiceProvider的构造函数执行一个简单的检查:

Both AesCryptoServiceProvider and SHA256CryptoServiceProvider use the same cryptograhics service named "Microsoft Enhanced RSA and AES Cryptographic Provider". Under XP, the name of the service is slightly different: "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)". The constructor of AesCryptoServiceProvider performs a simple check:

string providerName = "Microsoft Enhanced RSA and AES Cryptographic Provider";
if(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1)
{
    providerName = "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)";
}

SHAxxxCryptoServiceProvider类的构造函数检查(原型)名称,这就是为什么它们在XP中失败。如果他们这样做,他们会成功。

The constructors of SHAxxxCryptoServiceProvider classes do not check the (Prototype) name, and this is why they fail in XP. If they did, they would succeed.

在给定的PC上有一个简单的解决方法。转到注册表项 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider ,找到名为Microsoft Enhanced RSA and AES Cryptographic Provider(Prototype)的子项,将其导出为.reg ,编辑此.reg并从其名称中删除(Prototype)。当您导入它时,原始密钥将被复制到没有(原型)的新密钥,内容相同。从现在起,SHA256CryptoServiceProvider将在此XPSP3机器上工作。

There is a simple workaround on a given PC. Go to registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\Defaults\Provider, find its subkey named "Microsoft Enhanced RSA and AES Cryptographic Provider (Prototype)", export it to .reg, edit this .reg and delete " (Prototype)" from its name. When you import it back, the original key will be duplicated to the new key without (Prototype), with the same contents. From now on, SHA256CryptoServiceProvider will work on this XPSP3 machine.

这篇关于SHA256CryptoServiceProvider和相关可能在WinXP上使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆