public void IncorrectPrefix_DoesNotVerify()
{
{
var hash = crypto.HashPassword("pass", config.PasswordHashingIterationCount);
Assert.IsFalse(crypto.VerifyHashedPassword(crypto.EncodeIterations(5000) + "." + hash, "pass"));
}
{
var hash = crypto.HashPassword("pass", config.PasswordHashingIterationCount);
Assert.IsFalse(crypto.VerifyHashedPassword(crypto.EncodeIterations(5000) + ".5." + hash, "pass"));
}
{
var hash = crypto.HashPassword("pass", config.PasswordHashingIterationCount);
Assert.IsFalse(crypto.VerifyHashedPassword("hello." + hash, "pass"));
}
{
var hash = crypto.HashPassword("pass", config.PasswordHashingIterationCount);
Assert.IsFalse(crypto.VerifyHashedPassword("-1." + hash, "pass"));
}
{
var hash = crypto.HashPassword("pass", 10000);
hash = hash.Replace(crypto.EncodeIterations(10000), crypto.EncodeIterations(5000));
Assert.IsFalse(crypto.VerifyHashedPassword(hash, "pass"));
}
}