| Modifier and Type | Field and Description |
|---|---|
BCryptFormatter |
formatter
The formatter for the bcrypt message digest
|
BCryptParser |
parser
The parser used to parse a bcrypt message
|
static List<BCrypt.Version> |
SUPPORTED_VERSIONS
List of supported versions
|
static BCrypt.Version |
VERSION_2A
$2a$
|
static BCrypt.Version |
VERSION_2B
$2b$ (2014/02)
|
static BCrypt.Version |
VERSION_2X
$2x$ (2011)
|
static BCrypt.Version |
VERSION_2Y
$2y$ (2011)
|
byte[] |
versionIdentifier
Version identifier byte array, eg.{0x32, 0x61} for '2a'
|
| Constructor and Description |
|---|
Version(byte[] versionIdentifier,
BCryptFormatter formatter,
BCryptParser parser)
Create a new version.
|
public static final BCrypt.Version VERSION_2A
The original specification did not define how to handle non-ASCII character, nor how to handle a null terminator. The specification was revised to specify that when hashing strings: - the string must be UTF-8 encoded - the null terminator must be included
public static final BCrypt.Version VERSION_2B
A bug was discovered in the OpenBSD implementation of bcrypt. They were storing the length of their strings in an unsigned char (i.e. 8-bit Byte). If a password was longer than 255 characters, it would overflow and wrap at 255. To recognize possible incorrect hashes, a new version was created.
public static final BCrypt.Version VERSION_2X
Due to a bug in crypt_blowfish, a PHP implementation of BCrypt, a new version string was introduced to recognize old hashes. It was mis-handling characters with the 8th bit set. Nobody else, including canonical OpenBSD, adopted the idea of 2x/2y so this version marker change was limited to crypt_blowfish.
Nobody else, including canonical OpenBSD, adopted the idea of 2x/2y. This version marker change was limited to crypt_blowfish.
public static final BCrypt.Version VERSION_2Y
See VERSION_2X
public static final List<BCrypt.Version> SUPPORTED_VERSIONS
public final byte[] versionIdentifier
public final BCryptFormatter formatter
public final BCryptParser parser
public Version(byte[] versionIdentifier,
BCryptFormatter formatter,
BCryptParser parser)
VERSION_2A, VERSION_2Y etc.versionIdentifier - version as UTF-8 encoded byte array, e.g. '2a' = new byte[]{0x32, 0x61}, do not included the separator '$'formatter - the formatter responsible for formatting the out hash message digestCopyright © 2018. All rights reserved.