Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 15 Feb 2012 09:28:34 -0600
From: "jfoug" <jfoug@....net>
To: <john-users@...ts.openwall.com>
Subject: RE: sha1 + hex salt

I really wonder if the description of this crypt is wrong.  I bet this is
simply a fixed 16 byte null buffer, that has the password overwrite the
first part of this buffer, and then is crypted with SHA1.  This is similar
to how cisco pix works (but pix used md5).  I.e., we are seeing a fixed
sized null padded password buffer.

Thus, it may be better for this crypt, to do this type pseudo code:

clean_buffer   (whole buffer is NULL).
append_key
set_length_16  (I do not think this function exists in dynamic right now)
sha1_crypt

That way, it would not matter at all, if the password was 8 bytes, 4 bytes,
or 14 bytes.  As long as the layout is what I expect it to be.

But for now, I am digging into why the CONST1 is not working.  The code you
show below, appears to be correct for the given hash.

Jim.

>-----Original Message-----
>From: jfoug [mailto:jfoug@....net]
>Sent: Wednesday, February 15, 2012 9:18 AM
>To: john-users@...ts.openwall.com
>Subject: RE: [john-users] sha1 + hex salt
>
>Alex,
>
>I have been looking at this exact same thing.  It 'should' work.  It may
>be
>that I do not send the const values to the demangler code.  I know I did
>on
>salts, etc.  I just have to look.  I was sure I sent the consts there,
>because I did this for the PO format (uses 0xF7's or something like
>that).
>
>I will see what is wrong. It 'could' be that there is some get length
>using
>C's string functions, that is busted, thus the const1 has a length of 0.
>
>Jim.
>
>>From: Solar Designer [mailto:solar@...nwall.com]
>>
>>The following would work (to be placed in john.conf) if we could encode
>>a zero byte in a string:
>>
>>[List.Generic:dynamic_1999]
>>Expression=sha1($p."\0\0\0\0\0\0\0\0")
>>Flag=MGF_SHA1_40_BYTE_FINISH
>>Func=DynamicFunc__clean_input
>>Func=DynamicFunc__append_keys
>>Func=DynamicFunc__append_input1_from_CONST1
>>Func=DynamicFunc__SHA1_crypt_input1_to_output1_FINAL
>>Test=$dynamic_1999$20c59472b34ec4b9678b7149d519a2338bc31ba9:92086390
>>CONST1=\x00\x00\x00\x00\x00\x00\x00\x00
>>
>>Unfortunately, this setting of CONST1 does not appear to work right (so
>>this format fails self-test).
>>
>>Jim - is this something you'd enhance in a future revision of your
>code?
>>Alternatively/additionally, how about supporting hex-encoded salts?
>>
>>Alexander

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.