Re:Those 500K Bitcoins that caused the flash crash weren't real
by yuhong on Thursday June 30, 2011 @11:29PM
(#2716910)
Don't confuse SHA-512 hashing once with SHA-512 hashing 1000 times though.
[ Parent
| on HN ]
Re:Those 500K Bitcoins that caused the flash crash weren't real
by bradleyland on Friday July 01, 2011 @10:36AM
(#2718481)
No one is confused. SHA-512 is designed to be very, very fast. I just ran a very rudimentary test comparing SHA-512 and BCrypt with these results.
BCrypt 1000 iteration test script: https://gist.github.com/1058610
# => That took 76.370953 seconds
BCrypt 1 iteration test script: (same as above but with `1.times do`)
# => That took 0.074209 seconds
SHA512 1000 iteration test script:
# => That took 0.004092 seconds
SHA512 at 1000 iterations is over 18,000 times faster than BCrypt at similar iterations; which, by the way, makes no sense to do.
BCrypt has a "cost" factor, which is used to adjust the computational complexity to your use case. This is why BCrypt makes so much more sense for password encryption than something like SHA512. Running SHA512 n times is just a cheap, ineffective imitation of BCrypt.