Skip to content

Instantly share code, notes, and snippets.

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