http://www.perlmonks.org?node_id=1195931


in reply to Re: Using Crypt::OpenPGP with large files
in thread Using Crypt::OpenPGP with large files

Is there anything wrong with that? Need to open $fh to output file and then print to the output file the plain text after it was decrypted. Still the issue is the decrypt function returns to variable as opposed to being able to pass output filehandle
  • Comment on Re^2: Using Crypt::OpenPGP with large files

Replies are listed 'Best First'.
Re^3: Using Crypt::OpenPGP with large files
by stevieb (Canon) on Jul 24, 2017 at 22:34 UTC

    Well, you could just as well do this:

    $fh = $pgp->decrypt(Filename => $file, Passphrase => $pp);

    But depending on how that method works, you may not see any improvement. Worth a try though.

      All the code slurps files. Not a bad approach for starters, but it inevitably runs into memory limits
Re^3: Using Crypt::OpenPGP with large files
by Anonymous Monk on Jul 25, 2017 at 01:04 UTC

    Is there anything wrong with that? Need to open $fh to output file and then print to the output file the plain text after it was decrypted.

    But your code does not try to print anything to $fh, all it does is create an empty file ..

    Still the issue is the decrypt function returns to variable as opposed to being able to pass output filehandle

    Yeah decrypt doesn't do that

    You can make a feature request or bug report at rt://Crypt-OpenPGP ( bug-Crypt-OpenPGP@rt.cpan.org )

    It would be nice if decrypt didnt slurp giant files

      Your right, $fh = $pt; should have been print $fh $pt; I think copied the incorrectly into my original post