G
Gilian
Hello,
I hope somebody can help me with this problem.
I have a perl-script that creates file, that need to be encrypted.
I use the Crypt::OpenPGP module to make the encryption done. The only
thing I want to do is 'conventional encryption', which means I don't
want to use keys, but I want to encrypt it with a password.
The script looks like this:
#!/usr/bin/perl
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new();
$file = 'file.txt';
$phrase = 'test123456';
$encrypted = $pgp->encrypt(
Compat => 'PGP5', # <== in PGP2 it works fine!
Filename => $file,
Passphrase => $phrase,
) or die "can not encrypt ",$pgp->errstr;
print "$encrypted\n";
open (OUTFILE, "> $file.pgp");
print OUTFILE "$encrypted";
close (OUTFILE);
When I do this with the encryption in PGP2 there is no proble, when I
try to encrypt in PGP5 I get the following response:
Can't call method "keysize" on an undefined value at
/usr/lib/perl5/site_perl/5.8.3/Crypt/OpenPGP.pm line 525.
Can somebody tell me what the problem is, or rather give me a solution
to the problem.
Thanks in advance.
Regards,
Gilian.
I hope somebody can help me with this problem.
I have a perl-script that creates file, that need to be encrypted.
I use the Crypt::OpenPGP module to make the encryption done. The only
thing I want to do is 'conventional encryption', which means I don't
want to use keys, but I want to encrypt it with a password.
The script looks like this:
#!/usr/bin/perl
use Crypt::OpenPGP;
my $pgp = Crypt::OpenPGP->new();
$file = 'file.txt';
$phrase = 'test123456';
$encrypted = $pgp->encrypt(
Compat => 'PGP5', # <== in PGP2 it works fine!
Filename => $file,
Passphrase => $phrase,
) or die "can not encrypt ",$pgp->errstr;
print "$encrypted\n";
open (OUTFILE, "> $file.pgp");
print OUTFILE "$encrypted";
close (OUTFILE);
When I do this with the encryption in PGP2 there is no proble, when I
try to encrypt in PGP5 I get the following response:
Can't call method "keysize" on an undefined value at
/usr/lib/perl5/site_perl/5.8.3/Crypt/OpenPGP.pm line 525.
Can somebody tell me what the problem is, or rather give me a solution
to the problem.
Thanks in advance.
Regards,
Gilian.