MRAB schreef: > Canned wrote: >> Hi, >> 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). >> > [snip] > MD5 is a type of checksum, not a method of encryption.
I found this from google: http://tinyurl.com/4ow2q4 Using that, I changed my script and it seems that it works well. John recognize it as md5. It also raise another question. John can crack my password from /etc/shadow in less than a second, but if I write it down in a file and using the code below to encrypt the password, john would took really long time to crack the password. I've tried several different password using passwd command and my code to generate md5 hash, but it seems that john really having trouble with hashes generated with my code as the hashes generated with passwd being cracked in a matter of second. Is there something wrong with the code? Am I missing something? -----------------code------------------------- #!/usr/bin/env python import sys import md5encrypt # from http://tinyurl.com/4ow2q4 f = open(sys.argv[1]) for line in f: if line[-1:] == '\n': text = line[:-1] print text + ':' + md5encrypt.md5crypt(text, md5encrypt.generate_salt(5)) f.close() ---------------password.txt-------------------- 000000 00000000 111111 11111111 121212 123123 -------------result.txt----------------- 000000:$1$<rVpM$5cYcnJv6qY3AXKiJXKwh4/ 00000000:$1$...@w$eqau1mlk6uxogfgkmuf3i1 111111:$1$TVq;y$87mqQPcKXlnj6Ap.1rFgH0 11111111:$1$.iPHo$dLNmzzv5BXBFTn8FqCmog. 121212:$1$`]iS!$L3uSDmn17PGhZ.k275WZj0 123123:$1$}g5"m$OwzfVzg0CMEhNX271K.yp0 -- http://mail.python.org/mailman/listinfo/python-list