mirror of
https://github.com/5im-0n/sshenc.sh.git
synced 2025-08-03 11:50:04 +02:00
documentation
This commit is contained in:
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
bash script to encrypt data using a users ssh public key.
|
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
|
## examples
|
||||||
|
|
||||||
### encrypt a file using your own ssh public key
|
### encrypt a file using your own ssh public key
|
||||||
|
@@ -45,7 +45,7 @@ trap '{ rm -f "$temp_file"; }' EXIT
|
|||||||
|
|
||||||
if [[ -e "$public_key" ]]; then
|
if [[ -e "$public_key" ]]; then
|
||||||
if openssl rsautl -encrypt -pubin -inkey <(ssh-keygen -f "$public_key" -e -m PKCS8) -ssl > "$temp_file"; 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"
|
openssl base64 < "$temp_file"
|
||||||
fi
|
fi
|
||||||
elif [[ -e "$private_key" ]]; then
|
elif [[ -e "$private_key" ]]; then
|
||||||
|
Reference in New Issue
Block a user