MD5Crypt in .net

Hi. I'm working on a project in which I need to use MD5 cryptography. The requirements are vague, but I need to do both: compute the MD5 hash of a string and perform the MD5Crypt function on the string. I know that class MD5CryptoServiceProvider provides the ComputeHash() function (for the first part). However, I don't think it provides an MD5Crypt function. Actually, I have no idea what the MD5Crypt function is. From what I know MD5 is a hashing algorithm, so am I looking for a MD5 cryptography algorithm I don't think one exists (not under this name).

All I know about the MD5Crypt function is that it is a popular UNIX and BSD function.

Thanks,

Tib



Answer this question

MD5Crypt in .net

  • Kryten

    As of MD5 algorithm, its already implemented in .NET Framework and is ready to be used.

    All you will need to do is,

    System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider();

    string hash =BitConverter.ToString((md5.ComputeHash( System.Text.ASCIIEncoding.Default.GetBytes(stringtohash) ) ));

    Good Luck.


  • amerigo5

    Thanks for the reply.

    Actually, what I'm looking is for the UNIX MD5crypt method, which is not implemented in the FCL. There's specs, so I'll write my own.


  • MD5Crypt in .net