AppleScript - echo into openssl AES encryption - is there a way to crack/snoop thru logs? Don't know if this question is better off here, or in the Linux world...but I need a decent answer.. :)

I am using Applescript to pull data from fields in a spreadsheet or database, shove them directly into terminal for encryption.

My Applescript includes a line like:

echo "thisismydatastring and my saltbits"  | openssl aes-256-cbc -k thisismypassword -base64 


My question:  is there a way one could filter thru log files to catch this plaintext instance of the password? 

Is there a better way to prevent hacking?

If sending an "echo" into terminal is traceable, is there another way I could push something into Terminal where it doesn't hit any logs (and where AppleScript can get the results)?
I overcome the password issue in my bash scripts by sourcing (including) another file with a predetermined variable already set.

For example.  Say you have a "config" file  ~/config.conf and in it you assign some variables:

# Config file for MyScript.sh

$user = Me
$pass = S3cr3t5!


In your script you source the file so you can use the variables you defined:

#!/bin/bash

source /Path/to/config.conf

stuff= "thisismydatastring and my saltbits"

echo  $stuff | openssl aes-256-cbc -k $pass -base64


Personally, I like to keep the line that executes the command as clean as possible using variables (like stuff in the example above) so that it's easier to see what the command is doing and consequently easier to debug.

Is this safe from prying eyes?  Yes, for the most part.  You can set the permissions so that only the user can read and write the file and deny it to everyone else:

chmod 600 config.conf


Anyone snooping through logs (which is your question) won't be able to see the plain text passwords.