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