public final class SCrypt extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
check(String passwd,
String hashed)
Compare the supplied plaintext password to a hashed password.
|
static String |
create(HmacAlgorithms alg,
String passwd,
int N,
int r,
int p,
int dkLen)
Hash the supplied plaintext password and generate output in the format
described in
scrypt(HmacAlgorithms, byte[], byte[], int, int, int, int). |
static String |
create(String passwd,
int N,
int r,
int p) |
static byte[] |
pbkdf2(HmacAlgorithms alg,
byte[] P,
byte[] S,
int c,
int dkLen)
Implementation of PBKDF2 (RFC2898).
|
static byte[] |
scrypt(HmacAlgorithms alg,
byte[] P,
byte[] S,
int N,
int r,
int p,
int dkLen)
|
public static String create(HmacAlgorithms alg, String passwd, int N, int r, int p, int dkLen)
scrypt(HmacAlgorithms, byte[], byte[], int, int, int, int).alg - HmacAlgorithm.passwd - Password.N - CPU cost parameter. between 0x01 and 0x0F, 2^15=32768r - Memory cost parameter. between 0x01 and 0xFFp - Parallelization parameter. between 0x01 and 0xFFdkLen - Intended length, in octets, of the derived key.public static boolean check(String passwd, String hashed)
passwd - Plaintext password.hashed - scrypt hashed password.public static byte[] pbkdf2(HmacAlgorithms alg, byte[] P, byte[] S, int c, int dkLen)
alg - HmacAlgorithm.P - password of byte array.S - Salt.c - Iteration count.dkLen - Intended length, in octets, of the derived key.public static byte[] scrypt(HmacAlgorithms alg, byte[] P, byte[] S, int N, int r, int p, int dkLen)
alg - HmacAlgorithm.P - Password.S - Salt.N - CPU cost parameter.r - Memory cost parameter.p - Parallelization parameter.dkLen - Intended length of the derived key.Copyright © 2023. All rights reserved.