You are viewing a single thread.
View all comments
35 points

Infuriating fact: if a service has maximum password length limits (lower than 1000 characters), they’re reversibly storing your password and if they’re that lazy it’s probably plain text

permalink
report
reply
8 points

reversibly?

permalink
report
parent
reply
14 points

Yeah, you actually better not save the users passwords in plain text or in an encrypted way it could be decrypted. You rather save a (salted) hashed string of the password. When a user logs in you compare the hashed value of the password the user typed in against the hashed value in your database.

What is hashed? Think of it like a crossfoot of a number:

Let’s say you have a number 69: It’s crossfoot is (6+9) 15. But if someone steals this crossfoot they can’t know the original number it’s coming from. It could be 78 or 87.

permalink
report
parent
reply
8 points

Dumb question: isn’t it irrelevant for the malicous party if it’s 78 or 87 per your example, because the login only checks the hash anyway? Won’t both numbers succesfully login?

permalink
report
parent
reply
2 points

i was more wondering why a length limit implies anything about how they’re storing the password. once they receive the password they’re free to hash it any which way they want

random memory—yahoo back in the day used to hash the password in the browser before sending it to the server, but TLS made that unnecessary i guess

permalink
report
parent
reply
7 points

In the least bad case, they encrypt the password instead of hashing it, making it possible to decrypt the password.

In the most common case, they store the password in plaintext, so there isn’t even any encryption to be reversed.

permalink
report
parent
reply
3 points

They may just base their limit on one or a few block sizes of the hash function.

permalink
report
parent
reply
8 points

That sounds incredibly unlikely. I would be good money that 99% of password length limits are not based on concrete limits. Things like “100 should be enough 🤷” must be way more common.

I doubt 1% of programmers are away of their hashes block size. It is also probably irrelevant since after the first round everything is fixed size anyways.

permalink
report
parent
reply
2 points

Nope. No point in storing > 256 or even 128 chars for a password anyway. Useless storage wasted. Also it doesn’t really mean they store the password badly in the server.

permalink
report
parent
reply
18 points

A hashed password is always the same length though is it not?

permalink
report
parent
reply
3 points

The length limit is mostly for the user’s sake - companies don’t want people to set their passwords to 30+ character ones that they keep forgetting and call their tech support to reset.

permalink
report
parent
reply
8 points

Ignoring that they must be hashed to be acceptable and that it’s not possible for 1000 characters of text to add up to a waste of storage worth mentioning in pretty much any environment, it’s literally impossible for a 128 character password limit to be beneficial in any way.

A limit below that demonstrably lowers security by a huge margin.

permalink
report
parent
reply
4 points

Ok but are 15 characters too much?

I’ve seen 14-char limits, which are NOT reasonable

permalink
report
parent
reply

there is at least one bank that I know of with a 12 character limit

permalink
report
parent
reply
1 point

I share your frustration, especially when the maximum password length limit is outrageously low, but they do serve a purpose.

permalink
report
parent
reply
1 point

Couldn’t it just be that they’re using something like bcrypt which won’t take any chars above its limit into account (knowing that there’s a limit will pretty much never matter to a user but why obscure the fact)? What does it even mean to store it reversibly, just because they have a char limit doesn’t mean they are encrypting the password, could just be some frontend shenannigans as well.

permalink
report
parent
reply
0 points

Fun fact: Lemmy instances cap at 60. they’re not storing reversibly, they’re just using bcrypt and rather than pre-hashing the pw before bcrypt like most bcrypt users do, they just truncate to 60.

permalink
report
parent
reply
1 point

60 makes sense, 14 does not

permalink
report
parent
reply

Programmer Humor

!programmerhumor@lemmy.ml

Create post

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.

Community stats

  • 6.9K

    Monthly active users

  • 1.5K

    Posts

  • 34K

    Comments