Skip to content

Commit

Permalink
try awk instead of sed
Browse files Browse the repository at this point in the history
  • Loading branch information
andreineculau committed Aug 23, 2024
1 parent 99561a5 commit 65cb363
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion transcrypt
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ git_clean() {
if [ "$(is_salt_prefix_workaround_required)" == "true" ]; then
# Encrypt the file to base64, ensuring it includes the prefix 'Salted__' with the salt. #133
(
echo -n "Salted__" && echo -n "$salt" | sed "s/../\\\\x&/g" | xargs -0 printf "%b\n" &&
echo -n "Salted__" && echo -n "$salt" | awk '{for(i=1;i<=length;i+=2) printf "%c", strtonum("0x" substr($0, i, 2))}' &&
# Encrypt file to binary ciphertext
ENC_PASS=$password "$openssl_path" enc -e "-${cipher}" -md MD5 -pass env:ENC_PASS -S "$salt" -in "$tempfile"
) |
Expand Down

0 comments on commit 65cb363

Please sign in to comment.