Just take the string as bytes and hash it ffs

you are viewing a single comment's thread
view the rest of the comments
[–] 197 points 2 years ago (76 children)

There’s a special place in hell for those who set an upper limit in password lengths.

  • source
  • hideshow 76 child comments
  • [–] 61 points 2 years ago (50 children)

    I sort of get it. You don't want to allow the entire work of Shakespeare in the text field, even if your database can handle it.

    16 characters is too low. I'd say a good upper limit would be 100, maybe 255 if you're feeling generous.

  • source
  • parent
  • hideshow 50 child comments
  • [–] 90 points 2 years ago (24 children)

    The problem is that you (hopefully) hash the passwords, so they all end up with the same length.

  • source
  • parent
  • hideshow 24 child comments
  • [–] 58 points 2 years ago (3 children)

    At minimum you need to limit the request size to avoid DOS attacks and such. But obviously that would be a much larger limit than anyone would use for a password.

  • source
  • parent
  • hideshow 3 child comments
  • load more comments (20 replies)
  • [–] 24 points 2 years ago (9 children)

    The eBay password limit is 256 characters.

    They made the mistake of mentioning this when I went to change my password.

    Guess how many characters my eBay password has?

  • source
  • parent
  • hideshow 9 child comments
  • [–] 17 points 2 years ago (11 children)

    I sort of get it. You don’t want to allow the entire work of Shakespeare in the text field, even if your database can handle it.

    You don't store the original text. You store the hash of it. If you SHA512 it, anything that's ever given in the password field will always be 64Bytes.

    The only "legit" reason to restrict input to 16 character is if you're using an encryption mechanism that just doesn't support more characters as an input. However, if that's the case, that's a site I wouldn't want to use to begin with if at all possible.

  • source
  • parent
  • hideshow 11 child comments
  • load more comments (4 replies)
  • [–] 5 points 2 years ago* (2 children)

    Even 255 bytes with 10 million entries is only ~2.6GB of data you need to store, and if you have 10 million users the probably $1 a month extra that would cost is perfectly fine.

    I suppose there may be a performance impact too since you have to read more data to check the hash, but servers are so fast now it doesn't seem like that would be significant unless your backend was poorly made.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 53 points 2 years ago (9 children)

    Oh and also, "change this every four weeks please."

    Okay then. NEW PASSWORD: pa$$word_Aug24

  • source
  • parent
  • hideshow 9 child comments
  • [–] 4 points 2 years ago (1 child)

    Yep. Having to have requirements that doesn't flow with people very well and requiring constant updates, people WILL find shortcuts. In the office, I've seen sheets of paper with the password written down, I've seen sticky notes, I've seen people put them in notepad/word so they could just copy paste.

    This is made worse, because you have to go out of your way for a password manager, which means you need to know what that is. And you need a good one because there has been (and I'm going to generalize here) problems with some password managers in the past. And for work, they have to allow a password manager for that to even be an option. Which you then end up with this security theater.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 2 years ago

    And you need a good one because there has been problems with some password managers in the past.

    coughLastPasscough

    “Problems”. What an delightfully understated term to use.

  • source
  • parent
  • [–] 18 points 2 years ago (4 children)

    Reasonable upper limits are OK. But FFS, the limit should be enough to have a passphrase with 4 or 5 words in it.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 6 points 2 years ago (3 children)

    Usually 256 bit hash is used. 256 bits is 32 bytes or 32 characters. Of course you are losing some entropy because character set is limited, but 32 characters is beyond reasonable anyway.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 5 points 2 years ago* (last edited 2 years ago) (1 child)

    The eff passphrase generator has about 2.5 bits of entropy per character (without word separators). Eff recommends 6 word passphrases, and with an avg word length of 7, that's (only) 79.45 bits of entropy that won't even fit in the 32 characters. If there wasn't a password length limit it would be possible to saturate the hash entropy with a 20+ word & 102+ char passphrase.

  • source
  • parent
  • hideshow 1 child comment
  • load more comments (1 reply)
  • [–] 7 points 2 years ago (4 children)

    Just opened a PayPal account and their limit is 20. Plus the only 2fa option is sms 🙃.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 10 points 2 years ago (1 child)

    I just double checked and I have TOTP enabled for my PayPal account so it should be an option.

    I just found this support article of theirs and it says it can only be enabled through their website and not through the app (why?!) so you might be running into that?

    https://www.paypal.com/uk/cshelp/article/what-is-2-step-verification-and-how-do-i-turn-it-on-or-off-help167

  • source
  • parent
  • hideshow 1 child comment
  • [–] 5 points 2 years ago

    Probably people would struggle to scan the QR Code with their smartphone. I think most apps can scan it from a image but obviously this would be unsafe, especially when people sync their screenshot to the cloud.

    I can 100% confirm totp exist for PayPal, because I'm using it.

  • source
  • parent
  • load more comments (1 reply)
  • load more comments (1 reply)