anuvab1911

parallelcracker

Mar 20th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.70 KB | None | 0 0
  1. import multiprocessing
  2. import hashlib
  3. import time
  4. oldTime = time.time()
  5. def cracker(start,end,checkStr):
  6.     curStr = start
  7.     while curStr != end:
  8.         digest = hashlib.sha1()
  9.         digest.update(str(curStr))
  10.         if checkStr == digest.hexdigest():
  11.             print "Match found at " + str(curStr)
  12.             newTime = time.time()
  13.             print (newTime - oldTime)
  14.         curStr += 1
  15. if __name__ == '__main__':
  16.     procs = []
  17.     j = 0
  18.     for i in range(8):
  19.         p = multiprocessing.Process(target = cracker,args = (j,j*10000,"a0849622401ebc624406648bc39eca144427cd90"))
  20.         j = j*10000 + 1
  21.         procs.append(p)
  22.         p.start()
  23.     for p in procs:
  24.         p.join()
Add Comment
Please, Sign In to add comment