Was wondering if there was a reason its set so low by default, and if it shouldn't be 100,000 like Bitwarden now uses for their default? Or possibly a configurable option like how PASSWORD_ITERATIONS is for the server?
Originally created by @Ayitaka on GitHub (Sep 5, 2019).
In [src/db/models/user.rs](https://github.com/dani-garcia/bitwarden_rs/blob/1322b876e9113cc265e5a2b30f990c0d8ede716e/src/db/models/user.rs) I noticed the default client KDF iterations is 5000:
` pub const CLIENT_KDF_ITER_DEFAULT: i32 = 5_000;`
Was wondering if there was a reason its set so low by default, and if it shouldn't be 100,000 like [Bitwarden](https://help.bitwarden.com/article/what-encryption-is-used/) now uses for their default? Or possibly a configurable option like how PASSWORD_ITERATIONS is for the server?
Also note the default is set to 5000 in the migration scripts as well:
[migrations/mysql/2018-09-19-144557_add_kdf_columns/up.sql](https://github.com/dani-garcia/bitwarden_rs/blob/1322b876e9113cc265e5a2b30f990c0d8ede716e/migrations/mysql/2018-09-19-144557_add_kdf_columns/up.sql)
[migrations/sqlite/2018-09-19-144557_add_kdf_columns/up.sql](https://github.com/dani-garcia/bitwarden_rs/blob/1322b876e9113cc265e5a2b30f990c0d8ede716e/migrations/sqlite/2018-09-19-144557_add_kdf_columns/up.sql)
Thanks :)
Well at some point Bitwarden also used 5000 on the client and that's what I based the number on.
The default isn't really used anyway, as when you register an account, a kdfIterations is sent, which is set to 100000, and we use that value.
That said I'll change that default, to better reflect reality.
@dani-garcia commented on GitHub (Sep 5, 2019):
Well at some point Bitwarden also used 5000 on the client and that's what I based the number on.
The default isn't really used anyway, as when you register an account, a kdfIterations is sent, which is set to 100000, and we use that value.

That said I'll change that default, to better reflect reality.
Ahhh, I wondered about that. And no sense adding a setting since its overridden anyway. Good to know, thank you very much for clarifying!
closed
@Ayitaka commented on GitHub (Sep 5, 2019):
Ahhh, I wondered about that. And no sense adding a setting since its overridden anyway. Good to know, thank you very much for clarifying!
*closed*
This explains why I have this schema: client_kdf_type INTEGER NOT NULL DEFAULT 0, client_kdf_iter INTEGER NOT NULL DEFAULT 5000)
But when I check the latest migration scripts the it (client_kdf_iter) has become 100000.
But when looking into my rows, the value is always 100000, so i can confirm it got overridden.
@timaschew commented on GitHub (Dec 20, 2019):
This explains why I have this schema:
```client_kdf_type INTEGER NOT NULL DEFAULT 0, client_kdf_iter INTEGER NOT NULL DEFAULT 5000)```
But when I check the latest migration scripts the it (client_kdf_iter) has become **100000**.
But when looking into my rows, the value is always **100000**, so i can confirm it got overridden.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @Ayitaka on GitHub (Sep 5, 2019).
In src/db/models/user.rs I noticed the default client KDF iterations is 5000:
pub const CLIENT_KDF_ITER_DEFAULT: i32 = 5_000;Was wondering if there was a reason its set so low by default, and if it shouldn't be 100,000 like Bitwarden now uses for their default? Or possibly a configurable option like how PASSWORD_ITERATIONS is for the server?
Also note the default is set to 5000 in the migration scripts as well:
migrations/mysql/2018-09-19-144557_add_kdf_columns/up.sql
migrations/sqlite/2018-09-19-144557_add_kdf_columns/up.sql
Thanks :)
@dani-garcia commented on GitHub (Sep 5, 2019):
Well at some point Bitwarden also used 5000 on the client and that's what I based the number on.
The default isn't really used anyway, as when you register an account, a kdfIterations is sent, which is set to 100000, and we use that value.
That said I'll change that default, to better reflect reality.
@Ayitaka commented on GitHub (Sep 5, 2019):
Ahhh, I wondered about that. And no sense adding a setting since its overridden anyway. Good to know, thank you very much for clarifying!
closed
@timaschew commented on GitHub (Dec 20, 2019):
This explains why I have this schema:
client_kdf_type INTEGER NOT NULL DEFAULT 0, client_kdf_iter INTEGER NOT NULL DEFAULT 5000)But when I check the latest migration scripts the it (client_kdf_iter) has become 100000.
But when looking into my rows, the value is always 100000, so i can confirm it got overridden.