Konscious.Security.Cryptography
Konscious.Security.Cryptography copied to clipboard
Allow passwords of zero length
Currently a password of zero length causes ArgumentException in the constructor:
public Argon2(byte[] password)
{
if (password == null || password.Length == 0)
throw new ArgumentException("Argon2 needs a password set", nameof(password));
_password = password;
}
However, using a password of zero length as an input for Argon2 is an accepted practice:
- specification v1.3 allows it explicitly (section 3.1);
- another Argon2 library for .NET supports such passwords.
So, it would be nice to see the support of zero-length passwords here.