mirror of
https://github.com/5im-0n/sshenc.sh.git
synced 2025-08-03 11:50:04 +02:00
wait for plaintext to be available before outputting cypher
This commit is contained in:
@@ -49,6 +49,8 @@ trap cleanup EXIT
|
|||||||
if [[ "${#public_key[@]}" > 0 ]]; then
|
if [[ "${#public_key[@]}" > 0 ]]; then
|
||||||
openssl rand 32 > $temp_file_key
|
openssl rand 32 > $temp_file_key
|
||||||
|
|
||||||
|
plaintext=`cat`
|
||||||
|
|
||||||
echo "-- encrypted with https://git.e.tern.al/s2/sshencdec"
|
echo "-- encrypted with https://git.e.tern.al/s2/sshencdec"
|
||||||
echo "-- keys"
|
echo "-- keys"
|
||||||
for pubkey in "${public_key[@]}"
|
for pubkey in "${public_key[@]}"
|
||||||
@@ -65,7 +67,7 @@ if [[ "${#public_key[@]}" > 0 ]]; then
|
|||||||
done
|
done
|
||||||
echo "-- /keys"
|
echo "-- /keys"
|
||||||
|
|
||||||
if openssl enc -aes-256-cbc -salt -pass file:"$temp_file_key" > "$temp_file"; then
|
if echo "$plaintext" | openssl enc -aes-256-cbc -salt -pass file:"$temp_file_key" > "$temp_file"; then
|
||||||
openssl base64 < "$temp_file"
|
openssl base64 < "$temp_file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user