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

documentation

This commit is contained in:
s2
2017-10-25 18:11:00 +02:00
parent b3573ed635
commit 5738678d3c
2 changed files with 8 additions and 1 deletions

View File

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

View File

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