Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrf345/safelock-cli

⚡Fast files encryption package and command-line tool built for speed with Go
https://github.com/mrf345/safelock-cli

argon2 chacha20-poly1305 cli decryption encryption files-encryption go package

Last synced: about 1 month ago
JSON representation

⚡Fast files encryption package and command-line tool built for speed with Go

Awesome Lists containing this project

README

        



safelock-cli

build status


linter badge


Go Reference

Fast files encryption package and command-line tool built for speed with Go and [Archiver](https://github.com/mholt/archiver) ⚡

Utilizing `argon2id` and `chacha20poly1305` for encryption, see [default options](#options).

### Install

For command-line

```shell
go install https://github.com/mrf345/safelock-cli@latest
```

For packages

```shell
go get https://github.com/mrf345/safelock-cli@latest
```

Or using one of the latest release binaries [here](https://github.com/mrf345/safelock-cli/releases)

### Examples

Encrypt a path with default options

```shell
safelock-cli encrypt path_to_encrypt encrypted_file_path
```
And to decrypt

```shell
safelock-cli decrypt encrypted_file_path decrypted_files_path
```
> [!TIP]
> If you want it to run silently with no interaction use `--quiet` and pipe the password

```shell
echo "password123456" | safelock-cli encrypt path_to_encrypt encrypted_file_path --quiet
```

You can find interactive examples of using it as a package to [encrypt](https://pkg.go.dev/github.com/mrf345/safelock-cli/safelock#example-Safelock.Encrypt) and [decrypt](https://pkg.go.dev/github.com/mrf345/safelock-cli/safelock#example-Safelock.Decrypt).

### Options

Following the default options remanded by [RFC9106](https://datatracker.ietf.org/doc/html/rfc9106#section-7.4) and [crypto/argon2](https://pkg.go.dev/golang.org/x/crypto/argon2#IDKey)

| Option | Value |
|-------------------------|---------------------------------------------|
| Iterations | 3 |
| Memory size | 64 Megabytes |
| Salt length | 16 |
| Key length | 32 |
| Threads | Number of available cores `runtime.NumCPU()`|
| Minimum password length | 8 |

### Performance

> [!NOTE]
> You can reproduce the results by running [bench_and_plot.py](benchmark/bench_and_plot.py) (based on [Matplotlib](https://github.com/matplotlib/matplotlib) and [Hyperfine](https://github.com/sharkdp/hyperfine))



encryption time


decryption time


file size