Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Utilitaire pour le cryptage MD5

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

//-----------------------------------------------------------------------
// <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[] valeurByte = System.Text.Encoding.UTF8.GetBytes(value);
            byte[] byteHash = md5.ComputeHash(valeurByte);
 
            return Convert.ToBase64String(byteHash);
        }
 
    }
}

No comments yet.

Leave a Comment