Encrypt SHA1 : SHA1Managed « Security « C# / C Sharp






Encrypt SHA1

  
//-----------------------------------------------------------------------
// <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 byte[] EncryptSHA1(string text)
        {
            SHA1 sha1 = SHA1.Create();
            UTF8Encoding encoding = new UTF8Encoding();
            return sha1.ComputeHash(encoding.GetBytes(text));
        }
   }
}

   
    
  








Related examples in the same category

1.new SHA1Managed()
2.Encrypt SHA256
3.Returns a SHA1 hash of a given plaintext
4.SHA256 crypt
5.Marshal Str
6.Get SHA1 for a string
7.Get SHA256 for a string
8.Get SHA38 for a string
9.Get SHA512 for a string
10.Encrypts a string using the SHA256 algorithm.