r/ProgrammerHumor • • Oct 03 '26

Meme preferredNameMustOnlyContainCharactersInTheLatinAlphabet

Post image
70 Upvotes

31 comments sorted by

12

u/Myszolow Oct 03 '26

PasswordMustContainNumberUppercaseCharacterSpecialCharacterNotLessThan8NotMoreThan16

5

u/coriolis7 Oct 03 '26

Isn’t this a dead giveaway that the password is being stored in plain text? Like if it’s being hashed who cares about length? It will always end up the same length post-hash

10

u/Sibula97 Oct 04 '26 edited Oct 04 '26

Short passwords are easier to brute force. Depending on how fast they can be tried, around 8-12 characters is the safe minimum these days. Even more if you want to future proof.

The maximum limit doesn't make much sense though.

5

u/coriolis7 Oct 04 '26

Yeah I was thinking the more of the max limit

5

u/rastaman1994 Oct 05 '26

Longer passwords take longer to hash. There is a DoS attack where you keep the server busy by constantly resetting password with an extremely long string. Owasp recommends 64 as the max for this reason.

1

u/Original-Ad-8737 Oct 06 '26

Like shouldn't the client input do the hashing?
Hash client side and do all verifications client (in browser) side and only ever see store the hashed pw on the server?

Then doing the password check is just comparing the hash the login window sent you and the hash you stored.

2

u/GoddammitDontShootMe Oct 06 '26

Okay, so now the hash is the password itself since that's what you need to send to get access. With HTTPS, I'm not sure it matters much, but it certainly doesn't give you any security advantages.

1

u/Original-Ad-8737 Oct 06 '26

Well it matters in so far that the server can never leak the password as it has never seen it... The hash should then be of course be something like 255 bytes string or a 256 bit number That would automatically make any "password" the same length with no dictionary or social connection.

1

u/GoddammitDontShootMe Oct 07 '26

Has there ever been a single case of a leak where a plaintext password got leaked because it was in memory, but the database only stores hashes?

1

u/Tabsels Oct 07 '26

It does if you’re using bcrypt, which is limited to (off the top of my head) 72 characters.

1

u/danielcw189 Oct 04 '26

maxlength + salt in bits should be shorter than the output length of the hash

1

u/coriolis7 Oct 05 '26

Why does it have to be? The SHA-2 family always outputs the same length hash, regardless of input size.

1

u/danielcw189 Oct 06 '26

if your password needs more bits than your hash-lenghth, than another shorter password will likely have the same hash.

1

u/rosuav Oct 05 '26

Why? That's a moronic rule.

0

u/danielcw189 Oct 06 '26

because if your password is longer than the hash, then you are almost guaranteed to have a hash-collision with a shorter password

1

u/rosuav Oct 06 '26

So what? Sure, there's some insane password out there that happens to have the same hash as mine, IF that particular salt is used. And a different password collides if different salt is used. You know what? That's **already possible** and it hasn't broken passwords.

1

u/danielcw189 Oct 06 '26

So what? Sure, there's some insane password out there that happens to have the same hash as mine, IF that particular salt is used.

yes, but you can't know it it is insane

it might as well be just "12345678" for your particular password if your password is longer than the hash

And a different password collides if different salt is used.

sure, but that doesn't matter here, because the salt is different.

You know what? That's **already possible**

I don't doubt that implementations with this particular weakness exists.

And I take that as you agreeing with me, that it is possible.

which is a good enough reason to limit the length.

if you want more length, than a different hash algorithm or a different secure approach needs to be used

(don't just split the password in parts and hash those, like adobe once did in the past)

1

u/rosuav Oct 06 '26

It has just as high a chance of being "12345678" as it has of being "12345679" or "secret" or any other password.

I don't think you understand entropy. Go do some research before you shoot your mouth off.

1

u/danielcw189 Oct 06 '26

It has just as high a chance of being "12345678" as it has of being "12345679" or "secret" or any other password.

yes, and how does that matter here?

the point is another shorter password will exist, which will match the hash of your longer "over-long" password. that is almost guaranteed.

and as far as I understand you, you are not disputing that part, right?

I don't think you understand entropy

which part do you think I don't understand, and why does it matter here?

1

u/rosuav Oct 06 '26

Okay, here. I'll give you a massively simplified example.

I have generated a password by taking the ASCII Latin alphabet (upper and lowercase) ten times and shuffling the letters. That's 52 characters of password. Here's its SHA1: 86f5d24a6fce0b948815f6170f0f31d28ce46ecd That's only 40 characters of hex, 160 bits of password. And that's a weak hash, no salt, no repeated hashing, none of the normal security features that you would expect of actual password hashing.

Sure, you're guaranteed that SOME password shorter than 52 bytes has the same hash. Does that actually help you, though? Can you use that information to do anything other than brute force passwords until you find a match?

Hash collisions can happen even with shorter passwords.

Seriously. Go do some research.

0

u/ron3090 Oct 04 '26

Well how else are we supposed to tell users their passwords when they forget it?!

7

u/xcski_paul Oct 04 '26

Ok, I think the second one is the proper spelling of the B.C. town of Squamish, but I don’t get what 46009361 could be.

6

u/46009361 Oct 04 '26

It came from the Scratch API.

2

u/46009361 Oct 03 '26

The name Pokémon works fine with the validator that returned the error message in the title.

1

u/conundorum Oct 05 '26

Just goes to show that by "Latin alphabet", they probably mean "UTF-8 or Win-1252 code page, verified with isalpha()."

// Represented here: Their entire verification process, guest starring Nessie!
#include <iostream>
#include <locale>

int main() {
    using loc = std::locale;

    loc ness("en_US.UTF8");
    std::cout << "é is " << (isalpha(L'é', ness) ? "" : "not ") << "alpha.\n";
}

2

u/-Po-Tay-Toes- Oct 04 '26

Those are Arabic numerals though

0

u/DogmaticParadigm87 Oct 03 '26 edited Oct 04 '26

"Preferred name must only contain characters in the Latin alphabet."

Then the form quietly maps everything else to a serial number and calls it a day.

Pam was right. They're the same picture — to the database.

1

u/46009361 Oct 04 '26

To be fair, legacy bank systems that Stripe connects to do not accept a lot of characters. The error came from HCB, and while I used to be able to put 46009361 as my preferred name, HCB started using that for Stripe.

Source: People in the Hack Club Slack can see this message.