this post was submitted on 23 Aug 2023
85 points (96.7% liked)
Programming
21593 readers
144 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
With very few exceptions, yes. There should be no restrictions on characters used/length of password (within reason) if you're storing passwords correctly.
And if a site does have such restrictions, it could be an indication that they store passwords in plaintext, rather than hashed
Underappreciated fact: Bcrypt has a maximum of 72 bytes. It'll truncate passwords longer than that. Remember that UTF8 encoding of special characters can easily take more than one byte.
That said, this is rarely a problem in practice, except for some very long passphrases.
Interesting: https://en.wikipedia.org/wiki/Bcrypt#Maximum_password_length
Makes me question if bcrypt deserves to be widely used. Is there really no superior alternative?
Not only that, bcrypt could be run by GPUs and FPGA, that makes it more prone to bruteforcing attacks.
There are 2 modern alternatives: scrypt and argon2. They both require a substantial amount of memory, so gpu and hardware computation is no longer feasible.
A very high max of something like 500 characters just to make sure you don't get DOSed by folks hitting your endpoint with huge packets of data is about the most I would expect in terms of length restrictions. I'm not a security expert or anything though.
That's a misunderstanding of DDoS. 0 byte packets are actually worse than large packets.
Which is why most DDoS (at least was) is extremely slow 0 byte requests until the server throttles/crashes under the number of requests.
E: Consider this. Are you more likely to throttle a bandwidth of terabytes/petabytes with couple million 1gb requests; or break it entirely by sending >4294967295 0 byte requests that effectively never stop being requested from the server?