Jul 22, 2010

MD5 Encryption In C#

Encryption generally used for security purpose.
Some times we use this Encryption in Password( because we want to make password as case sensitive,In data base if we store data means, it's not case sensitive, so we want to perform the encryption for provide better security purpose.)

Here I added the MD5 Encryption Program



header files
System.text;
System.security.encryption;
function for Md5
public string encryptpasswordBL(string passwordBO)
    {
        Byte[] originalBytes;
        Byte[] encodedBytes;
        string encryptedPwdBL;
        MD5 md5 = new MD5CryptoServiceProvider();
        originalBytes = ASCIIEncoding.Default.GetBytes(passwordBO);
        encodedBytes = md5.ComputeHash(originalBytes);
        encryptedPwdBL = BitConverter.ToString(encodedBytes);
        return encryptedPwdBL;
    }



No comments:

Post a Comment