The problem: I have a project with a config file for development and production. I want the production config file to live in VCS to make it easy to checkout a tag and build a particular version of the project with the correct config at any time. Obviously, I don't want the production config to be plaintext in VCS to avoid leaking secrets.
My theoretical solution: The production config file is always encrypted on disk, so inside of VCS it is always an opaque blob. Certain people have the decryption key on their machines to modify the config as needed and to deploy it.
Ideally, this file is always encrypted after a VCS checkout and opening the file transparently decrypts it then re-encrypts it after saving it.
I feel like a proven crypto solution exists for this problem but I'm not sure what it is. Thoughts?