#! /usr/bin/perl -w
use strict;
use autodie;

use Crypt::CBC;
use Getopt::Long;

my %options = ('cipher-key' => 'BlahBlahBlahBlah');
GetOptions(
    \%options => qw(
        cipher-key|k=s
        password|p=s
        file-name|f=s
    )
);

my $cipher = Crypt::CBC->new(cipher => 'Rijndael', key => $options{'cipher-key'});

open my $fh, '>', $options{'file-name'};
print $fh $cipher->encrypt($options{password});
close($fh);
