public class SCryptUtil extends Object
SCrypt
interface for hashing passwords using the
scrypt key derivation function
and comparing a plain text password to a hashed one. The hashed output is an
extended implementation of the Modular Crypt Format that also includes the scrypt
algorithm parameters.
Format: $s0$PARAMS$SALT$KEY
.
s0
identifies version 0 of the scrypt format, using a 128-bit salt and 256-bit derived key.Constructor and Description |
---|
SCryptUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
check(String passwd,
String hashed)
Compare the supplied plaintext password to a hashed password.
|
static String |
scrypt(String passwd,
int N,
int r,
int p)
Hash the supplied plaintext password and generate output in the format described
in
SCryptUtil . |
public static String scrypt(String passwd, int N, int r, int p)
SCryptUtil
.passwd
- Password.N
- CPU cost parameter.r
- Memory cost parameter.p
- Parallelization parameter.Copyright © 2019. All rights reserved.