SHARE
TWEET

m-pass-hash.py

a guest Nov 1st, 2016 1,083 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import struct
  2. import binascii
  3. import scrypt
  4. N = 16384;
  5. r = 8;
  6. p = 1;
  7.  
  8. f = open('gatekeeper.pattern.key', 'rb')
  9. blob = f.read()
  10.  
  11. s = struct.Struct('<'+'17s 8s 32s')
  12. (meta, salt, signature) = s.unpack_from(blob)
  13. password = binascii.unhexlify('00010204060708');
  14. to_hash = meta
  15. to_hash += password
  16. hash = scrypt.hash(to_hash, salt, N, r, p)
  17.  
  18. print 'signature  %s' % signature.encode('hex')
  19. print 'Hash:      %s' % hash[0:32].encode('hex')
  20. print 'Equal:     %s' % (hash[0:32] == signature)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top