Advertisement
LinKin

Crypto 3

Oct 16th, 2013
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.40 KB | None | 0 0
  1. from Crypto.Hash import SHA256
  2.  
  3. Chunk = []
  4. with open( 'file','rb' ) as f:
  5.     while True:  
  6.         s = f.read( 1024 )
  7.         Chunk.append( s )
  8.         if len( s ) < 1024 :
  9.             print( len(s) )
  10.             break
  11.  
  12. Chunk.reverse()
  13. h = SHA256.new( Chunk[0] )
  14. for i in range( 1,len( Chunk ) ):
  15.     b = Chunk[i] + bytes.fromhex( h.hexdigest() )
  16.     h = SHA256.new( b )
  17.  
  18. print( h.hexdigest() )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement