status-go icon indicating copy to clipboard operation
status-go copied to clipboard

feat: make kdf iterations configurable when creating a multiaccount

Open richard-ramos opened this issue 3 years ago • 4 comments
trafficstars

In SaveAccount and SaveAccountAndLogin, the account json (the first parameter) can have an optional kdfIterations attribute which should contain the number of PBKDF2 iterations. If this attribute is not specified, the default value 3200 is used (which is what we currently use for encrypting the database.

On desktop we should try using the default value of SQLCipher: 256000 and see the performance, and if it's not adequate, tune it until an acceptable value is reached. (i.e. NIST recommends at least 10000 iterations).

NOTE: This change only affects the number of KDF iterations used when creating a new database. I tried changing existing databases but ended up with out of memory errors. Perhaps the DB must be exported unencrypted, and then reencrypted with the new encryption settings?

NOTE for mobile testing: the following scenarios must be tested:

  • Login with an existing account
  • Login after changing the password
  • Exporting a database
  • New account creation
  • Creating an account with seed phrase
  • Creating an account with keycard

richard-ramos avatar Aug 11 '22 18:08 richard-ramos

Pull Request Checklist

  • [x] Have you updated the documentation, if impacted (e.g. docs.status.im)?
  • [x] Have you tested changes with mobile?
  • [x] Have you tested changes with desktop?

status-github-bot[bot] avatar Aug 11 '22 18:08 status-github-bot[bot]

Jenkins Builds

Click to see older builds (33)
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: 2c0f5e5c #1 2022-08-11 18:06:51 ~2 min linux :package:zip
:heavy_check_mark: 2c0f5e5c #1 2022-08-11 18:07:27 ~3 min ios :package:zip
:heavy_check_mark: 2c0f5e5c #1 2022-08-11 18:08:52 ~4 min android :package:aar
:heavy_check_mark: 59f88706 #2 2022-08-11 18:28:20 ~1 min ios :package:zip
:heavy_check_mark: 59f88706 #2 2022-08-11 18:28:53 ~2 min linux :package:zip
:heavy_check_mark: 59f88706 #2 2022-08-11 18:30:05 ~3 min android :package:aar
:heavy_check_mark: 9925608f #3 2022-08-11 18:45:59 ~1 min linux :package:zip
:heavy_check_mark: 9925608f #3 2022-08-11 18:46:24 ~1 min ios :package:zip
:heavy_check_mark: 9925608f #3 2022-08-11 18:47:38 ~3 min android :package:aar
:heavy_check_mark: 79b5b119 #4 2022-08-11 19:41:57 ~1 min linux :package:zip
:heavy_check_mark: 79b5b119 #4 2022-08-11 19:42:22 ~2 min ios :package:zip
:heavy_check_mark: 79b5b119 #4 2022-08-11 19:43:33 ~3 min android :package:aar
:heavy_check_mark: db4156e8 #5 2022-08-11 19:50:36 ~1 min linux :package:zip
:heavy_check_mark: db4156e8 #5 2022-08-11 19:50:50 ~1 min ios :package:zip
:heavy_check_mark: db4156e8 #5 2022-08-11 19:53:47 ~4 min android :package:aar
:heavy_check_mark: ffce2630 #6 2022-08-18 21:45:40 ~3 min ios :package:zip
:heavy_check_mark: ffce2630 #6 2022-08-18 21:53:06 ~11 min android :package:aar
:heavy_check_mark: ffce2630 #6 2022-08-18 21:55:00 ~12 min linux :package:zip
:heavy_check_mark: 31244de8 #7 2022-08-18 22:11:23 ~1 min ios :package:zip
:heavy_check_mark: 31244de8 #7 2022-08-18 22:17:10 ~7 min linux :package:zip
:heavy_check_mark: 31244de8 #7 2022-08-18 22:20:00 ~10 min android :package:aar
:heavy_check_mark: 2e860341 #8 2022-08-18 22:27:48 ~1 min ios :package:zip
:heavy_check_mark: 2e860341 #8 2022-08-18 22:28:53 ~2 min android :package:aar
:heavy_check_mark: 2e860341 #8 2022-08-18 22:30:15 ~4 min linux :package:zip
:heavy_check_mark: 3ae49cbd #9 2022-08-22 13:05:55 ~4 min ios :package:zip
:heavy_check_mark: 3ae49cbd #9 2022-08-22 13:13:07 ~11 min android :package:aar
:heavy_check_mark: 3ae49cbd #9 2022-08-22 13:15:08 ~13 min linux :package:zip
:heavy_check_mark: 1e7650ef #10 2022-08-22 19:35:18 ~2 min ios :package:zip
:heavy_check_mark: 1e7650ef #10 2022-08-22 19:35:33 ~2 min linux :package:zip
:heavy_check_mark: 1e7650ef #10 2022-08-22 19:38:14 ~4 min android :package:aar
:heavy_check_mark: d1734259 #11 2022-09-21 20:30:23 ~2 min linux :package:zip
:heavy_check_mark: d1734259 #11 2022-09-21 20:33:08 ~5 min android :package:aar
:heavy_check_mark: d1734259 #11 2022-09-21 20:33:10 ~5 min ios :package:zip
:grey_question: Commit :hash: Finished (UTC) Duration Platform Result
:heavy_check_mark: f409eb8b #12 2022-09-27 13:25:40 ~2 min linux :package:zip
:heavy_check_mark: f409eb8b #12 2022-09-27 13:27:00 ~3 min ios :package:zip
:heavy_check_mark: f409eb8b #12 2022-09-27 13:27:51 ~4 min android :package:aar
:heavy_check_mark: d7111383 #13 2022-09-27 20:22:32 ~2 min linux :package:zip
:heavy_check_mark: d7111383 #13 2022-09-27 20:22:36 ~2 min ios :package:zip
:heavy_check_mark: d7111383 #13 2022-09-27 20:24:41 ~4 min android :package:aar

status-im-auto avatar Aug 11 '22 18:08 status-im-auto

Hi @richard-ramos ! Can you rebase your PRs, please? As VERSION was bumped to 0.105.1, most PRs have conflicts now.

qoqobolo avatar Aug 22 '22 09:08 qoqobolo

Rebased!

richard-ramos avatar Aug 22 '22 13:08 richard-ramos