Skip to content

Commit 6924fb2

Browse files
author
bram
committed
Added tests for wiping
1 parent f53729a commit 6924fb2

File tree

6 files changed

+890
-4
lines changed

6 files changed

+890
-4
lines changed

include/encryptionengine.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,18 @@ class EncryptionEngine
6060
bool encryptDisk(const QString& diskPath, const QString& password, const QString& algorithm, const QString& kdf, int iterations, bool useHMAC, const QStringList& keyfilePaths = QStringList());
6161
bool decryptDisk(const QString& diskPath, const QString& password, const QString& algorithm, const QString& kdf, int iterations, bool useHMAC, const QStringList& keyfilePaths = QStringList());
6262

63+
// Disk wiping methods
64+
bool secureWipeDisk(const QString& diskPath, int passes = 3, bool verifyWipe = true);
65+
bool secureWipePartition(const QString& partitionPath, int passes = 3);
66+
enum class WipePattern {
67+
ZEROS,
68+
ONES,
69+
RANDOM,
70+
DOD_SHORT, // DoD 5220.22-M short (3 passes)
71+
DOD_FULL, // DoD 5220.22-M full (7 passes)
72+
GUTMANN // Peter Gutmann's 35-pass method
73+
};
74+
6375
// Hidden volume support - encrypt/decrypt specific section of disk
6476
bool encryptDiskSection(const QString& diskPath, const QString& password, const QString& algorithm, const QString& kdf, int iterations, bool useHMAC, const QStringList& keyfilePaths, qint64 startOffset, qint64 sectionSize);
6577
bool decryptDiskSection(const QString& diskPath, const QString& password, const QString& algorithm, const QString& kdf, int iterations, bool useHMAC, const QStringList& keyfilePaths, qint64 startOffset, qint64 sectionSize);
@@ -150,6 +162,10 @@ class EncryptionEngine
150162
void updateEntropyHealthMetrics(const EntropyTestResult& result);
151163
void hashWhitenData(const QByteArray& input, QByteArray& output);
152164

165+
// Disk wiping helpers
166+
bool writeWipePattern(QFile& diskFile, WipePattern pattern, qint64 size, int passNumber, int totalPasses);
167+
bool verifyWipePattern(QFile& diskFile, WipePattern pattern, qint64 size);
168+
153169
// Entropy health status metrics
154170
mutable QMutex m_entropyMetricsMutex;
155171
QString m_entropyHealthStatus = "Unknown";

include/mainwindow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ private slots:
6161
void on_diskBrowseButton_clicked();
6262
void on_diskKeyfileBrowseButton_clicked();
6363
void on_refreshDisksButton_clicked();
64+
void on_diskSecureWipeCheckBox_toggled(bool checked);
65+
void on_wipePatternComboBox_currentIndexChanged(int index);
6466
void updateProgress(int value);
6567
void handleFinished(bool success, const QString &errorMessage);
6668
void showEstimatedTime(double seconds);

0 commit comments

Comments
 (0)