Skip to content

Instantly share code, notes, and snippets.

@vigzmv
Forked from theY4Kman/hmac_sha256.py
Last active July 9, 2017 08:26
Show Gist options
  • Save vigzmv/8919591eae32878bab466b5f8cb8a111 to your computer and use it in GitHub Desktop.
Save vigzmv/8919591eae32878bab466b5f8cb8a111 to your computer and use it in GitHub Desktop.
Python SHA-256 HMAC
from Crypto.Hash 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