Skip to content

Instantly share code, notes, and snippets.

@jecxjo
Created April 22, 2021 16:26
Show Gist options
  • Save jecxjo/c8f55aeb43d7c59033fb312b98003e8e to your computer and use it in GitHub Desktop.
Save jecxjo/c8f55aeb43d7c59033fb312b98003e8e to your computer and use it in GitHub Desktop.
Secure Shell Script
#!/usr/bin/env bash
usage() {
cat <<EOF
USAGE: sss.sh <script> [<args>]
To encrypt file you'll need openssl cli
$ openssl aes-256-cbc -a -salt -in <script> -out <enc script>
Can optionally add "#!/usr/bin/env sss.sh" to make file directly executable.
EOF
}
if [ $# -eq 0 ]; then
usage
exit 1
fi
SCRIPT=$1
shift
openssl aes-256-cbc -d -a -salt -in "$SCRIPT" 2>/dev/null | bash -s $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment