|
Message-ID: <024201cc6f10$1fd22f50$5f768df0$@net> Date: Fri, 9 Sep 2011 11:47:12 -0500 From: "jfoug" <jfoug@....net> To: <john-dev@...ts.openwall.com> Subject: RE: Question over validity of concept in JtR's benchmarking code. Here is -v3 of the patch. I had to add 2 case statements to the message building code in bench (so I did not change things from single salt/multi salt, into long/short). Here are some timings: 1.7.8-j6 with current pkzip_fmt code: $ ../run/john -test=4 -form=pkzip Benchmarking: pkzip [N/A]... DONE Short: 7622K c/s Long: 5065K c/s $ ../run/john -test=4 -form=NT Benchmarking: NT MD4 [128/128 SSE2 + 32/32]... DONE Raw: 19418K c/s $ ../run/john -test=4 -form=pdf Benchmarking: pdf [32/32]... DONE Many salts: 10135 c/s Only one salt: 16938 c/s $ ../run/john -test=4 -form=ssh Benchmarking: ssh [32/32]... DONE Raw: 68715 c/s Timings of same machine, with the patch below, with -1001 bench timing set for pdf and pkzip, and -1000 set for ssh (NT is still using original 0 bench timing, it simply shows there is NO change at all). $ ../run/john -test=4 -form=pkzip Benchmarking: pkzip [N/A]... DONE Many salts: 7652K c/s Only one salt: 5074K c/s $ ../run/john -test=4 -form=nt Benchmarking: NT MD4 [128/128 SSE2 + 32/32]... DONE Raw: 19540K c/s $ ../run/john -test=4 -form=ssh Benchmarking: ssh [32/32]... DONE Raw: 135926 c/s $ ../run/john -test=4 -form=pdf Benchmarking: pdf [32/32]... DONE Many salts: 13817 c/s Only one salt: 29822 c/s Jim. diff -urpN john-1.7.8-jumbo-6a/src/bench.c john-1.7.8-jumbo-6b/src/bench.c --- john-1.7.8-jumbo-6a/src/bench.c 2011-08-03 16:19:13.000000000 +0000 +++ john-1.7.8-jumbo-6b/src/bench.c 2011-09-09 16:37:25.515625000 +0000 @@ -114,6 +114,8 @@ char *benchmark_format(struct fmt_main * static void *binary = NULL; static int binary_size = 0; static char s_error[64]; + char *TmpPW[1024]; + int pw_mangled=0; char *where; struct fmt_tests *current; int cond; @@ -163,8 +165,29 @@ char *benchmark_format(struct fmt_main * if (format->params.benchmark_length > 0) { cond = (salts == 1) ? 1 : -1; salts = 1; - } else + } else { cond = 0; + if (format->params.benchmark_length < -950) { + /* smash the passwords */ + struct fmt_tests *current = format->params.tests; + int i=0; + pw_mangled = 1; + while (current->ciphertext) { + if (current->plaintext[0]) { + TmpPW[i] = str_alloc_copy(current->plaintext); + TmpPW[i][0] ^= 5; + current->plaintext = TmpPW[i++]; + } + ++current; + } + /* -1001 turns into -1 and -1000 turns into 0 , and -999 turns into 1 for benchmark length */ + format->params.benchmark_length += 1000; + if (format->params.benchmark_length > 0) { + cond = (salts == 1) ? 1 : -1; + salts = 1; + } + } + } bench_set_keys(format, current, cond); @@ -239,6 +262,21 @@ char *benchmark_format(struct fmt_main * for (index = 0; index < 2; index++) MEM_FREE(two_salts[index]); + /* unsmash the passwords */ + if (pw_mangled) { + struct fmt_tests *current = format->params.tests; + int i=0; + while (current->ciphertext) { + if (current->plaintext[0]) { + TmpPW[i][0] ^= 5; + current->plaintext = TmpPW[i++]; + } + ++current; + } + /* -1001 turns into -1 and -1000 turns into 0 , and -999 turns into 1 for benchmark length */ + format->params.benchmark_length -= 1000; + } + return event_abort ? "" : NULL; } @@ -378,11 +416,13 @@ int benchmark_all(void) #endif /* HAVE_MPI */ switch (format->params.benchmark_length) { case -1: + case -1000: msg_m = "Raw"; msg_1 = NULL; break; case 0: + case -1001: msg_m = "Many salts"; msg_1 = "Only one salt"; break;
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.