Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 13 Jul 2012 16:55:21 +0200
From: Frank Dittrich <frank_dittrich@...mail.com>
To: john-dev@...ts.openwall.com
Subject: Easy code changes to get started with JtR development (was: RACF
 format)

On 07/13/2012 03:34 PM, jfoug wrote:
> This actually could be a good 'get your feet wet' type task for someone that
> is wanting to get started learning about hacking into JtR coding, i.e. some
> eager new up/comer coder.  Is there anyone like this who has shown interest,
> but has yet to start?

While this is true, this doesn't mean Dhiru should continue to add new
formats which need additional work afterwards.

There are more tasks if somebody wants to get started:

LC_LL=C grep -n "'[0aA]'.*ciphertext.*'[9fF]'" *fmt*.c |less

Whenever you see 3 subsequent lines like these (hmacMD5_fmt.c, 116-118;
intention adjusted, to avoid unintended line breaks):

        if (!(  (('0' <= ciphertext[i])&&(ciphertext[i] <= '9')) ||
                (('a' <= ciphertext[i])&&(ciphertext[i] <= 'f'))
                || (('A' <= ciphertext[i])&&(ciphertext[i] <= 'F'))))

Then this could be replaced with

	if (atoi16[ARCH_INDEX(ciphertext[i])] == 0x7F)

... and so on.
This is even easier than enhancing valid(), may be it could even be
scripted.

Other formats don't use ciphertext[i], but can be changed as well.
sapG_fmt_plug.c:

               if (!(((p[i]>='A' && p[i]<='F')) ||
                        ((p[i]>='a' && p[i]<='f')) ||
                        ((p[i]>='0' && p[i]<='9')) ))
                        return 0;

BTW: in cuda_rawsha256_fmt.c, you find:

         if (!((ciphertext[i] >= '0' && ciphertext[i] <= '9') ||
                 (ciphertext[i] >= 'a' && ciphertext[i] <= 'f') ||
                 (ciphertext[i] >= 'A' && ciphertext[i] <= 'Z')))
                 return 0;

After looking at the test hashes, I am sure that must be 'F' instead of
'Z' here, so atoi16 can be used as well.

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.