- or download this
sub read_bytes {
my ($fh, $to_read) = @_;
...
my ($fh, $str) = @_;
print $fh (pack('N', length($str)), $str);
}
- or download this
sub writeSubmissions {
my ($cipher, $log_file, $str) = @_;
...
my $cipher = Crypt::CBC->new({ key => $my_key, cipher => 'Rijndael' })
+;
writeSubmissions($cipher, ..., ...);
- or download this
my $key_file = 'key_file.txt';
my $encrypted = '...';
...
while (!eof($FH_encrypted)) {
print $FH_decrypted $cipher->decrypt(read_str($FH_encrypted));
}