To create an encrypted archive of thedirectory, using des3 encryption, to produce a file called thearchive.tgz.des3 which is protected by thepassword:
tar -cz thedirectory | openssl des3 -salt -out thearchive.tgz.des3 -pass pass:thepassword
To decrypt and extract the archive:openssl des3 -d -in thearchive.tgz.des3 -pass pass:thepassword | tar -xz
In both cases, remove the -pass pass:thepassword if you want to be prompted for the password.