Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAArRjcwH21Fv1LW68YRExv8cYbvWbOf181NaL-KrXki3tyq1qA@mail.gmail.com>
Date: Mon, 25 Jun 2012 06:49:57 +0200
From: Jean-Michel PICOD <jm@...izoku.org>
To: john-users@...ts.openwall.com
Subject: Re: Re: SSHA / SHA256 BASE64 on 1.79-5

Sorry, I wrote it very quickly and I forgot to tell how to use the
script. Thanks Stephen for doing it.

For the crash, as all your lines ends with an equal sign, it seems
padded. So I guess that's just an empty line issue.
This version adds padding if needed so it should be protected against
blank lines
I also replaced the hardcoded endline to be more platform-aware.

Usage is still the same.

-----------8<----------------

#!/usr/bin/env python
import base64, sys, os

while True:
    line = sys.stdin.readline()
    if line == "":
        break
    line = line.rstrip(os.linesep)
    print "$SHA256$" + base64.b64decode(line + "=" * (4 -
(len(line)&3))).encode("hex")

-------8<----------


2012/6/25 donovan <contact.newangels@...il.com>:
> Stephen John Smoogen <smooge@...> writes:
>
>>
>> On 24 June 2012 16:25, newangels newangels
>> <contact.newangels@...> wrote:
>> > @ Stephen
>> >
>> > Thank you for your time & effort's
>> >
>> > @Jean Michel
>> >
>> > Thanks for your help & script, unfotunately when i run it on terminal
>> > ( MAC), it's never ended....i finaly make ctrl-C & got this message :
>>
>> You need to do something like:
>>
>> cat my-old-file | python ./p.py > my-new-file
>>
>> Or depending on the shell
>>
>> python ./p.py < my-old-file > my-new-file
>>
>> THe script takes stuff from a pipe or command line
>>
> Hi again
>
> Thank you so much for your help,
>
> Well done, that's work, but work 1/2
>
> the first command work well ( with pipe )
>
> but at the midle of the process, that's crash
>
> Here the error :
>
> ************************
>
> new-host:a xxx$ cat hashes.txt | python ./p.py > file.txt
> Traceback (most recent call last):
>  File "./p.py", line 9, in <module>
>    print "$SHA256$" + base64.b64decode(line).encode("hex")
>  File
> "/System/Library/Frameworks/Python.framework/
> Versions/2.7/lib/python2.7/base64.py",
> line 76, in b64decode
> TypeError: Incorrect padding
>
> ************************
>
> Anyway, i just whant to confirm on the part i win to decode, that's work's
> perfectly : ./john --format=raw-sha256 file.txt
>
> It's SLOW but working good !!
>
> THANKS AGAIN to all of you
>
> Regards,
>
> Donovan
>

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.