MD5CryptoServiceProvider SHA1CryptoServiceProvider
HMACMD5 SHA1Managed
HMACRIPEMD160 HMACSHA1
HMASCHA256
HMACSHA384
//HMACSHA512加密类练习
HMACSHA512 hmacsha512 = new HMACSHA512();
Byte[] hashdata = hmacsha512.ComputeHash(Encoding.GetEncoding("gb2312").GetBytes(Input));
StringBuilder Str = new StringBuilder();
foreach (Byte arg in hashdata) Str.Append(arg.ToString("x2"));
Console.WriteLine("哈希值为: " + Str.ToString() + "/n长度为: " + Str.Length);
Str.Remove(0, Str.Length);
Byte[] Key = hmacsha512.Key;
foreach (Byte arg in Key) Str.Append(arg.ToString("x2"));
Console.WriteLine("密匙为: " + Str.ToString() + "/n长度为: " + Str.Length);