Closed jpstotz closed 3 years ago
Seems like this feature is a bit hidden, I finally found it:
Argon2Advanced argon2 = Argon2Factory.createAdvanced();
HashResult result = argon2.hashAdvanced(iterations, memory, parallelism, pwd, salt, 80, Argon2Version.V13);
byte[] output = result.getRaw();
If you need key derivation, you can also take a look at de.mkammerer.argon2.Argon2Advanced#pbkdf
, which is a password based key derivation.
The current Argon2 interface has no method for executing Argon2 with a custom selected salt as it is needed for key derivation.
Please provide a method that allows to specify the salt value and returns the generated
byte[]
for example:byte[] hash(int iterations, int memory, int parallelism, byte[] salt, byte[] data);