From 90a559804c3a83e9d83b2b549f8d0ddf61122698 Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 23 Feb 2014 12:02:58 -0800 Subject: initial commit --- .gitignore | 1 + Makefile | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ financial.gpg | Bin 0 -> 2581 bytes 3 files changed, 69 insertions(+) create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 financial.gpg diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2211df6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.txt diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9f00b59 --- /dev/null +++ b/Makefile @@ -0,0 +1,68 @@ +# +# A Makefile to encrypt certain files to the right people. +# +# usage: make foo.pgp +# +# * If unencrypted file exists and is newer than the encrypted, it will +# encrypt it. +# * If the unencrypted file exists and is not newer than the encrypted, it +# will report "up to date" and won't encrypt it +# * If the unencrypted file doesn't exist, it will say you are dumb. +# +# If you don't have one of the keys needed for encrypting: +# +# gpg --recv-keys +# gpg --fingerprint --keyid-format long +# +# IT IS IMPERATIVE THAT YOU VERIFY THE FINGERPRINT. +# gpg does not verify the fingerprint when you run --recv-keys. +# +# To add additional files to be encrypted: +# +# files := file_a file_b +# file_a_readers := user1 user2 +# file_b_readers := user3 user4 +# +# Files should be named without their suffix. The actual source file must +# always end in .txt, and the encrypted file will always end in .gpg. +# + +## +## CONFIGURE HERE +## + +elijah := 8688B48800440025 +micah := 8CBF9A322861A790 +chiiph := 95E3881D9A753A6B +varac := 4CBCAE6A99575D06 +sunbird := D45523676ED610B7 +makechanges := 57F8E5D4069A9F31 + +files := financial + +financial_readers := elijah sunbird makechanges + +## +## NO NEED TO MODIFY BELOW HERE +## + +GPG := gpg --sign --encrypt + +plaintext_input := $(addsuffix .txt, ${files}) +encrypted_output := $(addsuffix .gpg, ${files}) + +empty := +space := $(empty) $(empty) +comma := , + +all: + @echo "USAGE: make FILE\n where FILE is one of $(subst $(space),$(comma)$(space),${encrypted_output})" + +$(encrypted_output): $(plaintext_input) + @echo "Encrypting '$<' to '$@' with these keys: $($(<:.txt=)_readers)" + $(GPG) $(foreach reader,$($(<:.txt=)_readers),--recipient $($(reader))) --output $@ $< + +$(plaintext_input): + @echo "'$@' doesn't exist, why are you trying to encrypt it?" + @exit 1 + diff --git a/financial.gpg b/financial.gpg new file mode 100644 index 0000000..f512aff Binary files /dev/null and b/financial.gpg differ -- cgit v1.2.3