Here is a shell script to decrypt a folder of files that was originally encrypted with openssl.

#! /bin/bash

#Disclaimer: This script is provided “as -is” for use at your sole risk without any warranty, whether

#express or implied of its accuracy, completeness, fitness for a particular purpose. The author accepts no liability for any damages or data loss you may sustain even

#if it has been advised of the possibility of such damages.

#Set Working Folder

#WorkingDirectory=./Downloads

#Set working encryption passphrase

PassPhrase=“password”

#Create output folder

#mkdir $WorkingDirectory/output

#uncomment next line to create backup copy of source files

#cp -r $WorkingDirectory/*.pdf $WorkingDirectory/output

read -p “Press [Enter] key to continue”

for file in .enc #$WorkingDirectory/.pdf

do

echo “Processing $file…”

#newfile=$(echo $file | rev | cut -f 2- -d “.” | rev)

#echo “Output file will be $newfile”

read -p “Press [Enter] key to continue”

#echo $PassPhrase

#uncomment next line to decrypt file or insert openssl command

#openssl enc -aes-256-cbc -d -in $file -out $newfile -k $PassPhrase # -iter 1000

echo “decrypted $file …”

read -p “Press [Enter] key to continue”

#uncomment next line to move decrypted file to output folder

#mv $file.txt $WorkingDirectory/output/

done