Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Mon, 10 Dec 2012 19:46:10 +0100
From: magnum <>
To: "" <>
Subject: split, valid and casing

This was off-list but I'm re-addressing the list for two reasons: First, If I screw up the following (would not be the first time), someone can correct me. Second, I bet some others learn from this discussion.

On 10 Dec, 2012, at 8:15 , Dhiru Kholia <> wrote:
> I don't understand why is it necessary to allow lowercase / uppercase hex only?
>>> Also, I believe RACF's valid() should reject lowercase hex hashes, or split should uppercase them
> I am fine with both (uppecase and lowercase). Why should I place a restriction?

One example: If you accept both but don't unify them in split(), a pot file entry in lower will not match a hash file entry in upper so it will not be detected as already cracked. And we can't ignore case when doing that check, because then base64 entries would be compared the wrong way (and during --show, john has no idea what a ciphertext string is, it may be hex or base64 or something else).

There are probably other cases where we'll get problems. I'm not sure, I just trust there's a reason Solar tends to get upset by these bugs :)

If you do not want a restriction, you unify the case in split() (to upper or to lower, that's up to you) and set that format flag. But you can't just ignore it because that will lead to problems.

Most of your formats use input files generated by something2john tools, so they do not really need any unifying - but valid() must then only regard whatever case the generator uses as hex digits. Formats using base64 must obviously not unify case, and thus must not set that flag.

Bottom line is we only have two options for hex hashes:

1. Simple but strict: valid() accept only one case. Split does not unify. Unify flag is unset.

2. A little more code but more relaxed: valid() accepts any case. Split unifies it. Unify flag is set.

I usually go for #2 (unifing to lower) and for good measure I use to uppercase at least one of the test vectors, trying to catch off-by-one errors in split().


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.