in reply to Encrypting large files with Crypt::Blowfish

Hi,
If you want to encrypt the content of a file using Crypt::Blowfish, you can slurp it, and pass the cypher as it where a "normal scalar", and then you can handle the content writing it back to disk, sending it, etc.

You can deal with files as large as you want, given the required system resources.

As Crypt::Blowfish relies on an external C library (Blowfish.so) it is faster than the "Pure Perl" implementation, Crypt::Blowfish_PP

Update: Sorry about this. I did not explained as i should. I was meaning that when encrypting with Blowfish, it does not matter weather you use text coming from a string, file or whatever, thinking always about chunking it before attempting to encrypt it. As it has been replied, you need to split the content as you encrypt it, but i was centered on the no limitation for the size of the file being encrypted, and the possibility of this module for handling unlimited chunks of data.
  • Comment on Re: Encrypting large files with Crypt::Blowfish

Replies are listed 'Best First'.
Re^2: Encrypting large files with Crypt::Blowfish
by ikegami (Patriarch) on Oct 24, 2005 at 16:13 UTC

    That's entirely false. Crypt::Blowfish only encrypts blocks of exactly 8 bytes. Passing an entire file will result in an error (unless, of course, the file happens to be 8 bytes long).

    if (input_len != 8) croak("input must be 8 bytes long");

    The Pure Perl version doesn't croak, but it only encrypts the first 8 bytes of data passed to it.

    Crypt::CBC is the solution to this, as mentioned in the Crypt::Blowfish docs.