This project is read-only.
Project Description
This is a simple implementation of the MD5 cryptographic hashing algorithm and HMAC-MD5. This class consists of fully transparent C# code, suitable for use in .NET, Silverlight and WP7 applications.

The implementation of the MD5 cryptographic hashing algorithm is based on : http://archive.msdn.microsoft.com/SilverlightMD5

I just added the HMAC-MD5 implementation ! For more information about the HMAC : http://en.wikipedia.org/wiki/HMAC

The code is very simple (2 classes) and suitable for use in .NET, Silverlight and WP7 applications (because the MD5 and HMACMD5 from System.Security.Cryptography are not available in WP7 and SL)

HMAC-MD5 sample:
// Create an instance of HMACMD5 with a key (from byte[] or string)
HMACMD5 hmac = new HMACMD5("My Key");

// Compute HMAC in Base64 string
string computedHashString = hmac.ComputeHashToBase64String("This is a test !!!");

// Compute HMAC in byte[]
byte[] computedHash = hmac.ComputeHash("This is a test !!!");

MD5 sample:
byte[] hash = MD5.GetHash("This is an example");
string hashString = MD5.GetHashString("This is an example");


Note :
The project is a "Portable Class Library". You need to install the Visual Studio 2010 SP1 and the Portable Library Tools !

Last edited Nov 9, 2011 at 2:33 PM by SebastienWarin, version 15