寻找“本地人” 在 Windows 2003 服务器中计算 MD5/SHA1 哈希值的 dll
有谁知道Windows(2003服务器)中是否存在一个dll,我可以调用它来计算字符串的MD5/SHA1哈希值?
我已经用 C# 编写了一个 .dll 来执行此操作,但由于公司对我们服务器的规定,我不允许使用它。
/奥斯加
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您确实安装了 .NET 2.0(我认为您确实安装了),那么是的,有一个。
它可以通过 COM 分别作为
System.Security.Cryptography.MD5CryptoServiceProvider
和System.Security.Cryptography.HMACSHA1
进行访问。在 C# 中实现它是没有用的,因为 C# 依赖于 .NET,而 .NET 已经为您实现了它。
PS 如果您的系统上没有 .NET 或者由于某种原因您不愿意使用 .NET/COM,那么有 Microsoft 的 ="nofollow noreferrer">示例加密API。
If you do have a .NET 2.0 installed (which I think you do), then yes, there is one.
It's accessible via COM as
System.Security.Cryptography.MD5CryptoServiceProvider
andSystem.Security.Cryptography.HMACSHA1
, respectively.It's no use to implent it in C# as C# relies on .NET and .NET has implemented it for you already.
P.S. If there is no .NET on your system or you reluct at using .NET/COM for some reason, then there is sample using Microsoft Crypto API.
您尝试过 openSSL 吗?
(例如,有适用于 Windows 的预编译 libeay32.dll 和 libssl32.dll 文件,但我不确定描述每个文件中可用的 DLL 函数的文档在哪里)
Have you tried openSSL?
(e.g. there are precompiled libeay32.dll and libssl32.dll files for windows, I'm not sure where the docs are that describe the DLL functions available in each of those, though)