MD5

.NET개발자/ASP.NET (C#) 2008/08/20 11:19

MD5 를 사용해볼까나


public string GetMD5Hash(string input)

{

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

byte[] bs = System.Text.Encoding.UTF8.GetBytes(input);

bs = x.ComputeHash(bs);

System.Text.StringBuilder s = new System.Text.StringBuilder();

foreach (byte b in bs)

{

s.Append(b.ToString("x2").ToLower());

}

string password = s.ToString();

return password;

}


이 글은 스프링노트에서 작성되었습니다.

크리에이티브 커먼즈 라이선스
Creative Commons License

'.NET개발자 > ASP.NET (C#)' 카테고리의 다른 글

.Net Framework  (0) 2009/05/21
MD5  (0) 2008/08/20
Posted by 까칠한곰탱이 까칠한곰탱이
TAG , , ,