1
0
mirror of https://github.com/5im-0n/sshenc.sh.git synced 2025-08-02 11:20:05 +02:00

support binary files

This commit is contained in:
s2
2019-01-16 16:31:34 +01:00
parent a365fe6cc8
commit 280168b820

View File

@@ -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