From e75f10addc9c91b35c7d3bc398576c8f98b9856d Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Mon, 20 Apr 2020 08:18:19 +0200 Subject: [PATCH 1/9] Bug Fixed and Fixed Crashes --- LICENSE | 0 PKGBUILD_amd64 | 2 +- PKGBUILD_arm64 | 2 +- README.md | 0 control_amd64 | 2 +- control_arm64 | 2 +- main.cpp | 6 +++--- mainwindow.cpp | 46 +++++++++++++++++++++++++++++++++++++++++--- mainwindow.h | 0 mainwindow.ui | 0 makearchpkg.sh | 0 makedebpkg.sh | 0 parameterparser.cpp | 0 parameterparser.h | 0 passman.cpp | 0 passman.h | 0 passman.pro | 0 passman_icon.svg | 0 qaesencryption.cpp | 0 qaesencryption.h | 0 resources.qrc | 0 screenshot.png | Bin 22 files changed, 50 insertions(+), 10 deletions(-) mode change 100644 => 100755 LICENSE mode change 100644 => 100755 PKGBUILD_amd64 mode change 100644 => 100755 PKGBUILD_arm64 mode change 100644 => 100755 README.md mode change 100644 => 100755 control_amd64 mode change 100644 => 100755 control_arm64 mode change 100644 => 100755 main.cpp mode change 100644 => 100755 mainwindow.cpp mode change 100644 => 100755 mainwindow.h mode change 100644 => 100755 mainwindow.ui mode change 100644 => 100755 makearchpkg.sh mode change 100644 => 100755 makedebpkg.sh mode change 100644 => 100755 parameterparser.cpp mode change 100644 => 100755 parameterparser.h mode change 100644 => 100755 passman.cpp mode change 100644 => 100755 passman.h mode change 100644 => 100755 passman.pro mode change 100644 => 100755 passman_icon.svg mode change 100644 => 100755 qaesencryption.cpp mode change 100644 => 100755 qaesencryption.h mode change 100644 => 100755 resources.qrc mode change 100644 => 100755 screenshot.png diff --git a/LICENSE b/LICENSE old mode 100644 new mode 100755 diff --git a/PKGBUILD_amd64 b/PKGBUILD_amd64 old mode 100644 new mode 100755 index b5af069..6354c80 --- a/PKGBUILD_amd64 +++ b/PKGBUILD_amd64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.2 +pkgver=1.0.3 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('x86_64') diff --git a/PKGBUILD_arm64 b/PKGBUILD_arm64 old mode 100644 new mode 100755 index e1c2532..fd0ad5f --- a/PKGBUILD_arm64 +++ b/PKGBUILD_arm64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.2 +pkgver=1.0.3 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('aarch64') diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/control_amd64 b/control_amd64 old mode 100644 new mode 100755 index 60fec78..137f86d --- a/control_amd64 +++ b/control_amd64 @@ -1,5 +1,5 @@ Package: passman -Version: 1.0.2 +Version: 1.0.3 Section: utils Priority: optional Architecture: amd64 diff --git a/control_arm64 b/control_arm64 old mode 100644 new mode 100755 index 985ab9e..a6b0d18 --- a/control_arm64 +++ b/control_arm64 @@ -1,5 +1,5 @@ Package: passman -Version: 1.0.2 +Version: 1.0.3 Section: utils Priority: optional Architecture: arm64 diff --git a/main.cpp b/main.cpp old mode 100644 new mode 100755 index 9b7702b..325012d --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) { - QString version = "1.0.2"; + QString version = "1.0.3"; if (argc == 1) { @@ -32,8 +32,8 @@ int main(int argc, char *argv[]) std::cout << "-h | --help | Shows this Help Screen\n"; std::cout << "-p | --pass | Input Password\n"; std::cout << "-d | --create-database | Creates new Database if it doesn't already exist\n"; - std::cout << "-n | --new | Creates new Database Entry\n"; - std::cout << "-r | --remove | Removes Database Entry\n"; + std::cout << "-n | --new | Creates new Database Entry\n"; + std::cout << "-r | --remove | Removes Database Entry\n"; std::cout << "-b | --backup | Makes Database Backup\n"; std::cout << "-a | --show-all | Shows all Database Entries\n"; std::cout << "-s | --show | Shows all Database Entries for given Website\n\n"; diff --git a/mainwindow.cpp b/mainwindow.cpp old mode 100644 new mode 100755 index 9b154d7..a35bf16 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -77,6 +77,8 @@ void MainWindow::decrypt_database() ui->tableWidgetCredentials->setHorizontalHeaderLabels({"Website", "Username", "Password", "Note"}); ui->tableWidgetCredentials->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); + + ui->lineEditSearch->setFocus(); } void MainWindow::backup_database() @@ -128,7 +130,21 @@ void MainWindow::remove_entry() { QList selected = ui->tableWidgetCredentials->selectedItems(); - saved = selected.size() <= 0; + if (selected.size() > 0) + { + saved = false; + } + + int last_row = -1; + for (int i = 0; i < selected.size(); i++) + { + if (last_row == selected[i]->row()) + { + selected.removeAt(i--); + continue; + } + last_row = selected[i]->row(); + } for (QTableWidgetItem* item : selected) { @@ -140,7 +156,21 @@ void MainWindow::generate_password() { QList selected = ui->tableWidgetCredentials->selectedItems(); - saved = selected.size() <= 0; + if (selected.size() > 0) + { + saved = false; + } + + int last_row = -1; + for (int i = 0; i < selected.size(); i++) + { + if (last_row == selected[i]->row()) + { + selected.removeAt(i--); + continue; + } + last_row = selected[i]->row(); + } for (QTableWidgetItem* item : selected) { @@ -247,7 +277,17 @@ void MainWindow::on_tableWidgetCredentials_itemChanged() void MainWindow::on_tableWidgetCredentials_itemSelectionChanged() { - if (ui->tableWidgetCredentials->selectedItems().size() > 1) + QList selected = ui->tableWidgetCredentials->selectedItems(); + + int count = 0; + int last_row = -1; + for (QTableWidgetItem* item : selected) + { + if (last_row != item->row()) count++; + last_row = item->row(); + } + + if (count > 1) { ui->pushButtonRemoveEntry->setText("Remove Selected Entries"); } else { diff --git a/mainwindow.h b/mainwindow.h old mode 100644 new mode 100755 diff --git a/mainwindow.ui b/mainwindow.ui old mode 100644 new mode 100755 diff --git a/makearchpkg.sh b/makearchpkg.sh old mode 100644 new mode 100755 diff --git a/makedebpkg.sh b/makedebpkg.sh old mode 100644 new mode 100755 diff --git a/parameterparser.cpp b/parameterparser.cpp old mode 100644 new mode 100755 diff --git a/parameterparser.h b/parameterparser.h old mode 100644 new mode 100755 diff --git a/passman.cpp b/passman.cpp old mode 100644 new mode 100755 diff --git a/passman.h b/passman.h old mode 100644 new mode 100755 diff --git a/passman.pro b/passman.pro old mode 100644 new mode 100755 diff --git a/passman_icon.svg b/passman_icon.svg old mode 100644 new mode 100755 diff --git a/qaesencryption.cpp b/qaesencryption.cpp old mode 100644 new mode 100755 diff --git a/qaesencryption.h b/qaesencryption.h old mode 100644 new mode 100755 diff --git a/resources.qrc b/resources.qrc old mode 100644 new mode 100755 diff --git a/screenshot.png b/screenshot.png old mode 100644 new mode 100755 From 7de7a8ef8adf137a172b111dcfacdbde92a8b277 Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Mon, 20 Apr 2020 08:22:11 +0200 Subject: [PATCH 2/9] Edited help screen.... Again --- main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index 325012d..60dfaa3 100755 --- a/main.cpp +++ b/main.cpp @@ -32,8 +32,8 @@ int main(int argc, char *argv[]) std::cout << "-h | --help | Shows this Help Screen\n"; std::cout << "-p | --pass | Input Password\n"; std::cout << "-d | --create-database | Creates new Database if it doesn't already exist\n"; - std::cout << "-n | --new | Creates new Database Entry\n"; - std::cout << "-r | --remove | Removes Database Entry\n"; + std::cout << "-n | --new | Creates new Database Entry\n"; + std::cout << "-r | --remove | Removes Database Entry\n"; std::cout << "-b | --backup | Makes Database Backup\n"; std::cout << "-a | --show-all | Shows all Database Entries\n"; std::cout << "-s | --show | Shows all Database Entries for given Website\n\n"; From 512445c47c896508d0020eb0142f4264a8a37d59 Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sun, 23 Aug 2020 03:34:00 +0200 Subject: [PATCH 3/9] Improved Comments --- main.cpp | 10 ++++++++++ mainwindow.cpp | 33 ++++++++++++++++++++++++++------- mainwindow.h | 30 +++++++++++++++--------------- parameterparser.h | 3 ++- passman.cpp | 5 ----- passman.h | 34 +++++++++++++++++----------------- 6 files changed, 70 insertions(+), 45 deletions(-) diff --git a/main.cpp b/main.cpp index 60dfaa3..3dc29bb 100755 --- a/main.cpp +++ b/main.cpp @@ -8,6 +8,7 @@ int main(int argc, char *argv[]) { QString version = "1.0.3"; + //Run GUI if no arguments are passed if (argc == 1) { QApplication a(argc, argv); @@ -25,6 +26,7 @@ int main(int argc, char *argv[]) parameterparser parameter_parser(argc, argv); passman password_manager; + //Print help ccreen if (parameter_parser.has_parameter("help", 'h')) { std::cout << "Passman v" << version.toStdString() << " - A Simple Password Manager with AES-256 Encryption by Aslan2142\n\n"; @@ -46,6 +48,7 @@ int main(int argc, char *argv[]) return 0; } + //Load password from an argument (if present) std::string password = parameter_parser.get_value("pass", 'p'); if (password.compare("-") == 0) { @@ -53,6 +56,7 @@ int main(int argc, char *argv[]) } password_manager.key = QString::fromStdString(password); + //Create database if (parameter_parser.has_parameter("create-database", 'd')) { if (password_manager.database_exists()) @@ -71,6 +75,7 @@ int main(int argc, char *argv[]) } } + //Print main errors (if occured) if (!password_manager.load()) { std::cerr << "Error Loading Database" << std::endl; @@ -82,6 +87,7 @@ int main(int argc, char *argv[]) return 2; } + //Create new entry std::string new_entry = parameter_parser.get_value("new", 'n'); if (new_entry.compare("-") != 0) { @@ -98,6 +104,7 @@ int main(int argc, char *argv[]) password_manager.save(); } + //Remove an entry std::string remove_entry = parameter_parser.get_value("remove", 'r'); if (remove_entry.compare("-") != 0) { @@ -131,11 +138,13 @@ int main(int argc, char *argv[]) password_manager.save(); } + //Backup database if (parameter_parser.has_parameter("backup", 'b')) { password_manager.backup(); } + //Show all entries if (parameter_parser.has_parameter("show-all", 'a')) { const std::vector> database = password_manager.get_database_copy(); @@ -145,6 +154,7 @@ int main(int argc, char *argv[]) } } + //Search and show entries by website std::string show_website = parameter_parser.get_value("show", 's'); if (show_website.compare("-") != 0) { diff --git a/mainwindow.cpp b/mainwindow.cpp index a35bf16..618ad64 100755 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -26,7 +26,7 @@ MainWindow::~MainWindow() void MainWindow::decrypt_database() { - //Load and Decrypt Database + //Load and decrypt database password_manager.key = ui->lineEditEncryptionKey->text(); if (!password_manager.load()) @@ -45,7 +45,7 @@ void MainWindow::decrypt_database() ui->labelDatabaseInfo->setText("Database Loaded"); ui->labelEncryptionInfo->setText("Database Decrypted"); - //Fill up the Table + //Fill up the table std::vector> database = password_manager.get_database_copy(); ui->tableWidgetCredentials->clear(); @@ -62,7 +62,7 @@ void MainWindow::decrypt_database() saved = true; - //Enable/Disable UI Elements + //Enable/Disable UI elements ui->pushButtonUnlock->setEnabled(false); ui->lineEditEncryptionKey->setEnabled(false); @@ -75,6 +75,7 @@ void MainWindow::decrypt_database() ui->lineEditSearch->setEnabled(true); ui->tableWidgetCredentials->setEnabled(true); + //Set UI collumn names ui->tableWidgetCredentials->setHorizontalHeaderLabels({"Website", "Username", "Password", "Note"}); ui->tableWidgetCredentials->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); @@ -83,6 +84,7 @@ void MainWindow::decrypt_database() void MainWindow::backup_database() { + //Backup the database if it exists if (password_manager.backup()) { ui->labelDatabaseInfo->setText("Database Backup Complete"); @@ -93,18 +95,22 @@ void MainWindow::backup_database() void MainWindow::save_database() { + //Clear old database data password_manager.clear_database(); std::array tmp_row; for (int i = 0; i < ui->tableWidgetCredentials->rowCount(); i++) { + //Get the data from the row for (int j = 0; j < 4; j++) { tmp_row[static_cast(j)] = ui->tableWidgetCredentials->item(i, j)->text(); } + //Add the row data to the database password_manager.add_entry(tmp_row[0], tmp_row[1], tmp_row[2], tmp_row[3]); } + //Encrypt and save the database onto a drive password_manager.encrypt(); password_manager.save(); @@ -115,12 +121,13 @@ void MainWindow::add_entry() { int row_count = ui->tableWidgetCredentials->rowCount(); + //Add the entry to the end of the database and scroll to the row ui->tableWidgetCredentials->insertRow(row_count); ui->tableWidgetCredentials->scrollToItem(ui->tableWidgetCredentials->takeItem(row_count, 0)); ui->tableWidgetCredentials->setItem(row_count, 0, new QTableWidgetItem("")); ui->tableWidgetCredentials->setItem(row_count, 1, new QTableWidgetItem("")); - ui->tableWidgetCredentials->setItem(row_count, 2, new QTableWidgetItem(password_manager.generate_password(password_length))); + ui->tableWidgetCredentials->setItem(row_count, 2, new QTableWidgetItem(password_manager.generate_password(password_length))); //Add generated password ui->tableWidgetCredentials->setItem(row_count, 3, new QTableWidgetItem("")); saved = false; @@ -128,6 +135,7 @@ void MainWindow::add_entry() void MainWindow::remove_entry() { + //Get a list of selected database entries QList selected = ui->tableWidgetCredentials->selectedItems(); if (selected.size() > 0) @@ -135,6 +143,7 @@ void MainWindow::remove_entry() saved = false; } + //Get rid of item duplicates caused by multiple collumns int last_row = -1; for (int i = 0; i < selected.size(); i++) { @@ -146,6 +155,7 @@ void MainWindow::remove_entry() last_row = selected[i]->row(); } + //Remove all selected rows for (QTableWidgetItem* item : selected) { ui->tableWidgetCredentials->removeRow(item->row()); @@ -154,6 +164,7 @@ void MainWindow::remove_entry() void MainWindow::generate_password() { + //Get a list of selected database entries QList selected = ui->tableWidgetCredentials->selectedItems(); if (selected.size() > 0) @@ -161,6 +172,7 @@ void MainWindow::generate_password() saved = false; } + //Get rid of item duplicates caused by multiple collumns int last_row = -1; for (int i = 0; i < selected.size(); i++) { @@ -172,6 +184,7 @@ void MainWindow::generate_password() last_row = selected[i]->row(); } + //Generate new password for all selected rows for (QTableWidgetItem* item : selected) { ui->tableWidgetCredentials->setItem(item->row(), 2, new QTableWidgetItem(password_manager.generate_password(password_length))); @@ -204,6 +217,7 @@ void MainWindow::search(const QString &input) void MainWindow::closeEvent(QCloseEvent *event) { + //Close the program if the newest database is saved, if not show a dialog if (saved) { event->accept(); @@ -236,17 +250,18 @@ void MainWindow::closeEvent(QCloseEvent *event) void MainWindow::check_database() { - if (password_manager.database_exists()) { return; } + //Show new database dialog QInputDialog input_dialog; input_dialog.resize(400, 200); input_dialog.setWindowTitle("Database not Found"); input_dialog.setLabelText("Enter Password for your new Database:"); + //Close the dialog if (input_dialog.exec() == 0) { close(); @@ -262,6 +277,7 @@ void MainWindow::check_database() password_manager.save(); } + //Recheck to see if a new database has been created check_database(); } @@ -272,21 +288,24 @@ void MainWindow::on_spinBoxPasswordLength_valueChanged(int arg1) void MainWindow::on_tableWidgetCredentials_itemChanged() { - saved = false; + saved = false; //Set save indicator to false if database entry has been changed } void MainWindow::on_tableWidgetCredentials_itemSelectionChanged() { + //Get a list of selected database entries QList selected = ui->tableWidgetCredentials->selectedItems(); int count = 0; int last_row = -1; + //Count the number of entries for (QTableWidgetItem* item : selected) { - if (last_row != item->row()) count++; + if (last_row != item->row()) count++; //Count only rows(entries) and not the collumns last_row = item->row(); } + //Set the remove entry button text according to number of selected entries if (count > 1) { ui->pushButtonRemoveEntry->setText("Remove Selected Entries"); diff --git a/mainwindow.h b/mainwindow.h index 70fe17d..dfac43f 100755 --- a/mainwindow.h +++ b/mainwindow.h @@ -19,27 +19,27 @@ class MainWindow : public QMainWindow public: explicit MainWindow(QString version, QWidget *parent = nullptr); ~MainWindow() override; - void check_database(); + void check_database(); //Shows dialog to make a new database if it doesn't exist protected: - passman password_manager; - bool saved = true; - int password_length = 20; - void closeEvent(QCloseEvent *event) override; + passman password_manager; //Password manager object + bool saved = true; //Indicates if all the database changes has been saved + int password_length = 20; //Used by the password generator + void closeEvent(QCloseEvent *event) override; //Executes when user tries to close the app protected slots: - void decrypt_database(); - void backup_database(); - void save_database(); - void add_entry(); - void remove_entry(); - void generate_password(); - void search(const QString &input); + void decrypt_database(); //Executes when user clicks on decrypt database button + void backup_database(); //Executes when user clicks on backup database button + void save_database(); //Executes when user clicks on save database button + void add_entry(); //Executes when user clicks on add entry button + void remove_entry(); //Executes when user clicks on remove entry button + void generate_password(); //Executes when user clicks on generate password button + void search(const QString &input); //Executes when user changes private slots: - void on_spinBoxPasswordLength_valueChanged(int arg1); - void on_tableWidgetCredentials_itemChanged(); - void on_tableWidgetCredentials_itemSelectionChanged(); + void on_spinBoxPasswordLength_valueChanged(int arg1); //Executes when password length spinbox has been changed + void on_tableWidgetCredentials_itemChanged(); //Executes when database entry has been changed + void on_tableWidgetCredentials_itemSelectionChanged(); //Executes when database entry selection has been changed private: Ui::MainWindow *ui; diff --git a/parameterparser.h b/parameterparser.h index e7008f1..7375454 100755 --- a/parameterparser.h +++ b/parameterparser.h @@ -4,6 +4,7 @@ #include #include +//Help to manage the program input parameters class parameterparser { public: @@ -13,7 +14,7 @@ public: protected: std::vector arg_names; std::vector arg_values; - void parse(int argc, char *argv[]); + void parse(int argc, char *argv[]); //Parse the parameters and insert values into vectors of string }; #endif // PARAMETERPARSER_H diff --git a/passman.cpp b/passman.cpp index 05067df..9f8ba1b 100755 --- a/passman.cpp +++ b/passman.cpp @@ -2,7 +2,6 @@ passman::passman() : encryption(new QAESEncryption(QAESEncryption::AES_256, QAESEncryption::CBC)) { } -//Save Database to Disk void passman::save() const { QFile output_file(database_path); @@ -11,7 +10,6 @@ void passman::save() const output_file.close(); } -//Load Database from Disk bool passman::load() { if (!database_exists()) @@ -27,7 +25,6 @@ bool passman::load() return true; } -//Encrypt Database void passman::encrypt() { QByteArray data = QString("passwords\n").toLocal8Bit(); @@ -50,7 +47,6 @@ void passman::encrypt() encrypted_data = data; } -//Decrypt Database bool passman::decrypt() { QByteArray data = encrypted_data; @@ -96,7 +92,6 @@ bool passman::decrypt() return stringData.startsWith("password"); } -//Make Database Backup bool passman::backup() const { if (!database_exists()) diff --git a/passman.h b/passman.h index 14a6765..fd13ea4 100755 --- a/passman.h +++ b/passman.h @@ -16,26 +16,26 @@ class passman public: passman(); QString database_path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/credentials.database"; - QString key = ""; - void save() const; - bool load(); - void encrypt(); - bool decrypt(); - bool backup() const; - void add_entry(QString website_name, QString username, QString password, QString note); - void remove_entry(int index); - void alter_entry(int index, QString new_website_name, QString new_username, QString new_password, QString new_note); - void clear_database(); - std::array get_entry_copy(int index) const; - std::vector> get_database_copy() const; - QString generate_password(int length) const; - bool database_exists() const; + QString key = ""; //Database encryption key + void save() const; //Save the database to the database path on drive + bool load(); //Loads the database from the database path on a drive + void encrypt(); //Encrypts database entries into encrypted data + bool decrypt(); //Decrypts encrypted database data into database entries + bool backup() const; //Backups the database in a backup location on a drive and returns false if there is not a database to backup + void add_entry(QString website_name, QString username, QString password, QString note); //Add new entry to database + void remove_entry(int index); //Return entry from a database + void alter_entry(int index, QString new_website_name, QString new_username, QString new_password, QString new_note); //Alter database entry + void clear_database(); //Removes everything from the database + std::array get_entry_copy(int index) const; //Returns entry copy from the database + std::vector> get_database_copy() const; //Returns full database copy + QString generate_password(int length) const; //Returns newly generated password string + bool database_exists() const; //Returns true if database exists on a drive in certain location protected: - QAESEncryption *encryption; + QAESEncryption *encryption; //Pointer to an object used for encryption QByteArray encrypted_data; //Encrypted Database std::vector> decrypted_entries; //Database Entries - QString characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:;.,/=-+*<>{}()[]_%#$@!?^&"; + QString characters = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ:;.,/=-+*<>{}()[]_%#$@!?^&"; //List of characters for password generator QStringList ivs = { "jW2jT]%0k2#-2R1.d(7'6V0Z|4=-HX2G9@F;561.07@21,NHq42)*896M(18R+9w080*Hs^,45G?;]5R7}'*0Z67?Y7|%SFI**0g", ")OR2*711+M)*a,5D/qB}/#]|fN*30oA<#;>]B80>,4J9@<<;J5;#wL*]p$G9D0i1860;Y8!$l9!4?6_,7L%4}z3Lu8;sb^q}9%lVy6I57L]8<,-ho?310Dd_h|y1#iz%3]rN'zr5T1Bc2uQ5cb!K39386)50c0+%.w.X'", "2-n$rL3v4T/*/22F%2tN}.yDX78#50z3Z9-B10X5*4]97+R-OK'2^F%7$>95c8jLu531C==1|V7Cd=o;5L6/B17jF2C9<1]R4'DY", - }; + }; //List of initialization vectors for aes encryption/decryption }; #endif // PASSMAN_H From d6e780297ea76e8083d3e30f831869ecd2d1e69a Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sat, 2 Jan 2021 21:28:10 -0500 Subject: [PATCH 4/9] Show that it's asking for password if it's not present in the command line argument --- main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.cpp b/main.cpp index 3dc29bb..9fab71d 100755 --- a/main.cpp +++ b/main.cpp @@ -50,8 +50,10 @@ int main(int argc, char *argv[]) //Load password from an argument (if present) std::string password = parameter_parser.get_value("pass", 'p'); + //Wait for password input in case it wasn't present in the argument if (password.compare("-") == 0) { + std::cout << "Input Pasword: "; std::cin >> password; } password_manager.key = QString::fromStdString(password); From bf5fc8af29a936936fb08a970b41cff798db31a7 Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sun, 3 Jan 2021 17:07:18 -0500 Subject: [PATCH 5/9] Updated readme to 1.0.3 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3ba7769..2312547 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Simple Password Manager with AES-256 Encryption
Files **qaesencryption.cpp** and **qaesencryption.h** are from [This Repo](https://github.com/bricke/Qt-AES) -Version 1.0.2
+Version 1.0.3
![screenshot.png](screenshot.png) From 71217541067f2b39d17f2ec0652a67f453111fc9 Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sat, 20 Aug 2022 13:13:54 -0400 Subject: [PATCH 6/9] Fix build --- passman.h | 1 + 1 file changed, 1 insertion(+) diff --git a/passman.h b/passman.h index fd13ea4..3d9b80c 100755 --- a/passman.h +++ b/passman.h @@ -3,6 +3,7 @@ #include #include +#include #include #include #include From a453286ba704b378fff64274ac3295890c70c3db Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sat, 20 Aug 2022 13:15:02 -0400 Subject: [PATCH 7/9] Fix critical bug where a collumn with newline or tab would scramble the data --- passman.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/passman.cpp b/passman.cpp index 9f8ba1b..c1d9140 100755 --- a/passman.cpp +++ b/passman.cpp @@ -34,6 +34,8 @@ void passman::encrypt() { for (QString& entry_column : entry_row) { + entry_column = entry_column.replace("\n", ""); + entry_column = entry_column.replace("\t", ""); data.append((entry_column + '\t').toLocal8Bit()); } data.append(QString('\n').toLocal8Bit()); @@ -66,6 +68,7 @@ bool passman::decrypt() { if (ch == '\n') { + std::cout << line.toStdString() << std::endl; if (line == "password") { line = ""; From f3ea5d2e3845348552e2d38b128c84315117d9a9 Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sat, 20 Aug 2022 13:17:43 -0400 Subject: [PATCH 8/9] Update version number to 1.0.4 --- PKGBUILD_amd64 | 2 +- PKGBUILD_arm64 | 2 +- README.md | 2 +- control_amd64 | 2 +- control_arm64 | 2 +- main.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/PKGBUILD_amd64 b/PKGBUILD_amd64 index 6354c80..19cda1b 100755 --- a/PKGBUILD_amd64 +++ b/PKGBUILD_amd64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.3 +pkgver=1.0.4 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('x86_64') diff --git a/PKGBUILD_arm64 b/PKGBUILD_arm64 index fd0ad5f..2441611 100755 --- a/PKGBUILD_arm64 +++ b/PKGBUILD_arm64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.3 +pkgver=1.0.4 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('aarch64') diff --git a/README.md b/README.md index 2312547..df902f0 100755 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ A Simple Password Manager with AES-256 Encryption
Files **qaesencryption.cpp** and **qaesencryption.h** are from [This Repo](https://github.com/bricke/Qt-AES) -Version 1.0.3
+Version 1.0.4
![screenshot.png](screenshot.png) diff --git a/control_amd64 b/control_amd64 index 137f86d..aa69764 100755 --- a/control_amd64 +++ b/control_amd64 @@ -1,5 +1,5 @@ Package: passman -Version: 1.0.3 +Version: 1.0.4 Section: utils Priority: optional Architecture: amd64 diff --git a/control_arm64 b/control_arm64 index a6b0d18..bd6f521 100755 --- a/control_arm64 +++ b/control_arm64 @@ -1,5 +1,5 @@ Package: passman -Version: 1.0.3 +Version: 1.0.4 Section: utils Priority: optional Architecture: arm64 diff --git a/main.cpp b/main.cpp index 9fab71d..a1d011d 100755 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) { - QString version = "1.0.3"; + QString version = "1.0.4"; //Run GUI if no arguments are passed if (argc == 1) From 5dce7c0d27c4515df1566c57043b8d6ca8345784 Mon Sep 17 00:00:00 2001 From: Aslan2142 Date: Sat, 20 Aug 2022 13:22:23 -0400 Subject: [PATCH 9/9] Remove unnecessary console log --- passman.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/passman.cpp b/passman.cpp index c1d9140..12c8ecd 100755 --- a/passman.cpp +++ b/passman.cpp @@ -68,7 +68,6 @@ bool passman::decrypt() { if (ch == '\n') { - std::cout << line.toStdString() << std::endl; if (line == "password") { line = "";