|
|
@ -4,6 +4,7 @@ import java.io.StringReader; |
|
|
|
import java.math.BigInteger; |
|
|
|
import java.security.MessageDigest; |
|
|
|
import java.security.NoSuchAlgorithmException; |
|
|
|
import java.util.Locale; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
public class PasswordValidator { |
|
|
@ -135,12 +136,13 @@ public class PasswordValidator { |
|
|
|
|
|
|
|
public static boolean isInWordlist(String password) { |
|
|
|
try { |
|
|
|
String lowerPassword = password.toLowerCase(); |
|
|
|
ResourceApi resourceApi = new ResourceApi(); |
|
|
|
String germanWordlist = resourceApi.getFileFromResourceAsString("german_wordlist.txt"); |
|
|
|
BufferedReader bufReader = new BufferedReader(new StringReader(germanWordlist)); |
|
|
|
String line = null; |
|
|
|
while ((line = bufReader.readLine()) != null) { |
|
|
|
if (line.contains(password)) { |
|
|
|
if (lowerPassword.contains(line.trim().toLowerCase())) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|