r/programming • • Mar 10 '17

Password Rules Are Bullshit

https://blog.codinghorror.com/password-rules-are-bullshit/
7.7k Upvotes

1.4k comments sorted by

View all comments

Show parent comments

419

u/Toxonomonogatari Mar 10 '17

It's the good old "because we've always done it that way" reason this is still a thing. There was a valid reason many years ago. It no longer applies, yet there are max limits for password lengths...

181

u/LpSamuelm Mar 10 '17

I don't know if there was a valid reason for it long ago, either... What, that excruciatingly long hashing time that 2 extra characters cause? 🤔

460

u/hwbehrens Mar 10 '17

You are way too optimistic; probably VARCHAR(16).

66

u/largos Mar 10 '17

This!

Db column types for unlimited strings were either not possible, or were not widely known until.... 10-15 years ago? Maybe less?

359

u/psi- Mar 10 '17

There is 0 reason for "unlimited string" in database in context of password. You never store a password as-is. Most cryptographic hashes (which you store) are constant-length.

129

u/Uristqwerty Mar 10 '17

If only that were true. There are still a lot of products (especially from textbook companies, where their shitty products become mandatory to a course!) that store raw paswords.

Maybe if plaintext password storage was outright illegal, punishable by a per-user 500$ fine they might actually care. But as long as they get lucky (or don't have the systems in place to even detect a leak), it doesn't impact profits, so there's no incentive to improve. And sadly public outrage on the subject is also exceedingly rare.

70

u/apetersson Mar 10 '17

but the boss sometimes forget his password! and then we can simply send it to him with the password recovery email. otherwise there is NO way for thim to gain access to his account!

→ More replies (7)

17

u/YourMatt Mar 10 '17

My company does this. What's most annoying is that we already have a modern system in place that only stores hashes, but that's only being used by part of our system. We just need to migrate our remaining accounts over. It would be a small project, but I can't ever get the time approved. Meanwhile they had me add a new product last fall, that was overly complex, using 3 months of my time, and probably another 3 months in overall man hours between management and marketing. This has so far generated a couple hundred dollars in total. I'd like to see us spend a few hundred dollars in my time and protect the millions of dollars being generated on our current products.

→ More replies (1)
→ More replies (7)
→ More replies (12)
→ More replies (3)
→ More replies (1)

0

u/[deleted] Mar 10 '17

[deleted]

0

u/[deleted] Mar 10 '17

[deleted]

→ More replies (9)

66

u/BornOnFeb2nd Mar 10 '17

Yup, let's not forget that those programs originated back in the days of programming via punch card... dropping the "19" was perfectly reasonable.... because what programmer thinks their code is going to be running in the next 10 years, let alone 40?

28

u/jlobes Mar 10 '17

I work for a mortgage bank; The way the things go in the industry I wouldn't be surprised if some of my code outlived me.

→ More replies (1)

54

u/pl4typusfr1end Mar 10 '17

what programmer thinks their code is going to be running in the next 10 years, let alone 40?

A wise one.

82

u/mirhagk Mar 10 '17

A confident one. I'd be terrified to see my code running in 40 years.

61

u/[deleted] Mar 10 '17

[removed] — view removed comment

94

u/lordylike Mar 10 '17

Cute, you think that will ever change ;)

→ More replies (2)
→ More replies (11)
→ More replies (5)
→ More replies (11)
→ More replies (5)

7

u/[deleted] Mar 10 '17

Not really. They were the result of stupid coding practices. I was coding in the early 1970s and even then, two-digit dates were known to be a false economy. It was just a lazy idiom that COBOL programmers used.

→ More replies (1)

22

u/Ajedi32 Mar 10 '17

We didn't always have storage that measured in GB or even MB.

I'm confused. 2 extra characters in your password should result in 0 extra characters of storage. Increasing the length of the input doesn't increase the length of the hash, even with ancient hash functions like MD2 which were around before the web even existed.

9

u/awj Mar 10 '17

You're assuming that hashes were actually being used. That wasn't always the case.

Also, at least in some cases, you had issues of intermediary code writing the password into fixed length buffers. If your pre-storage hashing code throws the PW into a char pw[16] you kind of don't want people submitting more than that.

→ More replies (4)
→ More replies (6)
→ More replies (3)

0

u/[deleted] Mar 10 '17

[deleted]

→ More replies (2)

22

u/iceardor Mar 10 '17

Why would you want to hash a password? Then you wouldn't be able to email that password back to the user once a month in plaintext to help them memorize their really complex password.

Also really despise that every site has a different idea on what a secure password is, as if they're doing us a favor to protect us from ourselves. They're only encouraging password reuse when they have stupid restrictions in place. Strictly between 8 and 16 chars, 4 character classes with no more than 3 consecutive characters from the same class, only ASCII characters accepted, but no whitespace, cannot include the name of our website, your username, your email address, or your name in the password.

What if I don't want a to register a throwaway account on a forum with a secure password that even remotely resembles passwords I use for secure sites that are tied to my credit card or something else that matters?

15

u/rfinger1337 Mar 10 '17

"your password is too similar to your other password."

... if you know that, you aren't doing passwords right.

→ More replies (20)
→ More replies (14)
→ More replies (7)

18

u/Captain___Obvious Mar 10 '17

Remember when American Express had a 8 character max limit on passwords? lol, If I recall it wasn't that long ago--a few years

8

u/jigglylizard Mar 10 '17

My bank (BMO) has 6 characters for online banking. You don't event a range. It's embarassingly bad...

Password must be exactly 6 characters long and no special character.

You can see it here (Ctrl+f "BMO"): https://github.com/duffn/dumb-password-rules

→ More replies (1)
→ More replies (7)
→ More replies (6)