|
|
@ -132,4 +132,22 @@ public class PasswordValidator { |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
public static boolean isInWordlist(String password) { |
|
|
|
try { |
|
|
|
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)) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
} |
|
|
|
} |