Added the first part of allowing the user to reset their password.

This commit is contained in:
2021-01-08 00:00:58 -06:00
parent fb61c971e9
commit d495bfca9c
5 changed files with 68 additions and 31 deletions
+5 -11
View File
@@ -58,23 +58,17 @@ namespace SecureCore.Authentication
}
}
public static string HashStringData(string data, byte[] salt = null)
{
return data;
if (salt == null) salt = new byte[0];
return GetHash(data, salt);
}
public static string HashStringData(string data, string salt = "")
{
return data;
var saltBytes = new byte[0];
if(!string.IsNullOrEmpty(salt))
saltBytes = Convert.FromBase64String(salt);
else
{
saltBytes = new byte[SaltSize];
ByteGenerator.GetRandomBytes(ref saltBytes);
}
return GetHash(data, saltBytes);
}