use Crypt::CBC; my $cipher = Crypt::CBC->new( -key => 'fjeislqp12345678', -cipher => 'Blowfish'); # get input arrays my($name, $value) = @_; # open output files my($latest_file,$all_file, $latest_all_file); my($param_name, $param_value,$file_time,$lineout); my($cipher_text); $file_time = get_time_for_file(); $latest_file = "C:\\hc\\logs\\SC\\TO\\Bode_" . $utid . "_latest_" . $file_time . ".txt"; open(LATEST, ">>",$latest_file) or die "Can't open $latest_file $!\n"; binmode LATEST, ":encoding(UTF-8)"; # $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->encrypt($lineout); } print LATEST $cipher->finish(); close(LATEST);