diff --git a/crack b/crack index 8fc77e5d077623d23e4cdc5e1cff70c1d4d64ef2..1d51ed1e8cbe7019d842b57a11cb99ddc07bf952 100755 Binary files a/crack and b/crack differ diff --git a/crack.c b/crack.c index c3af534b186601e5c31183d59216c06ea27e72a4..192d7ddbbc5fced0afdc6060b63ee2a1ecd59960 100644 --- a/crack.c +++ b/crack.c @@ -22,28 +22,6 @@ int sha256_test(int argc, char *argv[]) FILE *sha_file_6_ptr = fopen("pwd6sha256", "r"); BYTE hash6[SHA256_BLOCK_SIZE]; - /********** Below is code for getting ASCII values for numbers, lowercase, and uppercase **********/ - // ASCII values for numbers, lowercase letters (97 - 122), and uppercase letters (65-90) - // int num_ascii[10] = {48, 49, 50, 51, 52, 53, 54, 55, 56, 57}; - // int lowercase_ascii[26]; - // int uppercase_ascii[26]; - // int current_lower_ascii = 97; - // int current_upper_ascii = 65; - // for (int i = 0; i < 26; i++) - // { - // lowercase_ascii[i] = current_lower_ascii; - // uppercase_ascii[i] = current_upper_ascii; - // current_lower_ascii++; - // current_upper_ascii++; - // } - - // // Put all wanted ASCII values together - // int* all_ascii = malloc(62 * sizeof(int)); - // memcpy(all_ascii, num_ascii, 10 * sizeof(int)); - // memcpy(all_ascii + 10, lowercase_ascii, 26 * sizeof(int)); - // memcpy(all_ascii + 36, uppercase_ascii, 26 * sizeof(int)); - - /********** Below is code for all relevant ASCII characters **********/ int all_ascii[95]; int current_ascii = 32; for (int i = 0; i < 95; i++) @@ -139,7 +117,7 @@ int sha256_test(int argc, char *argv[]) BYTE *byte_guess = (BYTE *)guess; sha256_init(&ctx6); - sha256_update(&ctx6, byte_guess, 4); + sha256_update(&ctx6, byte_guess, 6); sha256_final(&ctx6, buf6); // Print when we find passwords matching hashes @@ -245,7 +223,7 @@ int sha256_test(int argc, char *argv[]) BYTE *byte_pwd = (BYTE *)buf; sha256_init(&ctx); - sha256_update(&ctx, byte_pwd, 4); + sha256_update(&ctx, byte_pwd, strlen(buf)); sha256_final(&ctx, hash); int hash_number = 1;