int main() { Node *root, *aux; int size, check = 1, number, temp, num1, num2; clock_t c2, c1; float _time; scanf("%s", input); transform_input(); printf("(%s)\n", input); size = strlen(input); root = make_graph(0, size - 1); printf("Original Graph:\n"); print_graph(root); printf("\n"); printf("Start..\n"); c1 = clock(); root = reduce_graph(root, 0); c2 = clock(); _time = (c2 - c1)*1000/CLOCKS_PER_SEC; printf("\n\nEnd!\n"); printf("Reduced Graph:\n"); print_graph(root); printf("\nTempo de redução: %dhs %dmin %dseg %dmiliseg\n\n", (((int) _time)/1000)/3600, ((((int) _time)/1000)%3600)/60, ((((int) _time)/1000)%3600)%60, ((int) _time) - (((int) _time)/1000)*1000); printf("\n"); return 0; }
int main(int argc, char *argv[]) { uint64_t start = Digit6-1000000;//Digit5 is the start of the 6 digit space uint64_t end = Digit6;//Digit6 is end of 6 digit space uint64_t hashes = end - start; uint64_t cmp1, cmp2; //unsigned char hash[16]; //unsigned char pass[] = "abcdefghijklmnopqrstuvwxyz"; // Hash is: c3fcd3d76192e4007dfb496cca67e13b transform_input(input1, input2); clock_t start_time, final_time; start_time = clock(); MD5 md5; //md5_initialize(&md5); for (uint64_t i = start; i < end; i++) { increment_pass(&guess, i); //guess_print(&guess); //md5_set(&md5,pass,strlen((char*)pass)); //md5_pad(&md5); //md5_initialize(&md5); md5_manipulate(&output, &guess); //md5_bigendian(&output,hash); //md5_print(hash); cmp1 = output._64[0] ^ input._64[0]; cmp2 = output._64[1] ^ input._64[1]; //printf(" %i\n", (char *)output._8); //printf(" %i\n", (char *)input._8); if ((cmp1 | cmp2) == 0) { printf("Found the hash!\n"); printf(" %s\n", (char *)guess._8); //exit(1); } } final_time = clock(); //had to multiply by ten since the system had an incorect CLOCKS_PER_SEC value, possibly due to virtual machine printf("%f seconds\n", ((float)difftime(final_time, start_time)) / CLOCKS_PER_SEC); printf("%f hashes/seconds\n", hashes / (((float)difftime(final_time, start_time)) / CLOCKS_PER_SEC)); return 0; }
int main(int argc, char *argv[]) { uint64_t start = Digit6-10000000;//Digit5 is the start of the 6 digit space uint64_t end = Digit6;//Digit6 is end of 6 digit space uint64_t hashes = end - start; uint64_t cmp1, cmp2; uint64_t i; transform_input(input1, input2); clock_t start_time, final_time; start_time = clock(); for (i = start; i < end; i++) { increment_pass(&guess, i); md5_manipulate(&output, &guess); cmp1 = output._64[0] ^ input._64[0]; cmp2 = output._64[1] ^ input._64[1]; if ((cmp1 | cmp2) == 0) { printf("Found the hash!\n"); printf(" %s\n", (char *)guess._8); //exit(1); } } final_time = clock(); //had to multiply by ten since the system had an incorect CLOCKS_PER_SEC value, possibly due to virtual machine printf("%f seconds\n", ((float)difftime(final_time, start_time)) / CLOCKS_PER_SEC); printf("%f hashes/seconds\n", hashes / (((float)difftime(final_time, start_time)) / CLOCKS_PER_SEC)); return 0; }