mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-08-18 11:08:05 -04:00
Implement Password Health Report
Introduce a password health check to the application that evaluates every entry in a database. Entries that fail various tests are listed for user review and action. Also moves the statistics panel to the new Database -> Reports widget. Recycled entries are excluded from the results. We now have two classes, PasswordHealth to deal with a single password and HealthChecker to deal with all passwords of a database. Tests include passwords that are expired, re-used, and weak. * Closes #551 * Move zxcvbn usage to a centralized class (PasswordHealth) and replace its usages across the application to ensure standardized interpretation of entropy calculations. * Add new icons for the database reports view * Updated the demo database to show off the reports
This commit is contained in:
parent
71a39c37ec
commit
a81c6469a8
38 changed files with 1364 additions and 75 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "cli/Utils.h"
|
||||
|
||||
#include "cli/TextStream.h"
|
||||
#include "core/PasswordHealth.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
@ -49,10 +50,9 @@ static void estimate(const char* pwd, bool advanced)
|
|||
{
|
||||
TextStream out(Utils::STDOUT, QIODevice::WriteOnly);
|
||||
|
||||
double e = 0.0;
|
||||
int len = static_cast<int>(strlen(pwd));
|
||||
if (!advanced) {
|
||||
e = ZxcvbnMatch(pwd, nullptr, nullptr);
|
||||
const auto e = PasswordHealth(pwd).entropy();
|
||||
// clang-format off
|
||||
out << QObject::tr("Length %1").arg(len, 0) << '\t'
|
||||
<< QObject::tr("Entropy %1").arg(e, 0, 'f', 3) << '\t'
|
||||
|
@ -62,7 +62,7 @@ static void estimate(const char* pwd, bool advanced)
|
|||
int ChkLen = 0;
|
||||
ZxcMatch_t *info, *p;
|
||||
double m = 0.0;
|
||||
e = ZxcvbnMatch(pwd, nullptr, &info);
|
||||
const auto e = ZxcvbnMatch(pwd, nullptr, &info);
|
||||
for (p = info; p; p = p->Next) {
|
||||
m += p->Entrpy;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue