use Digest::SHA; use utf8; no utf8; use MIME::Base64 qw(encode_base64 decode_base64); $x = "password"; utf8::encode($x); @ascii = unpack("C*", $x); print "UTF-8 : "; foreach $val (@ascii) { print $val; } print "\n"; $sha = Digest::SHA->new; $sha->add(@ascii); @z = unpack("C*",$sha->digest); print "Encrypted Bytes : "; foreach $val (@z) { print $val; } print "\n"; #$x = "jsmith"; #utf8::encode($x); # #print "0. \t\t" . $x . "\n"; #Encrypt, into bytes #@y = $sha->digest; #print "1. \t\t" . $y . "\n"; #Encode #$z = encode_base64($y); #print "2. \t\t" . $z . "\n"; #Print #print "Needs to be: \t5yfRRkrhJDbomacm2lsvEdg4GyY=";