Created
September 14, 2015 11:46
-
-
Save limitusus/cc0a5068e615ed563993 to your computer and use it in GitHub Desktop.
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
requires 'Digest::SHA'; | |
requires 'MIME::Base64'; |
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
#!/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