wiki:SoluzioneEsercizioPython

Version 2 (modified by monga, 9 years ago) ( diff )

--

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)


Note: See TracWiki for help on using the wiki.