|
@@ -14,9 +14,9 @@ import java.util.List;
|
|
|
import javax.inject.Inject;
|
|
|
import javax.inject.Singleton;
|
|
|
|
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
import org.cryptomator.ui.l10n.Localization;
|
|
|
|
|
|
+import com.google.common.base.Strings;
|
|
|
import com.nulabinc.zxcvbn.Zxcvbn;
|
|
|
|
|
|
import javafx.geometry.Insets;
|
|
@@ -41,8 +41,10 @@ public class PasswordStrengthUtil {
|
|
|
}
|
|
|
|
|
|
public int computeRate(String password) {
|
|
|
- if (StringUtils.isEmpty(password)) {
|
|
|
+ if (Strings.isNullOrEmpty(password)) {
|
|
|
return -1;
|
|
|
+ } else if (password.length() > 100) {
|
|
|
+ return 4; // assume this is strong. zxcvbn memory and runtime depends vastly on the password length
|
|
|
} else {
|
|
|
return zxcvbn.measure(password, sanitizedInputs).getScore();
|
|
|
}
|