README.rst 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. =================
  2. git-remote-gcrypt
  3. =================
  4. --------------------------------------
  5. GNU Privacy Guard-encrypted git remote
  6. --------------------------------------
  7. :Author: Ulrik Sverdrup
  8. :Manual section: 1
  9. Description
  10. ===========
  11. Remote helper programs are invoked by git to handle network transport.
  12. This helper handles gcrypt:: URLs that will access a remote repository
  13. encrypted with GPG, using our custom format.
  14. Supported locations are `local`, `ssh://`, `rsync://` and `sftp`, where
  15. the repository is stored as a set of files, or instead any `<giturl>`
  16. where gcrypt will store the same representation in a git repository,
  17. bridged over arbitrary git transport.
  18. .. NOTE:: Repository format MAY STILL change, incompatibly. We may
  19. not continue to support all types of remote transport.
  20. Quickstart
  21. ..........
  22. * Install `git-remote-gcrypt` by running the supplied `install.sh` script.
  23. * Configure the list of participant gpg keys:
  24. ::
  25. git config --global gcrypt.participants YOURKEYID
  26. * Create an encrypted remote by pushing to it:
  27. ::
  28. git remote add cryptremote gcrypt::ssh://example.com:repo
  29. git push cryptremote master
  30. > gcrypt: Setting up new repository at ssh://example.com:repo
  31. > gcrypt: Repository ID is KNBr0wKzct52
  32. > gcrypt: Repository URL is gcrypt::ssh://example.com:repo#KNBr0wKzct52
  33. > gcrypt: (configuration for cryptremote updated)
  34. > [ more lines .. ]
  35. > To gcrypt::[...]
  36. > * [new branch] master -> master
  37. * Share the updated Repository URL with all participants.
  38. (The generated Repository ID is not secret, it only exists to ensure
  39. that two repositories signed by the same user can not be maliciously
  40. switched around. It incidentally allows multiple repositories to all
  41. share location.)
  42. Design Goals
  43. ............
  44. Confidential, authenticated git storage and collaboration on any
  45. untrusted file host or service. The only information we (by necessity)
  46. leak is the approximate size and timing of updates. PLEASE help me
  47. evaluate how well we meet this design goal!
  48. Configuration
  49. =============
  50. *gcrypt.participants*
  51. Space-separated list of GPG key identifiers. The remote is
  52. encrypted to these participants and only signatures from these
  53. are accepted. ``gpg -k`` lists all public keys you know.
  54. You should set *user.signingkey* if your default signing key is not part
  55. of the participant list.
  56. The encryption of the manifest is updated for each push. The pusher must
  57. have the public keys of all collaborators. You can commit a keyring to
  58. the repo, further key management features do not yet exist.
  59. GPG configuration applies to public-key encryption, symmetric
  60. encryption, and signing. See `man gpg` for more information.
  61. Examples
  62. ========
  63. ::
  64. git config gcrypt.participants YOURKEYID
  65. git remote add cryptremote gcrypt::ssh://example.com:repo
  66. git push cryptremote HEAD
  67. How to use a git backend::
  68. # notice that the target repo must already exist and its
  69. # `master` branch will be overwritten!
  70. git remote add gitcrypt gcrypt::git@example.com:repo
  71. git push gitcrypt HEAD
  72. Notes
  73. =====
  74. Repository Format
  75. .................
  76. ::
  77. EncSign(X) is sign+encrypt to a PGP key holder
  78. Encrypt(K,X) is symmetric encryption
  79. Hash(X) is SHA-224
  80. B: branch list
  81. L: list of the hash (Hi) and key (Ki) for each packfile
  82. R: Hash(Repository ID)
  83. Store Manifest as EncSign(B || L || R) in filename R
  84. Store each packfile P as P' = Encrypt(Ki, P) in filename Hi
  85. where Hi = Hash(P') and Ki is a random string
  86. To read the repository
  87. decrypt+verify Manifest using private key -> (B, L, R)
  88. verify R matches Hash(Requested Repository ID)
  89. for Hi, Ki in L:
  90. download file Hi from the server -> P'
  91. verify Hash(P') matches Hi
  92. decrypt P' using Ki -> P then open P with git
  93. Only packs mentioned in L are downloaded.
  94. Manifest file
  95. .............
  96. ::
  97. $ gpg -d < 5a191cea8c1021a95d813c4007c14f2cc987a40880c2f669430f1916
  98. b4a4a39365d19282810c19d0f3f24d04dd2d179f refs/tags/version1
  99. 1d323ddadf4cf1d80fced447e637ab3766b168b7 refs/heads/master
  100. pack :SHA224:cfdf36515e0d0820554fe5fd9f00a4bee17bcf88ec8a752d851c46ee \
  101. Rc+j8Nv6GOW3mBhWOx6W6jjz3BTX7B6XIJ6RYI+P4TEy
  102. pack :SHA224:a43ccd208d3bd2ea582dbd5407cb8ed6e18b150b1da25c806115eaa5 \
  103. UXR3/R7awFCUJWYdzXzrlkk7E2Acxq/Y4EfEcd62AwGG
  104. repo :SHA224:5a191cea8c1021a95d813c4007c14f2cc987a40880c2f669430f1916 1
  105. + `field<space>value`, extends until newline.
  106. + `field` is one of `[0-9a-f]{40}`, `pack`, `repo`, `keep`, `extn`.
  107. `[0-9a-f]{40} <gitref>`
  108. SHA-1 and its git ref
  109. `pack :<hashtype>:<hash> <key>`
  110. Packfile hash (`Hi`) and corresponding symmetric key (`Ki`).
  111. `repo :<hashtype>:<hash> <version>`
  112. The hash of the repository id.
  113. `extn ...`
  114. Extension field, preserved but unused.
  115. `keep ...`
  116. TBD.
  117. Yet to be Implemented
  118. .....................
  119. + Repacking the remote repository
  120. + Some kind of simple keyring management
  121. See Also
  122. ========
  123. git-remote-helpers(1), gpg(1)
  124. License
  125. =======
  126. git-remote-gcrypt is licensed under the terms of the GNU GPL version 2
  127. (or at your option, any later version). See http://www.gnu.org/licenses/
  128. .. vim: ft=rst tw=72
  129. .. this document generates a man page with rst2man