#!C:\strawberry\perl\bin\perl # BEGIN { eval { require Crypt::Blowfish; }; } 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 = $ARGV[0]; $outf = "test.txt"; open(INFILE,$filen) or die "Can't open $filen for reading $!\n"; binmode INFILE, ":encoding(UTF-8)"; open(OUTFILE, ">>", $outf) or die "Can't open $outf to write: $!\n"; # binmode OUTFILE, ":encoding(UTF-8)"; $cipher->start('decrypting'); # print OUTFILE $cipher->decrypt($_) while(); while () { $line = $_; print OUTFILE $cipher->decrypt($line); } # print OUTFILE $cipher->finish(); $cipher->finish(); close(INFILE); close(OUTFILE);