Skip to content

[Discussion] Raise BCrypt default cost factor for current computing power - #2360

Merged
sgdc3 merged 1 commit into
masterfrom
2356-bcrypt-raise-default
Jun 24, 2021
Merged

sgdc3 merged 1 commit into
masterfrom
2356-bcrypt-raise-default

Conversation

@TuxCoding

@TuxCoding TuxCoding commented Jun 19, 2021 •

Copy link
Copy Markdown
Member

Based on the discussion #2356, there was the suggestion to raise the default BCrypt cost factor. This is necessary to accommodate todays increased computing power with the goal to slow down brute force attempts against leaked databases.

Notes:

  • BCrypt is insecure against massively parallel GPU hashing, ASICS and FPGA (low memory requirements)
  • Cost factor is a user configurable setting
  • BCrypt is not our default algorithm
  • Default in other software:
    • PHP: 10
    • Some Rust crates: 12
    • Ruby: 12
    • Golang: 10

Benchmark (JMH) from our BCrypt library with i7700k:
https://github.com/patrickfav/bcrypt#performance

cost 6 cost 8 cost 10 cost 12 cost 14
jBcrypt 3.43 ms 13.75 ms 54.76 ms 218.62 ms 883.55 ms
  • Sources imply that the common recommendation is to target 250ms

Advantages:

  • Better protection against brute force attacks so it slows down the attacker

Disadvantages:

  • Lower performance with weaker hardware low budget systems
  • Impact for DOS impacts
  • Maybe not so important for Minecraft, I guess?

Opinion:
I think we can implement the changes. DOS attacks should be implemented with other means.

@sgdc3
sgdc3 self-requested a review June 21, 2021 14:24
@sgdc3
sgdc3 requested a review from ljacqu June 21, 2021 14:24
@sgdc3
sgdc3 merged commit e7338f7 into master Jun 24, 2021
@sgdc3
sgdc3 deleted the 2356-bcrypt-raise-default branch June 24, 2021 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants