Resource Page DescriptionAn implementation of the MD5 cryptographic hashing algorithm for Silverlight. This class consists of fully transparent C# code, suitable for use in any managed Silverlight application. This class also works without modification on the full .NET runtime without modification, if the built in MD5CryptoServiceProvider does not meet your needs.
** A note on the security of the MD5 algorithm **
MD5 is generally considered insecure for use in cryptographic operations. If possible, you should be using a more modern algorithm for your software, such as
SHA2 for cryptographic hashing, or one of the CRC methods for transmission hashes. Nevertheless, it’s sometimes necessary for backwards compatibility. If this is the initial release of a Silverlight application, please don’t use MD5, use one of the ones above.
Usage
Simply add the MD5.cs file to your existing Silverlight or .NET project within Visual Studio. Because it’s a static class, simply call the function MD5Core.GetHash(argument), providing either a string or byte array as the first argument. The return value is a byte array containing the MD5 hash of the input object.
You can also use MD5Core.GetHashString(argument), with either a string or byte array, and get back a string consisting of the ASCII printable hex value.
For an MSDN-style reference, see the
MD5Core or
MD5Managed class reference.
Advanced Usage
There is a reference executable suitable for use with the full .NET framework included as MD5Test.cs. This should be compiled with MD5.cs and MD5Managed.cs, and implements performance tests and test vectors for the MD5 implementation. It is also available as a precompiled binary for .NET 2.0 as MD5Test.exe. Usage is:
MD5Test.exe [<string to hash>|-v|-t]
-v Run test vectors
-t Run performance test