#!/opt/local/perl/bin/perl -w use strict; use DBI; use Crypt::DES; use Crypt::CBC; # establish DB connection my $dbname = 'dbi:Oracle:my_db.world'; my $user = 'myuser'; my $password = 'mypass'; my $dbh = DBI->connect($dbname, $user, $password); if (!$dbh) { die "Error connecting to database; $DBI::errstr"; } $dbh->{LongReadLen} = 8192; my $sql = "select encrypted_column from my_table where rownum < 10"; my @responseList = map {$_->[0]} @{$dbh->selectall_arrayref($sql)}; my $cipher = Crypt::CBC->new(-key => 'mysecret', -cipher => 'Crypt::DES'); foreach my $cipherText (@responseList) { my $plaintext = $cipher->decrypt($cipherText); print "$plaintext\n"; }