dec / enc: don't set SALT
authorColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Mon, 11 Apr 2016 03:18:19 +0000 (20:18 -0700)
committerColin Patrick Mccabe <cmccabe@alumni.cmu.edu>
Mon, 11 Apr 2016 03:18:19 +0000 (20:18 -0700)
dec.sh
enc.sh

diff --git a/dec.sh b/dec.sh
index ef4aaa1..bbad6c6 100755 (executable)
--- a/dec.sh
+++ b/dec.sh
@@ -5,7 +5,6 @@ die() {
     exit 1
 }
 
-[ "x${SALT}" = "x" ] && die "you must set SALT to the salt."
 [ "x${PASS}" = "x" ] && die "you must set PASS to the password"
 
 RET=0
@@ -16,7 +15,6 @@ for FILE in "$@"; do
             echo "Not decrypting $FILE because there is already a ${BASE_FILE}"
         else
             if openssl enc -d -aes-256-ecb \
-                    -S "$SALT" \
                     -k "$PASS" < "${FILE}" > "${BASE_FILE}"; then
                 echo "Created ${BASE_FILE}"
             else
diff --git a/enc.sh b/enc.sh
index a0ec8ef..e6c51eb 100755 (executable)
--- a/enc.sh
+++ b/enc.sh
@@ -5,7 +5,9 @@ die() {
     exit 1
 }
 
-[ "x${SALT}" = "x" ] && die "you must set SALT to the salt."
+#[ "x${SALT}" = "x" ] && die "you must set SALT to the salt."
+#SALT=$(dd count=1024 if=/dev/random 2>/dev/null |md5sum|sed 's/-//')
+#[ $? -ne 0 ] && die "failed to generate SALT"
 [ "x${PASS}" = "x" ] && die "you must set PASS to the password"
 
 RET=0
@@ -18,7 +20,7 @@ for FILE in "$@"; do
             echo "Not encrypting ${FILE} because there is already a ${NEW_FILE}"
         else
             if openssl enc -aes-256-ecb \
-                    -S "${SALT}" \
+                    -salt \
                     -k "${PASS}" < "${FILE}" > "${NEW_FILE}"; then
                 echo "Created ${NEW_FILE}"
             else