C# 执行MD5算法报错(转)

C#程序执行到运用到哈希算法或MD5算法 ,报错提示:

System.InvalidOperationException: This implementation is not part of the Windows Platform FIPS validated cryptographic algorithms.
at System.Security.Cryptography.MD5CryptoServiceProvider..ctor()

此实现不是 Windows 平台 FIPS 验证的加密算法的一部分。

解决方法如下:

在window中打开功能里输入regedit,回车打开注册器。然后进入如下路径中

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\FipsAlgorithmPolicy 将enable设置为0 即可。

修改之后要重新启动电脑。







转自:https://blog.csdn.net/fengxing11/article/details/52919349

posted @ 2020-08-27 23:25  雨也绵绵  阅读(258)  评论(0编辑  收藏  举报