4 ms·
Question, I use SHA512 for my passwords; is that also "fast" in comparison to bcrypt?
by Ixiaus 16y ago
Question, I use SHA512 for my passwords; is that also "fast" in comparison to bcrypt?
- Xk 16y agoSHA512 is very, very fast compared to Bcrypt. It's only slightly slower than SHA1 or SHA256. Source: http://www.cryptopp.com/benchmarks.html http://www.cryptopp.com/benchmarks.html
- Ixiaus 16y agoThanks for the answer and the link. My salting algorithm is very strong but I hadn't considered the idea of renting a bunch of EC2 instances and brute-forcing hashes because the hashing algorithms are so fast.
- Xk 16y agoWhat do you mean by "my salting algorithm is very strong"?
- Ixiaus 16y agoInstead of just concatenating a salt to the password string, I use a dispersion method. I first concat the salt to the beginning of the password and SHA512 that. I then have a globally configured list in my app (it's different for every app I produce) that defines at which index, in the hashed salt+password digest, chunks of the (same) salt are sliced and interspersed. Given the same list of indexes, I can then "find" the salt of a stored password hash and run a given plain text password through that algorithm. But, as has been stated, that effort is completely null if the SHA512 algorithm is fast and brute-forcing it only takes a handful of rented GPU instances... [EDIT] Now that I think about it, if the Gawker attack were to happen to me, then the attackers would also have the source code and can get the salt dispersion list... So this is, in hindsight, kind of pointless.
- ErrantX 16y agoPoor mans solution here is to iterate your fast hash a number of times. This is essentially what bcrypt does for you anyway (in a really crude sense).
- tptacek 16y agoYou shouldn't get downmodded for a comment that demonstrates exactly the moment of enlightenment Coda was trying to get people to have about password hashing. Let me fix that for you.
- sparky 16y agoIf I can believe this ( http://www.cryptopp.com/benchmarks.html http://www.cryptopp.com/benchmarks.html ), SHA-512 can still hash data at tens to hundreds of megabytes per second on a single couple-year-old core. Bcrypt lets you configure the slowness of your key generation with a "work factor", so I suppose with a work factor of 1 it'd probably be pretty fast too, but with a work factor of 10 it takes me roughly 100ms to hash 1 10-byte password. So yeah, SHA-512 gives you a much larger keyspace, which is awesome, but isn't demonstrably slower than MD5, SHA-1, etc. Which was one of its design goals (and also one of the goals of all entrants in the ongoing SHA-3 competition).