Encrypt MD5 : MD5 « Security « C# / C Sharp






Encrypt MD5

  
//-----------------------------------------------------------------------
// <copyright file="CryptoUtil.cs" company="Pyramid Consulting">
//     Copyright (c) Pyramid Consulting. All rights reserved.
//  khoa.tran - 15-Dec-2007
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;

namespace Bamboo.Core.Common.Crypto
{
    public class CryptoUtil
    {
        public static string EncryptMD5(string value)
        {
            MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();
            byte[] byteValue = System.Text.Encoding.UTF8.GetBytes(value);
            byte[] byteHash = md5.ComputeHash(byteValue);

            return Convert.ToBase64String(byteHash);
        }

    }
}

   
    
  








Related examples in the same category

1.MD5 encode
2.MD5 Encrypt
3.Create MD5 Hash
4.Create ASCII MD5 Hash
5.MD5 Hash
6.MD5 Hash
7.Get MD5 Hash
8.Makes a MD5 hash from a string
9.Get MD5 Hash (2)
10.Computes the MD5 checksum for a single file.
11.Get MD5 for a string
12.Get and verify MD5 Hash
13.Md5 Hash (2)