3 ms·
Because there's very little point in doing so since bcrypt will automatically generate one for you. A use case for manually injecting the salt is when your KDF
by masklinn 13y ago
Because there's very little point in doing so since bcrypt will automatically generate one for you.
A use case for manually injecting the salt is when your KDF result isn't stored in Modular Crypt Format, and thus you can't just pass it to `password_verify`.
In that case, you get your stored cost and salt, explicitly inject them into `password_hash` and use a constant-time string comparison (which I'm not sure PHP provides, so there's a potential security hole here) instead of `password_verify`.