Metadata-Version: 2.4
Name: fernet-toolkit
Version: 1.0.1
Summary: A CLI tool to encrypt/decrypt using keys/passwords based on Fernet.
Project-URL: source, https://github.com/60x20/Fernet-Toolkit
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.14
Requires-Dist: cryptography>=46.0.7
Description-Content-Type: text/markdown

# Fernet Toolkit

A CLI tool to encrypt/decrypt using keys/passwords based on Fernet.

## Features

- Encrypt/Decrypt a single file or a directory.
- Use a key or a password (Argon2/PBKDF2).
- Only encrypt files of specified type.
- Doesn't require configuration. The work factor for key derivation is calculated from current year using Moore's Law.

## Installation

### Using pip

```bash
pip install fernet-toolkit
```

### From Source

```bash
git clone https://github.com/60x20/Fernet-Toolkit.git
cd Fernet-Toolkit
uv tool install .
```

## Usage

### Use key

```bash
f-encrypt -r "./input" -o "./"
f-decrypt -r "./encrypted" -o "./" -k "./key.key"
```

### Use password

```bash
f-encrypt -r "./input" -o "./" --use-password
f-decrypt -r "./encrypted" -o "./" --use-password
```

## Options

<!-- Generated by argdown -->

### Encrypt Options

| Short | Long             | Default  | Description                                   |
| ----- | ---------------- | -------- | --------------------------------------------- |
| `-h`  | `--help`         |          | show this help message and exit               |
| `-o`  | `--outdir`       | `None`   | output directory                              |
|       | `--file-type`    | `text`   | Only encrypt files of specified type.         |
| `-v`  | `--verbose`      |          | Print more information.                       |
| `-r`  | `--rootdir`      | `None`   | input directory                               |
| `-f`  | `--file`         | `None`   | input file                                    |
| `-k`  | `--path-to-key`  | `None`   | Encrypt using a key stored at the given path. |
|       | `--use-password` |          | Encrypt using a KDF.                          |
|       | `--KDF`          | `Argon2` | which KDF to use                              |

### Decrypt Options

| Short | Long             | Default | Description                                   |
| ----- | ---------------- | ------- | --------------------------------------------- |
| `-h`  | `--help`         |         | show this help message and exit               |
| `-r`  | `--rootdir`      | `None`  | input directory                               |
| `-o`  | `--outdir`       | `None`  | output directory                              |
| `-v`  | `--verbose`      |         | Print more information.                       |
| `-k`  | `--path-to-key`  | `None`  | Decrypt using a key stored at the given path. |
|       | `--use-password` |         | Decrypt using a KDF.                          |

## Known Bugs

- Outputting into input directory could cause the ciphertext to be re-encrypted. (especially with `--file-type any`)
