Reputation: 693
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
Upvotes: 2
Views: 3218
Reputation: 189796
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)
Upvotes: 0
Reputation: 425623
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.
Upvotes: 4