using System.Security.Cryptography;
public static void Main()
UTF32Encoding encode=new UTF32Encoding ();
byte [] kbyte=encode.GetBytes(key);
byte [] mbyte=encode.GetBytes(data);
HMACSHA256 hmac=new HMACSHA256(kbyte);
byte []hmsg=hmac.ComputeHash(mbyte);
string rslt=Convert.ToBase64String(hmsg,0,hmsg.Length);
Console.WriteLine("Before Hashing:{0}",data);
Console.WriteLine("After Hashing:{0}",rslt);