Get Hash for password : Hash « Security « C# / C Sharp






Get Hash for password

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Security.Cryptography;



class GestaoUtilizador
{



    public static string GetHash(string userpassword, string salt)
    {
        MD5 md5Hsh = MD5.Create();
        byte[] data = md5Hsh.ComputeHash(Encoding.Default.GetBytes(userpassword + salt));
        StringBuilder sBuilder = new StringBuilder();
        for (int i = 0; i < data.Length; i++)
        {
            sBuilder.Append(data[i].ToString("x2"));
        }
        return sBuilder.ToString();
    }

}

   
  








Related examples in the same category

1.Verify Hex Hash, Base64 Hash, Byte Hash
2.Generic Hash
3.Get Public Key Hash with HttpClientCertificate
4.Get Public Key Hash with SHA256
5.Get Public Key Hash for a string
6.Hash As Password
7.Generate Hash
8.Generates a hash code of the input string
9.Hash Data
10.Hash Password
11.Get SHA256 Hash
12.Create Password Hash