git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: encrypted repositories?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 17, 2009, 19:38 UTC
Message-ID
<alpine.LFD.2.01.0907171226460.13838@localhost.localdomain>
In-Reply-To
<op.uw7wmbr41e62zd@balu.cs.uni-paderborn.de>
On Fri, 17 Jul 2009, Matthias Andree wrote:
>
> Assume you have a repository where you want to work on embargoed information,
> so that not even system administrators of the server you're pushing to can get
> a hold of the cleartext data.

If the server can't ever read it, you're basically limited to just one story:

 - use rsync-like "stupid" transports to upload and download things.
 - a "smart" git server (eg the native git:// style protocol is not going 
   to be possible)

and you strictly speaking need no real git changes, because you might as well just do it by uploading an encrypted tar-file of the .git directory. And there is literally no upside in doing anything else - any native git support is almost entirely pointless.

You could make it a _bit_ more useful perhaps by adding some helper wrappers, probably by just implementing a new transport name (ie instead of using "rsync://", you'd just use "crypt-tgz://" or something).

Now, that said, there are probably situations where maybe you'd allow the server to decrypt things _temporarily_, but you don't want to be encrypted on disk, and no persistent keys on the server, then that would open up a lot more possibilities.

Of course, that still does require that you trust the server admin to _some_ degree - anybody who has root would be able to get the keys by running a debugger on the git upload/download sequence when you do a upload or download.

Maybe that kind of security is still acceptable to you, though? 

IF that is the case, then at least in theory we could add support for "encryption key exchange" to the native git protocol, and then you could have encryption over the network access (ssh obviously already does that, but I'm including things like the anonymous git:// protocol too), and you'd have encrypted data on disk, but git-upload-pack would be able to decrypt things in order to do deltas etc.

But see above: in order for that to work, you do have to allow the pack upload and download processes on the server to decrypt things (in memory). So it would not be "absolutely secure".

			Linus
Previous: Matthias KestenholzNext: John Tapsell
Message 5 of 17 in “encrypted repositories?”
  1. Matthias AndreeJul 17, 2009
  2. Michael J GruberJul 17, 2009
  3. Jakub NarebskiJul 17, 2009
  4. Matthias KestenholzJul 17, 2009
  5. Linus TorvaldsJul 17, 2009
  6. John TapsellJul 17, 2009
  7. Linus TorvaldsJul 17, 2009
  8. Linus TorvaldsJul 17, 2009
  9. Thomas KochJul 18, 2009
  10. Matthias AndreeJul 20, 2009
  11. Matthias AndreeJul 20, 2009
  12. Jakub NarebskiJul 20, 2009
  13. Matthias AndreeJul 21, 2009
  14. Jeff KingJul 20, 2009
  15. Matthias AndreeJul 21, 2009
  16. Jeff KingJul 23, 2009
  17. J-S-BAug 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.