1# git-secure-export 2 3Experimental tooling for encrypting the `git-fast-export(1)` output. 4 5## Description 6 7This repository provides `git-secure-export`, a postprocessor for 8`git-fast-export(1)` which encrypts file and commit message data of 9exported git repositories. Additionally, `git-secure-import` is provided10which acts as a preprocessor for `git-fast-import(1)` and allows11importing a previously encrypted `git-fast-export(1)` output.1213Based on these two programs, two very hacky shell scripts were written14which implement an ssh-based git remote helper (refer to15`gitremote-helpers(7)`) for encrypting repository on the remote. The16setup requires access to the remote server for installing a custom17script and thus does not work with GitHub or other hosted Git solutions.1819## Status2021Proof of concept, largely untested and very buggy.2223## Security2425The code uses [secretbox][secretbox doc] for symmetric encryption and26authentication of file contents and commit messages. The symmetric key27is stored in `.git/git-secure-key`, the file must be created explicitly28using `git-secure-init`. Encryption of file names is also being29considered but would likely require a separate deterministic encryption30scheme or some kind of local database.3132## Installation3334To install run:3536 $ go get github.com/nmeum/git-secure-export/cmd/...3738If you want to use the remote helper also install the scripts from the39`contrib/` directory. Refer to `contrib/README.md` for more information40on these scripts.4142## Usage4344The software requires the creation of a symmetric key this key must be45created explicitly by invoking `git secure-init` in an existing git46repository. Afterwards `git-secure-export` can be used in combination47with `git-fast-export(1)` as follows:4849 $ git fast-export <options> | git secure-export | \50 git secure-import | git fast-import5152Of cause it would be more meaningful to write the output of53`git-secure-export` to a file, using an output redirection, and passing54it to `git-secure-import`, using an input redirection, on a different55computer. Though this use-case would require copying the symmetric key.5657## See also5859Existing tooling which encrypts single files in a git repository:6061* https://github.com/elasticdog/transcrypt62* https://github.com/StackExchange/blackbox63* https://github.com/AGWA/git-crypt6465Existing tooling which encrypts entire git repositories:6667* https://github.com/spwhitton/git-remote-gcrypt68* https://github.com/rovaughn/git-remote-grave6970## License7172This program is free software: you can redistribute it and/or modify it73under the terms of the GNU General Public License as published by the74Free Software Foundation, either version 3 of the License, or (at your75option) any later version.7677This program is distributed in the hope that it will be useful, but78WITHOUT ANY WARRANTY; without even the implied warranty of79MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General80Public License for more details.8182You should have received a copy of the GNU General Public License along83with this program. If not, see <http://www.gnu.org/licenses/>.8485[secretbox doc]: https://pkg.go.dev/golang.org/x/crypto/nacl/secretbox