Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bcrypt - How many iterations/cost?

I've read some articles saying you should set the cost to be at least 16 (216), yet others say 8 or so is fine.

Is there any official standard for how high the cost should be set to?

like image 399
Obto Avatar asked Oct 01 '11 20:10

Obto


1 Answers

The cost you should use depends on how fast your hardware (and implementation) is.

Generally speaking a cost of 8 or 10 is fine -- there isn't any noticable delay. It's still a huge level of protection and far better than any home-grown solution using SHAs and salts. Once you upgrade your hardware you could increase the cost to 16. I would say that 16 is a little high at this time, and will probably result in noticeable (and annoying) delays. But if 16 works for you, by all means go for it!

like image 138
Joost Baaij Avatar answered Oct 19 '22 22:10

Joost Baaij