fix: Use built-in RNG (#1599)

### Summary

.NET 8 supports Xoroshiro 256** off the shelf and added Shuffle. Switching to that implementation.

### Developer Notes

* Removed many convenience methods that weren't used.
This commit is contained in:
Kamron Batman 2023-11-17 17:45:18 -08:00 • committed by GitHub
parent 1769d47ba5
commit dba3ec2db5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 159 additions and 699 deletions

View file

@ -22,9 +22,7 @@ namespace Server.Accounting.Security
{
public static IPasswordProtection Instance = new Argon2PasswordProtection();
private readonly Argon2PasswordHasher m_PasswordHasher = new(
rng: (RandomSources.SecureSource as SecureRandom)?.Generator
);
private readonly Argon2PasswordHasher m_PasswordHasher = new(rng: BuiltInSecureRng.Generator);
public string EncryptPassword(string plainPassword) =>
m_PasswordHasher.Hash(plainPassword);