A simple facade for encryption + signing/decryption data to a recipient with extra nifty utilities. Ideal for the workplace!
This script has ONLY been tested and developed for Mac/Linux.
I actively encrypt/decrypt files with GPG at work, though always forget the commands for the process.Thus, I made this very simple gpg_msg bash script. ...Emphasis on the simple part: Features such as batch encryption, specific compression techniques etc. are omitted here. In this case, refer to the gpg documentation.
This implementation is just intended for simple cryptography tasks, ensuring armoring, signatures etc. are by default enabled, benefitting from the security of GPG (If you're forgetful, lazy or just ensure consistency.
Although there is no real setup (besides sharing each other's public keys), it is recommended to set it up as an alias in your zsh/bash configuration file:
- Move the script to your bin folder:
sudo mv gpg_msg.sh /usr/local/bin/gpg_msg - Add an alias (can be anything, but I named it "gpgmsg":
echo 'alias gpgmsg="gpg_msg"' >> ~/.zshrc - Done!
If you have not created a keypair yet, either do it from the commandline or use GPG Suite for simplicity.
for a file:
gpgmsg encrypt <RECIPIENT> <FILE_TO_ENCRYPT>
for clipboard:
gpgmsg pb_encrypt <RECIPIENT>
for a file:
gpgmsg decrypt <FILE_TO_DECRYPT>
for clipboard:
gpgmsg pb_decrypt