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.

Installing Perl Crypt::CBC Module
Installing Perl Crypt::CBC Module

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.

Table of Contents

 About This Book

 Blowfish Cipher Algorithm

 Perl Crypt::Blowfish Module

 Perl Crypt::ECB Perl Module

Perl Crypt::CBC Module

 What is Crypt::CBC

Installing Crypt::CBC 2.33 with ActivePerl

 Crypt::CBC Encryption with Literal Keys

 Crypt::CBC Literal Key Error Cases

 Crypt::CBC Encryption with Crypt::Blowfish Objects

 Crypt::CBC Operation Simulation

 Crypt::CBC Encryption Verification

 Blowfish CBC 2-Block Test Vectors

 Crypt::CBC Prepending IV to Ciphertext

 Crypt::CBC Encryption with Salted Keys

 Crypt::CBC Salted Key Test Cases

 Crypt::CBC Secret Key and IV Algorithm

 Crypt::CBC Encryption with Random Salt

 Crypt::CBC Padding Options

 Crypt::CBC Padding Option Tests

 Crypt::CBC Blowfish Encryption Summary

 Perl Crypt::CFB Perl Module

 OpenSSL "enc -bf-ecb" for Blowfish/ECB Encryption

 OpenSSL "enc -bf-cbc" for Blowfish/CBC Encryption

 OpenSSL "enc -bf-cfb" for Blowfish/CFB Encryption

 OpenSSL "enc -bf-ofb" for Blowfish/OFB Encryption

 PHP Mcrypt Extension for Blowfish

 Blowfish 8-Bit Cipher in PHP

 References

 Full Version in PDF/EPUB