public class BCrypt extends Object
| 构造器和说明 |
|---|
BCrypt() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean |
checkpw(String plaintext,
String hashed)
Check that a plaintext password matches a previously hashed one
|
static String |
gensalt()
Generate a salt for use with the BCrypt.hashpw() method, selecting a reasonable
default for the number of hashing rounds to apply
|
static String |
gensalt(int log_rounds)
Generate a salt for use with the BCrypt.hashpw() method
|
static String |
gensalt(int log_rounds,
SecureRandom random)
Generate a salt for use with the BCrypt.hashpw() method
|
static String |
hashpw(String password,
String salt)
Hash a password using the OpenBSD bcrypt scheme
|
public static String hashpw(String password, String salt) throws IllegalArgumentException
password - the password to hashsalt - the salt to hash with (perhaps generated using BCrypt.gensalt)IllegalArgumentException - if invalid salt is passedpublic static String gensalt(int log_rounds, SecureRandom random)
log_rounds - the log2 of the number of rounds of hashing to apply - the work
factor therefore increases as 2**log_rounds. Minimum 4, maximum 31.random - an instance of SecureRandom to usepublic static String gensalt(int log_rounds)
log_rounds - the log2 of the number of rounds of hashing to apply - the work
factor therefore increases as 2**log_rounds. Minimum 4, maximum 31.public static String gensalt()
Copyright © 2020. All rights reserved.