Created
June 3, 2020 06:31
-
-
Save larsxschneider/be011886b8bff2f5c4428655ec66f835 to your computer and use it in GitHub Desktop.
Encrypt a file to send it securely to another Hubber
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Encrypt a file to send it securely to another Hubber | |
# | |
# Use https://gpgtools.org/ to an easy to use decryption UI. | |
# | |
# Usage: | |
# enc4hub larsxschneider /path/to/file | |
# | |
set -e | |
recipient=$1 | |
file=$2 | |
# Import the public key of the recipient from GitHub | |
gpg --import <(curl --silent https://github.com/$recipient.gpg) | |
# Encrypt the file with the recipient's key and sign it with my own key | |
gpg --encrypt --sign --armor --trust-model always --recipient [email protected] "$file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment