in reply to Encrypting large files with Crypt::Blowfish
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:
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)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); }
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Encrypting large files with Crypt::Blowfish
by radiantmatrix (Parson) on Oct 24, 2005 at 18:03 UTC | |
by PeterE (Initiate) on Oct 25, 2005 at 15:05 UTC | |
by radiantmatrix (Parson) on Oct 25, 2005 at 19:54 UTC | |
|
Re^2: Encrypting large files with Crypt::Blowfish
by sauoq (Abbot) on Oct 24, 2005 at 16:42 UTC | |
by thor (Priest) on Oct 24, 2005 at 16:47 UTC |