
{filelink=17842}
using System;
using System.IO;
using System.Text;
using System.Security.Cryptography;
class ExKeyedHashAlgorithm
{
public static void Main(string[] args)
{
byte[] clé = Encoding.Unicode.GetBytes(@"Area = u03A0r^2");
using (KeyedHashAlgorithm AlgoHash = KeyedHashAlgorithm.Create("HMACSHA1"))
{
AlgoHash.Key = clé;
using (Stream fichier = new FileStream(@"c:teste.txt", FileMode.Open, FileAccess.Read))
{
byte[] hash = AlgoHash.ComputeHash(fichier);
Console.WriteLine(BitConverter.ToString(hash));
}
}
}
}