8 #[ "x${SALT}" = "x" ] && die "you must set SALT to the salt."
9 #SALT=$(dd count=1024 if=/dev/random 2>/dev/null |md5sum|sed 's/-//')
10 #[ $? -ne 0 ] && die "failed to generate SALT"
11 [ "x${PASS}" = "x" ] && die "you must set PASS to the password"
15 if [[ "${FILE}" = *.nc ]]; then
16 echo "Not encrypting ${FILE} because its name already ends in .nc"
19 if [ -e "${NEW_FILE}" ]; then
20 echo "Not encrypting ${FILE} because there is already a ${NEW_FILE}"
22 if openssl enc -aes-256-ecb \
24 -k "${PASS}" < "${FILE}" > "${NEW_FILE}"; then
25 echo "Created ${NEW_FILE}"
27 echo "Failed to create ${NEW_FILE}"