blackjack21

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6fd68b12ebda9ebbc427143109bdceaee37574f6
parent f2c09bec72768021bee5fdef2a0c42a4c2b81c9b
Author: Michael Constantine Dimopoulos <31562759+MichaelDim02@users.noreply.github.com>
Date:   Wed, 29 Aug 2018 06:47:47 +0000

Update jack.cpp
Diffstat:
Mjack.cpp | 42+++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 15 deletions(-)

diff --git a/jack.cpp b/jack.cpp @@ -11,6 +11,7 @@ using namespace std; // Global Variables // +bool verbose; //Function prototypes // void md5_crack(string hash, string file); @@ -22,22 +23,26 @@ void sha512_crack(string hash, string file); //INTERFACE// void interface() { - cout << "BlackJack21 Password Cracker v0.1" << endl; - cout << "Written by Michael Constantine Dimopoulos in C++ - Thessaloniki, Greece 2017" << endl; + cout << "BlackJack21 Password Cracker v0.2" << endl; + cout << "Written by Michael C. Dim. in C++ - Thessaloniki, Greece 2017" << endl; cout << "Python version: github.com/MichaelDim02/BlackJack" << endl; - cout << "E-Mail: anivsante2@gmail.com" << endl; cout << "Hashes included: MD5, SHA1, SHA256, SHA512" << endl << endl; - cout << "Usage: ./jack [HASH-TYPE] [HASH] [DICTIONARY]" << endl; + cout << "Usage: ./jack [HASH-TYPE] [HASH] [DICTIONARY] [-v]" << endl; } int main(int argc, char* argv[]) { - if(argc == 1) { + if(argc < 4) { interface(); - } else if(argc == 4) { + } else if(argc == 4 || argc == 5) { string type = argv[1]; string hash = argv[2]; string dict = argv[3]; std::ifstream file(dict); if(file.is_open()) { + if (argc == 5) { + verbose = true; + } else { + verbose = false; + } if(type == "MD5" || type == "md5"){ md5_crack(hash, dict); }else if(type == "SHA1" || type == "sha1"){ @@ -66,7 +71,9 @@ void md5_crack(string hash, string filename) { cout << "[" << tries << "] - PASSWORD FOUND - " << pass << endl; exit(0); } else { - cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; + if (verbose == true) { + cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; + } } } } @@ -81,7 +88,9 @@ void sha1_crack(string hash, string filename) { cout << "[" << tries << "] - PASSWORD FOUND - " << pass << endl; exit(0); } else { - cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; + if (verbose == true) { + cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; + } } } } @@ -97,9 +106,11 @@ void sha256_crack(string hash, string filename) { cout << "[" << tries << "] - PASSWORD FOUND - " << pass << endl; exit(0); } else { - cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; - } - } + if (verbose == true) { + cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; + } + } + } } void sha512_crack(string hash, string filename) { @@ -113,8 +124,9 @@ void sha512_crack(string hash, string filename) { cout << "[" << tries << "] - PASSWORD FOUND - " << pass << endl; exit(0); } else { - cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; - } - } + if (verbose == true) { + cout << "[" << tries << "] - FAILED ATTEMPT - " << pass << endl; + } + } + } } -