# git-tresor

> Encrypt and decrypt files to store them inside a git repository.

Latest version **1.0.2** (published 2022-04-28) · ISC license · 0 weekly downloads

## Install

```sh
npm install git-tresor
pnpm add git-tresor
yarn add git-tresor
bun add git-tresor
```

Provides the command `git-tresor`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-04-28 |
| First published | 2022-04-28 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 6 |
| Unpacked size | 44.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | bitrebels |

## Links

- npm: https://www.npmjs.com/package/git-tresor
- Repository: https://github.com/thebitrebels/git-tresor
- Homepage: https://github.com/thebitrebels/git-tresor#readme
- Issues: https://github.com/thebitrebels/git-tresor/issues
- npm.io page: https://npm.io/package/git-tresor

## Dependencies (6)

- [glob](https://npm.io/package/glob.md) ^8.0.1
- [chalk](https://npm.io/package/chalk.md) ^5.0.1
- [inquirer](https://npm.io/package/inquirer.md) ^8.2.2
- [nanospinner](https://npm.io/package/nanospinner.md) ^1.1.0
- [command-line-args](https://npm.io/package/command-line-args.md) ^5.2.1
- [command-line-usage](https://npm.io/package/command-line-usage.md) ^6.1.3

## Recent versions

- 1.0.2 (latest) — 2022-04-28
- 1.0.1 — 2022-04-28
- 1.0.0 — 2022-04-28

## README

<img style="width:100%" src="./logo.png" />

---

Encrypt and decrypt files to store them inside a git repository. `git-tresor` uses [AES-256](https://en.wikipedia.org/wiki/Advanced_Encryption_Standard) encryption. Every file or directory has it's own password. This enables you to commit encrypted files either in a separate git repository or inside the same repository where your secret files are needed (f.e. Android-Keystores or Signing-Certificates for Apple).

---

<a href="https://github.com/thebitrebels/git-tresor/releases"><img src="https://img.shields.io/github/v/release/thebitrebels/git-tresor?color=lightgreen&label=Release&logo=github" /></a>
<a href="https://github.com/thebitrebels/git-tresor/actions/workflows/test.yml"><img src="https://img.shields.io/github/workflow/status/thebitrebels/git-tresor/Test/master?color=lightgreen&label=Test&logo=github" /></a>

## Setup

`git-tresor` can be installed via `npm`. If you want to install it globally simply type the following command:

```
npm i -g git-tresor 
```

For a local installation you run `npm i git-tresor --save-dev` from your npm-folder.

### Requirements

`git-tresor` runs on systems that support `npm`/`node`. If you have issues with your local environment let us know!

### Initialization

To initialize a new repository you should start by setting up git:

```
git init
```

Of course you do not need this step if the git repository is already initialized. After that you can go ahead and initialize `git-tresor` by running:

```
git-tresor init
```

It will guide you trough the process of initialization.

## Usage

Below you can see the currently available options.

```
Options

  -e, --encrypt              Flag to use encryption mode.
  -d, --decrypt              Flag to use decryption mode.
  -f, --file string          Path to the file that should be en- or decrypted.
  -dir, --directory string   Path to a directory that should be en- or decrypted.
  -p, --password string      Password that is used to en- or decrypt.
```

To de- or encrypt files you need to set the `-d` or `-e` flag. In both cases you need to specify a file and a password.

```
# Encryption
git-tresor -e -f secretFile.txt -p secretPassword

# Decryption
git-tresor -d -f secretFile.txt.enc -p secretPassword
```

If you want to de- or encrypt folders you need to set the `-dir` option instead of `-f`.

```
# Encryption
git-tresor -e -dir ./secretFolder -p secretPassword

# Decryption
git-tresor -d -dir ./secretFolder -p secretPassword
```

In all cases, you will be prompted to enter a password if you do not set `--password` (or `-p`).

## Sources & Further Readings

- [Brandonstilson - Let's encrypt with node](https://medium.com/@brandonstilson/lets-encrypt-files-with-node-85037bea8c0e) - Source and inspiration for core encryption code
- [git-secret](https://github.com/sobolevn/git-secret) - A bash-tool to store your private data inside a git repository.
- [fastlane-match](https://docs.fastlane.tools/actions/match/) - Easily sync your certificates and profiles across your team

---
_Source: https://npm.io/package/git-tresor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
