@guanghechen/tool-git-cipher
v6.0.0-alpha.21
Published
A cli tool to cipher git repository
Downloads
23
Readme
Fully encrypt the git repository
Prepare a directory
plaintextRootDir
, which tracks (or uses it as the source repository directly) the git repository to be encrypted. Every time the encrypt command is executed, the content under the pathplaintextRootDir
will be encrypted and stored into directoryciphertextRootDir
, and the structure of the file will be saved inindexFilepath
.Support incremental update content, determine whether the file needs to be re-encrypted by comparing the latest modified time of the source file.
The secret key to encrypt the
plaintextRootDir
directory is encrypted by a password entered by the user and saved in thesecretConfigPath
file. This file also saves the encrypted result of the mac value of the original key, which is used to verify whether the subsequent input password is correct.Default algorithm
AES-256 gcm
.
Install
npm
npm install -g @guanghechen/tool-git-cipher
yarn
yarn global add @guanghechen/tool-git-cipher
Examples
Basic:
You can specify configs into
package.json
like below:{ "name": "private-repository-demo", "version": "0.0.0", "private": true, "scripts": { "encrypt": "ghc-git-cipher encrypt .", "decrypt": "ghc-git-cipher decrypt ." }, "devDependencies": { "@guanghechen/tool-git-cipher": "^4.0.0-alpha.3" }, "@guanghechen/tool-git-cipher": { "__globalOptions__": { "catalogConfigPath": "ghc-crypt/.ghc-catalog", "cryptRootDir": "ghc-crypt", "encoding": "utf8", "CRYPT_FILES_DIR": "encrypted", "cryptFilepathSalt": "", "keepIntegrity": [ ".gitignore", ".npmrc", ".nvmrc", ".yarnrc", "package.json", "yarn.lock", ".ghc-secret" ], "keepPlainPatterns": [ ".gitignore", ".npmrc", ".nvmrc", ".yarnrc", "package.json", "yarn.lock", ".ghc-secret" ], "logLevel": "info", "minPasswordLength": 6, "PART_CODE_PREFIX": ".ghc-part", "pbkdf2Options": { "salt": "guanghechen", "digest": "sha256", "iterations": 100000, "keylen": 32 }, "secretConfigPath": ".ghc-secret", "showAsterisk": true }, "encrypt": { "catalogCachePath": ".ghc-catalog.cache.json" }, "decrypt": {} } }
While
__globalOptions__
is the global option,encrypt
is the option for the sub-commandencrypt
and etc.