MD5 Implementation in C#

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

15 responses to “MD5 Implementation in C#

  1. 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.

  2. many thanks for this code! ;)

  3. thank you so much …

  4. silvertongue

    thank you for the code, it really helps!!!

  5. Thanks from me, too. God bless.

  6. 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;
    }
    }

  7. 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

  8. Thanks, I’m using this in my Silverlight project and it works perfectly!

  9. I need to write the MD5 implementation in Silverlight 3, which namespace do I use to get the required classes.

    Thanks
    Sachin

  10. 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

  11. Pingback: MD5 hashes in C# – benchmark and speed ​​optimization | en.code-bude.net

  12. Pingback: MD5 Hashes in C# erzeugen – Benchmark und Geschwindigkeitsoptimierung | code-bude.net

  13. Good day
    Can you briefly comment on the work ?
    Difficult to understand…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s