修订控制 PGP 加密文本文件的好方法是什么?

发布于 2024-11-15 00:54:08 字数 341 浏览 2 评论 0原文

修订控制 PGP 加密文本文件的好方法是什么?

目标是

  • 仅在本地存储库(工作副本)和远程存储库(逻辑上的“中央”存储库)中的任何位置存储 PGP 加密(最好使用 ASCII 装甲)文本文件。

  • 在将存储修订历史记录的存储库中保留通过 PGP 加密(例如

  • < p>如果可能,减少存储开销

如果只是修订控制 PGP 加密和 ASCII 装甲文本文件,因为每次解密进行编辑然后加密之前,其整个内容都会发生变化被存储和提交对于修订控制存储库,差异将大致与文件大小成正比,并且即使解密文本的更改很小,也会快速增长。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

恍梦境° 2024-11-22 00:54:08

你似乎正在订购一个方圆。加密的一个重要目标是避免明文和密文的微小变化之间的任何关联。因此,如果您要求可怜的 VCS 处理加密文件,您就可以告别合理的空间消耗或任何增量。

我不清楚您是要加密所有文件还是仅加密部分文件。如果是前者,在我看来,您需要寻找一个在进出存储的过程中进行加密的 VCS。

如果我遇到这个问题,我会很想分叉 git 并尝试将其与 gpg 结合起来。

You seem to be ordering up a square circle. An important goal of encryption is to avoid any correlation between small changes in plaintext and ciphertext. So, if you ask the poor VCS to deal with encrypted files, you can say goodbye to reasonable space consumption or any deltas.

It's not clear to me if you are looking to encrypt all of your files or just a few. If the former, it seems to me that you need to go hunting a VCS that encrypts on the way to and from storage.

If I had this problem, I would be tempted to fork git and experiment with marrying it to gpg.

坠似风落 2024-11-22 00:54:08

我在想你也许可以做一些加密计算,即你可以加密数据,使计算机可以在不知道其值的情况下用它进行某些计算。但是,我认为通过 diff 不可能做到这一点。无论您要采用哪种解决方案,每次进行比较时都需要实际询问您密码,然后解密文件并重新加密比较。

嗯...搜索更多,看起来您想要的是 http://en.wikipedia。 org/wiki/Homomorphic_cryption 它同态地保留了“diff”操作(尽管您的限制有点宽松,因为您的输出域可能与您的输入不同)。

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).

青衫儰鉨ミ守葔 2024-11-22 00:54:08

您可以加密 PGP 文件以供共享访问吗?我认为 PGP 不能只允许一个知道密钥的人访问数据。版本控制系统用于共享访问,因此这是有问题的。

另一个问题是大多数版本控制系统都会计算和存储增量,并且无论如何它们都需要知道文件的纯文本表示形式。

如果这样做,没有什么可以阻止您安全地访问底层存储。例如将数据存储在加密的文件系统中。它不会被PGP加密,但会被加密。

不管怎样,您想要实现的 PGP 加密的目标是什么?也许除了 PGP 之外还有其他方法可以实现这一目标吗?

我不知道任何支持 PGP 甚至非对称加密的版本控制系统的实现。我怀疑它是否存在/实用。

这一切都归结为“为什么”的问题。您能解释一下您通过使用 PGP 版本控制系统想要实现的最终目标是什么吗?

Can you encrypt a PGP file for shared access? I think you can't PGP only allows one person who knows the secret key to access the data. Version control systems are used for shared access so this is problematic.

Another issue is most revision control systems compute and store deltas, and they need to know the plain text representation of the files anyway.

If they do, nothing prevents you secure access to the underlying store. For example store data in the encrypted file system. It won't be PGP encrypted but it will be encrypted.

Anyway, what is the goal of that PGP encryption you are trying to achieve? Maybe there are other ways than PGP to achieve this goal?

I'm not aware of any implementation of revision control system that supported PGP or even asymmetric cryptography in general. I doubt that it exists / practical.

Again this all comes down to question 'what for'. Can you explain what is the end goal you are trying to achieve by using PGP fo revision control system?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文