public final class BCrypt extends Object
This password hashing system tries to thwart off-line password cracking using a computationally-intensive hashing algorithm, based on Bruce Schneier's Blowfish cipher. The work factor of the algorithm is parameterised, so it can be increased as computers get faster.
Maven position:
Crypt
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
check(byte[] passwd,
String hashed)
Check that a plaintext password matches a previously hashed one
|
static boolean |
check(String passwd,
String hashed) |
static String |
create(byte[] passwd) |
static String |
create(byte[] passwd,
int logrounds)
Hash a password using the OpenBSD bcrypt scheme
|
static String |
create(String passwd) |
static String |
create(String passwd,
int logrounds) |
static byte[] |
crypt(byte[] passwd,
byte[] salt,
int logrounds) |
static byte[] |
crypt(byte[] passwd,
byte[] salt,
int logrounds,
int[] cdata)
Perform the central password hashing step in the bcrypt scheme
|
public static String create(byte[] passwd)
public static String create(byte[] passwd, int logrounds)
passwd - the password to hashlogrounds - the binary logarithm of the number
Math.pow(2,logrounds)public static boolean check(byte[] passwd,
String hashed)
passwd - the plaintext password to verifyhashed - the previously-hashed passwordpublic static byte[] crypt(byte[] passwd,
byte[] salt,
int logrounds)
public static byte[] crypt(byte[] passwd,
byte[] salt,
int logrounds,
int[] cdata)
passwd - the password to hashsalt - the binary salt to hash with the passwordlogrounds - the binary logarithm of the number
of rounds for hashing to applycdata - the plaintext to encryptCopyright © 2023. All rights reserved.