Skip to content

Instantly share code, notes, and snippets.

@wyw
Forked from theY4Kman/hmac_sha256.py
Created March 13, 2018 03:41
Show Gist options
  • Save wyw/5c8289895234b2595652c7ffa44e4725 to your computer and use it in GitHub Desktop.
Save wyw/5c8289895234b2595652c7ffa44e4725 to your computer and use it in GitHub Desktop.
Python SHA-256 HMAC
from Crypto import HMAC, SHA256
def hmac_sha256(key, msg):
hash_obj = HMAC.new(key=key, msg=msg, digestmod=SHA256)
return hash_obj.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment