"Usage: FinalEncrypt [OPTIONS]...\n" "Encrypts/Decrypts files using FinalEncrypt\n" "\n" " -h Prints help screen\n" " -e [filename] Encrypts a specified file (must be passed with -r)\n" " -d [filename] Decrypts a specified file (must be passed with -k)\n" " -k [512 bit Key in hex] Specifies the key used for decryption\n" " -r Generates a random key\n" "\n" "Examples - \n" "FinalEncrypt -r -e testfile.txt\n" "FinalEncrypt -d testfile.txt.enc -k D84165183346405877C13F497EB32B34410D5653A8141B07E307044F780EB733A62F1D087C126537" "BBEAB769EA56E15FCAC19E4E215A4E1A28D3FC46362FC80D\n");
for (size_t i = 0; i < b_len; i += 2) { char hex_str[3] = {b[i], b[i + 1], '\0'}; unsignedchar byte = (unsignedchar)strtol(hex_str, NULL, 16); bool found = false;
for (int j = 0; j < 128; j++) { if (v8[j] == byte) { indices[idx++] = j; // Store index of v8 where match is found found = true; break; } } if (!found) { all_found = false; break; } } indices[idx] = 0xFF; // Terminate the indices array return all_found; }
intmain(){ constchar *b = "e07816e1dba1da61536634bef2c3b6346d533cc3b6b834e3beb634c80264143c34e36400bb4daa6902ff643414e3b8344dff6634b8b66db6bbc33834143461ab147e04"; unsignedchar v8[256]; unsignedchar indices[128]; // Large enough to store all indices needed unsignedint start_time =1715153796; // time stamp of FileEncrypt unsignedint end_time = 1715156519; // time stamp of flag.md.enc
for (unsignedint v3 = start_time; v3 <= end_time; v3++) { custom_algorithm(v3, v8); if (match_v8_with_b(v8, b, indices)) { printf("Match found for seed %u\n", v3); printf("Matching indices in v8: "); for (int i = 0; indices[i] != 128; i++) { printf("%c", indices[i]); } printf("\n"); } } return0; } // DASCTF{7ou_h@ve_5o1ved_4he_fina1_4ncrypti0n_a4d_y0u_de5erv3_a_7lag}