use Crypt::CBC; my $cipher = Crypt::CBC->new( -key => 'fjeislqp12345678', -cipher => 'Blowfish'); .. various parameter and file declarations.. $cipher->start('encrypting'); for (my $i=0; $i < @$name; $i++) { $param_name = $name->[$i]; $param_value = $value->[$i]; $lineout = $param_name . "," . $param_value . "," . $filedate . "," . $utid . "\n"; print LATEST $cipher->crypt($lineout); print ALLFILE $cipher->crypt($lineout); print LAFILE $cipher->crypt($lineout); } print LATEST $cipher->finish(); print ALLFILE $cipher->finish(); print LAFILE $cipher->finish(); #### #!C:\strawberry\perl\bin\perl # use Crypt::CBC; # my ($line, $outf, $filen); my $cipher = Crypt::CBC->new( -key => 'fjeislqp12345678', -cipher => 'Blowfish'); # get filename if($#ARGV == -1) { print STDERR "$runtime::No data directory specified on the command line\n"; close(STDERR); exit; } $filen = $ARGV[0]; # $outf = "test.txt"; open(OUTFILE, ">>", $outf) or die "Can't open $outf to write: $!\n"; open(INFILE,$filen) or die "Can't open $filen for reading $!\n"; $cipher->start('decrypting'); print OUTFILE $cipher->crypt($_) while(); # while () { # $line = $_; # print OUTFILE $cipher->crypt($line); # } print OUTFILE $cipher->finish(); close(INFILE); close(OUTFILE);