Created
October 6, 2022 09:26
-
-
Save firaja/ed4099e89359e038b1cacc94088a6cdb to your computer and use it in GitHub Desktop.
Password4j - verify Argon2 hash without specifying parameters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String hash = "$argon2id$v=19$m=14,t=20,p=1$cHJpdmF0ZS1zYWx0$mxKlVBKpr3lNXHdaBKnuvjl/IsESYkYPCFAsb7VaIGs"; | |
Argon2Function argon2 = Argon2Function.getInstanceFromHash(hash); | |
boolean verified = Password.check("my password", hash) | |
.addPepper("shared-secret") | |
.with(argon2); | |
// true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment