Skip to content

Instantly share code, notes, and snippets.

@limitusus
Created September 14, 2015 11:46
Show Gist options
  • Save limitusus/cc0a5068e615ed563993 to your computer and use it in GitHub Desktop.
Save limitusus/cc0a5068e615ed563993 to your computer and use it in GitHub Desktop.
requires 'Digest::SHA';
requires 'MIME::Base64';
#!/usr/bin/env perl
use 5.012_000;
use Digest::SHA qw/hmac_sha256/;
use MIME::Base64;
my $key = "himitsu";
my $message = "SendRawEmail";
my $version_byte_string = pack("c", 2);
print "$version_byte_string\n";
my $signature = hmac_sha256($message, $key);
my $signature_ver = $version_byte_string . $signature;
my $password = encode_base64($signature_ver);
print $password . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment