#! /Users/XXX/perl5/perlbrew/perls/perl-5.20.0/bin/perl use strict; use lib "/Users/XXX/perl5/perlbrew/perls/perl-5.20.0/lib/site_perl/5.20.0/darwin-2level/Crypt/"; use Crypt::CBC; #use Crypt::Rijndael; my $cipher = Crypt::CBC->new( -key => $ARGV[0], -cipher => 'Rijndael' ); my $ciphertext = $cipher->encrypt("texttoencrypt"); open(my $fh,">",$ARGV[1]); print $fh $ciphertext; close $fh; my $plaintext = $cipher->decrypt($ciphertext); print "ciphertext " , $ciphertext,"\n"; print "plaintext " , $plaintext,"\n";