Search code examples
securityversion-controlcryptographypgpgnupg

What's good way of revision control PGP encrypted text files?


What's a good approach to revision control PGP encrypted text files?

The goal is to

  • only store PGP encrypted (preferably with ASCII armor) text files any where, in local repository (working copy) and remote repository ("central" repository, logically).

  • preserve privacy enabled by PGP encryption (by using GnuPG for example) in repositories where revision history will be stored

  • when possible, reduce storage overhead

If one just revision control the PGP encrypted and ASCII armored text file, as its entire content will change every time when it is decrypted for editing and then encrypted before being stored and committed to revision control repositories, the diff will be roughly proportional to the file size, and will grow fast even if the change in decrypted text is small.


Solution

  • I was thinking that you could perhaps do some encrypted computation, i.e. you can encrypt the data in a way that the computer can do certain computations with it without knowing its value. However, I don't think that would be possible with a diff. Whatever solution you're going to do needs to actually ask you for the password every time it takes a diff, and decrypt the file and re-encrypt the diff.

    Hmmm...searching some more, it's looking like what you'd want is http://en.wikipedia.org/wiki/Homomorphic_encryption which is homomorphically preserving the "diff" operation (although your restriction is somewhat relaxed, as your output domain can be different than your input).