Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- f = open('dictionary.txt')
- words = f.read().split('\n')
- cleanWords = []
- for word in words:
- cleanWords.append(word.rsplit)
- thedict = {}
- thehash = hashlib.md5()
- for word in words:
- thehash.update(word)
- key = thehash.hexdigest()
- thedict[key] = word
- #print key
- #print word
- #prints the entire dictionary with keys and value pairs
- print thedict
- outFile = open('rainbow.csv', 'a')
- for item in thedict:
- print item, thedict[item]
- outFile.write(item + "," + thedict[item] + "\n")
- outFile.close()
- ## to search the thedict to find the word that is paired to the MD5 hash
- print thedict["insert the hash value from scott"]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement