Exemplo n.º 1
0
        private string GenerateHash()
        {
            byte[] rnd = new byte[32];
            random.NextBytes(rnd);
            string h = DecodeEncodeHelper.Bin2Hex(rnd);

            return(h);
        }
Exemplo n.º 2
0
        private string EnhancePassword(string password)
        {
            ReadHash();
            HMACSHA1 hmac = new HMACSHA1(Encoding.UTF8.GetBytes(password));

            byte[] h = hmac.ComputeHash(Encoding.UTF8.GetBytes(_hash));

            return(DecodeEncodeHelper.Bin2Hex(h));
        }
Exemplo n.º 3
0
 private string EnhancePasswordOLD(string password)
 {
     ReadHash();
     byte[] h = (new SHA256Managed()).ComputeHash(Encoding.UTF8.GetBytes(String.Concat(password, _hash)));
     return(DecodeEncodeHelper.Bin2Hex(h));
 }