AppleScript - echo into openssl AES encryption - is there a way to crack/snoop thru logs?
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.