Last active
February 23, 2016 18:20
-
-
Save iamd3vil/7c05770cebd066a975d5 to your computer and use it in GitHub Desktop.
hmac_python.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib | |
import hmac | |
secret_key = b"secret-key" | |
text = b"This is a secret" | |
hmac_sha1 = hmac.HMAC(key=secret_key, msg=text, digestmod=hashlib.sha1).hexdigest() | |
print("HMAC is {}".format(hmac_sha1)) # HMAC is 08dc7014b3e778a44af52ea7a16a973a9b48f0dd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment