From e9576d180c4966acf563d2ac81d26ff6bda707d7 Mon Sep 17 00:00:00 2001 From: Nicolas Le Gall Date: Thu, 27 Jun 2019 00:07:59 +0200 Subject: [PATCH 1/2] Update `openssl` command to follow recommandation --- cryptr.bash | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cryptr.bash b/cryptr.bash index e53ace8..ced1f6c 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -46,9 +46,9 @@ cryptr_encrypt() { if [[ ! -z "${CRYPTR_PASSWORD}" ]]; then echo "[notice] using environment variable CRYPTR_PASSWORD for the password" - openssl $OPENSSL_CIPHER_TYPE -salt -in "$_file" -out "$_file".aes -pass env:CRYPTR_PASSWORD + openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "$_file".aes -pass env:CRYPTR_PASSWORD else - openssl $OPENSSL_CIPHER_TYPE -salt -in "$_file" -out "$_file".aes + openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "$_file".aes fi } @@ -61,9 +61,9 @@ local _file="$1" if [[ ! -z "${CRYPTR_PASSWORD}" ]]; then echo "[notice] using environment variable CRYPTR_PASSWORD for the password" - openssl $OPENSSL_CIPHER_TYPE -d -salt -in "$_file" -out "${_file%\.aes}" -pass env:CRYPTR_PASSWORD + openssl $OPENSSL_CIPHER_TYPE -d -salt -pbkdf2 -in "$_file" -out "${_file%\.aes}" -pass env:CRYPTR_PASSWORD else - openssl $OPENSSL_CIPHER_TYPE -d -salt -in "$_file" -out "${_file%\.aes}" + openssl $OPENSSL_CIPHER_TYPE -d -salt -pbkdf2 -in "$_file" -out "${_file%\.aes}" fi } From 36619f7ee0b1fde7f6a8d626436aa644d47f51c9 Mon Sep 17 00:00:00 2001 From: Nicolas Le Gall Date: Thu, 27 Jun 2019 00:29:35 +0200 Subject: [PATCH 2/2] Fix filename output --- cryptr.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cryptr.bash b/cryptr.bash index ced1f6c..6b54223 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -46,9 +46,9 @@ cryptr_encrypt() { if [[ ! -z "${CRYPTR_PASSWORD}" ]]; then echo "[notice] using environment variable CRYPTR_PASSWORD for the password" - openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "$_file".aes -pass env:CRYPTR_PASSWORD + openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file%\.aes}" -pass env:CRYPTR_PASSWORD else - openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "$_file".aes + openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file%\.aes}" fi }