From 8c3daa527c6ce10dc45838a2561716d6e0c6498d Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Sat, 26 Nov 2022 14:49:39 +0800 Subject: [PATCH 1/3] Fix encrypt/decrypt --- Commands/Decrypt selection.plist | 4 +++- Commands/Encrypt selection.plist | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Commands/Decrypt selection.plist b/Commands/Decrypt selection.plist index e3caf46..ce0db8b 100644 --- a/Commands/Decrypt selection.plist +++ b/Commands/Decrypt selection.plist @@ -6,6 +6,8 @@ nop command #!/usr/bin/env bash +STD_IN=$( diff --git a/Commands/Encrypt selection.plist b/Commands/Encrypt selection.plist index 35326a5..616fd56 100644 --- a/Commands/Encrypt selection.plist +++ b/Commands/Encrypt selection.plist @@ -6,6 +6,8 @@ nop command #!/usr/bin/env bash +STD_IN=$( From 04fbc5346d9481d3fe74fb295bcbaa947e232799 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Sat, 26 Nov 2022 15:49:50 +0800 Subject: [PATCH 2/3] Use better encryption settings --- Commands/Decrypt selection.plist | 4 ++-- Commands/Encrypt selection.plist | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Commands/Decrypt selection.plist b/Commands/Decrypt selection.plist index ce0db8b..8dd91a1 100644 --- a/Commands/Decrypt selection.plist +++ b/Commands/Decrypt selection.plist @@ -11,13 +11,13 @@ STD_IN=$( diff --git a/Commands/Encrypt selection.plist b/Commands/Encrypt selection.plist index 616fd56..d04592a 100644 --- a/Commands/Encrypt selection.plist +++ b/Commands/Encrypt selection.plist @@ -11,14 +11,14 @@ STD_IN=$( From 60a24ff40c69ac153a304de669113dbc4aedb0c9 Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Wed, 30 Nov 2022 15:52:10 +0800 Subject: [PATCH 3/3] Fix multi-line `base64` encoding --- Commands/Decrypt selection.plist | 2 +- Commands/Encrypt selection.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Commands/Decrypt selection.plist b/Commands/Decrypt selection.plist index 8dd91a1..683aa38 100644 --- a/Commands/Decrypt selection.plist +++ b/Commands/Decrypt selection.plist @@ -17,7 +17,7 @@ get_pw () { pw=$(get_pw 'What is the password?' Decrypt) [[ -z "$pw" ]] && exit_discard -if ! echo $STD_IN|openssl enc -d -aes256 -md sha512 -a -A -pass "pass:$pw"; then +if ! echo -n "$STD_IN"|base64 --decode|openssl enc -d -aes256 -md sha512 -pass "pass:$pw"; then exit_show_tool_tip fi diff --git a/Commands/Encrypt selection.plist b/Commands/Encrypt selection.plist index d04592a..3f78392 100644 --- a/Commands/Encrypt selection.plist +++ b/Commands/Encrypt selection.plist @@ -18,7 +18,7 @@ pw1=$(get_pw 'What password should be used?' Continue) pw2=$(get_pw 'Enter password again to verify.' Encrypt) if [[ "$pw1" == "$pw2" ]]; - then echo $STD_IN|openssl enc -e -aes256 -md sha512 -a -A -pass "pass:$pw1" + then echo -n "$STD_IN"|openssl enc -e -aes256 -md sha512 -pass "pass:$pw1"|base64 else exit_show_tool_tip 'Password mismatch! Please play again.' fi