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: 8 months ago
JSON representation
⚡Fast files encryption package and command-line tool built for speed with Go
- Host: GitHub
- URL: https://github.com/mrf345/safelock-cli
- Owner: mrf345
- License: agpl-3.0
- Created: 2024-08-11T10:42:10.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2025-02-01T08:20:27.000Z (over 1 year ago)
- Last Synced: 2025-10-11T21:36:59.877Z (8 months ago)
- Topics: argon2, chacha20-poly1305, cli, decryption, encryption, files-encryption, go, package
- Language: Go
- Homepage: https://pkg.go.dev/github.com/mrf345/safelock-cli/
- Size: 269 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
safelock-cli
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))