Skip to content

Instantly share code, notes, and snippets.

@firaja
Last active October 6, 2022 09:37
Show Gist options
  • Save firaja/fc3fba4ff1998495f9787f59b1198b5c to your computer and use it in GitHub Desktop.
Save firaja/fc3fba4ff1998495f9787f59b1198b5c to your computer and use it in GitHub Desktop.
Password4j - Hash password with Argon2
Argon2Function argon2 = Argon2Function.getInstance(14, 20, 1, 32, Argon2.ID);
Hash hash = Password.hash("my password")
.addPepper("shared-secret")
.addSalt("private-salt")
.with(argon2);
hash.getResult(); // $argon2id$v=19$m=14,t=20,p=1$cHJpdmF0ZS1zYWx0$mxKlVBKpr3lNXHdaBKnuvjl/IsESYkYPCFAsb7VaIGs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment