in reply to How to do encryption ?

Here is a good example:
#!/usr/bin/perl -w use strict; use Crypt::Blowfish_PP; my $key="abcdefghijklmnopqrstuvwxyz"; my $data="This is what I want to encrypt"; my $bf = Crypt::Blowfish_PP->new($key); my $encrypted_data = $bf->encrypt($data); my $decrypted_data = $bf->decrypt($encrypted_data);
Also, please look at the documentation for the module as well. It will explain how to do it.

TStanley
In the end, there can be only one!

Replies are listed 'Best First'.
Re: Re: How to do encryption ?
by THRAK (Monk) on Mar 23, 2001 at 20:29 UTC
    I came across this node and thought I'd give it a try as it is something I could use. But after installing the module and trying your example I get a 'Can't locate object method "new" via package "Crypt::Blowfish" ' error when I run it. Did anybody else run into this or better yet can somebody explain what I may be doing wrong?

    Thanks,

    THRAK
      The module that I used above is Crypt::Blowfish_PP, which is a
      pure perl version of the Crypt::Blowfish module. Check your use line
      to make sure you are using Crypt::Blowfish_PP and not Crypt::Blowfish

      TStanley
      In the end, there can be only one!
        I'm using "Blowfish_PP".  I did a straight cut and paste then did a "perl -wc tst.pl" to make sure things were fine. That passes, but when I run it I get the error.

        THRAK
        I'm using "Blowfish_PP".  I did a cut and paste of your example then a syntax check on it which passes. But when I run it I get the new method not found error.

        THRAK