This commit is contained in:
2021-10-20 23:25:32 +00:00
parent 8fbbb2e73b
commit e130c290f5
3 changed files with 10 additions and 4 deletions

View File

@@ -26,8 +26,14 @@ namespace AyaNova.Util
}
//Generate salt
/*
Used for many things:
DBID, JWT secret key when none provided, User Salt for login / password,
temporary 2fa codes, download tokens,
temporary user pw / login when newly created and haven't been set yet
*/
public static string GenerateSalt()
{
{
var salt = new byte[32];
var random = RandomNumberGenerator.Create();
random.GetNonZeroBytes(salt);