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

Different score for the password strength for the same string between TypeScript and Java versions #320

Open
him11 opened this issue May 10, 2022 · 5 comments

Comments

@him11
Copy link

him11 commented May 10, 2022

Hi.

I'm using zxcvbn libraries on back-end and front-end of an app.
For front-end: https://github.com/zxcvbn-ts/zxcvbn
For back-end: https://github.com/nulab/zxcvbn4j

The password strength score returned for the same password string, "Tiger@0177" is different for both the libraries. For TS version, it returns 3 (Strong) while for Java version, it returns 2 (Weak), which is giving a very bad UX for my users.

Can you suggest something why is this happening and is there a way to fix this issue? TIA.

@Emi75
Copy link

Emi75 commented May 16, 2022

Any support on this issue pls?

@Emi75
Copy link

Emi75 commented May 16, 2022

@him11 possible duplicate of nulab/zxcvbn4j#84

@MrWook
Copy link

MrWook commented May 17, 2022

Hey, the typescript library is a fork of this JS one and is not "official".
I forked it because this library is completely outdated. Which means the typescript port is an improved version with updated dictionaries, some fixes and new matchers.
You used the password Tiger@0177 which results in a scoring of 3 for the typescript port. In the original library this it has a scoring of 2 like in the java port that you are using.
That is because of the updated dictionaries. The password was splitted into Tiger and @0177.
In the Typescript port Tiger is ranked 256 in the password dictionary while in the original library it is ranked 210 which results in a different guess count. You could say that the cap isn't very big to move a whole score but the 210 is already pretty close to the scoring of 3.
All this can be seen in the comparison documentation of zxcvbn-ts https://zxcvbn-ts.github.io/zxcvbn/guide/comparison/

@Emi75
Copy link

Emi75 commented May 18, 2022

Thanks @MrWook
Looks like the TS unofficial porting is updated instead of the parent project and the related java porting.
I have reached the owner of the java porting
nulab/zxcvbn4j#84
but looks like they don't have bandwidth to work on that.
@MrWook what's your suggestion here?

@MrWook
Copy link

MrWook commented May 19, 2022

The problem on this one is that the original xato password list isn't available on the internet anymore. So you can't update it.
I wanted to get my hands on the collection #1 - collection #5 lists but i'm not really a dark web user :D
I think you have multiple options to handle this case:

  1. Use the backend library only and make api calls with a debounce on password typing. Or only validate the password on save
  2. Use the client library only
  3. If you have node installed on your server you could use a little js script that is called on your backend to check the password
  4. Maybe use https://github.com/GoSimpleLLC/nbvcxz instead of https://github.com/nulab/zxcvbn4j . It has has the same updated and feature like zxcvbn-ts but a few more that i had't have the time to work on yet.
    The last release was in 2020 but thats just because there isn't anything todo and it is kind of complete. The author is still active and helped me with the typescript port a lot

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

No branches or pull requests

3 participants