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

Sanitized Inputs seems a little ignored... #52

Open
er1c opened this issue Sep 21, 2018 · 2 comments
Open

Sanitized Inputs seems a little ignored... #52

er1c opened this issue Sep 21, 2018 · 2 comments

Comments

@er1c
Copy link
Contributor

er1c commented Sep 21, 2018

import com.nulabinc.zxcvbn.{Feedback, Strength, Zxcvbn}
import scala.collection.JavaConverters._

val zxcvbn: Zxcvbn = new Zxcvbn()
val measurement = zxcvbn.measure("demo_formule2", Seq("demo", "demoformule1", "demo_formule1", "demoformule", "formule", "formule1").asJava)

scala> measurement.getScore
res2: Int = 3

scala> measurement.getFeedback.getSuggestions
res5: java.util.List[String] = []

scala> measurement.getFeedback.getWarning
res6: String = ""

I don't have a comparison to the official dropbox version of Zxcvbn, but I expected the score to get calculated less than "good" based upon the current username (demo_formule1) password being passed in as the sanitizedInputs.

Is this expected behavior, or is there some other tweak I should be making?

@er1c
Copy link
Contributor Author

er1c commented Sep 21, 2018

I think I want something like the "Levenshtein Distance" (https://en.wikipedia.org/wiki/Levenshtein_distance) score between the dictionary values. I can compute that in a separate code path.

@Tostino
Copy link

Tostino commented Dec 11, 2018

Not to be a jerk and promote another library in this one's issues... but Nbvcxz (https://github.com/GoSimpleLLC/nbvcxz) does implement LD calculations for dictionary values. It's been one of the most worth while enhancements i've made as far as improving the seemingly common misspellings which do not get caught by a straight dictionary lookup.

If you don't feel like changing libraries, feel free to look at how I hooked the LD calculation into Nbvcxz for inspiration on how to implement it in zxcvbn4j (I just used the Apache Commons algorithm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants