http://qs321.pair.com?node_id=58174

TStanley has asked for the wisdom of the Perl Monks concerning the following question:

I have been tasked to add some features to my company's Perl API to allow
for the encryption of credit card information. I am using the Perl implemenation
of the Blowfish encryption algorythm (Blowfish_PP) and Crypt::CBC modules to
do this. I am also using the ConfigFiles module to get the key information from
the .ini file. To make sure my module worked, I wrote a short script to test it,
but I received the following back:
Encryption.pm did not return a true value at test.pl line 3. BEGIN failed--compilation aborted at test.pl line 3

This is the test script I wrote:
#!/usr/bin/perl -w use strict; use Encryption; my $ENC=Encryption->new(); my $TestString="This is a test"; my $EncryptedString = $ENC->encrypt_acctnumber($TestString); print"\$EncryptedString is : $EncryptedString";

And here is the module:
#!/usr/bin/perl -w use strict; use ConfigFile; use CBC; use Blowfish_PP; use Env qw (INI); package Encryption; sub new{ my $pkg = shift; # Default to the .ini file in the current directory if(!defined($INI)){ $INI = "test.ini"; } # Read the .ini file for the key setting my $ini = ConfigFile->new($INI); my $KEY = $ini->Parameter('Key','1'); # Create the Encryption object my $CBC = new CBC($KEY,'Blowfish'); return bless $pkg; } sub encrypt_acctnumber{ my $encrypted=$CBC->encrypt_hex($_[0]); return $encrypted; }
From what I can tell by the error code being returned, it can't even find the module
in question. Any help would be appreciated. Thanks in advance.

TStanley
In the end, there can be only one!