wiki:SoluzioneEsercizioPython
import crypt
import urllib2


PWDS = urllib2.urlopen("http://pastebin.com/raw.php?i=Kmnd6aPp")

passwords = []

for i in PWDS:
    passwords.append(i.split(':')[1].strip())

def decritta(sale, pwd):
    d = urllib2.urlopen("https://raw.githubusercontent.com/eneko/data-repository/master/data/words.txt")
    for w in d:
        if crypt.crypt(w.strip(), sale) == (sale + pwd):
            print "Trovata!"
            print w
            break

salt = passwords[0][:2]
pwd = passwords[0][2:]

decritta(salt, pwd)


Last modified 4 years ago Last modified on Oct 5, 2015, 7:30:06 PM