labrute974

SES SMTP password generation

Sep 26th, 2013
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.34 KB | None | 0 0
  1. #!/usr/bin/ruby
  2. require 'openssl'
  3. require 'base64'
  4.  
  5. sha256 = OpenSSL::Digest::Digest.new('sha256')
  6. secret_key = "Secret Access Key"
  7. message = "SendRawEmail"
  8. version = "\x02"
  9.  
  10. signature = OpenSSL::HMAC.digest(sha256, secret_key, message)
  11. verSignature = version + signature
  12.  
  13. smtp_password = Base64.encode64(verSignature)
  14. puts smtp_password
Advertisement
Add Comment
Please, Sign In to add comment