Skip to content

Instantly share code, notes, and snippets.

@zeroSteiner
Created December 15, 2014 15:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeroSteiner/12365ed37c9146e49973 to your computer and use it in GitHub Desktop.
Save zeroSteiner/12365ed37c9146e49973 to your computer and use it in GitHub Desktop.
Chromoting Secret Hash Calculation
import base64
import hashlib
import hmac
host_id = '11111111-2222-3333-4444-555555555555'
host_secret_hash = 'hmac:TI/gifEUGbMsEhiZSLY0PcTX4xyPzpvcb7b6seOhOYc='
secret_pin = '123456'
if 'hmac:' + base64.b64encode(hmac.new(host_id, secret_pin, hashlib.sha256).digest()) == host_secret_hash:
print('[+] secret hashes match!')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment