I've been monkeying around with Blowfish and have gotten it to work with one exception.
This works:
use Crypt::Blowfish;
my $key = pack("H16", "0123456789ABCDEF"); # min. 8 bytes
my $cipher = new Crypt::Blowfish $key;
my $ciphertext = $cipher->encrypt("big John"); # SEE NOTES
my $plaintext = $cipher->decrypt($ciphertext);
print "Content-type: text/html\n\n";
print "<html>\n <head>\n <title></title>\n </head>\n";
print "<body>\n <center>\n <h1>Here You Go</h1>\n </center>\n";
print unpack("H32", $ciphertext), "\n";
print "<P> $plaintext";
print "</body>\n</html>\n";
When executed it gives you the encrypted part and the decrypted part.
Now... if the encrypted word (Big John) is more than 8 characters long then the script breaks (server error). Wha' hoppen?
Does anybody know of a good tutorial on Blowfish or any other related encryption programs?
This works:
Code:
#!/usr/local/bin/perl use Crypt::Blowfish;
my $key = pack("H16", "0123456789ABCDEF"); # min. 8 bytes
my $cipher = new Crypt::Blowfish $key;
my $ciphertext = $cipher->encrypt("big John"); # SEE NOTES
my $plaintext = $cipher->decrypt($ciphertext);
print "Content-type: text/html\n\n";
print "<html>\n <head>\n <title></title>\n </head>\n";
print "<body>\n <center>\n <h1>Here You Go</h1>\n </center>\n";
print unpack("H32", $ciphertext), "\n";
print "<P> $plaintext";
print "</body>\n</html>\n";
When executed it gives you the encrypted part and the decrypted part.
Now... if the encrypted word (Big John) is more than 8 characters long then the script breaks (server error). Wha' hoppen?
Does anybody know of a good tutorial on Blowfish or any other related encryption programs?