encrypting lines from file with md5 module doesn't work?

Canned user at domain.invalid
Sat Feb 14 13:33:46 CET 2009

I need some help with my script. I hope someone can show me the right
direction or at least explain to me what did I wrong?

I write a small script that read lines from plain text file and encrypt
each lines using md5 module. I have a small word list that contain 2000+
words, 1 word/line. Using the code below, I can save the output to
another file to use it with john the ripper (http://www.openwall.com).

Here is the part that annoys me, john recognize the output as des and
not as md5. Using the original wordlist, I tried to crack the list but
nothing has come up after waiting for almost 9 hours. Can someone please
tell me what did I wrong? Why john don't recognize the output as md5?
I'm using python 2.5.1 and I'm python noob and also don't have any
knowledge about encryption.

import sys, md5

f = open(sys.argv[1])
obj = md5.new()

for line in f:
        if line[-1:] == '\n':
                text = line[:-1]
        print text + ':' + obj.hexdigest()



Thanks in advance

More information about the Python-list mailing list