寻找“本地人” 在 Windows 2003 服务器中计算 MD5/SHA1 哈希值的 dll

发布于 2024-07-12 04:10:23 字数 138 浏览 5 评论 0 原文

有谁知道Windows(2003服务器)中是否存在一个dll,我可以调用它来计算字符串的MD5/SHA1哈希值?

我已经用 C# 编写了一个 .dll 来执行此操作,但由于公司对我们服务器的规定,我不允许使用它。

/奥斯加

Does anyone know if there exist a dll in windows (2003 server) which I can call to calculate a MD5/SHA1 hash for a string?

I've written a .dll in C# that do this but I'm not allowed to use this because of company regulations for our servers.

/Ausgar

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

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

发布评论

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

评论(2

最冷一天 2024-07-19 04:10:23

如果您确实安装了 .NET 2.0(我认为您确实安装了),那么是的,有一个。

它可以通过 COM 分别作为 System.Security.Cryptography.MD5CryptoServiceProviderSystem.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 and System.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.

潇烟暮雨 2024-07-19 04:10:23

您尝试过 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)

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