Skip to content

Commit b178051

Browse files
committed
Added help menu for ciphers and kdfs to know which one to use
1 parent 18d9178 commit b178051

File tree

3 files changed

+58
-6
lines changed

3 files changed

+58
-6
lines changed

include/mainwindow.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ private slots:
3333
void on_fileEncryptButton_clicked();
3434
void on_fileDecryptButton_clicked();
3535
void on_fileBrowseButton_clicked();
36-
void on_fileKeyfileBrowseButton_clicked(); // New slot
36+
void on_fileKeyfileBrowseButton_clicked();
3737
void on_folderEncryptButton_clicked();
3838
void on_folderDecryptButton_clicked();
3939
void on_folderBrowseButton_clicked();
40-
void on_folderKeyfileBrowseButton_clicked(); // New slot
40+
void on_folderKeyfileBrowseButton_clicked();
4141
void updateProgress(int value);
4242
void handleFinished(bool success, const QString &errorMessage);
4343
void showEstimatedTime(double seconds);
@@ -47,6 +47,8 @@ private slots:
4747
void on_actionExit_triggered();
4848
void on_actionPreferences_triggered();
4949
void on_actionAbout_triggered();
50+
void on_actionAboutCiphers_triggered(); // New slot
51+
void on_actionAboutKDFs_triggered(); // New slot
5052
void applyTheme(const QString &theme);
5153

5254
private:
@@ -67,7 +69,7 @@ private slots:
6769
void checkHardwareAcceleration();
6870

6971
static void messageHandler(QtMsgType type, const QMessageLogContext &context, const QString &msg);
70-
void updateBenchmarkTable(int iterations, double mbps, double ms, const QString &cipher, const QString &kdf); // Add this line
72+
void updateBenchmarkTable(int iterations, double mbps, double ms, const QString &cipher, const QString &kdf);
7173

7274
void safeConnect(const QObject* sender, const char* signal, const QObject* receiver, const char* method);
7375

src/mainwindow.cpp

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ void MainWindow::setupComboBoxes() {
107107
ui->fileAlgorithmComboBox->addItems(algorithms);
108108
ui->folderAlgorithmComboBox->addItems(algorithms);
109109

110-
QStringList kdfs = {"PBKDF2", "Argon2", "Scrypt"};
110+
QStringList kdfs = {"Argon2", "Scrypt", "PBKDF2"};
111+
111112
ui->kdfComboBox->addItems(kdfs);
112113
ui->folderKdfComboBox->addItems(kdfs);
113114

@@ -146,6 +147,8 @@ void MainWindow::connectSignalsAndSlots()
146147
safeConnect(ui->actionExit, SIGNAL(triggered()), this, SLOT(on_actionExit_triggered()));
147148
safeConnect(ui->actionPreferences, SIGNAL(triggered()), this, SLOT(on_actionPreferences_triggered()));
148149
safeConnect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(on_actionAbout_triggered()));
150+
safeConnect(ui->actionAboutCiphers, SIGNAL(triggered()), this, SLOT(on_actionAboutCiphers_triggered())); // New connection
151+
safeConnect(ui->actionAboutKDFs, SIGNAL(triggered()), this, SLOT(on_actionAboutKDFs_triggered())); // New connection
149152

150153
m_signalsConnected = true;
151154
}
@@ -290,7 +293,7 @@ void MainWindow::on_benchmarkButton_clicked()
290293
"AES-128-CBC", "AES-192-CBC", "Camellia-256-CBC", "Camellia-128-CBC"
291294
};
292295

293-
QStringList kdfs = {"PBKDF2", "Argon2", "Scrypt"};
296+
QStringList kdfs = {"Argon2", "Scrypt", "PBKDF2"};
294297

295298
worker->setBenchmarkParameters(algorithms, kdfs);
296299
QMetaObject::invokeMethod(worker, "runBenchmark", Qt::QueuedConnection);
@@ -473,3 +476,39 @@ void MainWindow::savePreferences()
473476

474477
settingsFile.close();
475478
}
479+
480+
void MainWindow::on_actionAboutCiphers_triggered() {
481+
QString aboutCiphersText = QString(
482+
"Top Ciphers for File Encryption:\n\n"
483+
"AES-256-GCM: Provides strong encryption with built-in data integrity and authentication. Highly recommended for file encryption due to its security and performance.\n\n"
484+
"ChaCha20-Poly1305: A secure cipher that is resistant to timing attacks. It is highly efficient on both software and hardware, and is suitable for environments where performance is critical.\n\n"
485+
"AES-256-CTR: A strong encryption mode suitable for stream encryption. It does not provide data integrity or authentication by itself, so it should be used with additional integrity checks.\n\n"
486+
"AES-256-CBC: A widely used encryption mode that provides strong encryption but does not include data integrity or authentication. It is suitable for file encryption but should be combined with a message authentication code (MAC) to ensure data integrity.\n\n"
487+
"Recommendation: For maximum security in file encryption, use AES-256-GCM or ChaCha20-Poly1305, as they provide both strong encryption and built-in data integrity and authentication."
488+
);
489+
490+
QMessageBox::information(this, "About Ciphers", aboutCiphersText);
491+
}
492+
493+
void MainWindow::on_actionAboutKDFs_triggered() {
494+
QString aboutKDFsText = QString(
495+
"Key Derivation Function (KDF) Information:\n\n"
496+
"Argon2:\n"
497+
" - Designed to resist both GPU and ASIC attacks.\n"
498+
" - Highly secure and the winner of the Password Hashing Competition (PHC).\n"
499+
" - Recommended for new applications requiring strong password hashing.\n\n"
500+
"Scrypt:\n"
501+
" - Designed to be highly memory-intensive, making it resistant to hardware attacks.\n"
502+
" - Suitable for environments where memory usage is not a constraint.\n\n"
503+
"PBKDF2:\n"
504+
" - Widely used and well-established.\n"
505+
" - Provides basic protection against brute-force attacks by increasing the computation required.\n"
506+
" - Recommended for compatibility with older systems and applications.\n\n"
507+
"Recommendation:\n"
508+
"For maximum security, Argon2 is the best choice due to its resistance to various types of attacks. "
509+
"If memory usage is a concern, Scrypt offers a good balance of security and performance. PBKDF2 should "
510+
"be used primarily for compatibility with existing systems."
511+
);
512+
513+
QMessageBox::information(this, "About KDFs", aboutKDFsText);
514+
}

ui/mainwindow.ui

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,13 @@
394394
<string>Help</string>
395395
</property>
396396
<addaction name="actionAbout"/>
397+
<addaction name="actionAboutCiphers"/>
398+
<addaction name="actionAboutKDFs"/>
397399
</widget>
398400
<addaction name="menuFile"/>
399401
<addaction name="menuEdit"/>
400402
<addaction name="menuHelp"/>
401403
</widget>
402-
<widget class="QStatusBar" name="statusbar"/>
403404
<action name="actionExit">
404405
<property name="text">
405406
<string>Exit</string>
@@ -415,6 +416,16 @@
415416
<string>About</string>
416417
</property>
417418
</action>
419+
<action name="actionAboutCiphers">
420+
<property name="text">
421+
<string>About Ciphers</string>
422+
</property>
423+
</action>
424+
<action name="actionAboutKDFs">
425+
<property name="text">
426+
<string>About KDFs</string>
427+
</property>
428+
</action>
418429
</widget>
419430
<customwidgets>
420431
<customwidget>

0 commit comments

Comments
 (0)