Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BLU0-SMTP391603D5B7687FD2314F709FDFE0@phx.gbl>
Date: Wed, 20 Jun 2012 18:50:39 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Re: handling different BINARY_SIZE values in a single
 format

On 06/20/2012 06:43 PM, Dhiru Kholia wrote:
> Hi,
> 
> EPiServer format can crack both SHA1 and SHA256 hashes. However, the
> BINARY_SIZE for both these types is different. How can I handle this
> situation in cmp_* functions?
> 
> Currently, I have the following code which is valid for only SHA1 hashes.
> 
> static int cmp_one(void *binary, int index)
> {
>         return !memcmp(binary, crypt_out[index], 20); /* BUG: lesser
> of the two */
> }

This should work OK if you change cmp_exact from just returning 1 to
doing a real check.
Otherwise, how high is the risk of collisions (resulting in false
positives) if you just compare 20 bytes?

Frank

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.