Advertisement
kiwiboi

Untitled

Jul 18th, 2013
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import hmac
  2. import hashlib
  3.  
  4.  
  5. def first_two(server_seed, client_seed, nonce):
  6.     server_seed = server_seed.encode('utf-8')
  7.     msg = '%s:%d' % (client_seed, nonce)
  8.     h = hmac.new(server_seed, msg.encode('utf-8'), hashlib.sha512)
  9.     return int(h.hexdigest()[:2], 16)
  10.  
  11. server_seed = 'abcde'
  12. user_seed = '12345'
  13. nonce = 1
  14. rounds = 1000000
  15.  
  16. output = open('out.txt', 'w')
  17. for i in range(rounds):
  18.      output.write('%d\n' % first_two(server_seed, user_seed, nonce))
  19.      nonce += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement