Bitwarden and its Argon2id settings

  • Release Candidate 6
    Guest:
    We are at a “proposed final” true release candidate with nothing known remaining to be changed or fixed. For the full story, please see this page in the "Pre-Release Announcements & Feedback" forum.
    /Steve.
  • Be sure to checkout “Tips & Tricks”
    Dear Guest Visitor → Once you register and log-in:

    This forum does not automatically send notices of new content. So if, for example, you would like to be notified by mail when Steve posts an update to his blog (or of any other specific activity anywhere else), you need to tell the system what to “Watch” for you. Please checkout the “Tips & Tricks” page for details about that... and other tips!

    /Steve.

Guy

Member
Oct 4, 2020
10
4
Hooksett, NH
Hey all.
Just wanted to get the expert's take on what the settings should be for decent protection when using Bitwarden's new Argon2id KDF algorithm. I don't want to switch over just to find out I have my settings too low, and I don't want to crank it up and stall out my devices while unlocking.

Defaults for Argon2id seem to be 3 KDF iterations (wow that seems low!), 64 MB KDF memory, and 4 KDF Parallelism. @Steve hasn't mentioned these settings as of yet.

Are those defaults sufficient or should they be raised? if so.. by how much?

Thanks all!
 

Attachments

  • BW Argon.jpg
    BW Argon.jpg
    11.2 KB · Views: 174
  • Like
Reactions: Gilles
Well start with the fact that key stretching is NOT protection, it's just delay. For safety and security, you should start with a long and strong password to begin with. A passphrase of 25+ characters should be good enough protection for any situation, even one where a key stretching algorithm is not used.
 
  • Like
Reactions: Gilles
I think the ideal settings settings would probably depend on what devices you are using. For example, I was reading that the maximum you can really handle for Parallelism is double the number of CPU cores that you have.

So if all of your devices have 2 or more CPU cores, you can use 4 KDF parallelism. If you have single core devices, you have to drop that to 2. If all your devices are quad core or better, you can make it 8.

I get the impression that with these settings, you'd probably actually make Bitwarden outright on some of your devices not work if you set this stuff too strongly (vs PBKDF2 where it just slows it down a bit).
 
  • Like
Reactions: Gilles
Another fun note, it seems the way they did Argon2 in the browser extensions, they're signal threaded. It's possible browsers have yet to support enough WebAssembly to handle multiple threads, or the WebAssembly builds of Argon2 that Bitwarden can trust will work dependably at least can only run in single thread mode for now (I have seen test pages in which does have multi-thread support, and something else that at least Safari didn't support (SMID or something) which does speed things up)
 
  • Like
Reactions: Gilles
Interesting - that contradicts what I said before - if it's running single threaded, then what I read would suggest that it should never be higher than 2 KDF parallelism. But I've got mine set to 4, and it performs better on my desktop browser than it does with the app on either Android tablet or phone.
 
If your desktop run laps around your Android devices, then I assume that the way it's implemented, your desktop can run 4 parallel threads in a single tread faster.

Also, it's very much possible that what I read about the browser extensions being single threaded is wrong. Bitwarden might have used Web Workers to allow multi-threading in extensions anyway.
 
The KeePass article is indeed helpful. I also made a post regarding this in another thread here, though it's not as detailed as the KeePass article.

BitWarden adopted Argon2id as it's the most recommended variant, but the KeePass article is correct that 2d and 2id are a different and that client applications can choose 2d as they are less concerned with side-channel attacks. Servers have to worry more about side-channel attacks, so 2id has become fairly ubiquitous. BitWarden opted to go with 2id as it's the most recommended variant and is likely the safest choice to use across clients and servers. People like having 1 standard option and not multiples. AES-256 and SHA-256 became near-universal standards despite the existence of variants and I suspect that Argon2id will become the standard for Argon as it's a reasonable compromise between 2i and 2d.

I wouldn't worry too much about threading as requesting more threads than logical cores does not seem to slow performance to any substantial degree; I can't even measure an average difference. I cover this a bit more in the linked post.