Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 18 Sep 2015 18:25:08 +0300
From: Solar Designer <solar@...nwall.com>
To: john-dev@...ts.openwall.com
Subject: fast hash early exit vs. large hash list

magnum -

For raw-md5, we currently have early exit before the last 3 steps.
Aside from this being extremely far from what state of the art fast
hash crackers do in terms of steps reversal, as currently implemented it
also hurts performance when cracking large hash lists.  Only 32 bits of
the hash result are preserved and the rest are recomputed with scalar
code in cmp_exact(), and when the target hash list is large this happens
quite often.  In the 29M testcase, cmp_exact() is called a few million
times on wrong passwords (as well as 1.7+ million on correct passwords).

As an experiment, I've tried disabling REVERSE_STEPS in
rawMD5_fmt_plug.c, implementing a full binary check in cmp_one(), and
turning cmp_exact() into a "return 1;"  --test benchmark became about 5%
slower.  My 29M testcase runs remained mostly unaffected, with the best
one reaching:

real    0m40.659s
user    2m52.439s
sys     0m13.803s

I think we should support a mode where the SIMD code would exit early,
but would record the entire state (all four vectors), so that cmp_*()
wouldn't have to recompute from scratch.  Ideally, we'd only enable this
mode when the number of loaded hashes is large, although this can be
tricky in terms of (avoiding) code complexity.

Alexander

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ