-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Correct Argon2 settings when creating new database #11853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #11853 +/- ##
===========================================
- Coverage 63.92% 63.89% -0.03%
===========================================
Files 369 370 +1
Lines 38920 38921 +1
===========================================
- Hits 24878 24868 -10
- Misses 14042 14053 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 sounds a bit low to me. What about using idealThreadCount(), but cap it to, say, 8.
The way parallelism works in argon2 is that it divides the total memory (e.g., 64 MiB) by the parallelism number (called a lane) and then performs the argon2 algorithm on each lane at the same time. So if you make parallelism 8 but keep memory at 64 MiB, you actually don't improve security at all. But if you want to set memory to 512 MiB, you can set parallelism to 8, and the total time will stay the same as 64 MiB and parallelism of 1. This ultimately reduces the capability of a GPU attack, but only if you also increase memory. This is a good writeup: https://community.bitwarden.com/t/argon2id-parallelism-explanation/54189/6 At the end of the day, I think a max default of 4 is fine, but we should also be upping the default memory by the parallelism perhaps? |
Capping it a four is fine with me as well. Just up the memory cost accordingly as well. |
* Argon2 default parallelism settings were set to the number of threads on the computer. That is excessive on high cpu count computers.
3832ba0
to
6b36b33
Compare
See #11852 (comment)
Testing strategy
Tested manually and unit tests
Type of change