mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-13 16:56:03 -04:00
Removing password output from Estimate. (#1281)
* Removing password output from Estimate. * clang-format
This commit is contained in:
parent
57845851c0
commit
8b1c8f69f7
1 changed files with 4 additions and 9 deletions
|
@ -42,13 +42,13 @@ Estimate::~Estimate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calculate(const char* pwd, bool advanced)
|
static void estimate(const char* pwd, bool advanced)
|
||||||
{
|
{
|
||||||
double e;
|
double e;
|
||||||
int len = strlen(pwd);
|
int len = strlen(pwd);
|
||||||
if (!advanced) {
|
if (!advanced) {
|
||||||
e = ZxcvbnMatch(pwd, 0, 0);
|
e = ZxcvbnMatch(pwd, 0, 0);
|
||||||
printf("Pass '%s' \tLength %d\tEntropy %.3f\tLog10 %.3f\n", pwd, len, e, e * 0.301029996);
|
printf("Length %d\tEntropy %.3f\tLog10 %.3f\n", len, e, e * 0.301029996);
|
||||||
} else {
|
} else {
|
||||||
int ChkLen;
|
int ChkLen;
|
||||||
ZxcMatch_t *info, *p;
|
ZxcMatch_t *info, *p;
|
||||||
|
@ -58,12 +58,7 @@ static void calculate(const char* pwd, bool advanced)
|
||||||
m += p->Entrpy;
|
m += p->Entrpy;
|
||||||
}
|
}
|
||||||
m = e - m;
|
m = e - m;
|
||||||
printf("Pass '%s' \tLength %d\tEntropy %.3f\tLog10 %.3f\n Multi-word extra bits %.1f\n",
|
printf("Length %d\tEntropy %.3f\tLog10 %.3f\n Multi-word extra bits %.1f\n", len, e, e * 0.301029996, m);
|
||||||
pwd,
|
|
||||||
len,
|
|
||||||
e,
|
|
||||||
e * 0.301029996,
|
|
||||||
m);
|
|
||||||
p = info;
|
p = info;
|
||||||
ChkLen = 0;
|
ChkLen = 0;
|
||||||
while (p) {
|
while (p) {
|
||||||
|
@ -170,6 +165,6 @@ int Estimate::execute(QStringList arguments)
|
||||||
password = inputTextStream.readLine();
|
password = inputTextStream.readLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
calculate(password.toLatin1(), parser.isSet(advancedOption));
|
estimate(password.toLatin1(), parser.isSet(advancedOption));
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue