Perl Basics
Introduction to Perl
FAQ's
CGI
Regular Expressions

PC Overview
Cool Stuff
My Modules
Success Stories
Links
Perl in the News
Logos
Perl @ msn
Perl Chat

PC Internals
About
Contact
Guest Book
Handy Logos
What's new

Crypt::Blowfish

Blowfish was designed in 1993 by Bruce Schneier as a fast, free alternative to existing encryption algorithms.
P-friendly

[ home ] - [ search ] - [ sitemap ]

[ perl corner ] > [ Cryptography ] > [ Blowfish ] > [ more... ]

The key size can range from 32 bits (4 characters) to 448 bits (56 characters).

use Crypt::Blowfish;

my $key = pack("H16", "0123456789ABCDEF");  # min. 8 bytes

my $cipher = new Crypt::Blowfish $key;

my $ciphertext = $cipher->encrypt("plaintex");  # SEE NOTES

print unpack("H16", $ciphertext), "\n";


#####  Decrypt:

my $plaintext = $cipher->decrypt($ciphertext);

print "plaintext = '$plaintext'\n";

Demo

encrypt - decrypt

Input String: Is HEX

Secret Key: (At least 8 Bytes)



[ Example in PHP ]

home - feedback - search - web jobs
© 1998-2004 retoh :)