Tuesday, August 18, 2009

Unencrypting a directory of gpg files in perl

Here is a way to unencrypt all files in a directory which contain many gpg files

my @FList=`ls *.gpg`;
foreach $FFile (@FList)
{
open (MYFILE, "echo $secret | gpg --batch --passphrase-fd 0 --decrypt $FFile | cut -c2-5 |");
while (){
print "Line # ".$i." ".$_;
$i++;
}
close MYFILE;

No comments: