Blowfish Cipher Tutorials - Herong's Tutorial Examples - Version 1.21, by Dr. Herong Yang
Installing Crypt::CBC 2.33 with ActivePerl
A tutorial is provided to show how to install Crypt-CBC 2.33 module, that can be used together with Crypt::Blowfish (installed previously) to encrypt plaintext of any size.
Once we know what is Crypt::CBC, we may want to get it installed and try it. Here what I did to install it with ActivePerl 5.18 on my Windows system:
1. Run "ppm", the Perl Package Manager.
2. Click menu View > All Packages, to see all packages.
3. Find "Crypt-CBC - 2.33", right-mouse click on it and select "Install..." command to mark it for installation.
4. Press "Ctrl-Enter" to run installation. Crypt-CBC - 2.33 will be downloaded and installed automatically.
5. Exit "ppm".
6. Enter a simple test script, Crypt-CBC-Blowfish-Hello.pl, with a text editor:
#- Crypt-CBC-Blowfish-Hello.pl use Crypt::CBC; $cipher = Crypt::CBC->new( -key => 'my secret key', -cipher => 'Blowfish' ); $ciphertext = $cipher->encrypt("This data is hush hush"); print unpack("H*", $ciphertext), "\n";
7. Run the test script in a command window:
C:\Herong>perl Crypt-CBC-Blowfish-Hello.pl 53616c7465645f5fe54d5ca7f33d3b06571eaaa5 5183be059f196fe52b6c156f3450df58a6f103c1
Cool! I have correctly installed "Crypt-CBC 2.33", which is a Perl implementation of the CBC (Cipher Block Chaining) block cipher operation mode. It can be used together with Crypt::Blowfish (installed previously) to encrypt plaintext of any size. I can write more Perl scripts to play with Blowfish cipher in CBC mode now. See next tutorials.
Last update: 2015.
Table of Contents