use English;
use strict;
use locale;
use warnings;
use Safe;
use Config;
use Data::Dumper;
use Crypt::CBC; # libcrypt-cbc-perl
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
use MIME::Base64 qw( encode_base64 decode_base64 );
my $url=sprintf("http://www.%s/%s/%s",$webServerAddress,$webDirectory,$publicFileName);
my $ciphertext = get($url);
if ($debug){
open(my $FH, '>', "/tmp/ciphertext" );
print $FH $ciphertext;
close $FH or warn $!;
open(my $FH, '<', "/tmp/ciphertext" );
read ($FH,$c,40960);
close $FH or warn $!;
$ciphertext = $c;
}
my $string = Crypt::CBC->new(
-cipher => 'Blowfish',
-header => 'none',
-literal_key => 1,
-key => "x"x56,
-iv => "x"x8
)->decrypt($ciphertext);
$debug = 0 esetén a kimenet szemét
$debug = 1 esetén értelmes adatot kapok
(a hibakezelés és egyéb részeket szándékosan csonkoltam)
vfero