diff --git a/PKGBUILD_amd64 b/PKGBUILD_amd64 index 50228e7..e7afeb8 100644 --- a/PKGBUILD_amd64 +++ b/PKGBUILD_amd64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.0 +pkgver=1.0.1 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('x86_64') diff --git a/PKGBUILD_arm64 b/PKGBUILD_arm64 index 298c832..366138c 100644 --- a/PKGBUILD_arm64 +++ b/PKGBUILD_arm64 @@ -1,5 +1,5 @@ pkgname=passman -pkgver=1.0.0 +pkgver=1.0.1 pkgrel=1 pkgdesc="A Simple Password Manager with AES-256 Encryption" arch=('aarch64') diff --git a/README.md b/README.md index 10e495a..e648554 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,23 @@ # Passman 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.0 +Version 1.0.1 ## Installation -Check **Releases** section +Check **[Releases](https://github.com/Aslan2142/passman/releases)** section ## How To Use Simply Run Program and it'll launch QT GUI
It can also be used within CLI
-Type **passman --help** for list of commands (will be available in next version (1.0.1))
+Type **passman --help** for list of commands
Running **passman** without arguments will launch QT GUI -## How To Compile +## How To Compile and Make Package ### Debian Linux: Run **makedebpkg.sh** script with parameter {amd64/arm64}
diff --git a/control_amd64 b/control_amd64 index 0cb2d47..09c30ae 100644 --- a/control_amd64 +++ b/control_amd64 @@ -1,9 +1,9 @@ Package: passman -Version: 1.0.0 +Version: 1.0.1 Section: utils Priority: optional Architecture: amd64 Essential: no -Installed-Size: 132 +Installed-Size: 135 Maintainer: Aslan2142 Description: A Simple Password Manager with AES-256 Encryption diff --git a/control_arm64 b/control_arm64 index 9dd9221..7f0412d 100644 --- a/control_arm64 +++ b/control_arm64 @@ -1,9 +1,9 @@ Package: passman -Version: 1.0.0 +Version: 1.0.1 Section: utils Priority: optional Architecture: arm64 Essential: no -Installed-Size: 132 +Installed-Size: 135 Maintainer: Aslan2142 Description: A Simple Password Manager with AES-256 Encryption diff --git a/main.cpp b/main.cpp index 66b54ac..cdf6d6f 100644 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ int main(int argc, char *argv[]) { - QString version = "1.0.0"; + QString version = "1.0.1"; if (argc == 1) { @@ -24,6 +24,27 @@ int main(int argc, char *argv[]) parameterparser parameter_parser(argc, argv); passman password_manager; + + 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"; + + 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 << "-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"; + + std::cout << "If you don't input Password using parameter, Program will expect you to enter Password after you start Passman.\n"; + std::cout << "Database (including backups) is saved in your Documents Folder.\n"; + std::cout << "You can restore backup by renaming it.\n"; + std::cout << "Database can't be deleted using Passman from CLI for safety purposes, however you can delete it by removing the Database File." << std::endl; + + return 0; + } std::string password = parameter_parser.get_value("pass", 'p'); if (password.compare("-") == 0) @@ -66,10 +87,49 @@ int main(int argc, char *argv[]) { QStringList entry = QString::fromStdString(new_entry).split(","); + if (entry.size() != 4) + { + std::cerr << "Error Creating Database Entry (bad parameters)" << std::endl; + return 5; + } + password_manager.add_entry(entry[0], entry[1], entry[2], entry[3]); password_manager.encrypt(); password_manager.save(); } + + std::string remove_entry = parameter_parser.get_value("remove", 'r'); + if (remove_entry.compare("-") != 0) + { + int index = -1; + QStringList input = QString::fromStdString(remove_entry).split(","); + + if (input.size() != 2) + { + std::cerr << "Error Removing Database Entry (bad parameters)" << std::endl; + return 5; + } + + const std::vector> database = password_manager.get_database_copy(); + for (ulong i = 0; i < database.size(); i++) + { + if (database[i][0].compare(input[0]) == 0 && database[i][1].compare(input[1]) == 0) + { + index = i; + break; + } + } + + if (index < 0) + { + std::cerr << "Error Removing Database Entry (entry not Found)" << std::endl; + return 6; + } + + password_manager.remove_entry(index); + password_manager.encrypt(); + password_manager.save(); + } if (parameter_parser.has_parameter("backup", 'b')) {