@Test public void testWithNullTerminatorWithinPw_shouldNotTerminate() { byte[] pw1 = Bytes.from("secret").append(0x00).append("butthereismore").array(); byte[] pw2 = Bytes.from("secret").array(); byte[] salt = Bytes.random(16).array(); String hash1 = Bytes.wrap(BCrypt.withDefaults().hash(4, salt, pw1)).toString(); String hash2 = Bytes.wrap(BCrypt.withDefaults().hash(4, salt, pw2)).toString(); assertNotEquals(hash1, hash2); System.out.println(hash1 + "\n" + hash2); }
public static Hasher withDefaults() { return new Hasher(Version.VERSION_2A, new SecureRandom(), LongPasswordStrategies.strict(Version.VERSION_2A)); }
BCrypt { public static Hasher withDefaults() { return new Hasher(Version.VERSION_2A, new SecureRandom(), LongPasswordStrategies.strict(Version.VERSION_2A)); } }
BCrypt { public static Hasher withDefaults() { return new Hasher(Version.VERSION_2A, new SecureRandom(), LongPasswordStrategies.strict(Version.VERSION_2A)); } private  BCrypt(); }
BCrypt { public static Hasher withDefaults() { return new Hasher(Version.VERSION_2A, new SecureRandom(), LongPasswordStrategies.strict(Version.VERSION_2A)); } private  BCrypt(); static Hasher withDefaults(); static Hasher with(Version version); static Hasher with(SecureRandom secureRandom); static Hasher with(LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, SecureRandom secureRandom, LongPasswordStrategy longPasswordStrategy); static Verifyer verifyer(); static Verifyer verifyer(Version version); static Verifyer verifyer(Version version, LongPasswordStrategy longPasswordStrategy); }
BCrypt { public static Hasher withDefaults() { return new Hasher(Version.VERSION_2A, new SecureRandom(), LongPasswordStrategies.strict(Version.VERSION_2A)); } private  BCrypt(); static Hasher withDefaults(); static Hasher with(Version version); static Hasher with(SecureRandom secureRandom); static Hasher with(LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, SecureRandom secureRandom, LongPasswordStrategy longPasswordStrategy); static Verifyer verifyer(); static Verifyer verifyer(Version version); static Verifyer verifyer(Version version, LongPasswordStrategy longPasswordStrategy); static final int SALT_LENGTH; static final int MIN_COST; static final int MAX_COST; }