From 5738678d3c9db1435bf154f265d09a178cf7c402 Mon Sep 17 00:00:00 2001 From: s2 Date: Wed, 25 Oct 2017 18:11:00 +0200 Subject: [PATCH] documentation --- README.md | 7 +++++++ sshencdec.sh | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 994671b..dc12862 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,13 @@ bash script to encrypt data using a users ssh public key. +> If you received a message from someone that was encrypted with this script, you can +> just use openssl to decrypt it, without the need to download this script: + +``` +(openssl base64 -d | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa) < file-containing-the-encrypted-text.txt +``` + ## examples ### encrypt a file using your own ssh public key diff --git a/sshencdec.sh b/sshencdec.sh index 5d2166e..8279bde 100644 --- a/sshencdec.sh +++ b/sshencdec.sh @@ -45,7 +45,7 @@ trap '{ rm -f "$temp_file"; }' EXIT if [[ -e "$public_key" ]]; then if openssl rsautl -encrypt -pubin -inkey <(ssh-keygen -f "$public_key" -e -m PKCS8) -ssl > "$temp_file"; then - echo "-- decrypt with (openssl base64 -d | openssl rsautl -decrypt -inkey ~/.ssh/id_rsa) < the-text-below.txt" + echo "-- encrypted with https://git.e.tern.al/s2/sshencdec" openssl base64 < "$temp_file" fi elif [[ -e "$private_key" ]]; then