FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Bump default cost to 12 by bdewater · Pull Request #181 · bcrypt-ruby/bcrypt-ruby · GitHub

Repository navigation

Bump default cost to 12 - #181

Merged
tjschuck merged 1 commit into
bcrypt-ruby:masterfrom
bdewater:bump-default-cost-12
Nov 13, 2018
Merged

tjschuck merged 1 commit into
bcrypt-ruby:masterfrom
bdewater:bump-default-cost-12

Conversation

bdewater commented Sep 3, 2018 •
edited
Loading

Copy link
Copy Markdown
Contributor

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.

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.

Copy link
Copy Markdown
Collaborator

Agreed — thanks!

tjschuck merged commit 05d8187 into bcrypt-ruby:master Nov 13, 2018
tjschuck added a commit that referenced this pull request Nov 13, 2018
bdewater deleted the bump-default-cost-12 branch November 14, 2018 16:23
sergey-alekseev added a commit to sergey-alekseev/devise that referenced this pull request May 11, 2019
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL