This semester, I found myself making a lot of solutions to problem sets and exams, which I organize in public GitHub repos. I wanted a way to store the solutions to these assignments in the repos.
After a few months I found a solution that seemed to work well. The basic idea is to created a symlinked script on my local machine which encrypts solutions files so they can be committed.
Here is how it works
How is how to set it up
Here is how to set it up. I am assuming you have have installed openssl and set up a private key at ~/.ssh/id_rsa
First download the encrypt and decrypt scripts and give them execute permissions.
Then symlink the encrypt and decrypt scripts so you can access them in your PATH
Finally, alias the scripts (I did this in a .zshrc file)
After that you should be able to run
Important note: this system relies on a private key stored on your local machine. If you lose the key (e.g. maybe you get a new laptop), you will lose the encrypted answer forever. If you are teaching a class, losing your solutions is probably not such a big deal. But I did want to make a note of this.
If you are a student and you have read to here and also find a way to hack this system, I will give you an A.