sha1加密(C# VS2005)(转自:http://yardan.blog.51cto.com/304821/60705)

using System.Security.Cryptography;
string str = "20070111"; 
            SHA1 sha1 = new SHA1CryptoServiceProvider(); 
            byte[] bytes_sha1_in = UTF8Encoding.Default.GetBytes(str); 
            byte[] bytes_sha1_out = sha1.ComputeHash(bytes_sha1_in); 
            string str_sha1_out = BitConverter.ToString(bytes_sha1_out); 
            MessageBox.Show(str_sha1_out);

你可能感兴趣的:(加密,String,C#,byte)