use Crypt::CBC; # create a cipher object with cipher block chaining mode using the Blowfish algorithm my $Cipher = Crypt::CBC->new( {'key' => 'my secret key', 'cipher' => 'Blowfish', 'iv' => $iv, 'regenerate_key' => 0, # default true 'padding' => 'space', 'prepend_iv' => 0, 'pcbc' => 1 #default 0 }); $Cipher->encrypt_hex(...);