News for hackers. Stuff that matters.
Re:I will never be able to log in to Flickr again by nwh on Sunday May 25, 2014 @12:39AM (#7795432)
No spaces in passwords? Obviously not hashing them.
Re:I will never be able to log in to Flickr again by arcticPeril on Sunday May 25, 2014 @01:09AM (#7795518)
Actually, they are (or could be, given that I don't know for sure because I don't work there).

It merely means that they are most likely looking for spaces with client-side JavaScript, and rejecting any string that contains spaces.

Or, they're checking the string server-side, before hashing and storing the hash to their persistent data store.

Either way, as long as the connection is secure, it's reasonable to inspect the string in plain-text, both client-side and server-side, before creating the hash, as long as they actually create the hash when they do actually decide to save a representation of the password, rather than saving the plain-text password itself.

Part of me would like to guess that the reason spaces might be forbidden in passwords (and pass phrases) would be to prevent frequency analysis. But that doesn't really make much sense, when it comes to hashes, does it? So then, might the case be that they are storing the passwords with reversible encryption, and decrypting the token for a match? In my mind of minds, I doubt it, but you never know. What I really think is that the password policy is simply contrived and idiotic, and whatever rationale they've used to forbid spaces is silly and ill-conceived.

Either way, I agree with the author, whole-heartedly. That is a damned frustrating sign-up process. Two-factor account creation AND a CAPTCHA check? Holy moly!

Re:I will never be able to log in to Flickr again by nwh on Sunday May 25, 2014 @01:17AM (#7795542)
I'm very much aware of that. I'm saying that because they're disallowing the submission of spaces, they aren't hashing their passwords when they get to the server.

> they're checking the string server-side, before hashing and storing the hash to their persistent data store.

But why? People don't just add a rule because they feel like it, I'm suggesting that they are storing it in a stupid way that is not hashed and does not allow spaces.

> part of me would like to guess that the reason spaces might be forbidden in passwords (and pass phrases) would be to prevent frequency analysis.

The output of a cryptographic hash is completely random, you can't do any sort of analysis except for determining H(a) == H(b). You don't even know if H(b) was the same input as H(a) or just a collision against it.

Re:I will never be able to log in to Flickr again by arcticPeril on Sunday May 25, 2014 @01:23AM (#7795553)

  > But why?
Because you cannot trust any checks performed on the client-side, since the user may have total control over the client-side system, and possess the ability to (somehow) bypass or spoof client-side validation.

Client-side validation only exists to pluck the low-hanging fruit, and provide convenience to the majority of users. You cannot rely on any client-side events, when attempting to secure server-side resources.

All user input must be considered evil until proven otherwise.

Re:I will never be able to log in to Flickr again by nwh on Sunday May 25, 2014 @01:25AM (#7795558)
You've utterly missed the point of this.

If they hashed the user input, it wouldn't matter what the client gave them in terms of password requirements. Spaces, special characters, arbitrary lengths up to tens of thousands of characters would all be fine with a cryptographic hash, there's no way the resulting hash would be anything but a fixed length of n bytes. Nothing "evil" can make it through being hashed.

The password requirements Flickr has set show that they are not using a cryptographic hash, the limitations on length and character set imply that they are being stored incorrectly, either in plain text or a space delimited format. There's no reason to have these limitations if this were not the case.

Re:I will never be able to log in to Flickr again by arcticPeril on Sunday May 25, 2014 @01:29AM (#7795571)
So you're just going to implicitly trust the user's browser to generate the hash for you? Good luck with that, sir.

And there is a reason to limit length, the very obvious reason being that short passwords are easier to brute force.

Reduced character sets (numeric only, for example) are also easier to brute force, so by forbidding spaces, technically, they've reduced the character set of their passwords by at least one character (not that it's of any particular concern, all things considered).

By the way, I made mention that perhaps they're encrypting the string, and not hashing it. Did you miss that part?

Re:I will never be able to log in to Flickr again by nwh on Sunday May 25, 2014 @01:33AM (#7795579)
What the hell? When did I suggest that? Client side validation wasn't even a part of this, the rules are clearly enforced at the server as well.

> By the way, I made mention that perhaps they're encrypting the string, and not hashing it.

Encryption is the same, it's content agnostic. 20 characters doesn't make any sense with the size of a block cipher.

Re:I will never be able to log in to Flickr again by arcticPeril on Sunday May 25, 2014 @01:55AM (#7795611)
So, encryption (as opposed to hashing) COULD be prone to frequency analysis (depending on the cipher used, ROT13 for example, ha ha!). IF that's what Yahoo! were using to protect their password data. But that's a big "if."

But, as you mentioned, hash funtions always produce a fixed-length string as their output, so, hypothetically, if an evil-doer comprised the whole Yahoo! password database, and saw randomized byte values of varying length stored for the password data, it would be obvious that the passwords were encrypted, and not hashed. In which case, you'd be right: they weren't hashed, they were encrypted.

But still, I don't think forbidding spaces necessarily precludes the use of hashes. I also don't think Yahoo! is using a space-delimited data format for storing password data. Or at least if they were, I'd be as shocked at that as I would be to find out that they protected passwords with ROT13 or triple DES (encrypting a password with AES might be conscionable though).

To answer your question:

  > When did I suggest that?
I think I may have misinterpretted the following:

  > If they hashed the user input, it wouldn't matter 
    what the client gave them in terms of password 
    requirements.
To me, I read that as "If they (being the client) hashed the user input, it wouldn't matter what the client gave..." my mistake.
Re:I will never be able to log in to Flickr again by gaadd33 on Sunday May 25, 2014 @01:49AM (#7795601)
I don't see how setting business rules means that they aren't using a cryptographic hash. Can you explain why that has to be true?

Perhaps eliminating a frequently made mistake by people who don't have much computer expertise is the reason. Wouldn't it be possible that they have found that a large number of support requests for newly created accounts are due to people accidentally adding spaces? So by eliminating spaces, they can still hash the contents without a problem however they also reduce the support load and increase the usability by a subset of their users.

Re:I will never be able to log in to Flickr again by pconner on Sunday May 25, 2014 @12:48AM (#7795460)
Spaces are just characters. Their presence has nothing to do with hashing algorithms working or not.
Re:I will never be able to log in to Flickr again by PavlovsCat on Sunday May 25, 2014 @01:07AM (#7795511)
That's the point; since spaces in the password cleartext should not matter for storing the password hash, what would be a good reason to disallow them?
Re:I will never be able to log in to Flickr again by aaronem on Sunday May 25, 2014 @01:15AM (#7795535)
There isn't one.
Re:I will never be able to log in to Flickr again by nwh on Sunday May 25, 2014 @01:18AM (#7795544)
Which begs the question why I was downvoted heavily and posted to @shit_HN_says for making the comment.
Re:I will never be able to log in to Flickr again by aaronem on Sunday May 25, 2014 @01:33AM (#7795578)
How the hell should I know? But if I had to guess, I'd say it was because your prior comment implicitly equates "spaces prohibited in passwords" and "passwords not hashed" and assumes the latter as a necessary consequence of the former, when the two are entirely unrelated.

Now, to be fair, that's an uncharitable interpretation of the comment you're complaining about. But you helpfully make clear in a later comment that that was what you meant:

> I'm saying that because they're disallowing the submission of spaces, they aren't hashing their passwords when they get to the server.

And that just doesn't follow, and that's probably why your comment is getting downvoted, but not why I downvoted it just now. I don't downvote for content, but only for rudeness, unfunny jokes, and complaining about downvotes.

Re:I will never be able to log in to Flickr again by whoopdedo on Sunday May 25, 2014 @01:26AM (#7795559)
Should leading and trailing spaces be removed from input fields?
Re:I will never be able to log in to Flickr again by bowlofpetunias on Sunday May 25, 2014 @01:36AM (#7795585)
It's the lazy way of stopping users from cheating a minimum password length requirement.

To be fair, any other way would be lead to convoluted rules like "no consecutive spaces", "no leading/trailing spaces" or "spaces don't count towards the password length".

This is exactly why forcing users to use strong passwords is a shit idea in the first places. The rules either become ridiculously complicated or you disallow perfectly good passwords. There's no middle ground.

Re:I will never be able to log in to Flickr again by 1945 on Sunday May 25, 2014 @12:43AM (#7795447)
Why are they obviously not hashing?
Re:I will never be able to log in to Flickr again by iancarroll on Sunday May 25, 2014 @12:46AM (#7795453)
because if they were hashed, spaces would be irrelevant (hashes don't have spaces)
Re:I will never be able to log in to Flickr again by pconner on Sunday May 25, 2014 @12:54AM (#7795478)
You can apply a hashing algorithm to a string that contains spaces. The spaces are very much relevant.

In MD5 "String with spaces" yields eab431cd212fb8b5ae223acbcfe58cca

"Stringwithspaces" gives 3cd297b2d7e48709d92890f88abdde0a

Re:I will never be able to log in to Flickr again by iancarroll on Sunday May 25, 2014 @12:54AM (#7795482)
I meant the hashes themselves wouldn't have spaces, therefore any odd database storage requirement wouldn't matter.
Re:I will never be able to log in to Flickr again by tomschlick on Sunday May 25, 2014 @01:10AM (#7795525)
its probably because of dumb users. user makes password with spaces, then tries with without spaces and cant figure out why it wont work...
Re:I will never be able to log in to Flickr again by taspeotis on Sunday May 25, 2014 @01:31AM (#7795575)
I don't know why this is getting downvoted. It's pretty easy to have accidently insert leading or trailing whitespace when copying/pasting a password.

(Users should never store passwords in plain text or email them to one-another but the reality is they do.)

Re:I will never be able to log in to Flickr again by mattkrea on Sunday May 25, 2014 @12:54AM (#7795481)
client-side validation?
Re:I will never be able to log in to Flickr again by theboss on Sunday May 25, 2014 @10:35AM (#7796425)
There's a difference between not allowing spaces and not hashing. They could have just written a bad PW policy that doesn't completely make sense

You're drawing conclusions from information that doesn't lead you to one.