Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 8 Jul 2012 12:10:13 -0400
From:  <>
Subject: Format writing 101

I think (after looking at SIP format), that we REALLY need to generate a FAQ on how to build a proper format under JtR.

After looking at the SIP format, and others over time, I really think a mini 'how to' would be nice.  The SIP format as implemented, contains a ton of work being done in the set_salt.  That is the wrong place to do that work.  Solar made some changes to help 'hide' this problem (bumped up the password count to 64, from 1).  The speed on my system did go from about 88k to 900k with Solar's change.  In a real fast hack (needs work still), I moved this work into get_hash, and removed all the allocations.  With that change, it is running along at about 1200k, however, like I said, there still is work to be done.  I think I have likely caused JtR to fail to have dupe salt elimination.  

I think these type things need to be in there:

1. Hot path functions (inner loop), for salted and for unsalted hashes.
2. How to move code around to optimize formats, for salted formats (i.e. getting as many hashes out of the 'hot path'.
3. tutorials on utility functions within memory.c and misc.c. and common.c/.h.  Things like mem_alloc, mem_alloc_tiny, strnzcpy, itoa16, atoi16, ARCH_INDEX macro, etc.
4. requirements and hints on salt(), prepare() valid() and other very common format methods, which are outside of the 'hot' zone.
5. binary_hash / salt_hash, why they are needed, and how to use.
6. possibly tutorial on and the test suite, and why the TS is very useful.

What do people think?

There are a LOT of new and very active JtR developers currently.  Writing near optimal formats, really does not take any more time, than writing any old format, that happens to work, but is an order of magnitude slower than it should be.  

A lot of being able to write the optimal format, is simply learning how JtR 'expects' things to be.


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.