Skip to content

Instantly share code, notes, and snippets.

@yowcow
Last active February 2, 2021 07:16
Show Gist options
  • Save yowcow/d45333b7fac5e977b7d4e35bb111df5e to your computer and use it in GitHub Desktop.
Save yowcow/d45333b7fac5e977b7d4e35bb111df5e to your computer and use it in GitHub Desktop.
GPG encrypt/decrypt/sign/verify
RECIPIENT := [email protected]
all:
encrypt: _output/encrypted.txt.gpg.asc
decrypt: _output/decrypted.txt
sign: _output/message.txt.sig.asc
verify: _output/message.txt.sig.asc
gpg --verify $< message.txt
_output/encrypted.txt.gpg.asc: message.txt
mkdir -p $(dir $@)
gpg --output $@ --encrypt -a --recipient $(RECIPIENT) $<
_output/message.txt.sig.asc: message.txt
mkdir -p $(dir $@)
gpg --output $@ --detach-sig -a $<
_output/decrypted.txt: _output/encrypted.txt.gpg.asc
mkdir -p $(dir $@)
gpg --output $@ --decrypt $<
clean:
rm -rf _output
.PHONY: all encrypt decrypt sign clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment