Fun fact: bcrypt does NOT only hash the first 72 chars of a password.

It TRUNCATES the input to a maximum of 72 bytes.

Which could mean as few as 18 characters, depending on the character encoding.

The actual spec says to truncate to 56 bytes, but none of the implementations do that.
Reposted from Stephen Rees-Carter
Password length limits are often a sign of a legacy backend or insecure hashing, but did you know bcrypt only hashes the first 72 chars? It raises the question, should we be limiting password lengths when using bcrypt? 🤔

Comments