PERL and Blowfish

Hello,

Recently I got a PERL program written that will encrypt file using Blowfish. I need some changes but am unable to
trace that person and I am not a PERL programmer. I am a VB.NET Programmer. I have installed PERL 5.8 from http://downloads.activestate.com/ActivePerl/Windows/5.8/ActivePerl-5.8.8.817-MSWin32-x86-257965.msi
and Crypt-Blowfish_PP.

Following are my queries:

a. The file cryptdata.pl has the following line:
use Crypt::Blowfish;
But the client wants to use Crypt-Blowfish_PP and that is what I have downloaded and insgtalled. Since I am running this under windows and the source is pure text, can I change the line to use Crypt::Blowfish_PP; using NotePad? Will this impact the encryption code written by the earlier programmer?

b. Also can I change the line:
 my $proc = new Crypt::Blowfish $key_valid;
to
my $proc = new Crypt::BlowfishPP $key_valid;

c. The source file has:
my $key = "My key"
Now this key is in pure text format. How can I encrypt this
key itself? Otherwise programmers who will use this
source file can see the key which is not good. In other
words, I need to put the encrypted key and then decrypt
it at run-time. If this is not possible, then can I compile
this cryptdata.pl file into an executable? If yes, how? or is there any third party tool that can convert my .pl file into an exe?

d. What is difference between Blowfish and Blowfish_PP? Will the output differ if I change Blowfish to Blowfish_PP?

Regards,
VJ

vj_miAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozoCommented:
the output should be identical if you just change Crypt::Blowfish to Crypt::Blowfish_PP
Crypt::Blowfish_PP is implemented purely in Perl so it is more portable, while Crypt::Blowfish compiled in C so it is faster.
You can get the key at run time.  
0
ysreCommented:
a) According to the doc available at CPAN you can simply replace the use-call by the Crypt::Blowfish_PP one :)
b) It's actually "my $blowfish=new Crypt::Blowfish_PP ($key);" ;)
c) IMO you'd need a key to decrypt your crypted in-source key (which has to be supplied somehow.. eg. Add a prompt asking for the phrase on startup).
d) PP = PurePerl.. Which means it doesn't have to be compiled using a compiler.. but is slower than the C implementation of blowfish used in Crypt::Blowfish.

On a sidenote: You might wanna get Crypt::Blowfish (without the _PP) from activeperl's own repository.. Check ppm install Crypt_Blowfish (or something along the lines).
ppm.bat is a helper tool for accessing the ActivePerl module repository from the command line.. It can be found at %ACTIVEPERLINSTALLATIONDIRECTORY%/bin/ppm.bat :)

Ys

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ysreCommented:
Thanks for the points :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.