Utilitaire pour le cryptage MD5

Author:

Exemple,d'utilisation,de,'PermissionSet'
{filelink=17847}

//-----------------------------------------------------------------------
// 
//     Copyright (c) Pyramid Consulting. All rights reserved.
//  khoa.tran - 15-Dec-2007
// 
//-----------------------------------------------------------------------
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[] valeurByte = System.Text.Encoding.UTF8.GetBytes(value);
            byte[] byteHash = md5.ComputeHash(valeurByte);

            return Convert.ToBase64String(byteHash);
        }

    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *