Introduction :
This was my first piece of code in C# . It is a very simple implementation of MD5 message digest algorithm( RFC 1321) for generating hash values. The code is based on .net framework 1.1. You can use the windows form interface or console interface to quickly get MD5 hash values. You can also add it as reference to you project use it as a class library. Its quite light weight, and can be compiled for compact framework.
Download:
you can download the source code here : DOWNLOAD MD5 IMPLEMENTATION


Thanks a lot for this, I’ve been strugling a couple of weeks to get some C# MD5 implementation for analysis and at least I found one here!
Really nice, thanks a lot.
thanku so much……
its really helpful for me
thank you!
many thanks for this code! 😉
thank you so much …
thank you for the code, it really helps!!!
Thanks from me, too. God bless.
using System;
using System.Security.Cryptography;
using System.Text;
public class MD5
{
public static string MD5(string password)
{
var textBytes = Encoding.Default.GetBytes(password);
var cryptHandler = new MD5CryptoServiceProvider();
var hash = cryptHandler.ComputeHash(textBytes);
var ret = “”;
foreach (var a in hash)
{
ret += a.ToString(“x2”);
}
return ret;
}
}
Hi Mr. Mahmood,
i need a MD5 implementation for a silverlight project and found your code.
Under what kind of license did you publish this code – can it be used in a compiled commercial application?
thank you for more info
Thanks, I’m using this in my Silverlight project and it works perfectly!
I need to write the MD5 implementation in Silverlight 3, which namespace do I use to get the required classes.
Thanks
Sachin
I ‘m in need of the code for my final year project. thanks for the code , bt can i get a simplified code .. either in c# or vb.net
Pingback: MD5 hashes in C# – benchmark and speed optimization | en.code-bude.net
Pingback: MD5 Hashes in C# erzeugen – Benchmark und Geschwindigkeitsoptimierung | code-bude.net
Good day
Can you briefly comment on the work ?
Difficult to understand…
Good code. That’s what I’m looking for. Thanks man.
thank u very much
Thank you very much for sharing this code. It worked perfectly and save me hours!
Hello there.
There are the classes MD5ChangingEventArgs and MD5ChangedEventArgs.
The code where you declare the new local variable byte[] NewData
inside the initializers…
I believe you intended to reintialize the global variable with the same name declared inside these classes. But this way you can not access the changes because that local variable hides the global one.