Skip to content

Instantly share code, notes, and snippets.

@woowa-hsw0
Created November 24, 2016 01:17
Show Gist options
  • Save woowa-hsw0/c9722accee1a5f6f9b6940a13ee35876 to your computer and use it in GitHub Desktop.
Save woowa-hsw0/c9722accee1a5f6f9b6940a13ee35876 to your computer and use it in GitHub Desktop.
AWS Secret key -> SES SMTP Password
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# https://docs.aws.amazon.com/ko_kr/ses/latest/DeveloperGuide/smtp-credentials.html
from getpass import getpass
from hmac import HMAC
from hashlib import sha256
key = getpass('AWS Secret Access Key: ')
message = "SendRawEmail"
versionInBytes = chr(0x02)
print (versionInBytes + HMAC(key, message, sha256).digest()).encode('base64')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment