News for hackers. Stuff that matters.
Re:The FBI stole an Instapaper server in an unrelated raid by mwytock on Thursday June 23, 2011 @02:09PM (#2689069)
I dont understand. If you can use mixed-cased, letters and symbols you have 26 * 2 + 20 = 72 possible characters.

72^8 >> 1e9

It would still take more than 8 days to brute force at 1 billion/sec. And using a longer password (16 chars?) would make this a very long time.

Or is there other trick that makes this fast? Or, is it simply that people don't choose random, long passwords?

Re:The FBI stole an Instapaper server in an unrelated raid by tptacek on Thursday June 23, 2011 @02:13PM (#2689091)
Secure password hashes don't protect users, and particularly not users who use one-time effectively-random passwords.

Secure password hashes protect application developers from the disclosure of hundreds or thousands of user passwords from their database. It allows them to attest to their userbase "your password is cryptographically stored in a manner that makes them hard to break even by dedicated hardware; you should consider changing your password if it's weak and shared", instead of, "expect to see your password on Pastebin any day now".

Re:The FBI stole an Instapaper server in an unrelated raid by kragen on Thursday June 23, 2011 @05:44PM (#2690021)
To clarify, I assume you mean that using secure password hashes instead of insecure ones does not help users who use one-time effectively-random passwords, because those users are already safe?

That is true.

However, it seems to me that the combination of an effectively-random password and password hashing does protect users, because their password is not effectively crackable in a situation like this. Additionally, there's a tradeoff between how secure your password hashing is and how much randomness users need to put into their password: every additional factor of 1000 in the iterations of the hash saves you a random character or two.

Re:The FBI stole an Instapaper server in an unrelated raid by sunchild on Thursday June 23, 2011 @09:01PM (#2690546)
I wish everyone could use complex, unique, strong passwords all the time, but some use cases just don't support it. For example, I have to type my Apple ID into my iPhone/iPad what seems like every 5 minutes in iOS. Without access to 1password or a similar tool, I just can't use a strong password. Even if I did, I couldn't change it as often as I'd like to. FWIW, I wish I could.
Re:The FBI stole an Instapaper server in an unrelated raid by sliverstorm on Thursday June 23, 2011 @10:46PM (#2690756)
security vs. convenience
Re:The FBI stole an Instapaper server in an unrelated raid by sunchild on Friday June 24, 2011 @01:33AM (#2691140)
My point was that the choice is sometimes not left in the user's direct control. If I thought I could choose an absurdly strong password (e.g., to overcome the shortcomings of the developer's choice of SHA1), I would always do that – except if I'm going to need to enter that password from memory a bunch of times per day.
Re:The FBI stole an Instapaper server in an unrelated raid by getsat on Thursday June 23, 2011 @02:22PM (#2689142)
You're looking at more like 5+ billion/sec today. There was a listing of modern consumer video cards + their hashing capabilities posted on another HN story recently, but I can't find it.
Re:The FBI stole an Instapaper server in an unrelated raid by ahi on Thursday June 23, 2011 @04:44PM (#2689795)
https://en.bitcoin.it/wiki/Mining_hardware_comparison

Not sure if this is what you were looking for or the particular hash bitcoin uses, but a $110 Radeon 5830 can get you around 250Mhash/s

Re:The FBI stole an Instapaper server in an unrelated raid by angusgr on Thursday June 23, 2011 @07:37PM (#2690372)
"Hashes" aren't interchangeable, they're an abstract concept. In this case, the thread is talking about the SHA-1 hash algorithm. AFAIK Bitcoin uses SHA-2 w/256-bit digests.

So, actually, in this case the two happen to be related but different - SHA-1 being considered potentially flawed but not (yet) the stronger SHA-2.

Also, the Bitcoin block headers that are hashed are (I think) 80 bytes (640 bits) long, salted passwords probably a bit shorter.

Wikipedia says SHA-256 runs about 2/3 the raw throughput of SHA-1. You can the comparative rate yourself on any nix computer:

$ openssl speed sha1 sha256 -snip- Doing sha1 for 3s on 16 size blocks: 7760096 sha1's in 2.99s Doing sha1 for 3s on 64 size blocks: 5502820 sha1's in 3.00s -snip= Doing sha256 for 3s on 16 size blocks: 5460366 sha256's in 3.00 Doing sha256 for 3s on 64 size blocks: 3169031 sha256's in 3.00s -snip- *

So... about 2/3 faster. I don't know enough about crypto implementation, but I'd guess this ratio would scale roughly to the much faster GPU implementations as well.

Re:The FBI stole an Instapaper server in an unrelated raid by woadwarrior01 on Friday June 24, 2011 @05:02AM (#2691543)
Yes, I have 2 6950s, which together average to about 660MH/s on hashkill mining bitcoin, but when I tried MD5, IIRC they averaged to about 3200MH/s. I'd assume SHA1 to be slightly slower, but not much.
Re:The FBI stole an Instapaper server in an unrelated raid by spindritf on Saturday June 25, 2011 @01:31PM (#2696084)
> You're looking at more like 5+ billion/sec today.

Sounds about right http://blog.zorinaq.com/?e=43 And a few times more if it's md5.

Re:The FBI stole an Instapaper server in an unrelated raid by meroliph on Thursday June 23, 2011 @02:13PM (#2689096)
> Or, is it simply that people don't choose random, long passwords?

That's always part of the problem.

Re:The FBI stole an Instapaper server in an unrelated raid by Hawramani on Thursday June 23, 2011 @02:34PM (#2689209)
If my understanding is correct that's not the issue here. Hashes are meant to be one-way functions, the developer can easily check if a user's password matches the hash, but it should be practically impossible to deduce the password from the hash.

What the user chose as their password should be irrelevant if using a good hash.

[Edit: I stand corrected on the effect of password length.]

Re:The FBI stole an Instapaper server in an unrelated raid by Xk on Thursday June 23, 2011 @03:00PM (#2689326)
SHA-1 is a reasonably good hashing algorithm, but for the sake of argument, I'll talk about an imaginary SHA-4 which is perfect in every respect. It will be a 4096 bit hash function which has no faster-than-bruteforce collisions or preimage attacks or second preimage attacks.

Let's also assume that this perfect SHA-4 function is freakishly fast, say, a million times faster than SHA-1.

Now, even though my imaginary SHA-4 function is perfect in every way, it would be strictly worse to use this for password hashing than SHA-1. Why? Because cryptographic attacks aren't the problem here. The problem is that the entropy of a user's password is very VERY small. So small, in fact, that attacks on passwords aren't done through cryptographic weaknesses, they are done by simply hashing everything someone might pick as a password and asking "did I get it right?". An attacker will repeat this process for a little while, and eventually they'll get the answer "YES, this user chose to make abc123 as their password!".

Re:The FBI stole an Instapaper server in an unrelated raid by encoderer on Thursday June 23, 2011 @03:13PM (#2689377)
Right, which is the reason why "perfect in every respect" and "freakishly fast" are mutually exclusive in a hashing algorithm.

A "perfect in every respect" hash then would be one that takes a consistent, acceptably-long time. Some large fraction of a second perhaps.

Of course, this fictional hash wouldn't be the right choice for everything. But for password hashing, it's a good start.

Re:The FBI stole an Instapaper server in an unrelated raid by jonknee on Thursday June 23, 2011 @03:21PM (#2689419)
... Which is pretty much what bcrypt is.

http://codahale.com/how-to-safely-store-a-password/

Re:The FBI stole an Instapaper server in an unrelated raid by Xk on Thursday June 23, 2011 @03:21PM (#2689418)
(Edit: see child comment -- I was responding to something other than what was intended. I'm leaving this here for clarity, but you can ignore it.)

No, not really. Hashing functions aren't designed for passwords, they're mainly used for integrity checks and other uses which need to be fast: why do you think one of the axes the SHA-3 hashes are competing on is speed?

You have your 10gb file and want to send it to your coworker and let him know it's really yours and no one has messed with it. So you run an HMAC over it and then sign it with your private key.

You want it to be as fast as possible. It would be optimal if there was a single x86 instruction called sha4 which did this in the time it takes to do an add.

Hashing is really, really not meant for passwords.

Re:The FBI stole an Instapaper server in an unrelated raid by encoderer on Thursday June 23, 2011 @03:43PM (#2689521)
Woah, slow down, I think you whipped up a 4 paragraph reply before you ever got to my last sentence.

Or, go on and tell me more about all the things hashes are used for as if I just fell off the turnip truck.

This discussion is not about checksums on files. It's abotu passwords. And your "perfect hash" in your example about passwords is "freakishly fast." In fact, like the other guy that replied to me mentioned, this is the entire point of the workfactor in bcrypt, right?

Of course, bycrypt is really, really not meant for checksums. Good thing nobody was talking about checksums then.

Re:The FBI stole an Instapaper server in an unrelated raid by Xk on Thursday June 23, 2011 @03:56PM (#2689589)
When you wrote "this fictional hash" I read that as talking about the SHA-4 I made up, not the one you did.

I then didn't respond to the rest of the post because when you said "for password hashing, it's a good start" I again assumed you were talking about my hash function, which is not good for hashing. Yours would be perfectly fine.

I apologize.

Re:The FBI stole an Instapaper server in an unrelated raid by encoderer on Thursday June 23, 2011 @04:29PM (#2689730)
Apology accepted, and thank you for adding a lot to the discussion further down the page (the interesting maths related to the probability of collisions on a hashed-hash)
Re:The FBI stole an Instapaper server in an unrelated raid by vl on Thursday June 23, 2011 @10:16PM (#2690691)
>Let's also assume that this perfect SHA-4 function is freakishly fast, say, a million times faster than SHA-1

This is why they invented key stretching: http://en.wikipedia.org/wiki/PBKDF2

Just set number of rounds to 10000000000 instead of, like, 10000 for SHA1.

Re:The FBI stole an Instapaper server in an unrelated raid by InclinedPlane on Thursday June 23, 2011 @06:06PM (#2690112)
Sure, but if you can run through billions of possible hashes per second then it's possible to brute force the "one way" hash by exploring hashes for short passwords.

1 billion passwords per second is 86 trillion passwords per day. If a hacker wanted to gain access to a particular password then it can become trivial to crack with fairly modest resources. The only thing that protects you is a sufficiently complex and long password.

Re:The FBI stole an Instapaper server in an unrelated raid by rchowe on Thursday June 23, 2011 @02:42PM (#2689245)
But there are rainbow tables, or tables of all of the MD5s/SHA1s/<insert favorite hash algorithm> for arbitrary strings. So the time's already sunk in.

8 days for one password is a very short amount of time comparatively (tiny for a botnet). If you use bcrypt, which you can force a certain complexity on, you can get that amount of time up much higher.

Re:The FBI stole an Instapaper server in an unrelated raid by tptacek on Thursday June 23, 2011 @02:48PM (#2689274)
Rainbow tables don't work even against amateurish salted hash schemes.