| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The default cost has not changed since the initial checkin of the code in 2007. Computers have gotten faster in general and GPGPU password cracking became a thing. BCrypt::Engine.calibrate(250) returns 12 on my Intel Core i7-4870HQ.
|
Agreed — thanks! |
Sorry, something went wrong.
Test script
---
```ruby
require 'bcrypt'
require 'benchmark'
Benchmark.measure { BCrypt::Password.create('password', cost: 12) }
```
Test results
---
- [Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz](https://ark.intel.com/content/www/us/en/ark/products/97535/intel-core-i5-7360u-processor-4m-cache-up-to-3-60-ghz.html): `#<Benchmark::Tms:0x00007fdd00a4eb30 @Label="", @real=0.21730700000080105, @CsTime=0.0, @cutime=0.0, @stime=0.00020399999999999585, @utime=0.21685199999999996, @ToTal=0.21705599999999997>`
- [Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz](https://ark.intel.com/content/www/us/en/ark/products/137979/intel-core-i7-8559u-processor-8m-cache-up-to-4-50-ghz.html): `#<Benchmark::Tms:0x00007fe91094fd30 @Label="", @real=0.17964200000278652, @CsTime=0.0, @cutime=0.0, @stime=7.399999999996298e-05, @utime=0.17950799999999845, @ToTal=0.1795819999999984>`
Other gems
---
- bcrypt-ruby which is used by devise [updated](bcrypt-ruby/bcrypt-ruby#181) their default cost to 12 (not released a gem version yet).
- rails has [a PR](rails/rails#35321) from the Rails core team member to update their `ActiveModel::SecurePassword` which powers `has_secure_password` default cost to 13 (not merged yet).
Previous changes
---
[Previous PR](heartcombo#3549) to increase the default stretches to 12 was created more than 4 years ago. That time the default stretches value [was increased](heartcombo@9efc601) from 10 to 11.
| Back | FazBrowse Home | New Git URL |
The default cost has not changed since the initial checkin of the code in 2007. Computers have gotten faster in general and GPGPU password cracking became a thing.
BCrypt::Engine.calibrate(250) returns 12 on my Intel Core i7-4870HQ (mid-2015 Macbook). Some people argued in 2015 already that this should be the default so I think this is a pretty safe value to go with without too much bikeshedding.