I am trying to use the Argon2 Password Hashing method. I googled it and found that it requires libsodium.dll and so downloaded the zip file of libsodium.dll from github, which is below
https://github.com/adamcaudill/libsodium-net/releases
And tried to add the libsodium.dll to my project, it threw this error.
Error: A reference to 'C:\libsodium-net.v0.9.0\libsodium.dll' could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM Component.
I was trying to figure out how to use libsodium and Argon2 for password hashing and how to resolve the error when adding the libsodium.dll to my project. Please suggest!!!
What I have tried:
I installed 'libsodium for .NET 0.9.0' from NuGet packages, it added sodium.dll, but it doesn't have the Argon method that I was looking for.
I am trying to find a way to solve this, and I found this,
https://paragonie.com/blog/2016/02/how-safely-store-password-in-2016
Thought it would be helpful for me if I add the libsodium.dll. Tried with hasing method for C#.Net from that URL, but it was throwing error at ArgonHashString method.
var hash = PasswordHash.ArgonHashString(yourPasswordString, Strength.Interactive)
if (PasswordHash.ArgonHashStringVerify(hash, yourPasswordString) {
//correct password
}
I tried to add the reference by copying the libsodium.dll to the bin of my project and by copying the dll yo C:\Program Files\Reference Assemblies\Microsoft\VSTO40\v10.0. It threw the same error. I tried to add the libsodium.dll by moving it to different folders. Tested by adding other dlls to my project and there is no issue when adding other dlls.