views:

84

answers:

3

Hi,

Some hash functions are today not as safe as they were some years ago. Which hash function would currently be a good choice for hashing passwords?

Thanks in advance.

A: 

The official answer is the one that produces the largest hash (like SHA-512). However, in practice, you usually have to make a tradeoff between that and storage concerns and processing time to calculate the hash.

Here's a list of hash functions, along with data about their size and more:
http://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_algorithms

Joel Martinez
A: 

A keyed hash such as SHA256 HMAC would be a good option to prevent brute force attacks if your data store is compromised.

recursive
+3  A: 

Well, sha-2 is technically more secure, but no collisions have been found for sha-1 yet.

If you're trying to defend against rainbow tables or something, I would go with sha-2, since it has not seen wide use (yet).

SHA hash functions (Wikipedia)

Matt