Skip to content

Commit

Permalink
Removing password output from Estimate. (keepassxreboot#1281)
Browse files Browse the repository at this point in the history
* Removing password output from Estimate.

* clang-format
  • Loading branch information
louib authored Dec 15, 2017
1 parent 5784585 commit 8b1c8f6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/cli/Estimate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ Estimate::~Estimate()
{
}

static void calculate(const char* pwd, bool advanced)
static void estimate(const char* pwd, bool advanced)
{
double e;
int len = strlen(pwd);
if (!advanced) {
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 {
int ChkLen;
ZxcMatch_t *info, *p;
Expand All @@ -58,12 +58,7 @@ static void calculate(const char* pwd, bool advanced)
m += p->Entrpy;
}
m = e - m;
printf("Pass '%s' \tLength %d\tEntropy %.3f\tLog10 %.3f\n Multi-word extra bits %.1f\n",
pwd,
len,
e,
e * 0.301029996,
m);
printf("Length %d\tEntropy %.3f\tLog10 %.3f\n Multi-word extra bits %.1f\n", len, e, e * 0.301029996, m);
p = info;
ChkLen = 0;
while (p) {
Expand Down Expand Up @@ -170,6 +165,6 @@ int Estimate::execute(QStringList arguments)
password = inputTextStream.readLine();
}

calculate(password.toLatin1(), parser.isSet(advancedOption));
estimate(password.toLatin1(), parser.isSet(advancedOption));
return EXIT_SUCCESS;
}

0 comments on commit 8b1c8f6

Please sign in to comment.