| Modifier and Type | Method and Description |
|---|---|
byte[] |
hash(int cost,
byte[] password)
Hashes given password with the OpenBSD bcrypt schema.
|
byte[] |
hash(int cost,
byte[] salt,
byte[] password)
Hashes given password with the OpenBSD bcrypt schema.
|
byte[] |
hash(int cost,
char[] password)
Hashes given password with the OpenBSD bcrypt schema.
|
BCrypt.HashData |
hashRaw(int cost,
byte[] salt,
byte[] password)
Hashes given password with the OpenBSD bcrypt schema.
|
char[] |
hashToChar(int cost,
char[] password)
Hashes given password with the OpenBSD bcrypt schema.
|
String |
hashToString(int cost,
char[] password)
Hashes given password with the OpenBSD bcrypt schema.
|
public char[] hashToChar(int cost,
char[] password)
SecureRandom to generate the internal 16 byte hash.
This implementation will add a null-terminator to the password and return a 23 byte length hash in accordance with the OpenBSD implementation.
The random salt will be created internally with a SecureRandom instance.
cost - exponential cost (log2 factor) between BCrypt.MIN_COST and BCrypt.MAX_COST e.g. 12 --> 2^12 = 4,096 iterationspassword - to hash, will be internally converted to a utf-8 byte array representationpublic String hashToString(int cost, char[] password)
SecureRandom to generate the internal 16 byte hash.
This implementation will add a null-terminator to the password and return a 23 byte length hash in accordance with the OpenBSD implementation.
The random salt will be created internally with a SecureRandom instance.
This is the same as calling new String(hash(cost, password), StandardCharsets.UTF-8)
cost - exponential cost (log2 factor) between BCrypt.MIN_COST and BCrypt.MAX_COST e.g. 12 --> 2^12 = 4,096 iterationspassword - to hash, will be internally converted to a utf-8 byte array representationpublic byte[] hash(int cost,
char[] password)
SecureRandom to generate the internal 16 byte hash.
This implementation will add a null-terminator to the password and return a 23 byte length hash in accordance with the OpenBSD implementation.
The random salt will be created internally with a SecureRandom instance.
cost - exponential cost (log2 factor) between BCrypt.MIN_COST and BCrypt.MAX_COST e.g. 12 --> 2^12 = 4,096 iterationspassword - to hash, will be internally converted to a utf-8 byte array representationpublic byte[] hash(int cost,
byte[] password)
SecureRandom to generate the internal 16 byte hash.
This implementation will add a null-terminator to the password and return a 23 byte length hash in accordance with the OpenBSD implementation.
The random salt will be created internally with a SecureRandom instance.
cost - exponential cost (log2 factor) between BCrypt.MIN_COST and BCrypt.MAX_COST e.g. 12 --> 2^12 = 4,096 iterationspassword - the utf-8 encoded byte array representationpublic byte[] hash(int cost,
byte[] salt,
byte[] password)
This implementation will add a null-terminator to the password and return a 23 byte length hash in accordance with the OpenBSD implementation.
Note: This is part of the advanced APIs, only use if you know what you are doing.
cost - exponential cost factor between BCrypt.MIN_COST and BCrypt.MAX_COST e.g. 12 --> 2^12 = 4,096 iterationssalt - a random 16 byte long word, only used oncepassword - the utf-8 encoded byte array representationpublic BCrypt.HashData hashRaw(int cost, byte[] salt, byte[] password)
This implementation will add a null-terminator to the password and return a 23 byte length hash in accordance with the OpenBSD implementation.
Note: This is part of the advanced APIs, only use if you know what you are doing.
cost - exponential cost (log2 factor) between BCrypt.MIN_COST and BCrypt.MAX_COST e.g. 12 --> 2^12 = 4,096 iterationssalt - a random 16 byte long word, only used oncepassword - the utf-8 encoded byte array representationCopyright © 2018–2019. All rights reserved.