In the perldoc for Crypt::Blowfish, I see that it mentions using Crypt::CBC as a helper module. In looking at Crypt::CBC, it says the following:
In combination with a block cipher such as DES or IDEA, you can encrypt and decrypt messages of arbitrarily long length.
That seems promising enough. Also, the example code that they have there actually uses Blowfish, so you've got that going for you. I see, however, that you've place a seemingly arbitrary restriction on using core modules (of which Crypt::Blowfish is not one). I suppose you could do something like this:
use Crypt::Blowfish my $file = "your file name here"; my $key = "magick"; open(my $in, "<", $file ) or die "Couldn't open '$file' for re +ad: $!"; open(my $out, ">", "$file.crypt") or die "Couldn't open '$file.crypt' +for write: $!"; my $cipher = Crypt::Blowfish->new($key); my $buffer; while( read($in, $buffer, 1024) ) { print $out $cipher->encrypt($buffer); }
Of course, the docs on Crypt::Blowfish say to make sure that the block that you're encrypting is exactly 8 bytes long (which confuses me, so I didn't address it in my example code)

thor

Feel the white light, the light within
Be your own disciple, fan the sparks of will
For all of us waiting, your kingdom will come


In reply to Re: Encrypting large files with Crypt::Blowfish by thor
in thread Encrypting large files with Crypt::Blowfish by PeterE

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.