9 Replies
You need to use SequenceEqual, not Equals.
Equals for a byte array will only check if they are the same instance, not if they contain the same elements.
in addition, you should use a constant-time implementation of SequenceEquals to make your code less vulnerable to timing attacks
it would be something like that
Imo I'd opt for a more complete and up to date library that handles most of the easy trip-ups for you
GitHub
GitHub - mheyman/Isopoh.Cryptography.Argon2: Fully managed .Net Cor...
Fully managed .Net Core implementation of Argon2. Contribute to mheyman/Isopoh.Cryptography.Argon2 development by creating an account on GitHub.
Thank you very much I will do that
Hi Lisa, I wanted to touch base regarding the library we discussed earlier, Isopoh.Cryptography.Argon2. After some thorough investigation and testing, I must advise against using this specific library for our project.
The issue lies in how the library handles the salt in Argon2 hashing. It was discovered that the salt wasn't effectively incorporated into the hashing process, rendering it essentially ineffective for its intended purpose of enhancing security.
What makes you say so? I do not think your conclusion is correct.
I made a post here on the server called: issue with unit test for Argon2. take a look
Lisa
This is because you are using
argon2Config.EncodeString
EncodeString includes information about how the hash was computed, including the salt. In this case the provided salt is ignored and the salt from the hashstring is used.Quoted by
<@100644656710180864> from #Issue with unit test for Argon2-based password hash service (click here)
React with ❌ to remove this embed.