Created
June 23, 2017 10:23
-
-
Save mitchese/fde3e2db94b6230ad0ced8169b80f40c to your computer and use it in GitHub Desktop.
Convert AWS credentials to SMTP password
This file contains 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 base64 | |
import hmac | |
import hashlib | |
import sys | |
def generate_smtp_password(key): | |
message = "SendRawEmail" | |
version = '\x02' | |
h = hmac.new(key, message, digestmod=hashlib.sha256) | |
print base64.b64encode("{0}{1}".format(version, h.digest())) | |
generate_smtp_password(sys.argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment