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

Compare commits

...

7 Commits

Author SHA1 Message Date
s2
590f54717f add license 2019-01-14 09:57:24 +01:00
s2
24d5b75065 fork me on gh 2019-01-14 09:49:45 +01:00
s2
dedabb77cd fix more references 2019-01-14 09:45:33 +01:00
s2
ab6ea06921 a dec too much 2019-01-14 09:39:01 +01:00
s2
a0fcd1eae6 rename sshencdec to the shorter and nicer sshenc 2019-01-14 08:52:10 +01:00
s2
68212e098c update readme to reflect homepage change 2019-01-14 08:51:32 +01:00
s2
5c2b4c4989 homepage 2019-01-14 08:49:18 +01:00
22 changed files with 38248 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
# sshencdec.sh
# sshenc.sh
bash script to encrypt data using a users ssh public key.
@@ -6,35 +6,35 @@ bash script to encrypt data using a users ssh public key.
> decrypt it with your ssh private key using the following command:
```
./sshencdec.sh -s ~/.ssh/id_rsa < file-containing-the-encrypted-text.txt
./sshenc.sh -s ~/.ssh/id_rsa < file-containing-the-encrypted-text.txt
```
## install
```
wget https://git.e.tern.al/s2/sshencdec/raw/branch/master/sshencdec.sh
chmod +x sshencdec.sh
wget wget https://sshenc.sh/sshenc.sh
chmod +x sshenc.sh
```
## examples
### encrypt a file using your own ssh public key
```
./sshencdec.sh -p ~/.ssh/id_rsa.pub < plain-text-file.txt > encrypted.txt
./sshenc.sh -p ~/.ssh/id_rsa.pub < plain-text-file.txt > encrypted.txt
```
### encrypt a file using multiple recipients (broadcast encryption)
```
./sshencdec.sh -p ~/.ssh/id_rsa.pub -p id_rsa-alice.pub -p id_rsa-bob.pub < plain-text-file.txt > encrypted.txt
./sshenc.sh -p ~/.ssh/id_rsa.pub -p id_rsa-alice.pub -p id_rsa-bob.pub < plain-text-file.txt > encrypted.txt
```
### encrypt a file using the public key of a github user
```
./sshencdec.sh -p <(curl -sf "https://github.com/S2-.keys" | grep ssh-rsa | tail -n1) < plain-text-file.txt
./sshenc.sh -p <(curl -sf "https://github.com/S2-.keys" | grep ssh-rsa | tail -n1) < plain-text-file.txt
```
this line fetches the first public key for the github user `S2-` and encrypts the file `plain-text-file.txt` using this key.
### decrypt a file
```
./sshencdec.sh -s ~/.ssh/id_rsa < encrypted.txt
./sshenc.sh -s ~/.ssh/id_rsa < encrypted.txt
```

124
index.html Normal file
View File

@@ -0,0 +1,124 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<title>sshenc.sh</title>
<!-- Bootstrap core CSS -->
<link href="vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<!-- my own stuff -->
<link href="main.css" rel="stylesheet">
</head>
<body>
<a href="https://github.com/S2-/sshenc.sh"><img style="position: absolute; top: 0; right: 0; border: 0; z-index: 10;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-dark bg-dark static-top">
<div class="container">
<a class="navbar-brand" href="#">sshenc.sh</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<!--
<div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ml-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home
<span class="sr-only">(current)</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Services</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Contact</a>
</li>
</ul>
</div>
-->
</div>
</nav>
<!-- Page Content -->
<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="mt-5">sshenc.sh</h1>
<hr>
<p class="lead">bash script to encrypt data using a users ssh public key.</p>
<hr>
<div class="bd-callout bd-callout-info">
If you received a message from someone that was encrypted with this script, you can decrypt it with your ssh private key using the following command:<br>
<code>./sshenc.sh -s ~/.ssh/id_rsa < file-containing-the-encrypted-text.txt</code>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h2>Install</h2>
<div class="bd-callout bd-callout-info">
<code>wget https://sshenc.sh/sshenc.sh<br>
chmod +x sshenc.sh</code>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h2 id="examples">Examples</h2>
<hr>
<h3 id="encrypt-own">encrypt a file using your own ssh public key</h3>
<div class="bd-callout bd-callout-info">
<code>./sshenc.sh -p ~/.ssh/id_rsa.pub < plain-text-file.txt > encrypted.txt</code>
</div>
<h3 id="encrypt-multi">encrypt a file using multiple recipients (broadcast encryption)</h3>
<div class="bd-callout bd-callout-info">
<code>./sshenc.sh -p ~/.ssh/id_rsa.pub -p id_rsa-alice.pub -p id_rsa-bob.pub < plain-text-file.txt > encrypted.txt</code>
</div>
<h3 id="encrypt-gh">encrypt a file using the public key of a github user</h3>
<div class="bd-callout bd-callout-info">
<code>./sshenc.sh -p <(curl -sf "https://github.com/S2-.keys" | grep ssh-rsa | tail -n1) < plain-text-file.txt</code>
</div>
<p>this line fetches the first public key for the github user S2- and encrypts the file plain-text-file.txt using this key.</p>
<h3 id="decrypt">dedecrypt a file</h3>
<div class="bd-callout bd-callout-info">
<code>./sshenc.sh -s ~/.ssh/id_rsa < encrypted.txt</code>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<h2>License</h2>
<a href="https://opensource.org/licenses/MIT">MIT</a>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript -->
<script src="vendor/jquery/jquery.min.js"></script>
<script src="vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
</body>
</html>

13
main.css Normal file
View File

@@ -0,0 +1,13 @@
.bd-callout-info {
border-left-color: #5bc0de;
}
.bd-callout {
padding: 1.25rem;
margin-top: 1.25rem;
margin-bottom: 1.25rem;
border: 1px solid #eee;
border-left-color: rgb(238, 238, 238);
border-left-width: 1px;
border-left-width: .25rem;
border-radius: .25rem;
}

5
sshencdec.sh → sshenc.sh Executable file → Normal file
View File

@@ -15,7 +15,7 @@ examples:
- decrypt a file
$me -s ~/.ssh/id_rsa < encrypted.txt
$me home page: https://git.e.tern.al/s2/sshencdec
$me home page: https://sshenc.sh/
EOF
}
@@ -51,7 +51,7 @@ if [[ "${#public_key[@]}" > 0 ]]; then
plaintext=`cat`
echo "-- encrypted with https://git.e.tern.al/s2/sshencdec"
echo "-- encrypted with https://sshenc.sh/"
echo "-- keys"
for pubkey in "${public_key[@]}"
do
@@ -108,4 +108,3 @@ else
show_help
exit 1
fi

9030
vendor/bootstrap/css/bootstrap.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

6461
vendor/bootstrap/js/bootstrap.bundle.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

3944
vendor/bootstrap/js/bootstrap.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
vendor/bootstrap/js/bootstrap.js.map vendored Normal file

File diff suppressed because one or more lines are too long

7
vendor/bootstrap/js/bootstrap.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

10364
vendor/jquery/jquery.js vendored Normal file

File diff suppressed because it is too large Load Diff

2
vendor/jquery/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
vendor/jquery/jquery.min.map vendored Normal file

File diff suppressed because one or more lines are too long

8269
vendor/jquery/jquery.slim.js vendored Normal file

File diff suppressed because it is too large Load Diff

2
vendor/jquery/jquery.slim.min.js vendored Normal file

File diff suppressed because one or more lines are too long

1
vendor/jquery/jquery.slim.min.map vendored Normal file

File diff suppressed because one or more lines are too long