Encrypting a string using the MD5 algorithm

This C# method will encrypt any string using the MD5 algorithm. It generates the same hash as the PHP md5() function.

using System.Security.Cryptography;



public static string EncodePassword(string originalPassword)

{

Byte[] originalBytes;

Byte[] encodedBytes;

MD5 md5;





md5 = new MD5CryptoServiceProvider();

originalBytes = ASCIIEncoding.Default.GetBytes(originalPassword);

encodedBytes = md5.ComputeHash(originalBytes);



// Bytes to string

return System.Text.RegularExpressions.Regex.Replace(BitConverter.ToString(encodedBytes), "-", "").ToLower();

}

Sumber : http://www.geekpedia.com
nuat decrypt nya cari sendiri yak...@_+ xixixixixix


Related Articles






IP

Followers

 

Copyright © 2009 by ::EXPLORE::