bcrypt hashes only the first 72 bytes. 24 characters is the max amount of 4 byte UTF8 characters when using bcrypt. Which is stupid because UTF8 is variable, but still, it’s a possible explanation.
Comment on My password is not accepted because it is too long
Zikeji@programming.dev 2 days agoIs the maximum 24 characters because their database column is a VARCHAR(24)? That’s one of the first questions that I thought of. Sure, it doesn’t guarantee plaintext, but it’s a indicator that it may be stored plaintext, considering hashing doesn’t care about length. Or at the very least whoever has had eyes on this code doesn’t know shit about security, which makes me less confident in the product as a whole.
The only reason I can think of to have a maximum would be to save on bandwidth and CPU cycles, and even then 24 characters is ridiculously stingy when the difference would be negligible.
x00z@lemmy.world 2 days ago
notquitetitan@sh.itjust.works 2 days ago
A reason reason to switch to argon :)
WhatAmLemmy@lemmy.world 1 day ago
To be fair, 24 is still a secure length for a password, and will probably be for another 5+ years.
Redjard@lemmy.dbzer0.com 1 day ago
Cryptographic hash functions actually have fixed runtime too, to avoid timing-based attacks.
So correct password implementations use the same storage and cpu-time regardless of the password.AA5B@lemmy.world 1 day ago
I would have thought the opposite. I remember having a familiar conversation: “we need a sanity check in the password: what would no sane person do?” I believe we cut it off at 64 characters, but I can see someone thinking 24 is kore than enough, if they’ve never used a password generator.
LouSlash@sh.itjust.works 2 days ago
Image
spankmonkey@lemmy.world 2 days ago
Oh look, a free account!