my $cipher = Crypt::Blowfish->new($key); my $buffer; while( read($in, $buffer, 8) ) { print $out $cipher->encrypt($buffer); }