
Show HN: Partially encrypt a file based on its HEREDOCs
by higgins on Hacker News.
Hi HN! I wrote a tool that partially encrypts files based on the presence of a HEREDOC. Check it out:
https://ift.tt/8NTWVUL When added to a git repo, it will automatically transparently encrypt/decrypt files you want privatized. For example if you configured your repo to privatize the file `example.txt`, you could write: “`
Today I a burrito.
<<PRIVATE
I was on the toilet for hours.
PRIVATE
I got a lot of reading done.
“`
but when git-commit'ed would become: “`
Today I a burrito.
<<PRIVATE
xuJ0fld2vmNWaVLogTIufmWsiFso
PRIVATE
I got a lot of reading done.
“`
Diffing works as you expect (on the unencrypted source) and only those with the `privatize` symmetric key would be able to unlock and decrypt these files. Why did I do this? I keep a public log of what I plan to accomplish and what I'm working on both personally/professionally.
At the end of the day, I write a summary of everything that happened.
Naturally, there are some details of my life that should be kept private (details of too-be-launched projects, sensitive family events, etc). It's helpful for me to track everything in one file so as to keep the day's context together. Would love to know what you think!
Justin
