From e0ee0fa380f8d1043062b70d4edcc001114d0c07 Mon Sep 17 00:00:00 2001 From: Guillaume <67098259+Gu1llaum-3@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:33:14 +0200 Subject: [PATCH 1/4] Update cryptr.bash Ask the user if they want to delete the original file --- cryptr.bash | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cryptr.bash b/cryptr.bash index edc2910..74940ec 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -50,6 +50,19 @@ cryptr_encrypt() { else openssl $OPENSSL_CIPHER_TYPE -salt -pbkdf2 -in "$_file" -out "${_file}.aes" fi + + if [[ $? -eq 0 ]]; then + read -p "Do you want to delete the original file? (y/N): " confirm + if [[ "$confirm" =~ ^[Yy]$ ]]; then + echo "[notice] Deleting the original file" + rm -f "$_file" + else + echo "[notice] Original file not deleted" + fi + else + echo "[error] Encryption failed, original file not deleted" 1>&2 + exit 6 + fi } cryptr_decrypt() { From 3dc218b08b2daa29b6bb7a4053116527d450c1d8 Mon Sep 17 00:00:00 2001 From: Guillaume <67098259+Gu1llaum-3@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:23:14 +0200 Subject: [PATCH 2/4] Update cryptr.bash Change Deleting for deleting --- cryptr.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptr.bash b/cryptr.bash index 74940ec..03877cf 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -54,7 +54,7 @@ cryptr_encrypt() { if [[ $? -eq 0 ]]; then read -p "Do you want to delete the original file? (y/N): " confirm if [[ "$confirm" =~ ^[Yy]$ ]]; then - echo "[notice] Deleting the original file" + echo "[notice] deleting the original file" rm -f "$_file" else echo "[notice] Original file not deleted" From 41ec15b5d150dfdf4192990f4137e9d4f60a3795 Mon Sep 17 00:00:00 2001 From: Guillaume <67098259+Gu1llaum-3@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:25:33 +0200 Subject: [PATCH 3/4] Update cryptr.bash Change Encryption for encryption --- cryptr.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cryptr.bash b/cryptr.bash index 03877cf..63c54e6 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -60,7 +60,7 @@ cryptr_encrypt() { echo "[notice] Original file not deleted" fi else - echo "[error] Encryption failed, original file not deleted" 1>&2 + echo "[error] encryption failed, original file not deleted" 1>&2 exit 6 fi } From d3697abcadce24a5b3ee3d76cf54c9fbc2caef9f Mon Sep 17 00:00:00 2001 From: Guillaume <67098259+Gu1llaum-3@users.noreply.github.com> Date: Tue, 30 Jul 2024 11:31:08 +0200 Subject: [PATCH 4/4] Update cryptr.bash Remove else clause and notice for non-deletion of original file --- cryptr.bash | 2 -- 1 file changed, 2 deletions(-) diff --git a/cryptr.bash b/cryptr.bash index 63c54e6..782df22 100755 --- a/cryptr.bash +++ b/cryptr.bash @@ -56,8 +56,6 @@ cryptr_encrypt() { if [[ "$confirm" =~ ^[Yy]$ ]]; then echo "[notice] deleting the original file" rm -f "$_file" - else - echo "[notice] Original file not deleted" fi else echo "[error] encryption failed, original file not deleted" 1>&2