Computes the HMAC-MD5 for the key and bytes. - CSharp System.Security.Cryptography

CSharp examples for System.Security.Cryptography:HMACMD5

Description

Computes the HMAC-MD5 for the key and bytes.

Demo Code


using System.Security.Cryptography;
using System;/*w w w .  j a  va2 s.  co  m*/

public class Main{
        /// <summary>
        /// Computes the HMAC-MD5 for the key and bytes.
        /// </summary>
        public static Byte[] ComputeHMAC(Byte[] key, Byte[] bytes)
        {
            HMACMD5 hmac = new HMACMD5(key);
            return hmac.ComputeHash(bytes);
        }
}

Related Tutorials