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