Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hmac
- import hashlib
- def first_two(server_seed, client_seed, nonce):
- server_seed = server_seed.encode('utf-8')
- msg = '%s:%d' % (client_seed, nonce)
- h = hmac.new(server_seed, msg.encode('utf-8'), hashlib.sha512)
- return int(h.hexdigest()[:2], 16)
- server_seed = 'abcde'
- user_seed = '12345'
- nonce = 1
- rounds = 1000000
- output = open('out.txt', 'w')
- for i in range(rounds):
- output.write('%d\n' % first_two(server_seed, user_seed, nonce))
- nonce += 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement