Skip to content
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

raise PBKDF2 iterations in backward compatible way #160

Merged
merged 6 commits into from
Mar 1, 2023

Conversation

robinmoisson
Copy link
Owner

@robinmoisson robinmoisson commented Feb 26, 2023

Following the discussion on #159 , this PR does the following:

  • raise the number of PBKDF2 iterations in a backward compatible way
  • when parsing and upgrading a legacy remember-me hash from 1k to Xk iterations, update the saved hash in localStorage (so that we don't need to recompute the upgrade on each page, we save the upgraded hash after we computed it once and it's now not legacy anymore)
  • show a warning to users who are using a custom password_template
  • the warning points to a github issue with easy instructions to follow to update your password_template
  • update the README to detail what's a good password
  • warn the user if they are using a weak password and suggests a better one

I tested:

  • encrypting from 2.2 with remember-me / auto-decrypt link, then re-encrypting with this PR: the autodecryption work correctly
  • encrypting with a custom password_template from <2.2: the encryption is done with 1k and a warning message is shown as expected

I'm not yet sure what will be the final iteration count, as the JS implementation is pretty slow and we don't want to impact decrypting users too much. 50k is definitely noticeable, around 1s on a decent CPU.

I think the order of magnitude is what matters: going from 1k to 10k is significant, going from 15k to 50k maybe not so much, so I'll test a little more.

Once that's done and merged in 2.x, another PR will update 1.x.

Legacy template:
Screenshot from 2023-02-26 11-56-18

Short password:
Screenshot from 2023-03-01 18-45-01

@robinmoisson robinmoisson self-assigned this Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant