You might want to look at GnuPG. It's been a while since I've used it, but you could encrypt using a passphrase with the command:
echo testing123|gpg --symmetric --passphrase-fd 0 --output EncryptedFilename FilenameToEncrypt
If you want the encrypted file to be email-safe you can also have it ASCII-encoded:
echo testing123|gpg --symmetric --passphrase-fd 0 --output EncryptedFilename --armour FilenameToEncrypt
Decrypt like so:
echo testing123|gpg -d --passphrase-fd 0 --output UnEncryptedFilename EncryptedFilename
The echo command pipes the passphrase into stdin for the gpg command. The "--passphrase-fd 0" option tells gpg to grab the passphrase from stdin. They used to have a plain old "--passphrase" option that let you give it on the gpg command itself, but they considered that too insecure (what a pain).
If you leave off the "--passphrase-fd 0" option (leave off the echo command as well), gpg will prompt you for a passphrase.