Skip to content

Instantly share code, notes, and snippets.

@firaja
Last active October 6, 2022 11:51
Show Gist options
  • Save firaja/7fb259db65fd18e9533d1fd28534bed7 to your computer and use it in GitHub Desktop.
Save firaja/7fb259db65fd18e9533d1fd28534bed7 to your computer and use it in GitHub Desktop.
Password4j - Verify scrypt hash
ScryptFunction scrypt = ScryptFunction.getInstance(1<<16, 8, 1);
boolean verified = Password.check("my password", "$100801$cHJpdmF0ZS1zYWx0$ibAGantBIzk0Zcpl11VLaywBOdVA4mgrwTkIxWbNYBsIDROtTIMGULxMS9AJj7MOs74D/fQk6WtodZ1115i5wg==")
.addPepper("shared-secret")
.with(scrypt);
// true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment