I\'m using the .net port of libsodium. The hash generation function has two forms, one that accepts byte arrays and one that accepts strings:
public static b
I think the problem here is that the ArgonGenerateSalt
method doesn't return a UTF8 encoded string, it returns completely random bytes.
You can't decode random bytes as a UTF8 string and expect it to round trip. A trivial example to see where this blows up is to do the following:
var data = new byte[] { 128 };
var dataAsString = Encoding.UTF8.GetString( data );
var dataAsBytes = Encoding.UTF8.GetBytes( dataAsString );
After this, dataAsBytes
will be 3 bytes (specifically 239, 191, 189).