Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20141113155257.7GU7V.755426.imail@eastrmwml301>
Date: Thu, 13 Nov 2014 15:52:57 -0500
From:  <jfoug@....net>
To: john-users@...ts.openwall.com
Subject: New tool in JtR toolset (and common code)

There is a new tool that will be build (in the latest git bleeding JtR). The tool is base64conv, and will be built in ./run.  This tool will convert between any formats:   raw, hex (upper/lower case), mime-base64, crypt-base64 and a byte swapped crypt-base64.

This new 'tool' is simply a command line wrapper around the internal convert function.  This function is now being used in a few places in JtR, and it will start to replace a lot fo one-off custom code in dozens (if not hundreds) of hash formats.  I wrote this common code, after doing conversions of one base-64 flavor into another to make things like handling cisco8 or cisco9 formats easy.    Cisco8 is almost identical to pbkdf2-hmac-sha256, except for the encoding (and primary format signature). But with this conversion function, I was able to use the original pbkdf2-hmac-sha256-fmt.c source code, and simply add a few lines to a prepare() function and magically cisco8 works.   For cisco9, it was almost identical to scrypt, again, other than the base64 encoding (and the signature used to pass N, r and p variables).  Well, with the base64 convert function this was trivial to add to the existing scrypt format, by simply adding a little into the prepare function.

Shortly after this, I found one of the git issues, and that was to support the perl  ScryptKDF.pm format.  Again, that was trivial to add into the existing scrypt format, by simply converting the base64 string (and the N, r, p variable layouts).

Here is a real quick 'circular' example of conversions:

$ ../run/base64conv -i raw -o crypt ThisIsATestMessage
ThisIsATestMessage  -->  J4VdQoZnEJFZQrFBNLBnMKRZ

$ ../run/base64conv -i crypt -o mime J4VdQoZnEJFZQrFBNLBnMKRZ
J4VdQoZnEJFZQrFBNLBnMKRZ  -->  VGhpc0lzQVRlc3RNZXNzYWdl

$ ../run/base64conv -i mime -o hex VGhpc0lzQVRlc3RNZXNzYWdl
VGhpc0lzQVRlc3RNZXNzYWdl  -->  54686973497341546573744d657373616765

$ ../run/base64conv -i hex -o raw 54686973497341546573744d657373616765
54686973497341546573744d657373616765  -->  ThisIsATestMessage

Jim.

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.