1- // THCrypt v1.1
1+ // THCrypt v1.2
22// Copyright (c) 2017 TypicalHog
33// https://github.com/TypicalHog/THCrypt
44
@@ -108,6 +108,7 @@ int main(int argc, char *argv[])
108108 return 0 ;
109109 }
110110
111+ if (!external_run) std::cout << ' \n ' ;
111112 switch (generate_lookup_tables (1337 ))
112113 {
113114 case 0 :
@@ -171,10 +172,27 @@ int main(int argc, char *argv[])
171172 std::cout << " \n Operation: Decryption" << std::endl;
172173 }
173174 std::cout << " Threads: " << num_threads << std::endl;
175+ std::cout << " Key source: " << " [FILE] " << filename_key << std::endl;
176+ // std::cout << "Key source: " << "[USER_INPUT]" << std::endl;
174177 std::cout << " Key size: " << key_size << " bytes (" << key_size * 8 << " -bit)" << std::endl;
175178 std::cout << " Input file: " << filename_in << std::endl;
176179 std::cout << " Output file: " << filename_out << std::endl;
177- std::cout << " File size: " << file_size << " bytes" << std::endl;
180+ if (file_size < 1024 )
181+ {
182+ std::cout << " File size: " << file_size << " bytes" << std::endl;
183+ }
184+ else if (file_size < 1024 * 1024 )
185+ {
186+ std::cout << " File size: " << file_size / 1024.0 << " KB (" << file_size << " bytes)" << std::endl;
187+ }
188+ else if (file_size < 1024 * 1024 * 1024 )
189+ {
190+ std::cout << " File size: " << file_size / (1024.0 * 1024.0 ) << " MB (" << file_size << " bytes)" << std::endl;
191+ }
192+ else
193+ {
194+ std::cout << " File size: " << file_size / (1024.0 * 1024.0 * 1024.0 ) << " GB (" << file_size << " bytes)" << std::endl;
195+ }
178196 std::cout << " -------------------------------------------------------------------" << std::endl;
179197
180198 auto start = std::chrono::high_resolution_clock::now ();
@@ -309,23 +327,33 @@ int main(int argc, char *argv[])
309327 {
310328 std::cout << " \n TIME: " << time << " microseconds" << std::endl;
311329 }
312- else if (time < 1000000 )
330+ else if (time < 1000'000 )
313331 {
314332 time = std::chrono::duration<double , std::milli>(end - start).count ();
315333 std::cout << " \n TIME: " << time << " milliseconds" << std::endl;
316334 }
317- else
335+ else if (time < 1000'000'000 )
318336 {
319337 time = std::chrono::duration<double >(end - start).count ();
320338 std::cout << " \n TIME: " << time << " seconds" << std::endl;
321339 }
340+ else if (time < 1000'000'000LL * 60 )
341+ {
342+ time = std::chrono::duration<double , std::ratio<60 >>(end - start).count ();
343+ std::cout << " \n TIME: " << time << " minutes" << std::endl;
344+ }
345+ else
346+ {
347+ time = std::chrono::duration<double , std::ratio<3600 >>(end - start).count ();
348+ std::cout << " \n TIME: " << time << " hours" << std::endl;
349+ }
322350 }
323351 else
324352 {
325353 std::cout << " \n ERROR: Cannot access file." << std::endl;
326354 }
327355
328- std::cout << " \n ---OPERATION COMPLETE--- " << std::endl;
356+ std::cout << " \n ===COMPLETED=== " << std::endl;
329357 if (external_run) std::cin.ignore ();
330358
331359 return 0 ;
@@ -345,7 +373,7 @@ void progress_bar(unsigned long long current, unsigned long long max, unsigned l
345373 float ratio = (float )current / max;
346374 unsigned long long c = (unsigned int )(ratio * width);
347375
348- std::cout << " \r Progress : " << std::setw (3 ) << (int )(ratio * 100 ) << " % [" ;
376+ std::cout << " \r PROGRESS : " << std::setw (3 ) << (int )(ratio * 100 ) << " % [" ;
349377 for (unsigned long long i = 0 ; i < c; ++i) std::cout << " =" ;
350378 for (unsigned long long i = c; i < width; ++i) std::cout << " " ;
351379 std::cout << " ]" << std::flush;
0 commit comments