BCrypt Class

Provides static methods used to encrypt passwords using a computationally- intensive hashing algorithm, based on Bruce Schneier's Blowfish cipher.

Constructors

public BCrypt( )

Methods

checkpw( String plaintext, String hashed ) returns boolean
Check that a plaintext password matches a previously hashed one
plaintextthe plaintext password to verify
hashedthe previously-hashed password
crypt_raw( byte[] password, byte[] salt, int log_rounds, int[] cdata ) returns byte[]
Perform the central password hashing step in the bcrypt scheme
passwordthe password to hash
saltthe binary salt to hash with the password
log_roundsthe binary logarithm of the number of rounds of hashing to apply
cdatathe plaintext to encrypt
gensalt( ) returns String
Generate a salt for use with the BCrypt.hashpw() method, selecting a reasonable default for the number of hashing rounds to apply
gensalt( int log_rounds ) returns String
Generate a salt for use with the BCrypt.hashpw() method
log_roundsthe log2 of the number of rounds of hashing to apply - the work factor therefore increases as 2**log_rounds.
gensalt( int log_rounds, java.security.SecureRandom random ) returns String
Generate a salt for use with the BCrypt.hashpw() method
log_roundsthe log2 of the number of rounds of hashing to apply - the work factor therefore increases as 2**log_rounds.
randoman instance of SecureRandom to use
hashpw( String password, String salt ) returns String
Hash a password using the OpenBSD bcrypt scheme
passwordthe password to hash
saltthe salt to hash with (perhaps generated using BCrypt.gensalt)