Live data from Hacker News

Speed Hashing

codinghorror.com

91–100 of 133 posts

Re: Speed Hashing

#91
post #70
post #63

Earlier quoted context omitted.

In reality you arent using 2 salts, you are using one unique salt per user, each users salt starts with the same few bytes though.

yes, I put the first salt in database and the second salt under www-root. Hacker who hack the database only will not know the fist salt.

I think you have to assume worst case: if they have access to your database, they have access to your web root. It might not be the case, but you should assume that.

Re: Speed Hashing

#92
Here is my problem with all of this. PBKDF really just means "take this hash function and apply it 1000 times in succession". That seems like a very butchery style to approach cryptography for me.

bcrypt seems to lack any research verification. Its a modified blowfish, but who of us can tell what modifications are safe without making the scheme ineffective and gauge its validity?

Re: Speed Hashing

#93
In reality the usable space is substantially less; you can start seeing significant collisions once you've filled half the space.

More problematic, the chance of any collisions is 50% when you have filled just sqrt(space) - known as the birthday paradox.

Re: Speed Hashing

#94
post #79
post #49

Nobody mentioned pepper yet. Not the "static salt" variant which you might find while googling. That is just more security by obscurity. I'm talking about adding a random string of fixed length characters to the (salted) password that is not saved anywhere. At login, it requires a bit of brute-forcing on the server to check the hash since we have to go trough all possible pepper strings. This adds a few ms (e.g. with…

That's because it's a silly idea which is inferior to cryptographic adaptive hashing, as is done by bcrypt, scrypt, and PBKDF2. If you want to provide a work factor, use a real one.

First of all, you come off as condescending when you say "it's a silly idea" and say that the work factors you mentioned are "real" ones, thereby implying that adding more combinations is not a real work factor.

Second, the actual usefulness of any work factor has to be proven first. Do we know that the iterative approaches offer "real" work factors? What if subsequent iterations are easier to compute by exploiting the structure of the input (i.e. password + result of previous iteration). We have to prove that this is not the case. The same argument holds for peppering, which is also based on computing hashes with a certain structure.

I'd like to hear your arguments as to why certain work factors are more "real" than others, especially peppering.

Re: Speed Hashing

#95
post #3

One very curious thing to me is that for the upcoming SHA-3 standard, Wikipedia lists the cycle timings for each hash method. I would have thought that slower hashing speed would be a good thing, but the faster the candidate algorithm the better it appears. Perhaps the faster the hash is easier implement in hardware / less power for embedded devices?

I would have thought that slower hashing speed would be a good thing, but the faster the candidate algorithm the better it appears.

This is due to the confusion about the general purpose of a hash function versus the specific purpose of a "password hash"/PBKDF, which Jeff's article helps contribute to with it's loose terminology.

A general hash function should be fast as it needs to be invoked often.

Re: Speed Hashing

#96

Why would you use MD5 as a checksum if different documents with identical hashes can be produced?

Because it is fast, ubiquitous, and you can't produce a collision by accident. That means it's perfectly fine to use where no malicious behavior is possible. In fact, it should be used in those instances due to the speed and availability on all platforms. Where security is a concern, use SHA-256 or SHA-512.

Re: Speed Hashing

#97

Using "hash" to mean "strongly collision-free function" is a valid terminological choice; in a wide-readership piece like this it should ideally be pointed out in order to avoid confusion, but there are many fields where that definition would be assumed without statement. Getting confused between hash functions and password-based key derivation functions , on the other hand, is absolutely inexcusable; that very confu…

Also PBKDF2 is not designed to be hard to crack on a GPU. PBKDF2 is actually notoriously easy to implement on a GPU or FPGA due to its small fixed amount of ram. It's probably not a huge deal since taking a large fraction of a second on a CPU to validate a login would translate into taking a large fraction of 1/150 of a second per password crack attempt on a GPU so it still is decent security.

For something designed to defeat specialized hardware, see scrypt.

[edit] Just noticed who I was replying to. Now that's funny.

Re: Speed Hashing

#98
post #94
post #79

Earlier quoted context omitted.

That's because it's a silly idea which is inferior to cryptographic adaptive hashing, as is done by bcrypt, scrypt, and PBKDF2. If you want to provide a work factor, use a real one.

First of all, you come off as condescending when you say "it's a silly idea" and say that the work factors you mentioned are "real" ones, thereby implying that adding more combinations is not a real work factor. Second, the actual usefulness of any work factor has to be proven first. Do we know that the iterative approaches offer "real" work factors? What if subsequent iterations are easier to compute by exploiting t…

I am absolutely intending condescension towards the idea. Since you're an anonymous user with almost no comments in your history, I do not concede the idea that it's even possible to condescend to you: I have no idea who you are.

The usefulness of work factors has been proven. You can start here: http://www.bsdcan.org/2009/schedule/attachments/87_scrypt.pd...

Re: Speed Hashing

#99
post #80

Earlier quoted context omitted.

"Password based key derivation function". The problem here isn't that cryptographers are inflicting a terrible name at you, it's that security people have repurposed a function intended for one purpose (generating crypto keys) for another (storing passwords). Also: don't blame us, blame the PKCS standards group.

I don't see that it was repurposed; "key derivation function" != "encryption key derivation function", and I prefer the term "login key" over "password hash".

Since there are good password hashes that are also bad KDFs, I'm not sure I agree with the equivalence.

Re: Speed Hashing

#100
post #88
post #80

Earlier quoted context omitted.

"Password based key derivation function". The problem here isn't that cryptographers are inflicting a terrible name at you, it's that security people have repurposed a function intended for one purpose (generating crypto keys) for another (storing passwords). Also: don't blame us, blame the PKCS standards group.

Sure sure. What I'm really saying is that the core concepts here are "collision resistance" and "susceptibility to brute force", and that those are comparatively easy to grok for a typical developer. But they get scared to death when they read stuff like (verbatim from cperciva above) "MD5's breakage as a hash function does not impact its security as a PBKDF, and not realizing that MD5 and SHA256, being not designed…

But what he's saying is very straightforward:

The MD5 vulnerabilities that this post talked about don't change the security of PBKDF-MD5 (or any iterated MD5 password hash), because password hashes aren't used to authenticate data. Similarly (this is a little mindbending): HMAC-MD5 has no known viable attacks, so many crypto protocols that use MD5 don't have viable attacks.

and

Because they all seem like acronyms, people get MD5 and SHA256 (which are core hash functions, "primitives" in a cryptosystem) with PBKDF, which is a standard for turning passwords into crypto keys.

(I know you know both, I'm just trying to restate).

Post reply on HN