Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to specify the salt value? #91

Closed
jpstotz opened this issue Oct 3, 2021 · 2 comments
Closed

How to specify the salt value? #91

jpstotz opened this issue Oct 3, 2021 · 2 comments

Comments

@jpstotz
Copy link

jpstotz commented Oct 3, 2021

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);

@jpstotz
Copy link
Author

jpstotz commented Oct 3, 2021

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();

@jpstotz jpstotz closed this as completed Oct 3, 2021
@phxql
Copy link
Owner

phxql commented Oct 4, 2021

If you need key derivation, you can also take a look at de.mkammerer.argon2.Argon2Advanced#pbkdf, which is a password based key derivation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants