Skip to content

Instantly share code, notes, and snippets.

View peinwag's full-sized avatar
:octocat:

Patrick Einwag peinwag

:octocat:
View GitHub Profile
@peinwag
peinwag / smtp.rb
Created December 7, 2021 09:54
derive access key to smtp secret v4
require 'openssl'
require 'base64'
def aws_iam_smtp_password_generator(key, region)
# The values of the following variables should always stay the same.
date = "11111111"
service = "ses"
terminal = "aws4_request"
message = "SendRawEmail"
version_in_bytes = "\x04"