Created
September 29, 2016 21:44
-
-
Save richvdh/e7aca9c2c867fa7fe33b9b32071ab839 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env python | |
import hashlib | |
import hmac | |
user = "esouvbh" | |
password = "souvik" | |
admin = False | |
key="shared_secret" | |
mac = hmac.new( | |
key=key, | |
digestmod=hashlib.sha1, | |
) | |
mac.update("esouvbh") | |
mac.update("\x00") | |
mac.update("souvik") | |
mac.update("\x00") | |
mac.update("admin" if admin else "notadmin") | |
print mac.hexdigest() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment