From 280168b82082358a5f861223cf769fedd2d45746 Mon Sep 17 00:00:00 2001 From: s2 Date: Wed, 16 Jan 2019 16:31:34 +0100 Subject: [PATCH] support binary files --- sshenc.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sshenc.sh b/sshenc.sh index 0d883c2..19d1640 100644 --- a/sshenc.sh +++ b/sshenc.sh @@ -49,8 +49,6 @@ trap cleanup EXIT if [[ "${#public_key[@]}" > 0 ]]; then openssl rand 32 > $temp_file_key - plaintext=`cat` - echo "-- encrypted with https://sshenc.sh/" echo "-- keys" for pubkey in "${public_key[@]}" @@ -67,7 +65,7 @@ if [[ "${#public_key[@]}" > 0 ]]; then done echo "-- /keys" - if echo "$plaintext" | openssl enc -aes-256-cbc -salt -pass file:"$temp_file_key" > "$temp_file"; then + if cat | openssl enc -aes-256-cbc -salt -pass file:"$temp_file_key" > "$temp_file"; then openssl base64 < "$temp_file" fi