Freebitco Pridect On Python
Freebitco Pridect On Python
import random
from random import sample
alphabet = '680113444f795fd49455201055ad275cb5feeed63e90be77e3fe7019909522c3'
string=''
xrange=range
file = open("m.txt","a")
for count in xrange(0,wmaximum):
for x in random.sample(alphabet,random.randint(minimum,maximum)):
string+=x
file.write(string+'\n')
string=''
file.close()
print ('DONE!')
try:
wordlistfile = open(wordlist,"r")
except IOError:
print ("Invalid file.")
input()
sys.exit()
else:
pass
for line in wordlistfile:
m = hashlib.sha256() #flush the buffer (this caused a massive problem when
placed at the beginning of the script, because the buffer kept getting overwritten,
thus comparing incorrect hashes)
line = line.replace("\n","")
m.update(line.encode(wordlistfile.encoding))
word_hash = m.hexdigest()
if word_hash==hash:
print ("Collision! The word corresponding to the given hash is",
line,)
input()
sys.exit()
print ("The hash given does not correspond to any supplied word in the wordlist.")
input()
sys.exit()
#EoF
#Written by Neil Shah, 9th grade