Skip to content

Instantly share code, notes, and snippets.

@cyb3rko
Created September 5, 2021 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyb3rko/2c87b38f5a9f1afa15349d86106b80d4 to your computer and use it in GitHub Desktop.
Save cyb3rko/2c87b38f5a9f1afa15349d86106b80d4 to your computer and use it in GitHub Desktop.
Password Strength Estimation Script - Top 200 of 2020 (without additional dictionary)
import me.gosimple.nbvcxz.Nbvcxz
import java.io.File
fun main() {
val passwords = mutableListOf<String>()
File("my_passwords.txt").useLines { lines -> lines.forEach { passwords.add(it) }}
val nbvcxz = Nbvcxz()
File("results.csv").printWriter().use { out ->
out.append("Rank, Password, Basic Score (0-4), Entropy (0-multiple hundreds)\n")
passwords.forEachIndexed { index, s ->
val result = nbvcxz.estimate(s)
out.append("${index + 1}, $s, ${result.basicScore}, ${result.entropy}\n")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment